File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,17 +30,32 @@ class File {
3030 toString = ( ) => `(clojure.java.io/file "${ this . path } ")` ;
3131}
3232
33- const jsType = ( x ?: any ) => ( typeof x !== 'undefined' ? x . constructor . name . toLowerCase ( ) : null ) ;
33+ const jsType = ( input ?: any ) => {
34+ if ( input === undefined ) {
35+ return null ;
36+ }
37+
38+ if ( input === null ) {
39+ return 'null' ;
40+ }
3441
35- const objEmpty = ( x ?: any ) => ( jsType ( x ) === 'object' ? Object . keys ( x ) . length === 0 : false ) ;
42+ return input . constructor . name . toLowerCase ( ) ;
43+ } ;
44+
45+ const objEmpty = ( input ?: any ) => {
46+ if ( jsType ( input ) === 'object' ) {
47+ return Object . keys ( input ) . length === 0 ;
48+ }
49+ return false ;
50+ } ;
3651
37- const filterEmpty = ( m : Record < string , any > ) => {
38- Object . keys ( m )
39- . filter ( x => objEmpty ( m [ x ] ) )
52+ const filterEmpty = ( input : Record < string , any > ) => {
53+ Object . keys ( input )
54+ . filter ( x => objEmpty ( input [ x ] ) )
4055 . forEach ( x => {
41- delete m [ x ] ;
56+ delete input [ x ] ;
4257 } ) ;
43- return m ;
58+ return input ;
4459} ;
4560
4661const padBlock = ( padSize : number , input : string ) => {
Original file line number Diff line number Diff line change 1- <MISSING>
1+ (require '[clj-http.client :as client])
2+
3+ (client/post " http://mockbin.com/har" {:content-type :json
4+ :form-params {:foo " bar" }})
Original file line number Diff line number Diff line change 1- <MISSING>
1+ (require '[clj-http.client :as client])
2+
3+ (client/post " http://mockbin.com/har" {:content-type :json
4+ :form-params {:foo nil }})
Original file line number Diff line number Diff line change @@ -61,11 +61,6 @@ availableTargets()
6161 ) ;
6262 try {
6363 const expected = readFileSync ( expectedPath ) . toString ( ) ;
64- if ( expected === '<MISSING>' ) {
65- console . log ( `known missing test for ${ targetId } :${ clientId } "${ fixture } "` ) ;
66- return ;
67- }
68-
6964 const { convert } = new HTTPSnippet ( request ) ;
7065 const result = convert ( targetId , clientId ) ; //?
7166
You can’t perform that action at this time.
0 commit comments