Skip to content

Commit 79216b7

Browse files
feat(lodash): remove lodash-es
lodash-es has a problem when using without a bundler which understands es2015 modules, so basically in pure node implementation with cjs modules, (import / export) will throw an error
1 parent b40caa7 commit 79216b7

File tree

17 files changed

+20
-38
lines changed

17 files changed

+20
-38
lines changed

jest.config.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ module.exports = {
88
transform: {
99
".(ts|tsx|js)": "ts-jest"
1010
},
11-
transformIgnorePatterns: [
12-
"<rootDir>/node_modules/(?!lodash-es)"
13-
],
1411
testRegex: "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
1512
moduleFileExtensions: [
1613
"ts",

package-lock.json

Lines changed: 3 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"devDependencies": {
7777
"@types/debug": "^0.0.30",
7878
"@types/jest": "^23.3.1",
79-
"@types/lodash-es": "^4.17.1",
79+
"@types/lodash": "^4.14.116",
8080
"@types/node": "^8.0.26",
8181
"@types/reflect-metadata": "^0.1.0",
8282
"@types/uuid": "^3.4.1",
@@ -90,7 +90,7 @@
9090
"husky": "^0.14.0",
9191
"jest": "^23.5.0",
9292
"lint-staged": "^7.2.0",
93-
"lodash-es": "^4.17.10",
93+
"lodash": "^4.17.10",
9494
"lodash.camelcase": "^4.3.0",
9595
"moment": "^2.22.1",
9696
"prettier": "^1.14.0",
@@ -117,7 +117,7 @@
117117
},
118118
"peerDependencies": {
119119
"aws-sdk": "^2.286.1",
120-
"lodash-es": "^4.17.10",
120+
"lodash": "^4.17.10",
121121
"moment": "^2.22.2",
122122
"rxjs": "^6.0.0"
123123
},

src/decorator/impl/model/model.decorator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { kebabCase } from 'lodash-es'
1+
import { kebabCase } from 'lodash'
22
import { PropertyMetadata } from '../../metadata/property-metadata.model'
33
import { SecondaryIndex } from '../index/secondary-index'
44
import { KEY_PROPERTY } from '../property/property.decorator'

src/dynamo/batchget/batch-get.request.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { AttributeMap, BatchGetItemInput } from 'aws-sdk/clients/dynamodb'
2-
import { isObject, isString } from 'lodash-es'
2+
import { isObject, isString } from 'lodash'
33
import { Observable } from 'rxjs'
44
import { map } from 'rxjs/operators'
55
import { MetadataHelper } from '../../decorator/metadata/metadata-helper'

src/dynamo/expression/condition-expression-builder.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { has } from 'lodash-es'
1+
import { has } from 'lodash'
22
import * as moment from 'moment'
33
import { PartitionKey } from '../../decorator/impl/key/partition-key.decorator'
44
import { Model } from '../../decorator/impl/model/model.decorator'

src/dynamo/expression/condition-expression-builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { AttributeMap, AttributeValue } from 'aws-sdk/clients/dynamodb'
2-
import { curryRight, forEach, isPlainObject } from 'lodash-es'
2+
import { curryRight, forEach, isPlainObject } from 'lodash'
33
import { Metadata } from '../../decorator/metadata/metadata'
44
import { PropertyMetadata } from '../../decorator/metadata/property-metadata.model'
55
import { Mapper } from '../../mapper/mapper'

src/dynamo/expression/logical-operator/merge-conditions.function.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { mapKeys } from 'lodash-es'
1+
import { mapKeys } from 'lodash'
22
import { Metadata } from '../../../decorator/metadata/metadata'
33
import { uniqAttributeValueName } from '../functions/unique-attribute-value-name.function'
44
import { ConditionExpressionDefinitionFunction } from '../type/condition-expression-definition-function'

src/dynamo/expression/param-util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
ScanInput,
66
UpdateItemInput,
77
} from 'aws-sdk/clients/dynamodb'
8-
import { isEmpty, isString } from 'lodash-es'
8+
import { isEmpty, isString } from 'lodash'
99
import { Expression } from './type/expression.type'
1010

1111
export class ParamUtil {

src/dynamo/expression/request-expression-builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { curry } from 'lodash-es'
1+
import { curry } from 'lodash'
22
import { Metadata } from '../../decorator/metadata/metadata'
33
import { BaseRequest } from '../request/base.request'
44
import { ConditionExpressionBuilder } from './condition-expression-builder'

0 commit comments

Comments
 (0)