@@ -62,23 +62,23 @@ export function fnToString(fn: IInjectable) {
62
62
return ( _fn && _fn . toString ( ) ) || 'undefined' ;
63
63
}
64
64
65
- const isRejection = Rejection . isRejectionPromise ;
66
- const hasToString = ( obj : any ) =>
67
- isObject ( obj ) && ! isArray ( obj ) && obj . constructor !== Object && isFunction ( obj . toString ) ;
68
-
69
- const stringifyPattern = pattern ( [
70
- [ isUndefined , val ( 'undefined' ) ] ,
71
- [ isNull , val ( 'null' ) ] ,
72
- [ isPromise , val ( '[Promise]' ) ] ,
73
- [ isRejection , ( x : any ) => x . _transitionRejection . toString ( ) ] ,
74
- [ hasToString , ( x : object ) => x . toString ( ) ] ,
75
- [ isInjectable , functionToString ] ,
76
- [ val ( true ) , identity ] ,
77
- ] ) as ( val : any ) => string ;
78
-
79
65
export function stringify ( o : any ) {
80
66
const seen : any [ ] = [ ] ;
81
67
68
+ const isRejection = Rejection . isRejectionPromise ;
69
+ const hasToString = ( obj : any ) =>
70
+ isObject ( obj ) && ! isArray ( obj ) && obj . constructor !== Object && isFunction ( obj . toString ) ;
71
+
72
+ const stringifyPattern = pattern ( [
73
+ [ isUndefined , val ( 'undefined' ) ] ,
74
+ [ isNull , val ( 'null' ) ] ,
75
+ [ isPromise , val ( '[Promise]' ) ] ,
76
+ [ isRejection , ( x : any ) => x . _transitionRejection . toString ( ) ] ,
77
+ [ hasToString , ( x : object ) => x . toString ( ) ] ,
78
+ [ isInjectable , functionToString ] ,
79
+ [ val ( true ) , identity ] ,
80
+ ] ) as ( val : any ) => string ;
81
+
82
82
function format ( value : any ) {
83
83
if ( isObject ( value ) ) {
84
84
if ( seen . indexOf ( value ) !== - 1 ) return '[circular ref]' ;
@@ -98,12 +98,14 @@ export function stringify(o: any) {
98
98
}
99
99
100
100
/** Returns a function that splits a string on a character or substring */
101
- export const beforeAfterSubstr = ( char : string ) => ( str : string ) : string [ ] => {
102
- if ( ! str ) return [ '' , '' ] ;
103
- const idx = str . indexOf ( char ) ;
104
- if ( idx === - 1 ) return [ str , '' ] ;
105
- return [ str . substr ( 0 , idx ) , str . substr ( idx + 1 ) ] ;
106
- } ;
101
+ export const beforeAfterSubstr =
102
+ ( char : string ) =>
103
+ ( str : string ) : string [ ] => {
104
+ if ( ! str ) return [ '' , '' ] ;
105
+ const idx = str . indexOf ( char ) ;
106
+ if ( idx === - 1 ) return [ str , '' ] ;
107
+ return [ str . substr ( 0 , idx ) , str . substr ( idx + 1 ) ] ;
108
+ } ;
107
109
108
110
export const hostRegex = new RegExp ( '^(?:[a-z]+:)?//[^/]+/' ) ;
109
111
export const stripLastPathElement = ( str : string ) => str . replace ( / \/ [ ^ / ] * $ / , '' ) ;
0 commit comments