From 924263a555435edccbee70bbd57d40d02894b955 Mon Sep 17 00:00:00 2001 From: Bart Veneman <1536852+bartveneman@users.noreply.github.com> Date: Wed, 8 Jan 2025 11:34:49 +0100 Subject: [PATCH] upgrade Colorjs.io to 0.6.0-alpha.1 (#83) --- index.js | 4 ++-- package-lock.json | 20 ++++++++++++-------- package.json | 2 +- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/index.js b/index.js index bda0c14..02baff9 100644 --- a/index.js +++ b/index.js @@ -25,7 +25,7 @@ ColorSpace.register(OKLCH) */ /** - * @param {string | number | {raw: string} | undefined} value + * @param {string | number | {raw: string} | undefined | null} value * @returns {number} * @todo Make this faster based on usage heuristics */ @@ -36,7 +36,7 @@ function numerify(value) { if (Number.isNaN(value)) { return 0 } - if (typeof value === 'object' && 'raw' in value) { + if (typeof value === 'object' && value !== null && 'raw' in value) { return parseFloat(value.raw) } return 0 diff --git a/package-lock.json b/package-lock.json index e74dd90..7431fcf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "6.1.0", "license": "MIT", "dependencies": { - "colorjs.io": "^0.5.2" + "colorjs.io": "^0.6.0-alpha.1" }, "devDependencies": { "@codecov/vite-plugin": "^1.7.0", @@ -1879,10 +1879,14 @@ "license": "MIT" }, "node_modules/colorjs.io": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/colorjs.io/-/colorjs.io-0.5.2.tgz", - "integrity": "sha512-twmVoizEW7ylZSN32OgKdXRmo1qg+wT5/6C3xu5b9QsWzSFAhHLn2xd8ro0diCsKfCj1RdaTP/nrcW+vAoQPIw==", - "license": "MIT" + "version": "0.6.0-alpha.1", + "resolved": "https://registry.npmjs.org/colorjs.io/-/colorjs.io-0.6.0-alpha.1.tgz", + "integrity": "sha512-c/h/8uAmPydQcriRdX8UTAFHj6SpSHFHBA8LvMikvYWAVApPTwg/pyOXNsGmaCBd6L/EeDlRHSNhTtnIFp/qsg==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/color" + } }, "node_modules/combined-stream": { "version": "1.0.8", @@ -4826,9 +4830,9 @@ "dev": true }, "colorjs.io": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/colorjs.io/-/colorjs.io-0.5.2.tgz", - "integrity": "sha512-twmVoizEW7ylZSN32OgKdXRmo1qg+wT5/6C3xu5b9QsWzSFAhHLn2xd8ro0diCsKfCj1RdaTP/nrcW+vAoQPIw==" + "version": "0.6.0-alpha.1", + "resolved": "https://registry.npmjs.org/colorjs.io/-/colorjs.io-0.6.0-alpha.1.tgz", + "integrity": "sha512-c/h/8uAmPydQcriRdX8UTAFHj6SpSHFHBA8LvMikvYWAVApPTwg/pyOXNsGmaCBd6L/EeDlRHSNhTtnIFp/qsg==" }, "combined-stream": { "version": "1.0.8", diff --git a/package.json b/package.json index b2b4155..444f0b1 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "url": "https://github.com/projectwallace/color-sorter/issues" }, "dependencies": { - "colorjs.io": "^0.5.2" + "colorjs.io": "^0.6.0-alpha.1" }, "devDependencies": { "@codecov/vite-plugin": "^1.7.0",