Skip to content

Commit eb3aef5

Browse files
author
lairabella
authored
Moved from js to es for Angular10 (#286)
1 parent c9b699a commit eb3aef5

8 files changed

+27
-24
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [Unreleased]
8+
9+
## [2.1.19] - 2020-08-25
10+
11+
### Fixed
12+
13+
- Changed JS modules and methods for ES
14+
715
## [2.1.18] - 2020-08-13
816

917
### Fixed

jest.base.config.js

+2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ module.exports = {
1717
'json'
1818
],
1919
moduleNameMapper: {
20+
'^lodash-es$': 'lodash',
2021
'^ngx-jsonapi/(?!db)(.*)': '<rootDir>/src/$1'
2122
},
2223
transformIgnorePatterns: [
2324
'node_modules/(?!ngx-jsonapi)'
25+
2426
],
2527
modulePathIgnorePatterns: [
2628
'dist',

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@
108108
"@types/fs-extra": "^2.1.0",
109109
"@types/glob": "^5.0.33",
110110
"@types/jest": "^24.0.18",
111-
"@types/lodash": "^4.14.80",
112111
"@types/node": "^7.0.5",
113112
"@types/ora": "^1.3.1",
114113
"@types/rimraf": "^0.0.28",
@@ -154,7 +153,7 @@
154153
},
155154
"dependencies": {
156155
"dexie": "^2.0.4",
157-
"lodash": "^4.17.19",
156+
"lodash-es": "^4.17.15",
158157
"rxjs": "^6.2"
159158
}
160159
}

src/cloned-document-resource.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { IDocumentResource } from './interfaces/data-object';
22
import { Resource } from './resource';
33
import { IClonedResource, isClonedResource } from './interfaces/cloned-resource';
4-
import { isEqual } from 'lodash';
4+
import { isEqual } from 'lodash-es';
55
import { IParamsResource } from './interfaces';
66
import { IDataResource } from './interfaces/data-resource';
77

src/cloned-resource.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Resource } from './resource';
22
import { IParamsResource } from './interfaces';
33
import { IDocumentResource } from './interfaces/data-object';
44
import { ClonedDocumentResource } from './cloned-document-resource';
5-
import { cloneDeep } from 'lodash';
5+
import { cloneDeep } from 'lodash-es';
66
import { IClonedResource } from './interfaces/cloned-resource';
77

88
export class ClonedResource<T extends Resource> extends Resource implements IClonedResource {

src/resource.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ export class Resource implements ICacheable {
318318
if ('id' in success.data) {
319319
this.id = success.data.id;
320320
this.fill(<IDocumentResource>success);
321-
} else if (isArray(success.data)) {
321+
} else if (Array.isArray(success.data)) {
322322
console.warn('Server return a collection when we save()', success.data);
323323
}
324324

src/services/url-params-builder.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Base } from './base';
2-
import { isObject } from 'util';
32

43
export class UrlParamsBuilder {
54
public toparams(params): string {
@@ -13,7 +12,7 @@ export class UrlParamsBuilder {
1312

1413
private toparamsarray(params, add): string {
1514
let ret = '';
16-
if (Array.isArray(params) || isObject(params)) {
15+
if (Array.isArray(params) || params instanceof Object) {
1716
Base.forEach(params, (value, key) => {
1817
ret += this.toparamsarray(value, add + '[' + key + ']');
1918
});

yarn.lock

+12-17
Original file line numberDiff line numberDiff line change
@@ -626,11 +626,6 @@
626626
dependencies:
627627
"@types/jest-diff" "*"
628628

629-
"@types/lodash@^4.14.80":
630-
version "4.14.141"
631-
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.141.tgz#d81f4d0c562abe28713406b571ffb27692a82ae6"
632-
integrity sha512-v5NYIi9qEbFEUpCyikmnOYe4YlP8BMUdTcNCAquAKzu+FA7rZ1onj9x80mbnDdOW/K5bFf3Tv5kJplP33+gAbQ==
633-
634629
"@types/minimatch@*":
635630
version "3.0.3"
636631
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d"
@@ -4704,9 +4699,9 @@ https-browserify@^1.0.0:
47044699
integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=
47054700

47064701
https-proxy-agent@^2.2.1:
4707-
version "2.2.4"
4708-
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz#4ee7a737abd92678a293d9b34a1af4d0d08c787b"
4709-
integrity sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==
4702+
version "2.2.2"
4703+
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz#271ea8e90f836ac9f119daccd39c19ff7dfb0793"
4704+
integrity sha512-c8Ndjc9Bkpfx/vCJueCPy0jlP4ccCCSNDp8xwCZzPjKJUm+B+u9WX2x98Qx4n1PiMNTWo3D7KK5ifNV/yJyRzg==
47104705
dependencies:
47114706
agent-base "^4.3.0"
47124707
debug "^3.1.0"
@@ -6874,6 +6869,11 @@ locate-path@^3.0.0:
68746869
p-locate "^3.0.0"
68756870
path-exists "^3.0.0"
68766871

6872+
lodash-es@^4.17.15:
6873+
version "4.17.15"
6874+
resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.15.tgz#21bd96839354412f23d7a10340e5eac6ee455d78"
6875+
integrity sha512-rlrc3yU3+JNOpZ9zj5pQtxnx2THmvRykwL4Xlxoa8I9lHBlVbbyPhgyPMioxVZ4NqyxaVVtaJnzsyOidQIhyyQ==
6876+
68776877
lodash.capitalize@^4.1.0:
68786878
version "4.2.1"
68796879
resolved "https://registry.yarnpkg.com/lodash.capitalize/-/lodash.capitalize-4.2.1.tgz#f826c9b4e2a8511d84e3aca29db05e1a4f3b72a9"
@@ -6919,16 +6919,11 @@ lodash.tail@^4.1.1:
69196919
resolved "https://registry.yarnpkg.com/lodash.tail/-/lodash.tail-4.1.1.tgz#d2333a36d9e7717c8ad2f7cacafec7c32b444664"
69206920
integrity sha1-0jM6NtnncXyK0vfKyv7HwytERmQ=
69216921

6922-
6922+
[email protected], lodash@^4.0.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.3.0, lodash@~4.17.10:
69236923
version "4.17.15"
69246924
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
69256925
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
69266926

6927-
lodash@^4.0.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.19, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.3.0, lodash@~4.17.10:
6928-
version "4.17.19"
6929-
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b"
6930-
integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==
6931-
69326927
log-driver@^1.2.7:
69336928
version "1.2.7"
69346929
resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8"
@@ -11111,9 +11106,9 @@ websocket-driver@>=0.5.1:
1111111106
websocket-extensions ">=0.1.1"
1111211107

1111311108
websocket-extensions@>=0.1.1:
11114-
version "0.1.4"
11115-
resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42"
11116-
integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==
11109+
version "0.1.3"
11110+
resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.3.tgz#5d2ff22977003ec687a4b87073dfbbac146ccf29"
11111+
integrity sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==
1111711112

1111811113
whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3, whatwg-encoding@^1.0.5:
1111911114
version "1.0.5"

0 commit comments

Comments
 (0)