1
- import { assignInWith , set , get , isFunction , isString , zipObject , memoize , MapCache } from 'lodash' ;
1
+ import { assignInWith , set , get , isFunction , zipObject , memoize } from 'lodash' ;
2
2
3
3
const aggregator = ( paths : any , object : any ) => {
4
4
return paths . reduce ( ( delta : any , path : any ) => {
@@ -15,6 +15,10 @@ function isObject(value: any) {
15
15
return value != null && ( type === 'object' || type === 'function' ) ;
16
16
}
17
17
18
+ function isString ( value : any ) : value is string {
19
+ return typeof value === 'string' || value instanceof String ;
20
+ }
21
+
18
22
export interface Schema {
19
23
[ targetProperty : string ] :
20
24
| string
@@ -96,7 +100,7 @@ let Morphism: {
96
100
getMapper ?: ( type : any ) => any ;
97
101
setMapper ?: ( type : any , schema : Schema ) => any ;
98
102
deleteMapper ?: ( type : any ) => any ;
99
- mappers ?: MapCache ;
103
+ mappers ?: Map < any , any > ;
100
104
} ;
101
105
/**
102
106
* Object Literals Mapper (Curried Function)
@@ -217,7 +221,7 @@ class MorphismRegistry {
217
221
}
218
222
219
223
static get mappers ( ) {
220
- return _registry . cache ;
224
+ return _registry . cache as Map < any , any > ;
221
225
}
222
226
223
227
static exists ( type : any ) {
0 commit comments