@@ -41,20 +41,20 @@ export function kebobString(camelCase: string) {
41
41
. replace ( / ( [ A - Z ] ) / g, $1 => "-" + $1 . toLowerCase ( ) ) ; // replace rest
42
42
}
43
43
44
- function _toJson ( obj ) {
44
+ function _toJson ( obj : Object ) {
45
45
return JSON . stringify ( obj ) ;
46
46
}
47
47
48
- function _fromJson ( json ) {
48
+ function _fromJson ( json : string ) {
49
49
return isString ( json ) ? JSON . parse ( json ) : json ;
50
50
}
51
51
52
52
53
- function promiseToString ( p ) {
53
+ function promiseToString ( p : Promise < any > ) {
54
54
return `Promise(${ JSON . stringify ( p ) } )` ;
55
55
}
56
56
57
- export function functionToString ( fn ) {
57
+ export function functionToString ( fn : Function ) {
58
58
let fnStr = fnToString ( fn ) ;
59
59
let namedFunctionMatch = fnStr . match ( / ^ ( f u n c t i o n [ ^ ] + \( [ ^ ) ] * \) ) / ) ;
60
60
return namedFunctionMatch ? namedFunctionMatch [ 1 ] : fnStr ;
@@ -71,18 +71,18 @@ let stringifyPattern = pattern([
71
71
[ not ( isDefined ) , val ( "undefined" ) ] ,
72
72
[ isNull , val ( "null" ) ] ,
73
73
[ isPromise , promiseToString ] ,
74
- [ isTransitionRejectionPromise , x => x . _transitionRejection . toString ( ) ] ,
74
+ [ isTransitionRejectionPromise , ( x : any ) => x . _transitionRejection . toString ( ) ] ,
75
75
[ is ( Rejection ) , invoke ( "toString" ) ] ,
76
76
[ is ( Transition ) , invoke ( "toString" ) ] ,
77
77
[ is ( Resolvable ) , invoke ( "toString" ) ] ,
78
78
[ isInjectable , functionToString ] ,
79
79
[ val ( true ) , identity ]
80
80
] ) ;
81
81
82
- export function stringify ( o ) {
83
- var seen = [ ] ;
82
+ export function stringify ( o : Object ) {
83
+ var seen : any [ ] = [ ] ;
84
84
85
- function format ( val ) {
85
+ function format ( val : any ) {
86
86
if ( isObject ( val ) ) {
87
87
if ( seen . indexOf ( val ) !== - 1 ) return '[circular ref]' ;
88
88
seen . push ( val ) ;
@@ -94,7 +94,7 @@ export function stringify(o) {
94
94
}
95
95
96
96
/** Returns a function that splits a string on a character or substring */
97
- export const beforeAfterSubstr = char => str => {
97
+ export const beforeAfterSubstr = ( char : string ) => ( str : string ) => {
98
98
if ( ! str ) return [ "" , "" ] ;
99
99
let idx = str . indexOf ( char ) ;
100
100
if ( idx === - 1 ) return [ str , "" ] ;
0 commit comments