From 3396c1ea79f2098c26fea4302c07c703898a359c Mon Sep 17 00:00:00 2001 From: ivanportilloleal Date: Mon, 19 Feb 2024 13:54:08 +0100 Subject: [PATCH] fix: Replace lodash submodules by entire lodash but using only needed functions on require --- lib/i18n/v2/index.js | 4 ++-- lib/i18n/v3/index.js | 4 ++-- lib/index-v2.js | 2 +- lib/index-v3.js | 2 +- lib/index.js | 2 +- package-lock.json | 22 +++------------------- package.json | 4 +--- src/i18n/v2/index.js | 4 ++-- src/i18n/v3/index.js | 4 ++-- src/index-v2.js | 2 +- src/index-v3.js | 2 +- src/index.js | 2 +- 12 files changed, 18 insertions(+), 36 deletions(-) diff --git a/lib/i18n/v2/index.js b/lib/i18n/v2/index.js index a098c6c..98be98a 100644 --- a/lib/i18n/v2/index.js +++ b/lib/i18n/v2/index.js @@ -20,8 +20,8 @@ var _createClass = function () { function defineProperties(target, props) { for function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -var includes = require('lodash.includes'); -var keys = require('lodash.keys'); +var includes = require('lodash/includes'); +var keys = require('lodash/keys'); var dictionaries = require('./dictionaries'); var I18nData = function () { diff --git a/lib/i18n/v3/index.js b/lib/i18n/v3/index.js index 471bb4a..d413750 100644 --- a/lib/i18n/v3/index.js +++ b/lib/i18n/v3/index.js @@ -20,8 +20,8 @@ var _createClass = function () { function defineProperties(target, props) { for function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -var includes = require('lodash.includes'); -var keys = require('lodash.keys'); +var includes = require('lodash/includes'); +var keys = require('lodash/keys'); var dictionaries = require('./dictionaries'); var I18nData = function () { diff --git a/lib/index-v2.js b/lib/index-v2.js index a887e20..2a3ca42 100644 --- a/lib/index-v2.js +++ b/lib/index-v2.js @@ -24,7 +24,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -var pick = require('lodash.pick'); +var pick = require('lodash/pick'); var I18nDataV2 = require('./i18n/v2'); var PersonalityProfileV2 = require('./profiles/v2/index'); var TextSummaryImpl = require('./text-summary'); diff --git a/lib/index-v3.js b/lib/index-v3.js index 4acd8a4..d70c2a8 100644 --- a/lib/index-v3.js +++ b/lib/index-v3.js @@ -24,7 +24,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -var pick = require('lodash.pick'); +var pick = require('lodash/pick'); var I18nDataV3 = require('./i18n/v3'); var PersonalityProfileV3 = require('./profiles/v3/index'); var TextSummaryImpl = require('./text-summary'); diff --git a/lib/index.js b/lib/index.js index 4f3afe3..5a8b533 100644 --- a/lib/index.js +++ b/lib/index.js @@ -24,7 +24,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -var pick = require('lodash.pick'); +var pick = require('lodash/pick'); var I18nDataV2 = require('./i18n/v2'); var I18nDataV3 = require('./i18n/v3'); var PersonalityProfileV2 = require('./profiles/v2/index'); diff --git a/package-lock.json b/package-lock.json index 84ed730..ce42c83 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3822,10 +3822,9 @@ } }, "lodash": { - "version": "4.17.5", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", - "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", - "dev": true + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "lodash._baseassign": { "version": "3.2.0", @@ -3885,11 +3884,6 @@ "lodash._isiterateecall": "^3.0.0" } }, - "lodash.includes": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", - "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=" - }, "lodash.isarguments": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", @@ -3902,22 +3896,12 @@ "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", "dev": true }, - "lodash.keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-4.2.0.tgz", - "integrity": "sha1-oIYCrBLk+4P5H8H7ejYKTZujUgU=" - }, "lodash.memoize": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=", "dev": true }, - "lodash.pick": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz", - "integrity": "sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM=" - }, "longest": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", diff --git a/package.json b/package.json index e23fe61..cee74e6 100644 --- a/package.json +++ b/package.json @@ -27,9 +27,7 @@ "ibm watson" ], "dependencies": { - "lodash.includes": "^4.3.0", - "lodash.keys": "^4.2.0", - "lodash.pick": "^4.4.0" + "lodash": "^4.17.21" }, "devDependencies": { "babel-preset-es2015": "^6.22.0", diff --git a/src/i18n/v2/index.js b/src/i18n/v2/index.js index 1c70af8..24e195b 100644 --- a/src/i18n/v2/index.js +++ b/src/i18n/v2/index.js @@ -16,8 +16,8 @@ 'use strict'; -const includes = require('lodash.includes'); -const keys = require('lodash.keys'); +const includes = require('lodash/includes'); +const keys = require('lodash/keys'); const dictionaries = require('./dictionaries'); class I18nData { diff --git a/src/i18n/v3/index.js b/src/i18n/v3/index.js index 6d1531e..739bd13 100644 --- a/src/i18n/v3/index.js +++ b/src/i18n/v3/index.js @@ -16,8 +16,8 @@ 'use strict'; -const includes = require('lodash.includes'); -const keys = require('lodash.keys'); +const includes = require('lodash/includes'); +const keys = require('lodash/keys'); const dictionaries = require('./dictionaries'); class I18nData { diff --git a/src/index-v2.js b/src/index-v2.js index 9d66ef1..0efc57f 100644 --- a/src/index-v2.js +++ b/src/index-v2.js @@ -16,7 +16,7 @@ 'use strict'; -const pick = require('lodash.pick'); +const pick = require('lodash/pick'); const I18nDataV2 = require('./i18n/v2'); const PersonalityProfileV2 = require('./profiles/v2/index'); const TextSummaryImpl = require('./text-summary'); diff --git a/src/index-v3.js b/src/index-v3.js index ec23c28..ef6ced5 100644 --- a/src/index-v3.js +++ b/src/index-v3.js @@ -16,7 +16,7 @@ 'use strict'; -const pick = require('lodash.pick'); +const pick = require('lodash/pick'); const I18nDataV3 = require('./i18n/v3'); const PersonalityProfileV3 = require('./profiles/v3/index'); const TextSummaryImpl = require('./text-summary'); diff --git a/src/index.js b/src/index.js index 9d4df21..4de8094 100644 --- a/src/index.js +++ b/src/index.js @@ -16,7 +16,7 @@ 'use strict'; -const pick = require('lodash.pick'); +const pick = require('lodash/pick'); const I18nDataV2 = require('./i18n/v2'); const I18nDataV3 = require('./i18n/v3'); const PersonalityProfileV2 = require('./profiles/v2/index');