Skip to content

Commit 2487f5b

Browse files
committed
feat: remove isString. remove MapCache
1 parent 177da94 commit 2487f5b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/morphism.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assignInWith, set, get, isFunction, isString, zipObject, memoize, MapCache } from 'lodash';
1+
import { assignInWith, set, get, isFunction, zipObject, memoize } from 'lodash';
22

33
const aggregator = (paths: any, object: any) => {
44
return paths.reduce((delta: any, path: any) => {
@@ -15,6 +15,10 @@ function isObject(value: any) {
1515
return value != null && (type === 'object' || type === 'function');
1616
}
1717

18+
function isString(value: any): value is string {
19+
return typeof value === 'string' || value instanceof String;
20+
}
21+
1822
export interface Schema {
1923
[targetProperty: string]:
2024
| string
@@ -96,7 +100,7 @@ let Morphism: {
96100
getMapper?: (type: any) => any;
97101
setMapper?: (type: any, schema: Schema) => any;
98102
deleteMapper?: (type: any) => any;
99-
mappers?: MapCache;
103+
mappers?: Map<any, any>;
100104
};
101105
/**
102106
* Object Literals Mapper (Curried Function)
@@ -217,7 +221,7 @@ class MorphismRegistry {
217221
}
218222

219223
static get mappers() {
220-
return _registry.cache;
224+
return _registry.cache as Map<any, any>;
221225
}
222226

223227
static exists(type: any) {

0 commit comments

Comments
 (0)