From 88f22fe10c6915be6c3a7ec341c32f76a3a04245 Mon Sep 17 00:00:00 2001 From: Miguel Andrade Date: Thu, 1 Apr 2021 01:44:35 +0100 Subject: [PATCH] drop ember-truth-helpers or dep. fixes #636 --- addon/components/base-layer.hbs | 2 +- addon/components/geojson-layer.hbs | 2 +- addon/components/leaflet-map.hbs | 2 +- addon/helpers/ember-leaflet-or.js | 7 ++++++ app/helpers/ember-leaflet-or.js | 1 + package-lock.json | 36 +++--------------------------- package.json | 1 - 7 files changed, 14 insertions(+), 37 deletions(-) create mode 100644 addon/helpers/ember-leaflet-or.js create mode 100644 app/helpers/ember-leaflet-or.js diff --git a/addon/components/base-layer.hbs b/addon/components/base-layer.hbs index 4520c838..3261dcb2 100644 --- a/addon/components/base-layer.hbs +++ b/addon/components/base-layer.hbs @@ -15,7 +15,7 @@ {{#each this.componentsToYield as |c|}} {{ember-leaflet-assign-to components - key=(or c.as c.name) + key=(ember-leaflet-or c.as c.name) value=(component c.name parent=this node=Node) onChange=this.mergeComponents}} {{/each}} diff --git a/addon/components/geojson-layer.hbs b/addon/components/geojson-layer.hbs index 843b9a8e..233b5708 100644 --- a/addon/components/geojson-layer.hbs +++ b/addon/components/geojson-layer.hbs @@ -9,7 +9,7 @@ {{#each this.componentsToYield as |c|}} {{ember-leaflet-assign-to components - key=(or c.as c.name) + key=(ember-leaflet-or c.as c.name) value=(component c.name parent=this node=Node) onChange=this.mergeComponents}} {{/each}} diff --git a/addon/components/leaflet-map.hbs b/addon/components/leaflet-map.hbs index 27496176..acb3e9b7 100644 --- a/addon/components/leaflet-map.hbs +++ b/addon/components/leaflet-map.hbs @@ -11,7 +11,7 @@ {{#each this.componentsToYield as |c|}} {{ember-leaflet-assign-to components - key=(or c.as c.name) + key=(ember-leaflet-or c.as c.name) value=(component c.name parent=this node=Node) onChange=this.mergeComponents}} {{/each}} diff --git a/addon/helpers/ember-leaflet-or.js b/addon/helpers/ember-leaflet-or.js new file mode 100644 index 00000000..bb6e0498 --- /dev/null +++ b/addon/helpers/ember-leaflet-or.js @@ -0,0 +1,7 @@ +import { helper } from '@ember/component/helper'; + +export function emberLeafletOr(params) { + return params.reduce((previous, current) => previous || current, undefined); +} + +export default helper(emberLeafletOr); diff --git a/app/helpers/ember-leaflet-or.js b/app/helpers/ember-leaflet-or.js new file mode 100644 index 00000000..4329e977 --- /dev/null +++ b/app/helpers/ember-leaflet-or.js @@ -0,0 +1 @@ +export { default, emberLeafletOr } from 'ember-leaflet/helpers/ember-leaflet-or'; diff --git a/package-lock.json b/package-lock.json index 8069f88e..994a89e9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5590,12 +5590,6 @@ } } }, - "caniuse-lite": { - "version": "1.0.30001178", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001178.tgz", - "integrity": "sha512-VtdZLC0vsXykKni8Uztx45xynytOi71Ufx9T8kHptSw9AL4dpqailUJJHavttuzUe1KYuBYtChiWv+BAb7mPmQ==", - "dev": true - }, "core-js-compat": { "version": "3.8.2", "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.8.2.tgz", @@ -11103,9 +11097,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001143", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001143.tgz", - "integrity": "sha512-p/PO5YbwmCpBJPxjOiKBvAlUPgF8dExhfEpnsH+ys4N/791WHrYrGg0cyHiAURl5hSbx5vIcjKmQAP6sHDYH3w==" + "version": "1.0.30001205", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001205.tgz", + "integrity": "sha512-TL1GrS5V6LElbitPazidkBMD9sa448bQDDLrumDqaggmKFcuU2JW1wTOHJPukAcOMtEmLcmDJEzfRrf+GjM0Og==" }, "capture-exit": { "version": "2.0.0", @@ -16560,11 +16554,6 @@ } } }, - "caniuse-lite": { - "version": "1.0.30001178", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001178.tgz", - "integrity": "sha512-VtdZLC0vsXykKni8Uztx45xynytOi71Ufx9T8kHptSw9AL4dpqailUJJHavttuzUe1KYuBYtChiWv+BAb7mPmQ==" - }, "core-js-compat": { "version": "3.8.2", "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.8.2.tgz", @@ -22014,11 +22003,6 @@ } } }, - "caniuse-lite": { - "version": "1.0.30001178", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001178.tgz", - "integrity": "sha512-VtdZLC0vsXykKni8Uztx45xynytOi71Ufx9T8kHptSw9AL4dpqailUJJHavttuzUe1KYuBYtChiWv+BAb7mPmQ==" - }, "core-js-compat": { "version": "3.8.2", "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.8.2.tgz", @@ -23181,14 +23165,6 @@ "tether": "^1.4.0" } }, - "ember-truth-helpers": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ember-truth-helpers/-/ember-truth-helpers-3.0.0.tgz", - "integrity": "sha512-hPKG9QqruAELh0li5xaiLZtr88ioWYxWCXisAWHWE0qCP4a2hgtuMzKUPpiTCkltvKjuqpzTZCU4VhQ+IlRmew==", - "requires": { - "ember-cli-babel": "^7.22.1" - } - }, "ember-try": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/ember-try/-/ember-try-1.4.0.tgz", @@ -31166,12 +31142,6 @@ } } }, - "caniuse-lite": { - "version": "1.0.30001178", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001178.tgz", - "integrity": "sha512-VtdZLC0vsXykKni8Uztx45xynytOi71Ufx9T8kHptSw9AL4dpqailUJJHavttuzUe1KYuBYtChiWv+BAb7mPmQ==", - "dev": true - }, "core-js-compat": { "version": "3.8.2", "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.8.2.tgz", diff --git a/package.json b/package.json index e672b23e..6fa6b724 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,6 @@ "ember-get-config": "^0.3.0", "ember-in-element-polyfill": "^1.0.0", "ember-render-helpers": "^0.2.0", - "ember-truth-helpers": "^3.0.0", "fastboot-transform": "^0.1.3", "resolve": "^1.19.0" },