diff --git a/index.js b/index.js index c68df12..3f94a7b 100644 --- a/index.js +++ b/index.js @@ -4,7 +4,6 @@ // Created by Curran Kelleher and Chrostophe Serafin. // Contributions from Paul Brewer and Javier Blanco Martinez. const objectPath = require('object-path'); -const dedupe = require('dedupe'); // An enhanced version of `typeof` that handles arrays and dates as well. function type(value) { @@ -42,11 +41,7 @@ function Parameter(match) { // Constructs a template function with deduped `parameters` property. function Template(fn, parameters) { - // Paul Brewer Dec 2017 add deduplication call, use only key property to eliminate - Object.assign(fn, { - parameters: dedupe(parameters, item => item.key) - }); - + fn.parameters = Array.from(new Map(parameters.map(parameter => [parameter.key, parameter])).values()) return fn; } diff --git a/package.json b/package.json index 9933153..dcd8dcd 100644 --- a/package.json +++ b/package.json @@ -25,12 +25,11 @@ }, "homepage": "https://github.com/datavis-tech/json-templates#readme", "devDependencies": { - "mocha": "^9.1.2", - "rollup": "^2.58.0", + "mocha": "^10.2.0", + "rollup": "^3.26.0", "rollup-plugin-buble": "^0.19.8" }, "dependencies": { - "dedupe": "^3.0.2", "object-path": "^0.11.8" } }