From 3cf1d9f4d0989f54261f243dd5d9de2de4206fa5 Mon Sep 17 00:00:00 2001 From: Curran Kelleher Date: Tue, 4 Jul 2023 09:41:16 -0400 Subject: [PATCH] Remove dedupe dependency --- index.js | 7 +------ package.json | 5 ++--- 2 files changed, 3 insertions(+), 9 deletions(-) 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" } }