From beed255698c2efb3b7139f2145123829578345f6 Mon Sep 17 00:00:00 2001 From: Yaroslav Admin Date: Wed, 2 Sep 2020 18:20:19 +0200 Subject: [PATCH] fix: remove unused JSON utilities and flatted dependency (#3550) This is unused since 70b72a91834c531adc259b8d88f9907ec8d0d13d. --- lib/utils/json-utils.js | 10 ---------- package-lock.json | 6 ------ package.json | 1 - test/unit/utils/json-utils.spec.js | 18 ------------------ 4 files changed, 35 deletions(-) delete mode 100644 lib/utils/json-utils.js delete mode 100644 test/unit/utils/json-utils.spec.js diff --git a/lib/utils/json-utils.js b/lib/utils/json-utils.js deleted file mode 100644 index 3002bf3f7..000000000 --- a/lib/utils/json-utils.js +++ /dev/null @@ -1,10 +0,0 @@ - -const { stringify } = require('flatted/cjs') - -const JsonUtils = { - stringify (obj) { - return stringify(obj) - } -} - -module.exports = JsonUtils diff --git a/package-lock.json b/package-lock.json index 75b5f56a5..df060cd41 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6217,12 +6217,6 @@ } } }, - "flatted": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", - "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", - "dev": true - }, "follow-redirects": { "version": "1.11.0", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.11.0.tgz", diff --git a/package.json b/package.json index 3ba73d283..487e40f48 100644 --- a/package.json +++ b/package.json @@ -431,7 +431,6 @@ "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.2.1", "eslint-plugin-standard": "^4.0.1", - "flatted": "^2.0.2", "grunt": "^1.2.1", "grunt-auto-release": "^0.0.7", "grunt-browserify": "^5.0.0", diff --git a/test/unit/utils/json-utils.spec.js b/test/unit/utils/json-utils.spec.js deleted file mode 100644 index 92b69762a..000000000 --- a/test/unit/utils/json-utils.spec.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict' - -const JsonUtils = require('../../../lib/utils/json-utils') - -describe('json-utils', () => { - it('stringify-s', () => { - const obj = { a: 'a', i: 1 } - const json = JsonUtils.stringify(obj) - expect(json).to.be.equal('[{"a":"1","i":1},"a"]') - }) - it('stringify-s circular data', () => { - const a = [{}] - a[0].a = a - a.push(a) - - expect(JsonUtils.stringify(a)).to.be.equal('[["1","0"],{"a":"0"}]') - }) -})