From 7bd0000bfcc6157e401b12c3d7fd73e233f27ba1 Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Thu, 5 Aug 2021 21:20:36 +0300 Subject: [PATCH 01/40] Clean up deprecated methods --- src/clamp.js | 16 +- src/deficiency.js | 341 ++++++------------------------ src/formatter.js | 23 +- src/index.js | 30 +-- src/interpolate/cosine.js | 24 --- src/interpolate/linear.js | 14 +- src/interpolate/splineBasis.js | 27 +-- src/interpolate/splineMonotone.js | 29 +-- src/interpolate/splineNatural.js | 23 +- test/interpolate-legacy.test.js | 20 -- 10 files changed, 88 insertions(+), 459 deletions(-) delete mode 100644 src/interpolate/cosine.js delete mode 100644 test/interpolate-legacy.test.js diff --git a/src/clamp.js b/src/clamp.js index 10a85b83..f634ce09 100644 --- a/src/clamp.js +++ b/src/clamp.js @@ -13,7 +13,7 @@ const fixup_rgb = color => { return c; }; -const clampRgb = color => { +export const clampRgb = color => { color = prepare(color); // if the color is undefined or displayable, return it directly @@ -25,7 +25,7 @@ const clampRgb = color => { return conv(fixup_rgb(color)); }; -const clampChroma = (color, mode = 'lch') => { +export const clampChroma = (color, mode = 'lch') => { color = prepare(color); // if the color is undefined or displayable, return it directly @@ -68,15 +68,3 @@ const clampChroma = (color, mode = 'lch') => { displayable(clamped) ? clamped : { ...clamped, c: _last_good_c } ); }; - -// Deprecated / no longer documented -const clamp = (method = 'rgb') => { - switch (method) { - case 'rgb': - return clampRgb; - case 'lch': - return clampChroma; - } -}; - -export { clampRgb, clampChroma, clamp }; diff --git a/src/deficiency.js b/src/deficiency.js index abb34531..b7f99e9f 100644 --- a/src/deficiency.js +++ b/src/deficiency.js @@ -25,342 +25,132 @@ let rgb = converter('rgb'); const PROT = [ [1.0, 0.0, -0.0, 0.0, 1.0, 0.0, -0.0, -0.0, 1.0], [ - 0.856167, - 0.182038, - -0.038205, - 0.029342, - 0.955115, - 0.015544, - -0.00288, - -0.001563, - 1.004443 + 0.856167, 0.182038, -0.038205, 0.029342, 0.955115, 0.015544, -0.00288, + -0.001563, 1.004443 ], [ - 0.734766, - 0.334872, - -0.069637, - 0.05184, - 0.919198, - 0.028963, - -0.004928, - -0.004209, - 1.009137 + 0.734766, 0.334872, -0.069637, 0.05184, 0.919198, 0.028963, -0.004928, + -0.004209, 1.009137 ], [ - 0.630323, - 0.465641, - -0.095964, - 0.069181, - 0.890046, - 0.040773, - -0.006308, - -0.007724, - 1.014032 + 0.630323, 0.465641, -0.095964, 0.069181, 0.890046, 0.040773, -0.006308, + -0.007724, 1.014032 ], [ - 0.539009, - 0.579343, - -0.118352, - 0.082546, - 0.866121, - 0.051332, - -0.007136, - -0.011959, - 1.019095 + 0.539009, 0.579343, -0.118352, 0.082546, 0.866121, 0.051332, -0.007136, + -0.011959, 1.019095 ], [ - 0.458064, - 0.679578, - -0.137642, - 0.092785, - 0.846313, - 0.060902, - -0.007494, - -0.016807, - 1.024301 + 0.458064, 0.679578, -0.137642, 0.092785, 0.846313, 0.060902, -0.007494, + -0.016807, 1.024301 ], [ - 0.38545, - 0.769005, - -0.154455, - 0.100526, - 0.829802, - 0.069673, - -0.007442, - -0.02219, - 1.029632 + 0.38545, 0.769005, -0.154455, 0.100526, 0.829802, 0.069673, -0.007442, + -0.02219, 1.029632 ], [ - 0.319627, - 0.849633, - -0.169261, - 0.106241, - 0.815969, - 0.07779, - -0.007025, - -0.028051, - 1.035076 + 0.319627, 0.849633, -0.169261, 0.106241, 0.815969, 0.07779, -0.007025, + -0.028051, 1.035076 ], [ - 0.259411, - 0.923008, - -0.18242, - 0.110296, - 0.80434, - 0.085364, - -0.006276, - -0.034346, - 1.040622 + 0.259411, 0.923008, -0.18242, 0.110296, 0.80434, 0.085364, -0.006276, + -0.034346, 1.040622 ], [ - 0.203876, - 0.990338, - -0.194214, - 0.112975, - 0.794542, - 0.092483, - -0.005222, - -0.041043, - 1.046265 + 0.203876, 0.990338, -0.194214, 0.112975, 0.794542, 0.092483, -0.005222, + -0.041043, 1.046265 ], [ - 0.152286, - 1.052583, - -0.204868, - 0.114503, - 0.786281, - 0.099216, - -0.003882, - -0.048116, - 1.051998 + 0.152286, 1.052583, -0.204868, 0.114503, 0.786281, 0.099216, -0.003882, + -0.048116, 1.051998 ] ]; const DEUTER = [ [1.0, 0.0, -0.0, 0.0, 1.0, 0.0, -0.0, -0.0, 1.0], [ - 0.866435, - 0.177704, - -0.044139, - 0.049567, - 0.939063, - 0.01137, - -0.003453, - 0.007233, - 0.99622 + 0.866435, 0.177704, -0.044139, 0.049567, 0.939063, 0.01137, -0.003453, + 0.007233, 0.99622 ], [ - 0.760729, - 0.319078, - -0.079807, - 0.090568, - 0.889315, - 0.020117, - -0.006027, - 0.013325, - 0.992702 + 0.760729, 0.319078, -0.079807, 0.090568, 0.889315, 0.020117, -0.006027, + 0.013325, 0.992702 ], [ - 0.675425, - 0.43385, - -0.109275, - 0.125303, - 0.847755, - 0.026942, - -0.00795, - 0.018572, - 0.989378 + 0.675425, 0.43385, -0.109275, 0.125303, 0.847755, 0.026942, -0.00795, + 0.018572, 0.989378 ], [ - 0.605511, - 0.52856, - -0.134071, - 0.155318, - 0.812366, - 0.032316, - -0.009376, - 0.023176, - 0.9862 + 0.605511, 0.52856, -0.134071, 0.155318, 0.812366, 0.032316, -0.009376, + 0.023176, 0.9862 ], [ - 0.547494, - 0.607765, - -0.155259, - 0.181692, - 0.781742, - 0.036566, - -0.01041, - 0.027275, - 0.983136 + 0.547494, 0.607765, -0.155259, 0.181692, 0.781742, 0.036566, -0.01041, + 0.027275, 0.983136 ], [ - 0.498864, - 0.674741, - -0.173604, - 0.205199, - 0.754872, - 0.039929, - -0.011131, - 0.030969, - 0.980162 + 0.498864, 0.674741, -0.173604, 0.205199, 0.754872, 0.039929, -0.011131, + 0.030969, 0.980162 ], [ - 0.457771, - 0.731899, - -0.18967, - 0.226409, - 0.731012, - 0.042579, - -0.011595, - 0.034333, - 0.977261 + 0.457771, 0.731899, -0.18967, 0.226409, 0.731012, 0.042579, -0.011595, + 0.034333, 0.977261 ], [ - 0.422823, - 0.781057, - -0.203881, - 0.245752, - 0.709602, - 0.044646, - -0.011843, - 0.037423, - 0.974421 + 0.422823, 0.781057, -0.203881, 0.245752, 0.709602, 0.044646, -0.011843, + 0.037423, 0.974421 ], [ - 0.392952, - 0.82361, - -0.216562, - 0.263559, - 0.69021, - 0.046232, - -0.01191, - 0.040281, - 0.97163 + 0.392952, 0.82361, -0.216562, 0.263559, 0.69021, 0.046232, -0.01191, + 0.040281, 0.97163 ], [ - 0.367322, - 0.860646, - -0.227968, - 0.280085, - 0.672501, - 0.047413, - -0.01182, - 0.04294, - 0.968881 + 0.367322, 0.860646, -0.227968, 0.280085, 0.672501, 0.047413, -0.01182, + 0.04294, 0.968881 ] ]; const TRIT = [ [1.0, 0.0, -0.0, 0.0, 1.0, 0.0, -0.0, -0.0, 1.0], [ - 0.92667, - 0.092514, - -0.019184, - 0.021191, - 0.964503, - 0.014306, - 0.008437, - 0.054813, - 0.93675 + 0.92667, 0.092514, -0.019184, 0.021191, 0.964503, 0.014306, 0.008437, + 0.054813, 0.93675 ], [ - 0.89572, - 0.13333, - -0.02905, - 0.029997, - 0.9454, - 0.024603, - 0.013027, - 0.104707, - 0.882266 + 0.89572, 0.13333, -0.02905, 0.029997, 0.9454, 0.024603, 0.013027, + 0.104707, 0.882266 ], [ - 0.905871, - 0.127791, - -0.033662, - 0.026856, - 0.941251, - 0.031893, - 0.01341, - 0.148296, - 0.838294 + 0.905871, 0.127791, -0.033662, 0.026856, 0.941251, 0.031893, 0.01341, + 0.148296, 0.838294 ], [ - 0.948035, - 0.08949, - -0.037526, - 0.014364, - 0.946792, - 0.038844, - 0.010853, - 0.193991, - 0.795156 + 0.948035, 0.08949, -0.037526, 0.014364, 0.946792, 0.038844, 0.010853, + 0.193991, 0.795156 ], [ - 1.017277, - 0.027029, - -0.044306, - -0.006113, - 0.958479, - 0.047634, - 0.006379, - 0.248708, - 0.744913 + 1.017277, 0.027029, -0.044306, -0.006113, 0.958479, 0.047634, 0.006379, + 0.248708, 0.744913 ], [ - 1.104996, - -0.046633, - -0.058363, - -0.032137, - 0.971635, - 0.060503, - 0.001336, - 0.317922, - 0.680742 + 1.104996, -0.046633, -0.058363, -0.032137, 0.971635, 0.060503, 0.001336, + 0.317922, 0.680742 ], [ - 1.193214, - -0.109812, - -0.083402, - -0.058496, - 0.97941, - 0.079086, - -0.002346, - 0.403492, - 0.598854 + 1.193214, -0.109812, -0.083402, -0.058496, 0.97941, 0.079086, -0.002346, + 0.403492, 0.598854 ], [ - 1.257728, - -0.139648, - -0.118081, - -0.078003, - 0.975409, - 0.102594, - -0.003316, - 0.501214, - 0.502102 + 1.257728, -0.139648, -0.118081, -0.078003, 0.975409, 0.102594, + -0.003316, 0.501214, 0.502102 ], [ - 1.278864, - -0.125333, - -0.153531, - -0.084748, - 0.957674, - 0.127074, - -0.000989, - 0.601151, - 0.399838 + 1.278864, -0.125333, -0.153531, -0.084748, 0.957674, 0.127074, + -0.000989, 0.601151, 0.399838 ], [ - 1.255528, - -0.076749, - -0.178779, - -0.078411, - 0.930809, - 0.147602, - 0.004733, - 0.691367, - 0.3039 + 1.255528, -0.076749, -0.178779, -0.078411, 0.930809, 0.147602, 0.004733, + 0.691367, 0.3039 ] ]; @@ -392,8 +182,9 @@ const deficiency = (lut, t) => { }; }; -const deficiencyProt = (severity = 1) => deficiency(PROT, severity); -const deficiencyDeuter = (severity = 1) => deficiency(DEUTER, severity); -const deficiencyTrit = (severity = 1) => deficiency(TRIT, severity); - -export { deficiencyProt, deficiencyDeuter, deficiencyTrit }; +export const filterDeficiencyProt = (severity = 1) => + deficiency(PROT, severity); +export const filterDeficiencyDeuter = (severity = 1) => + deficiency(DEUTER, severity); +export const filterDeficiencyTrit = (severity = 1) => + deficiency(TRIT, severity); diff --git a/src/formatter.js b/src/formatter.js index 78695d3a..8d40d1df 100644 --- a/src/formatter.js +++ b/src/formatter.js @@ -10,7 +10,7 @@ let twoDecimals = round(2); const clamp = value => Math.max(0, Math.min(1, value)); const fixup = value => Math.round(clamp(value) * 255); -const formatHex = c => { +export const formatHex = c => { let color = rgb(c); if (color === undefined) { @@ -24,7 +24,7 @@ const formatHex = c => { return '#' + ((1 << 24) | (r << 16) | (g << 8) | b).toString(16).slice(1); }; -const formatHex8 = c => { +export const formatHex8 = c => { let color = rgb(c); if (color === undefined) { @@ -36,7 +36,7 @@ const formatHex8 = c => { return formatHex(color) + ((1 << 8) | a).toString(16).slice(1); }; -const formatRgb = c => { +export const formatRgb = c => { let color = rgb(c); if (color === undefined) { @@ -56,7 +56,7 @@ const formatRgb = c => { } }; -const formatHsl = c => { +export const formatHsl = c => { let color = hsl(c); if (color === undefined) { @@ -76,7 +76,7 @@ const formatHsl = c => { } }; -const formatCss = c => { +export const formatCss = c => { const color = prepare(c); if (!color) { return undefined; @@ -99,16 +99,3 @@ const formatCss = c => { } return undefined; }; - -// Deprecated / no longer documented -const formatter = (format = 'rgb') => { - switch (format) { - case 'rgb': - return formatRgb; - case 'hex': - return formatHex; - } - return undefined; -}; - -export { formatHex, formatHex8, formatRgb, formatHsl, formatCss, formatter }; diff --git a/src/index.js b/src/index.js index e7217ac6..cd3969bb 100644 --- a/src/index.js +++ b/src/index.js @@ -114,7 +114,6 @@ export { }; export { - formatter, formatHex, formatHex8, formatRgb, @@ -128,30 +127,21 @@ export { interpolateWithPremultipliedAlpha } from './interpolate/interpolate'; -export { - interpolateLinear, // @deprecated - interpolatorLinear -} from './interpolate/linear'; +export { interpolatorLinear } from './interpolate/linear'; export { interpolatorPiecewise } from './interpolate/piecewise'; -// @deprecated -export { default as interpolateCosine } from './interpolate/cosine'; - export { - interpolateSplineBasis, // @deprecated interpolatorSplineBasis, interpolatorSplineBasisClosed } from './interpolate/splineBasis'; export { - interpolateSplineNatural, // @deprecated interpolatorSplineNatural, interpolatorSplineNaturalClosed } from './interpolate/splineNatural'; export { - interpolateSplineMonotone, // @deprecated interpolatorSplineMonotone, interpolatorSplineMonotone2, interpolatorSplineMonotoneClosed @@ -160,7 +150,7 @@ export { export { default as lerp } from './interpolate/lerp'; export { default as samples } from './samples'; export { default as displayable } from './displayable'; -export { clamp, clampRgb, clampChroma } from './clamp'; +export { clampRgb, clampChroma } from './clamp'; export { default as nearest } from './nearest'; export { getModeDefinition } from './modes'; export { default as parse } from './parse'; @@ -191,27 +181,19 @@ export { default as easingGamma } from './easing/gamma'; export { luminance as wcagLuminance, contrast as wcagContrast } from './wcag'; export { - deficiencyProt as filterDeficiencyProt, - deficiencyDeuter as filterDeficiencyDeuter, - deficiencyTrit as filterDeficiencyTrit, - // @deprecated - deficiencyProt, - deficiencyDeuter, - deficiencyTrit + filterDeficiencyProt, + filterDeficiencyDeuter, + filterDeficiencyTrit } from './deficiency'; export { - fixupHueShorter as interpolateHue, // @deprecated fixupHueShorter, fixupHueLonger, fixupHueIncreasing, fixupHueDecreasing } from './fixup/hue'; -export { - fixupAlpha, - fixupAlpha as interpolateAlpha // @deprecated -} from './fixup/alpha'; +export { fixupAlpha } from './fixup/alpha'; export { mapper, diff --git a/src/interpolate/cosine.js b/src/interpolate/cosine.js deleted file mode 100644 index e952b405..00000000 --- a/src/interpolate/cosine.js +++ /dev/null @@ -1,24 +0,0 @@ -/* - Cosine interpolation - -------------------- - - Reference: - - http://paulbourke.net/miscellaneous/interpolation/ - */ - -import lerp from './lerp'; -import easeInOutSine from '../easing/inOutSine'; -import gamma from '../easing/gamma'; -import { interpolatorPiecewise } from './piecewise'; - -// @deprecated -const cosine = (fixup, γ = 1) => arr => { - let ease = gamma(γ); - let interpolator = interpolatorPiecewise((a, b, t) => - lerp(a, b, easeInOutSine(t)) - )((fixup || (v => v))(arr)); - return t => interpolator(ease(t)); -}; - -export default cosine; diff --git a/src/interpolate/linear.js b/src/interpolate/linear.js index 1863b631..d9d93b47 100644 --- a/src/interpolate/linear.js +++ b/src/interpolate/linear.js @@ -1,16 +1,4 @@ import lerp from './lerp'; -import gamma from '../easing/gamma'; import { interpolatorPiecewise } from './piecewise'; -const interpolatorLinear = interpolatorPiecewise(lerp); - -const interpolateLinear = (fixup, γ = 1) => arr => { - let ease = gamma(γ); - return t => interpolatorLinear((fixup || (v => v))(arr))(ease(t)); -}; - -export { - interpolatorLinear, - // legacy - interpolateLinear -}; +export const interpolatorLinear = interpolatorPiecewise(lerp); diff --git a/src/interpolate/splineBasis.js b/src/interpolate/splineBasis.js index dfdb6f63..fc887c8b 100644 --- a/src/interpolate/splineBasis.js +++ b/src/interpolate/splineBasis.js @@ -1,5 +1,3 @@ -import gamma from '../easing/gamma'; - /* Basis spline ------------ @@ -35,7 +33,7 @@ const bspline = (Vim2, Vim1, Vi, Vip1, t) => { ); }; -const interpolatorSplineBasis = arr => t => { +export const interpolatorSplineBasis = arr => t => { let classes = arr.length - 1; let i = t >= 1 ? classes - 1 : Math.max(0, Math.floor(t * classes)); return bspline( @@ -47,7 +45,7 @@ const interpolatorSplineBasis = arr => t => { ); }; -const interpolatorSplineBasisClosed = arr => t => { +export const interpolatorSplineBasisClosed = arr => t => { const classes = arr.length - 1; const i = Math.floor(t * classes); return bspline( @@ -58,24 +56,3 @@ const interpolatorSplineBasisClosed = arr => t => { (t - i / classes) * classes ); }; - -const interpolateSplineBasis = - (fixup, type = 'default', γ = 1) => - arr => { - let ease = gamma(γ); - if (type === 'default') { - return t => - interpolatorSplineBasis((fixup || (v => v))(arr))(ease(t)); - } else if (type === 'closed') { - return t => - interpolatorSplineBasisClosed((fixup || (v => v))(arr))( - ease(t) - ); - } - }; - -export { - interpolateSplineBasis, - interpolatorSplineBasis, - interpolatorSplineBasisClosed -}; diff --git a/src/interpolate/splineMonotone.js b/src/interpolate/splineMonotone.js index dac3da47..17657123 100644 --- a/src/interpolate/splineMonotone.js +++ b/src/interpolate/splineMonotone.js @@ -1,4 +1,3 @@ -import gamma from '../easing/gamma'; import { interpolatorLinear } from './linear'; /* @@ -65,7 +64,7 @@ const interpolator = (arr, yp, s) => { A monotone spline which uses one-sided finite differences at the boundaries. */ -const interpolatorSplineMonotone = arr => { +export const interpolatorSplineMonotone = arr => { if (arr.length < 3) { return interpolatorLinear(arr); } @@ -85,7 +84,7 @@ const interpolatorSplineMonotone = arr => { linear interpolation. */ -const interpolatorSplineMonotone2 = arr => { +export const interpolatorSplineMonotone2 = arr => { if (arr.length < 3) { return interpolatorLinear(arr); } @@ -112,7 +111,7 @@ const interpolatorSplineMonotone2 = arr => { ...and so on. */ -const interpolatorSplineMonotoneClosed = arr => { +export const interpolatorSplineMonotoneClosed = arr => { let n = arr.length - 1; let [s, p, yp] = mono(arr); // boundary conditions @@ -127,25 +126,3 @@ const interpolatorSplineMonotoneClosed = arr => { min(abs(s[n - 1]), abs(s_n), 0.5 * abs(p[n])); return interpolator(arr, yp, s); }; - -const interpolateSplineMonotone = - (fixup, type = 'default', γ = 1) => - arr => { - let ease = gamma(γ); - if (type === 'closed') { - return t => - interpolatorSplineMonotoneClosed((fixup || (v => v))(arr))( - ease(t) - ); - } else if (type === 'default') { - return t => - interpolatorSplineMonotone((fixup || (v => v))(arr))(ease(t)); - } - }; - -export { - interpolateSplineMonotone, - interpolatorSplineMonotone, - interpolatorSplineMonotone2, - interpolatorSplineMonotoneClosed -}; diff --git a/src/interpolate/splineNatural.js b/src/interpolate/splineNatural.js index 09d1ad76..1f33bc8e 100644 --- a/src/interpolate/splineNatural.js +++ b/src/interpolate/splineNatural.js @@ -2,7 +2,6 @@ import { interpolatorSplineBasisClosed, interpolatorSplineBasis } from './splineBasis'; -import gamma from '../easing/gamma'; const solve = v => { let i; @@ -32,23 +31,7 @@ const solve = v => { return sol; }; -const interpolatorSplineNatural = arr => interpolatorSplineBasis(solve(arr)); -const interpolatorSplineNaturalClosed = arr => +export const interpolatorSplineNatural = arr => + interpolatorSplineBasis(solve(arr)); +export const interpolatorSplineNaturalClosed = arr => interpolatorSplineBasisClosed(solve(arr)); - -const interpolateSplineNatural = (fixup, type = 'default', γ = 1) => arr => { - let ease = gamma(γ); - if (type === 'default') { - return t => - interpolatorSplineNatural((fixup || (v => v))(arr))(ease(t)); - } else if (type === 'closed') { - return t => - interpolatorSplineNaturalClosed((fixup || (v => v))(arr))(ease(t)); - } -}; - -export { - interpolateSplineNatural, - interpolatorSplineNatural, - interpolatorSplineNaturalClosed -}; diff --git a/test/interpolate-legacy.test.js b/test/interpolate-legacy.test.js deleted file mode 100644 index 1a83bf05..00000000 --- a/test/interpolate-legacy.test.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - Interpolation: legacy API - */ - -import tape from 'tape'; -import { - interpolate, - interpolateLinear, - interpolateHue, - formatHex -} from '../src/index'; - -tape('custom interpolators', t => { - let interpolator = interpolate(['red', 'green'], 'hsv', { - h: interpolateLinear(interpolateHue) - }); - - t.deepEqual(formatHex(interpolator(0.5)), '#c0c000'); - t.end(); -}); From ca85aaf274ce103e465e6bef9465b2fa1b94ac71 Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Sat, 18 Sep 2021 15:35:19 +0300 Subject: [PATCH 02/40] Re: #142, switch to type:module in package.json and update tools / dependencies: * Use `esbuild` instead of `rollup` to build separate ESM/CJS/IIFE bundles; * Update `eslint` to work with the new setup * Run tests without passing the sources through the `esm` package --- .eleventy.js | 8 +- .eslintrc.js | 25 - .eslintrc.json | 24 + package-lock.json | 2603 ++------------------------------------ package.json | 21 +- rollup.config.js | 26 - src/rgb/parseHex.js | 1 + test/hsl.test.js | 2 +- test/interpolate.test.js | 7 +- 9 files changed, 119 insertions(+), 2598 deletions(-) delete mode 100644 .eslintrc.js create mode 100644 .eslintrc.json delete mode 100644 rollup.config.js diff --git a/.eleventy.js b/.eleventy.js index d49670cc..9970838d 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,4 +1,6 @@ -module.exports = function (env) { +import highlight from '@11ty/eleventy-plugin-syntaxhighlight'; + +export default function (env) { env.addPassthroughCopy('docs/img'); env.addPassthroughCopy('docs/css'); env.addPassthroughCopy({ 'docs/static': '.' }); @@ -14,7 +16,7 @@ module.exports = function (env) { return 0; }); }); - env.addPlugin(require('@11ty/eleventy-plugin-syntaxhighlight')); + env.addPlugin(highlight); return { pathPrefix: '/', dir: { @@ -23,4 +25,4 @@ module.exports = function (env) { }, htmlTemplateEngine: 'njk' }; -}; +} diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index e8f2fca0..00000000 --- a/.eslintrc.js +++ /dev/null @@ -1,25 +0,0 @@ -module.exports = { - env: { - browser: true, - commonjs: true, - es6: true, - node: true - }, - parserOptions: { - ecmaVersion: 2018, - sourceType: 'module' - }, - plugins: ['import'], - rules: { - 'constructor-super': 1, - 'import/no-anonymous-default-export': 1, - 'import/no-unused-modules': 1, - 'no-const-assign': 1, - 'no-this-before-super': 1, - 'no-undef': 2, - 'no-unreachable': 0, - 'no-unused-expressions': 0, - 'no-unused-vars': [1, { args: 'none' }], - 'valid-typeof': 1 - } -}; diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 00000000..dc678107 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,24 @@ +{ + "env": { + "browser": true, + "es2021": true, + "node": true + }, + "extends": ["eslint:recommended", "plugin:import/recommended"], + "parserOptions": { + "ecmaVersion": 12, + "sourceType": "module" + }, + "plugins": ["import"], + "rules": { + "constructor-super": 1, + "import/no-anonymous-default-export": 1, + "import/no-unused-modules": 1, + "no-const-assign": 1, + "no-mixed-spaces-and-tabs": 0, + "no-this-before-super": 1, + "no-undef": 2, + "no-unused-vars": [1, { "args": "none" }], + "valid-typeof": 1 + } +} diff --git a/package-lock.json b/package-lock.json index 4ae675fd..7e78427d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,17 +11,13 @@ "devDependencies": { "@11ty/eleventy": "^0.12.1", "@11ty/eleventy-plugin-syntaxhighlight": "^3.1.2", - "@rollup/plugin-buble": "^0.21.3", + "esbuild": "^0.12.28", "eslint": "^7.32.0", "eslint-plugin-import": "^2.24.2", - "esm": "^3.2.25", "gh-pages": "^3.2.3", "husky": "^4.2.5", - "nyc": "^15.1.0", "prettier": "^2.4.1", "pretty-quick": "^3.1.1", - "rollup": "^2.56.3", - "rollup-plugin-terser": "^7.0.2", "tap-spec": "^5.0.0", "tape": "^5.3.1" } @@ -99,12 +95,6 @@ "@11ty/eleventy": ">=0.5.4" } }, - "node_modules/@11ty/eleventy/node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, "node_modules/@babel/code-frame": { "version": "7.12.11", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", @@ -114,197 +104,12 @@ "@babel/highlight": "^7.10.4" } }, - "node_modules/@babel/core": { - "version": "7.12.10", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.10.tgz", - "integrity": "sha512-eTAlQKq65zHfkHZV0sIVODCPGVgoo1HdBlbSLi9CqOzuZanMv2ihzY+4paiKr1mH+XmYESMAmJ/dpZ68eN6d8w==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.12.10", - "@babel/helper-module-transforms": "^7.12.1", - "@babel/helpers": "^7.12.5", - "@babel/parser": "^7.12.10", - "@babel/template": "^7.12.7", - "@babel/traverse": "^7.12.10", - "@babel/types": "^7.12.10", - "convert-source-map": "^1.7.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.1", - "json5": "^2.1.2", - "lodash": "^4.17.19", - "semver": "^5.4.1", - "source-map": "^0.5.0" - }, - "engines": { - "node": ">=6.9.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/babel" - } - }, - "node_modules/@babel/core/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/@babel/core/node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/@babel/generator": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.11.tgz", - "integrity": "sha512-Ggg6WPOJtSi8yYQvLVjG8F/TlpWDlKx0OpS4Kt+xMQPs5OaGYWy+v1A+1TvxI6sAMGZpKWWoAQ1DaeQbImlItA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.11", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - } - }, - "node_modules/@babel/generator/node_modules/jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true, - "bin": { - "jsesc": "bin/jsesc" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/generator/node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/@babel/helper-function-name": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.11.tgz", - "integrity": "sha512-AtQKjtYNolKNi6nNNVLQ27CP6D9oFR6bq/HPYSizlzbp7uC1M59XJe8L+0uXjbIaZaUJF99ruHqVGiKXU/7ybA==", - "dev": true, - "dependencies": { - "@babel/helper-get-function-arity": "^7.12.10", - "@babel/template": "^7.12.7", - "@babel/types": "^7.12.11" - } - }, - "node_modules/@babel/helper-get-function-arity": { - "version": "7.12.10", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.10.tgz", - "integrity": "sha512-mm0n5BPjR06wh9mPQaDdXWDoll/j5UpCAPl1x8fS71GHm7HA6Ua2V4ylG1Ju8lvcTOietbPNNPaSilKj+pj+Ag==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.10" - } - }, - "node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.12.7", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.7.tgz", - "integrity": "sha512-DCsuPyeWxeHgh1Dus7APn7iza42i/qXqiFPWyBDdOFtvS581JQePsc1F/nD+fHrcswhLlRc2UpYS1NwERxZhHw==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.7" - } - }, - "node_modules/@babel/helper-module-imports": { - "version": "7.12.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.5.tgz", - "integrity": "sha512-SR713Ogqg6++uexFRORf/+nPXMmWIn80TALu0uaFb+iQIUoR7bOC7zBWyzBs5b3tBBJXuyD0cRu1F15GyzjOWA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.5" - } - }, - "node_modules/@babel/helper-module-transforms": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.12.1.tgz", - "integrity": "sha512-QQzehgFAZ2bbISiCpmVGfiGux8YVFXQ0abBic2Envhej22DVXV9nCFaS5hIQbkyo1AdGb+gNME2TSh3hYJVV/w==", - "dev": true, - "dependencies": { - "@babel/helper-module-imports": "^7.12.1", - "@babel/helper-replace-supers": "^7.12.1", - "@babel/helper-simple-access": "^7.12.1", - "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/helper-validator-identifier": "^7.10.4", - "@babel/template": "^7.10.4", - "@babel/traverse": "^7.12.1", - "@babel/types": "^7.12.1", - "lodash": "^4.17.19" - } - }, - "node_modules/@babel/helper-optimise-call-expression": { - "version": "7.12.10", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.10.tgz", - "integrity": "sha512-4tpbU0SrSTjjt65UMWSrUOPZTsgvPgGG4S8QSTNHacKzpS51IVWGDj0yCwyeZND/i+LSN2g/O63jEXEWm49sYQ==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.10" - } - }, - "node_modules/@babel/helper-replace-supers": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.11.tgz", - "integrity": "sha512-q+w1cqmhL7R0FNzth/PLLp2N+scXEK/L2AHbXUyydxp828F4FEa5WcVoqui9vFRiHDQErj9Zof8azP32uGVTRA==", - "dev": true, - "dependencies": { - "@babel/helper-member-expression-to-functions": "^7.12.7", - "@babel/helper-optimise-call-expression": "^7.12.10", - "@babel/traverse": "^7.12.10", - "@babel/types": "^7.12.11" - } - }, - "node_modules/@babel/helper-simple-access": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.12.1.tgz", - "integrity": "sha512-OxBp7pMrjVewSSC8fXDFrHrBcJATOOFssZwv16F3/6Xtc138GHybBfPbm9kfiqQHKhYQrlamWILwlDCeyMFEaA==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.1" - } - }, - "node_modules/@babel/helper-split-export-declaration": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.11.tgz", - "integrity": "sha512-LsIVN8j48gHgwzfocYUSkO/hjYAOJqlpJEc7tGXcIm4cubjVUf8LGW6eWRyxEu7gA25q02p0rQUWoCI33HNS5g==", - "dev": true, - "dependencies": { - "@babel/types": "^7.12.11" - } - }, "node_modules/@babel/helper-validator-identifier": { "version": "7.12.11", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", "dev": true }, - "node_modules/@babel/helpers": { - "version": "7.12.5", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.5.tgz", - "integrity": "sha512-lgKGMQlKqA8meJqKsW6rUnc4MdUk35Ln0ATDqdM1a/UpARODdI4j5Y5lVfUScnSNkJcdCRAaWkspykNoFg9sJA==", - "dev": true, - "dependencies": { - "@babel/template": "^7.10.4", - "@babel/traverse": "^7.12.5", - "@babel/types": "^7.12.5" - } - }, "node_modules/@babel/highlight": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", @@ -375,43 +180,6 @@ "node": ">=6.0.0" } }, - "node_modules/@babel/template": { - "version": "7.12.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.7.tgz", - "integrity": "sha512-GkDzmHS6GV7ZeXfJZ0tLRBhZcMcY0/Lnb+eEbXDBfCAcZCjrZKe6p3J4we/D24O9Y8enxWAg1cWwof59yLh2ow==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.10.4", - "@babel/parser": "^7.12.7", - "@babel/types": "^7.12.7" - } - }, - "node_modules/@babel/traverse": { - "version": "7.12.12", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.12.tgz", - "integrity": "sha512-s88i0X0lPy45RrLM8b9mz8RPH5FqO9G9p7ti59cToE44xFm1Q+Pjh5Gq4SXBbtb88X7Uy7pexeqRIQDDMNkL0w==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.12.11", - "@babel/generator": "^7.12.11", - "@babel/helper-function-name": "^7.12.11", - "@babel/helper-split-export-declaration": "^7.12.11", - "@babel/parser": "^7.12.11", - "@babel/types": "^7.12.12", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.19" - } - }, - "node_modules/@babel/traverse/node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/@babel/types": { "version": "7.12.12", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.12.tgz", @@ -472,86 +240,6 @@ "integrity": "sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w==", "dev": true }, - "node_modules/@istanbuljs/load-nyc-config": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", - "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", - "dev": true, - "dependencies": { - "camelcase": "^5.3.1", - "find-up": "^4.1.0", - "get-package-type": "^0.1.0", - "js-yaml": "^3.13.1", - "resolve-from": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@istanbuljs/schema": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz", - "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", @@ -587,55 +275,6 @@ "node": ">= 8" } }, - "node_modules/@rollup/plugin-buble": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@rollup/plugin-buble/-/plugin-buble-0.21.3.tgz", - "integrity": "sha512-Iv8cCuFPnMdqV4pcyU+OrfjOfagPArRQ1PyQjx5KgHk3dARedI+8PNTLSMpJts0lQJr8yF2pAU4GxpxCBJ9HYw==", - "dev": true, - "dependencies": { - "@rollup/pluginutils": "^3.0.8", - "@types/buble": "^0.19.2", - "buble": "^0.20.0" - }, - "engines": { - "node": ">= 8.0.0" - }, - "peerDependencies": { - "rollup": "^1.20.0||^2.0.0" - } - }, - "node_modules/@rollup/pluginutils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", - "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", - "dev": true, - "dependencies": { - "@types/estree": "0.0.39", - "estree-walker": "^1.0.1", - "picomatch": "^2.2.2" - }, - "engines": { - "node": ">= 8.0.0" - }, - "peerDependencies": { - "rollup": "^1.20.0||^2.0.0" - } - }, - "node_modules/@types/buble": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@types/buble/-/buble-0.19.2.tgz", - "integrity": "sha512-uUD8zIfXMKThmFkahTXDGI3CthFH1kMg2dOm3KLi4GlC5cbARA64bEcUMbbWdWdE73eoc/iBB9PiTMqH0dNS2Q==", - "dev": true, - "dependencies": { - "magic-string": "^0.25.0" - } - }, - "node_modules/@types/estree": { - "version": "0.0.39", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", - "dev": true - }, "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", @@ -648,12 +287,6 @@ "integrity": "sha512-1z8k4wzFnNjVK/tlxvrWuK5WMt6mydWWP7+zvH5eFep4oj+UkrfiJTRtjCeBXNpwaA/FYqqtb4/QS4ianFpIRA==", "dev": true }, - "node_modules/@types/node": { - "version": "15.3.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-15.3.0.tgz", - "integrity": "sha512-8/bnjSZD86ZfpBsDlCIkNXIvm+h6wi9g7IqL+kmFkQ+Wvu3JrasgLElfiPgoo8V8vVfnEi0QVS12gbl94h9YsQ==", - "dev": true - }, "node_modules/@types/parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", @@ -703,15 +336,6 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-dynamic-import": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz", - "integrity": "sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw==", - "dev": true, - "peerDependencies": { - "acorn": "^6.0.0" - } - }, "node_modules/acorn-jsx": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", @@ -727,19 +351,6 @@ "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=", "dev": true }, - "node_modules/aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "dev": true, - "dependencies": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -796,24 +407,6 @@ "node": ">= 8" } }, - "node_modules/append-transform": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", - "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", - "dev": true, - "dependencies": { - "default-require-extensions": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/archy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", - "dev": true - }, "node_modules/argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -1149,92 +742,9 @@ "dev": true }, "node_modules/bs-snippet-injector": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/bs-snippet-injector/-/bs-snippet-injector-2.0.1.tgz", - "integrity": "sha1-YbU5PxH1JVntEgaTEANDtu2wTdU=", - "dev": true - }, - "node_modules/buble": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/buble/-/buble-0.20.0.tgz", - "integrity": "sha512-/1gnaMQE8xvd5qsNBl+iTuyjJ9XxeaVxAMF86dQ4EyxFJOZtsgOS8Ra+7WHgZTam5IFDtt4BguN0sH0tVTKrOw==", - "dev": true, - "dependencies": { - "acorn": "^6.4.1", - "acorn-dynamic-import": "^4.0.0", - "acorn-jsx": "^5.2.0", - "chalk": "^2.4.2", - "magic-string": "^0.25.7", - "minimist": "^1.2.5", - "regexpu-core": "4.5.4" - }, - "bin": { - "buble": "bin/buble" - } - }, - "node_modules/buble/node_modules/acorn": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", - "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/buble/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/buble/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/buble/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/buble/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bs-snippet-injector/-/bs-snippet-injector-2.0.1.tgz", + "integrity": "sha1-YbU5PxH1JVntEgaTEANDtu2wTdU=", "dev": true }, "node_modules/buffer-shims": { @@ -1252,21 +762,6 @@ "node": ">= 0.8" } }, - "node_modules/caching-transform": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", - "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", - "dev": true, - "dependencies": { - "hasha": "^5.0.0", - "make-dir": "^3.0.0", - "package-hash": "^4.0.0", - "write-file-atomic": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", @@ -1395,15 +890,6 @@ "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", "dev": true }, - "node_modules/clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -1572,15 +1058,6 @@ "@babel/types": "^7.6.1" } }, - "node_modules/convert-source-map": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", - "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.1" - } - }, "node_modules/cookie": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", @@ -1591,9 +1068,9 @@ } }, "node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "dev": true }, "node_modules/cosmiconfig": { @@ -1739,18 +1216,6 @@ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, - "node_modules/default-require-extensions": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", - "integrity": "sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==", - "dev": true, - "dependencies": { - "strip-bom": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", @@ -2205,11 +1670,15 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/es6-error": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", - "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", - "dev": true + "node_modules/esbuild": { + "version": "0.12.28", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.12.28.tgz", + "integrity": "sha512-pZ0FrWZXlvQOATlp14lRSk1N9GkeJ3vLIwOcUoo3ICQn9WNR4rWoNi81pbn6sC1iYUy7QPqNzI3+AEzokwyVcA==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + } }, "node_modules/escalade": { "version": "3.1.1", @@ -2486,15 +1955,6 @@ "node": ">=8" } }, - "node_modules/esm": { - "version": "3.2.25", - "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", - "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/espree": { "version": "7.3.1", "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", @@ -2582,12 +2042,6 @@ "node": ">=4.0" } }, - "node_modules/estree-walker": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", - "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", - "dev": true - }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -2891,19 +2345,6 @@ "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", "dev": true }, - "node_modules/foreground-child": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", - "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.0", - "signal-exit": "^3.0.2" - }, - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/fresh": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", @@ -2913,26 +2354,6 @@ "node": ">= 0.6" } }, - "node_modules/fromentries": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", - "integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", @@ -2988,15 +2409,6 @@ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, - "node_modules/gensync": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -3353,34 +2765,12 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/hasha": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", - "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", - "dev": true, - "dependencies": { - "is-stream": "^2.0.0", - "type-fest": "^0.8.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/hosted-git-info": { "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", "dev": true }, - "node_modules/html-escaper": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true - }, "node_modules/htmlparser2": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz", @@ -3478,55 +2868,6 @@ "url": "https://opencollective.com/husky" } }, - "node_modules/husky/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/husky/node_modules/chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/husky/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/husky/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, "node_modules/husky/node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -3536,18 +2877,6 @@ "node": ">=8" } }, - "node_modules/husky/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -3603,15 +2932,6 @@ "node": ">=0.8.19" } }, - "node_modules/indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/indexof": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", @@ -3995,12 +3315,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, "node_modules/is-unc-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", @@ -4050,189 +3364,32 @@ } }, "node_modules/is-wsl": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", - "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/isarray": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", - "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=", - "dev": true - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "node_modules/istanbul-lib-coverage": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", - "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-hook": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", - "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", - "dev": true, - "dependencies": { - "append-transform": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-instrument": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", - "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", - "dev": true, - "dependencies": { - "@babel/core": "^7.7.5", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.0.0", - "semver": "^6.3.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-instrument/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/istanbul-lib-processinfo": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz", - "integrity": "sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==", - "dev": true, - "dependencies": { - "archy": "^1.0.0", - "cross-spawn": "^7.0.0", - "istanbul-lib-coverage": "^3.0.0-alpha.1", - "make-dir": "^3.0.0", - "p-map": "^3.0.0", - "rimraf": "^3.0.0", - "uuid": "^3.3.3" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-processinfo/node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", - "dev": true, - "dependencies": { - "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^3.0.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-report/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-source-maps": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz", - "integrity": "sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg==", - "dev": true, - "dependencies": { - "debug": "^4.1.1", - "istanbul-lib-coverage": "^3.0.0", - "source-map": "^0.6.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-reports": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz", - "integrity": "sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", "dev": true, - "dependencies": { - "html-escaper": "^2.0.0", - "istanbul-lib-report": "^3.0.0" - }, "engines": { - "node": ">=8" + "node": ">=4" } }, + "node_modules/isarray": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", + "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=", + "dev": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, "node_modules/javascript-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/javascript-stringify/-/javascript-stringify-2.1.0.tgz", "integrity": "sha512-JVAfqNPTvNq3sB/VHQJAFxN/sPgKnsKrCwyRt15zwNCdrMMJDdcEOdubuy+DuJYYdm0ox1J4uzEuYKkN+9yhVg==", "dev": true }, - "node_modules/jest-worker": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", - "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", - "dev": true, - "dependencies": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^7.0.0" - }, - "engines": { - "node": ">= 10.13.0" - } - }, - "node_modules/jest-worker/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/js-beautify": { "version": "1.13.13", "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.13.13.tgz", @@ -4279,15 +3436,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", - "dev": true, - "bin": { - "jsesc": "bin/jsesc" - } - }, "node_modules/json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", @@ -4312,21 +3460,6 @@ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, - "node_modules/json5": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", - "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", - "dev": true, - "dependencies": { - "minimist": "^1.2.5" - }, - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/jsonfile": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-3.0.1.tgz", @@ -4543,12 +3676,6 @@ "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", "dev": true }, - "node_modules/lodash.flattendeep": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", - "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", - "dev": true - }, "node_modules/lodash.isfinite": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/lodash.isfinite/-/lodash.isfinite-3.3.2.tgz", @@ -4586,15 +3713,6 @@ "node": "*" } }, - "node_modules/magic-string": { - "version": "0.25.7", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", - "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", - "dev": true, - "dependencies": { - "sourcemap-codec": "^1.4.4" - } - }, "node_modules/make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -4880,18 +3998,6 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, - "node_modules/node-preload": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", - "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", - "dev": true, - "dependencies": { - "process-on-spawn": "^1.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/nopt": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", @@ -4995,117 +4101,6 @@ "node": ">= 6" } }, - "node_modules/nyc": { - "version": "15.1.0", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", - "integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==", - "dev": true, - "dependencies": { - "@istanbuljs/load-nyc-config": "^1.0.0", - "@istanbuljs/schema": "^0.1.2", - "caching-transform": "^4.0.0", - "convert-source-map": "^1.7.0", - "decamelize": "^1.2.0", - "find-cache-dir": "^3.2.0", - "find-up": "^4.1.0", - "foreground-child": "^2.0.0", - "get-package-type": "^0.1.0", - "glob": "^7.1.6", - "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-hook": "^3.0.0", - "istanbul-lib-instrument": "^4.0.0", - "istanbul-lib-processinfo": "^2.0.2", - "istanbul-lib-report": "^3.0.0", - "istanbul-lib-source-maps": "^4.0.0", - "istanbul-reports": "^3.0.2", - "make-dir": "^3.0.0", - "node-preload": "^0.2.1", - "p-map": "^3.0.0", - "process-on-spawn": "^1.0.0", - "resolve-from": "^5.0.0", - "rimraf": "^3.0.0", - "signal-exit": "^3.0.2", - "spawn-wrap": "^2.0.0", - "test-exclude": "^6.0.0", - "yargs": "^15.0.2" - }, - "bin": { - "nyc": "bin/nyc.js" - }, - "engines": { - "node": ">=8.9" - } - }, - "node_modules/nyc/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/nyc/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/nyc/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/nyc/node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/nyc/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/nyc/node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -5342,18 +4337,6 @@ "node": ">=4" } }, - "node_modules/p-map": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", - "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", - "dev": true, - "dependencies": { - "aggregate-error": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", @@ -5363,21 +4346,6 @@ "node": ">=6" } }, - "node_modules/package-hash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", - "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.15", - "hasha": "^5.0.0", - "lodash.flattendeep": "^4.4.0", - "release-zalgo": "^1.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -5486,9 +4454,9 @@ } }, "node_modules/path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, "node_modules/path-root": { @@ -5863,18 +4831,6 @@ "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", "dev": true }, - "node_modules/process-on-spawn": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", - "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", - "dev": true, - "dependencies": { - "fromentries": "^1.2.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", @@ -6083,15 +5039,6 @@ } ] }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "dependencies": { - "safe-buffer": "^5.1.0" - } - }, "node_modules/range-parser": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", @@ -6233,24 +5180,6 @@ "mkdirp": "bin/cmd.js" } }, - "node_modules/regenerate": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", - "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", - "dev": true - }, - "node_modules/regenerate-unicode-properties": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", - "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", - "dev": true, - "dependencies": { - "regenerate": "^1.4.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/regexp.prototype.flags": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.1.tgz", @@ -6279,53 +5208,6 @@ "url": "https://github.com/sponsors/mysticatea" } }, - "node_modules/regexpu-core": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.5.4.tgz", - "integrity": "sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ==", - "dev": true, - "dependencies": { - "regenerate": "^1.4.0", - "regenerate-unicode-properties": "^8.0.2", - "regjsgen": "^0.5.0", - "regjsparser": "^0.6.0", - "unicode-match-property-ecmascript": "^1.0.4", - "unicode-match-property-value-ecmascript": "^1.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/regjsgen": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", - "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==", - "dev": true - }, - "node_modules/regjsparser": { - "version": "0.6.4", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.4.tgz", - "integrity": "sha512-64O87/dPDgfk8/RQqC4gkZoGyyWFIEUTTh80CU6CWuK5vkCGyekIx+oKcEIYtP/RAxSQltCZHCNu/mdd7fqlJw==", - "dev": true, - "dependencies": { - "jsesc": "~0.5.0" - }, - "bin": { - "regjsparser": "bin/parser" - } - }, - "node_modules/release-zalgo": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", - "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", - "dev": true, - "dependencies": { - "es6-error": "^4.0.1" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", @@ -6440,36 +5322,6 @@ "rimraf": "bin.js" } }, - "node_modules/rollup": { - "version": "2.56.3", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.56.3.tgz", - "integrity": "sha512-Au92NuznFklgQCUcV96iXlxUbHuB1vQMaH76DHl5M11TotjOHwqk9CwcrT78+Tnv4FN9uTBxq6p4EJoYkpyekg==", - "dev": true, - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=10.0.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, - "node_modules/rollup-plugin-terser": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz", - "integrity": "sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.10.4", - "jest-worker": "^26.2.1", - "serialize-javascript": "^4.0.0", - "terser": "^5.0.0" - }, - "peerDependencies": { - "rollup": "^2.0.0" - } - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -6653,15 +5505,6 @@ "node": ">= 0.6" } }, - "node_modules/serialize-javascript": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", - "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", - "dev": true, - "dependencies": { - "randombytes": "^2.1.0" - } - }, "node_modules/serve-index": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz", @@ -6973,62 +5816,14 @@ "debug": "~4.1.0", "isarray": "2.0.1" } - }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", - "dev": true, - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "node_modules/sourcemap-codec": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", - "dev": true - }, - "node_modules/spawn-wrap": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", - "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", - "dev": true, - "dependencies": { - "foreground-child": "^2.0.0", - "is-windows": "^1.0.2", - "make-dir": "^3.0.0", - "rimraf": "^3.0.0", - "signal-exit": "^3.0.2", - "which": "^2.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/spawn-wrap/node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "engines": { + "node": ">=0.10.0" } }, "node_modules/spdx-correct": { @@ -7205,15 +6000,6 @@ "node": ">=0.10.0" } }, - "node_modules/strip-bom": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", - "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/strip-bom-string": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", @@ -7451,46 +6237,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/terser": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.0.tgz", - "integrity": "sha512-HP5/9hp2UaZt5fYkuhNBR8YyRcT8juw8+uFbAme53iN9hblvKnLUTKkmwJG6ocWpIKf8UK4DoeWG4ty0J6S6/g==", - "dev": true, - "dependencies": { - "commander": "^2.20.0", - "source-map": "~0.7.2", - "source-map-support": "~0.5.19" - }, - "bin": { - "terser": "bin/terser" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/terser/node_modules/source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/test-exclude": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", - "dev": true, - "dependencies": { - "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -7721,24 +6467,6 @@ "node": ">= 0.8.0" } }, - "node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dev": true, - "dependencies": { - "is-typedarray": "^1.0.0" - } - }, "node_modules/ua-parser-js": { "version": "0.7.28", "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.28.tgz", @@ -7807,46 +6535,6 @@ "node": ">=0.10.0" } }, - "node_modules/unicode-canonical-property-names-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", - "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/unicode-match-property-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", - "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", - "dev": true, - "dependencies": { - "unicode-canonical-property-names-ecmascript": "^1.0.4", - "unicode-property-aliases-ecmascript": "^1.0.4" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/unicode-match-property-value-ecmascript": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", - "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/unicode-property-aliases-ecmascript": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", - "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", @@ -7889,16 +6577,6 @@ "node": ">= 0.4.0" } }, - "node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", - "dev": true, - "bin": { - "uuid": "bin/uuid" - } - }, "node_modules/v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", @@ -8116,18 +6794,6 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, - "node_modules/write-file-atomic": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", - "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", - "dev": true, - "dependencies": { - "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" - } - }, "node_modules/ws": { "version": "7.4.6", "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", @@ -8272,12 +6938,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/yargs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, "node_modules/yargs/node_modules/find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -8291,15 +6951,6 @@ "node": ">=8" } }, - "node_modules/yargs/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/yargs/node_modules/locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -8333,20 +6984,6 @@ "node": ">=8" } }, - "node_modules/yargs/node_modules/string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/yargs/node_modules/strip-ansi": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", @@ -8438,14 +7075,6 @@ "slugify": "^1.4.7", "time-require": "^0.1.2", "valid-url": "^1.0.9" - }, - "dependencies": { - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - } } }, "@11ty/eleventy-plugin-syntaxhighlight": { @@ -8467,179 +7096,12 @@ "@babel/highlight": "^7.10.4" } }, - "@babel/core": { - "version": "7.12.10", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.10.tgz", - "integrity": "sha512-eTAlQKq65zHfkHZV0sIVODCPGVgoo1HdBlbSLi9CqOzuZanMv2ihzY+4paiKr1mH+XmYESMAmJ/dpZ68eN6d8w==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.12.10", - "@babel/helper-module-transforms": "^7.12.1", - "@babel/helpers": "^7.12.5", - "@babel/parser": "^7.12.10", - "@babel/template": "^7.12.7", - "@babel/traverse": "^7.12.10", - "@babel/types": "^7.12.10", - "convert-source-map": "^1.7.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.1", - "json5": "^2.1.2", - "lodash": "^4.17.19", - "semver": "^5.4.1", - "source-map": "^0.5.0" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - } - } - }, - "@babel/generator": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.11.tgz", - "integrity": "sha512-Ggg6WPOJtSi8yYQvLVjG8F/TlpWDlKx0OpS4Kt+xMQPs5OaGYWy+v1A+1TvxI6sAMGZpKWWoAQ1DaeQbImlItA==", - "dev": true, - "requires": { - "@babel/types": "^7.12.11", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - }, - "dependencies": { - "jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - } - } - }, - "@babel/helper-function-name": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.11.tgz", - "integrity": "sha512-AtQKjtYNolKNi6nNNVLQ27CP6D9oFR6bq/HPYSizlzbp7uC1M59XJe8L+0uXjbIaZaUJF99ruHqVGiKXU/7ybA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.12.10", - "@babel/template": "^7.12.7", - "@babel/types": "^7.12.11" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.12.10", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.10.tgz", - "integrity": "sha512-mm0n5BPjR06wh9mPQaDdXWDoll/j5UpCAPl1x8fS71GHm7HA6Ua2V4ylG1Ju8lvcTOietbPNNPaSilKj+pj+Ag==", - "dev": true, - "requires": { - "@babel/types": "^7.12.10" - } - }, - "@babel/helper-member-expression-to-functions": { - "version": "7.12.7", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.7.tgz", - "integrity": "sha512-DCsuPyeWxeHgh1Dus7APn7iza42i/qXqiFPWyBDdOFtvS581JQePsc1F/nD+fHrcswhLlRc2UpYS1NwERxZhHw==", - "dev": true, - "requires": { - "@babel/types": "^7.12.7" - } - }, - "@babel/helper-module-imports": { - "version": "7.12.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.5.tgz", - "integrity": "sha512-SR713Ogqg6++uexFRORf/+nPXMmWIn80TALu0uaFb+iQIUoR7bOC7zBWyzBs5b3tBBJXuyD0cRu1F15GyzjOWA==", - "dev": true, - "requires": { - "@babel/types": "^7.12.5" - } - }, - "@babel/helper-module-transforms": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.12.1.tgz", - "integrity": "sha512-QQzehgFAZ2bbISiCpmVGfiGux8YVFXQ0abBic2Envhej22DVXV9nCFaS5hIQbkyo1AdGb+gNME2TSh3hYJVV/w==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.12.1", - "@babel/helper-replace-supers": "^7.12.1", - "@babel/helper-simple-access": "^7.12.1", - "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/helper-validator-identifier": "^7.10.4", - "@babel/template": "^7.10.4", - "@babel/traverse": "^7.12.1", - "@babel/types": "^7.12.1", - "lodash": "^4.17.19" - } - }, - "@babel/helper-optimise-call-expression": { - "version": "7.12.10", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.10.tgz", - "integrity": "sha512-4tpbU0SrSTjjt65UMWSrUOPZTsgvPgGG4S8QSTNHacKzpS51IVWGDj0yCwyeZND/i+LSN2g/O63jEXEWm49sYQ==", - "dev": true, - "requires": { - "@babel/types": "^7.12.10" - } - }, - "@babel/helper-replace-supers": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.11.tgz", - "integrity": "sha512-q+w1cqmhL7R0FNzth/PLLp2N+scXEK/L2AHbXUyydxp828F4FEa5WcVoqui9vFRiHDQErj9Zof8azP32uGVTRA==", - "dev": true, - "requires": { - "@babel/helper-member-expression-to-functions": "^7.12.7", - "@babel/helper-optimise-call-expression": "^7.12.10", - "@babel/traverse": "^7.12.10", - "@babel/types": "^7.12.11" - } - }, - "@babel/helper-simple-access": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.12.1.tgz", - "integrity": "sha512-OxBp7pMrjVewSSC8fXDFrHrBcJATOOFssZwv16F3/6Xtc138GHybBfPbm9kfiqQHKhYQrlamWILwlDCeyMFEaA==", - "dev": true, - "requires": { - "@babel/types": "^7.12.1" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.11.tgz", - "integrity": "sha512-LsIVN8j48gHgwzfocYUSkO/hjYAOJqlpJEc7tGXcIm4cubjVUf8LGW6eWRyxEu7gA25q02p0rQUWoCI33HNS5g==", - "dev": true, - "requires": { - "@babel/types": "^7.12.11" - } - }, "@babel/helper-validator-identifier": { "version": "7.12.11", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", "dev": true }, - "@babel/helpers": { - "version": "7.12.5", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.5.tgz", - "integrity": "sha512-lgKGMQlKqA8meJqKsW6rUnc4MdUk35Ln0ATDqdM1a/UpARODdI4j5Y5lVfUScnSNkJcdCRAaWkspykNoFg9sJA==", - "dev": true, - "requires": { - "@babel/template": "^7.10.4", - "@babel/traverse": "^7.12.5", - "@babel/types": "^7.12.5" - } - }, "@babel/highlight": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", @@ -8694,42 +7156,6 @@ "integrity": "sha512-N3UxG+uuF4CMYoNj8AhnbAcJF0PiuJ9KHuy1lQmkYsxTer/MAH9UBNHsBoAX/4s6NvlDD047No8mYVGGzLL4hg==", "dev": true }, - "@babel/template": { - "version": "7.12.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.7.tgz", - "integrity": "sha512-GkDzmHS6GV7ZeXfJZ0tLRBhZcMcY0/Lnb+eEbXDBfCAcZCjrZKe6p3J4we/D24O9Y8enxWAg1cWwof59yLh2ow==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.10.4", - "@babel/parser": "^7.12.7", - "@babel/types": "^7.12.7" - } - }, - "@babel/traverse": { - "version": "7.12.12", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.12.tgz", - "integrity": "sha512-s88i0X0lPy45RrLM8b9mz8RPH5FqO9G9p7ti59cToE44xFm1Q+Pjh5Gq4SXBbtb88X7Uy7pexeqRIQDDMNkL0w==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.12.11", - "@babel/generator": "^7.12.11", - "@babel/helper-function-name": "^7.12.11", - "@babel/helper-split-export-declaration": "^7.12.11", - "@babel/parser": "^7.12.11", - "@babel/types": "^7.12.12", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.19" - }, - "dependencies": { - "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true - } - } - }, "@babel/types": { "version": "7.12.12", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.12.tgz", @@ -8771,77 +7197,16 @@ "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", "dev": true, - "requires": { - "@humanwhocodes/object-schema": "^1.2.0", - "debug": "^4.1.1", - "minimatch": "^3.0.4" - } - }, - "@humanwhocodes/object-schema": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz", - "integrity": "sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w==", - "dev": true - }, - "@istanbuljs/load-nyc-config": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", - "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", - "dev": true, - "requires": { - "camelcase": "^5.3.1", - "find-up": "^4.1.0", - "get-package-type": "^0.1.0", - "js-yaml": "^3.13.1", - "resolve-from": "^5.0.0" - }, - "dependencies": { - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true - } + "requires": { + "@humanwhocodes/object-schema": "^1.2.0", + "debug": "^4.1.1", + "minimatch": "^3.0.4" } }, - "@istanbuljs/schema": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz", - "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==", + "@humanwhocodes/object-schema": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz", + "integrity": "sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w==", "dev": true }, "@nodelib/fs.scandir": { @@ -8870,43 +7235,6 @@ "fastq": "^1.6.0" } }, - "@rollup/plugin-buble": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@rollup/plugin-buble/-/plugin-buble-0.21.3.tgz", - "integrity": "sha512-Iv8cCuFPnMdqV4pcyU+OrfjOfagPArRQ1PyQjx5KgHk3dARedI+8PNTLSMpJts0lQJr8yF2pAU4GxpxCBJ9HYw==", - "dev": true, - "requires": { - "@rollup/pluginutils": "^3.0.8", - "@types/buble": "^0.19.2", - "buble": "^0.20.0" - } - }, - "@rollup/pluginutils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", - "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", - "dev": true, - "requires": { - "@types/estree": "0.0.39", - "estree-walker": "^1.0.1", - "picomatch": "^2.2.2" - } - }, - "@types/buble": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@types/buble/-/buble-0.19.2.tgz", - "integrity": "sha512-uUD8zIfXMKThmFkahTXDGI3CthFH1kMg2dOm3KLi4GlC5cbARA64bEcUMbbWdWdE73eoc/iBB9PiTMqH0dNS2Q==", - "dev": true, - "requires": { - "magic-string": "^0.25.0" - } - }, - "@types/estree": { - "version": "0.0.39", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", - "dev": true - }, "@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", @@ -8919,12 +7247,6 @@ "integrity": "sha512-1z8k4wzFnNjVK/tlxvrWuK5WMt6mydWWP7+zvH5eFep4oj+UkrfiJTRtjCeBXNpwaA/FYqqtb4/QS4ianFpIRA==", "dev": true }, - "@types/node": { - "version": "15.3.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-15.3.0.tgz", - "integrity": "sha512-8/bnjSZD86ZfpBsDlCIkNXIvm+h6wi9g7IqL+kmFkQ+Wvu3JrasgLElfiPgoo8V8vVfnEi0QVS12gbl94h9YsQ==", - "dev": true - }, "@types/parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", @@ -8965,13 +7287,6 @@ "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", "dev": true }, - "acorn-dynamic-import": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz", - "integrity": "sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw==", - "dev": true, - "requires": {} - }, "acorn-jsx": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", @@ -8985,16 +7300,6 @@ "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=", "dev": true }, - "aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "dev": true, - "requires": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - } - }, "ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -9035,21 +7340,6 @@ "picomatch": "^2.0.4" } }, - "append-transform": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", - "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", - "dev": true, - "requires": { - "default-require-extensions": "^3.0.0" - } - }, - "archy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", - "dev": true - }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -9332,70 +7622,6 @@ "integrity": "sha1-YbU5PxH1JVntEgaTEANDtu2wTdU=", "dev": true }, - "buble": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/buble/-/buble-0.20.0.tgz", - "integrity": "sha512-/1gnaMQE8xvd5qsNBl+iTuyjJ9XxeaVxAMF86dQ4EyxFJOZtsgOS8Ra+7WHgZTam5IFDtt4BguN0sH0tVTKrOw==", - "dev": true, - "requires": { - "acorn": "^6.4.1", - "acorn-dynamic-import": "^4.0.0", - "acorn-jsx": "^5.2.0", - "chalk": "^2.4.2", - "magic-string": "^0.25.7", - "minimist": "^1.2.5", - "regexpu-core": "4.5.4" - }, - "dependencies": { - "acorn": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", - "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, "buffer-shims": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", @@ -9408,18 +7634,6 @@ "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", "dev": true }, - "caching-transform": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", - "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", - "dev": true, - "requires": { - "hasha": "^5.0.0", - "make-dir": "^3.0.0", - "package-hash": "^4.0.0", - "write-file-atomic": "^3.0.0" - } - }, "call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", @@ -9518,12 +7732,6 @@ "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", "dev": true }, - "clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "dev": true - }, "cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -9680,15 +7888,6 @@ "@babel/types": "^7.6.1" } }, - "convert-source-map": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", - "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - } - }, "cookie": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", @@ -9696,9 +7895,9 @@ "dev": true }, "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "dev": true }, "cosmiconfig": { @@ -9816,15 +8015,6 @@ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, - "default-require-extensions": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", - "integrity": "sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==", - "dev": true, - "requires": { - "strip-bom": "^4.0.0" - } - }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", @@ -10201,10 +8391,10 @@ "is-symbol": "^1.0.2" } }, - "es6-error": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", - "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "esbuild": { + "version": "0.12.28", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.12.28.tgz", + "integrity": "sha512-pZ0FrWZXlvQOATlp14lRSk1N9GkeJ3vLIwOcUoo3ICQn9WNR4rWoNi81pbn6sC1iYUy7QPqNzI3+AEzokwyVcA==", "dev": true }, "escalade": { @@ -10435,12 +8625,6 @@ "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", "dev": true }, - "esm": { - "version": "3.2.25", - "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", - "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==", - "dev": true - }, "espree": { "version": "7.3.1", "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", @@ -10506,12 +8690,6 @@ "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true }, - "estree-walker": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", - "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", - "dev": true - }, "esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -10745,28 +8923,12 @@ "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", "dev": true }, - "foreground-child": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", - "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", - "dev": true, - "requires": { - "cross-spawn": "^7.0.0", - "signal-exit": "^3.0.2" - } - }, "fresh": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", "dev": true }, - "fromentries": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", - "integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==", - "dev": true - }, "fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", @@ -10814,12 +8976,6 @@ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, - "gensync": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", - "dev": true - }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -11083,28 +9239,12 @@ "has-symbols": "^1.0.2" } }, - "hasha": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", - "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", - "dev": true, - "requires": { - "is-stream": "^2.0.0", - "type-fest": "^0.8.0" - } - }, "hosted-git-info": { "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", "dev": true }, - "html-escaper": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true - }, "htmlparser2": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz", @@ -11173,54 +9313,11 @@ "which-pm-runs": "^1.0.0" }, "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } } } }, @@ -11261,12 +9358,6 @@ "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true }, - "indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "dev": true - }, "indexof": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", @@ -11536,12 +9627,6 @@ "has-symbols": "^1.0.1" } }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, "is-unc-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", @@ -11573,129 +9658,25 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true - }, - "is-wsl": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", - "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", - "dev": true - }, - "isarray": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", - "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "istanbul-lib-coverage": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", - "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", - "dev": true - }, - "istanbul-lib-hook": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", - "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", - "dev": true, - "requires": { - "append-transform": "^2.0.0" - } - }, - "istanbul-lib-instrument": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", - "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", - "dev": true, - "requires": { - "@babel/core": "^7.7.5", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.0.0", - "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "istanbul-lib-processinfo": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz", - "integrity": "sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==", - "dev": true, - "requires": { - "archy": "^1.0.0", - "cross-spawn": "^7.0.0", - "istanbul-lib-coverage": "^3.0.0-alpha.1", - "make-dir": "^3.0.0", - "p-map": "^3.0.0", - "rimraf": "^3.0.0", - "uuid": "^3.3.3" - }, - "dependencies": { - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - } - } - }, - "istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", - "dev": true, - "requires": { - "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^3.0.0", - "supports-color": "^7.1.0" - }, - "dependencies": { - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } + "dev": true }, - "istanbul-lib-source-maps": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz", - "integrity": "sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg==", - "dev": true, - "requires": { - "debug": "^4.1.1", - "istanbul-lib-coverage": "^3.0.0", - "source-map": "^0.6.1" - } + "is-wsl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", + "dev": true }, - "istanbul-reports": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz", - "integrity": "sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==", - "dev": true, - "requires": { - "html-escaper": "^2.0.0", - "istanbul-lib-report": "^3.0.0" - } + "isarray": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", + "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true }, "javascript-stringify": { "version": "2.1.0", @@ -11703,28 +9684,6 @@ "integrity": "sha512-JVAfqNPTvNq3sB/VHQJAFxN/sPgKnsKrCwyRt15zwNCdrMMJDdcEOdubuy+DuJYYdm0ox1J4uzEuYKkN+9yhVg==", "dev": true }, - "jest-worker": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", - "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", - "dev": true, - "requires": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^7.0.0" - }, - "dependencies": { - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "js-beautify": { "version": "1.13.13", "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.13.13.tgz", @@ -11760,12 +9719,6 @@ "esprima": "^4.0.0" } }, - "jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", - "dev": true - }, "json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", @@ -11790,15 +9743,6 @@ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, - "json5": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", - "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, "jsonfile": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-3.0.1.tgz", @@ -11982,12 +9926,6 @@ "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", "dev": true }, - "lodash.flattendeep": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", - "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", - "dev": true - }, "lodash.isfinite": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/lodash.isfinite/-/lodash.isfinite-3.3.2.tgz", @@ -12022,15 +9960,6 @@ "integrity": "sha512-VKsFsPggTA0DvnxtJdiExAucKdAnwbCCNlMM5ENvHlxubqWd0xhZcdb4XgZ7QFNhaRhilXCFxHuoObP5BNA4PA==", "dev": true }, - "magic-string": { - "version": "0.25.7", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", - "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", - "dev": true, - "requires": { - "sourcemap-codec": "^1.4.4" - } - }, "make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -12247,15 +10176,6 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, - "node-preload": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", - "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", - "dev": true, - "requires": { - "process-on-spawn": "^1.0.0" - } - }, "nopt": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", @@ -12328,92 +10248,6 @@ } } }, - "nyc": { - "version": "15.1.0", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", - "integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==", - "dev": true, - "requires": { - "@istanbuljs/load-nyc-config": "^1.0.0", - "@istanbuljs/schema": "^0.1.2", - "caching-transform": "^4.0.0", - "convert-source-map": "^1.7.0", - "decamelize": "^1.2.0", - "find-cache-dir": "^3.2.0", - "find-up": "^4.1.0", - "foreground-child": "^2.0.0", - "get-package-type": "^0.1.0", - "glob": "^7.1.6", - "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-hook": "^3.0.0", - "istanbul-lib-instrument": "^4.0.0", - "istanbul-lib-processinfo": "^2.0.2", - "istanbul-lib-report": "^3.0.0", - "istanbul-lib-source-maps": "^4.0.0", - "istanbul-reports": "^3.0.2", - "make-dir": "^3.0.0", - "node-preload": "^0.2.1", - "p-map": "^3.0.0", - "process-on-spawn": "^1.0.0", - "resolve-from": "^5.0.0", - "rimraf": "^3.0.0", - "signal-exit": "^3.0.2", - "spawn-wrap": "^2.0.0", - "test-exclude": "^6.0.0", - "yargs": "^15.0.2" - }, - "dependencies": { - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - } - } - }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -12588,33 +10422,12 @@ } } }, - "p-map": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", - "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", - "dev": true, - "requires": { - "aggregate-error": "^3.0.0" - } - }, "p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, - "package-hash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", - "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.15", - "hasha": "^5.0.0", - "lodash.flattendeep": "^4.4.0", - "release-zalgo": "^1.0.0" - } - }, "parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -12696,9 +10509,9 @@ "dev": true }, "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, "path-root": { @@ -12971,15 +10784,6 @@ "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", "dev": true }, - "process-on-spawn": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", - "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", - "dev": true, - "requires": { - "fromentries": "^1.2.0" - } - }, "progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", @@ -13165,15 +10969,6 @@ "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true }, - "randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "requires": { - "safe-buffer": "^5.1.0" - } - }, "range-parser": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", @@ -13297,21 +11092,6 @@ } } }, - "regenerate": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", - "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", - "dev": true - }, - "regenerate-unicode-properties": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", - "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", - "dev": true, - "requires": { - "regenerate": "^1.4.0" - } - }, "regexp.prototype.flags": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.1.tgz", @@ -13328,44 +11108,6 @@ "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", "dev": true }, - "regexpu-core": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.5.4.tgz", - "integrity": "sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ==", - "dev": true, - "requires": { - "regenerate": "^1.4.0", - "regenerate-unicode-properties": "^8.0.2", - "regjsgen": "^0.5.0", - "regjsparser": "^0.6.0", - "unicode-match-property-ecmascript": "^1.0.4", - "unicode-match-property-value-ecmascript": "^1.1.0" - } - }, - "regjsgen": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", - "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==", - "dev": true - }, - "regjsparser": { - "version": "0.6.4", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.4.tgz", - "integrity": "sha512-64O87/dPDgfk8/RQqC4gkZoGyyWFIEUTTh80CU6CWuK5vkCGyekIx+oKcEIYtP/RAxSQltCZHCNu/mdd7fqlJw==", - "dev": true, - "requires": { - "jsesc": "~0.5.0" - } - }, - "release-zalgo": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", - "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", - "dev": true, - "requires": { - "es6-error": "^4.0.1" - } - }, "repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", @@ -13457,27 +11199,6 @@ "glob": "^7.1.3" } }, - "rollup": { - "version": "2.56.3", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.56.3.tgz", - "integrity": "sha512-Au92NuznFklgQCUcV96iXlxUbHuB1vQMaH76DHl5M11TotjOHwqk9CwcrT78+Tnv4FN9uTBxq6p4EJoYkpyekg==", - "dev": true, - "requires": { - "fsevents": "~2.3.2" - } - }, - "rollup-plugin-terser": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz", - "integrity": "sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.10.4", - "jest-worker": "^26.2.1", - "serialize-javascript": "^4.0.0", - "terser": "^5.0.0" - } - }, "run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -13624,15 +11345,6 @@ } } }, - "serialize-javascript": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", - "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", - "dev": true, - "requires": { - "randombytes": "^2.1.0" - } - }, "serve-index": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz", @@ -13918,47 +11630,6 @@ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true }, - "source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "sourcemap-codec": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", - "dev": true - }, - "spawn-wrap": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", - "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", - "dev": true, - "requires": { - "foreground-child": "^2.0.0", - "is-windows": "^1.0.2", - "make-dir": "^3.0.0", - "rimraf": "^3.0.0", - "signal-exit": "^3.0.2", - "which": "^2.0.1" - }, - "dependencies": { - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - } - } - }, "spdx-correct": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", @@ -14099,12 +11770,6 @@ "ansi-regex": "^2.0.0" } }, - "strip-bom": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", - "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", - "dev": true - }, "strip-bom-string": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", @@ -14292,36 +11957,6 @@ } } }, - "terser": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.0.tgz", - "integrity": "sha512-HP5/9hp2UaZt5fYkuhNBR8YyRcT8juw8+uFbAme53iN9hblvKnLUTKkmwJG6ocWpIKf8UK4DoeWG4ty0J6S6/g==", - "dev": true, - "requires": { - "commander": "^2.20.0", - "source-map": "~0.7.2", - "source-map-support": "~0.5.19" - }, - "dependencies": { - "source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true - } - } - }, - "test-exclude": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", - "dev": true, - "requires": { - "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" - } - }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -14524,21 +12159,6 @@ "prelude-ls": "^1.2.1" } }, - "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true - }, - "typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dev": true, - "requires": { - "is-typedarray": "^1.0.0" - } - }, "ua-parser-js": { "version": "0.7.28", "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.28.tgz", @@ -14582,34 +12202,6 @@ "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", "dev": true }, - "unicode-canonical-property-names-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", - "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", - "dev": true - }, - "unicode-match-property-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", - "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", - "dev": true, - "requires": { - "unicode-canonical-property-names-ecmascript": "^1.0.4", - "unicode-property-aliases-ecmascript": "^1.0.4" - } - }, - "unicode-match-property-value-ecmascript": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", - "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", - "dev": true - }, - "unicode-property-aliases-ecmascript": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", - "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", - "dev": true - }, "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", @@ -14643,12 +12235,6 @@ "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", "dev": true }, - "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "dev": true - }, "v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", @@ -14820,18 +12406,6 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, - "write-file-atomic": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", - "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", - "dev": true, - "requires": { - "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" - } - }, "ws": { "version": "7.4.6", "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", @@ -14929,12 +12503,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, "find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -14945,12 +12513,6 @@ "path-exists": "^4.0.0" } }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, "locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -14975,17 +12537,6 @@ "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true }, - "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, "strip-ansi": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", diff --git a/package.json b/package.json index 5e0df034..4818951f 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,8 @@ { "name": "culori", "version": "0.20.1", - "main": "build/culori.umd.js", - "browser": "build/culori.umd.js", - "module": "build/culori.js", + "main": "build/culori.js", + "type": "module", "repository": "git@github.com:Evercoder/culori.git", "author": "Dan Burzo ", "description": "A general-purpose color library for JavaScript", @@ -35,28 +34,24 @@ "devDependencies": { "@11ty/eleventy": "^0.12.1", "@11ty/eleventy-plugin-syntaxhighlight": "^3.1.2", - "@rollup/plugin-buble": "^0.21.3", + "esbuild": "^0.12.28", "eslint": "^7.32.0", "eslint-plugin-import": "^2.24.2", - "esm": "^3.2.25", "gh-pages": "^3.2.3", "husky": "^4.2.5", - "nyc": "^15.1.0", "prettier": "^2.4.1", "pretty-quick": "^3.1.1", - "rollup": "^2.56.3", - "rollup-plugin-terser": "^7.0.2", "tap-spec": "^5.0.0", "tape": "^5.3.1" }, "scripts": { - "start": "rollup -cw", - "build": "rollup -c", - "test": "tape -r esm 'test/*.js' | tap-spec", + "test": "tape 'test/*.js' | tap-spec", + "build": "npm run build:esm && npm run build:cjs && npm run build:iife", + "build:esm": "esbuild --bundle --minify --format=esm src/index.js --outfile=build/culori.js", + "build:cjs": "esbuild --bundle --format=cjs src/index.js --outfile=build/culori.cjs.js", + "build:iife": "esbuild --bundle --minify --format=iife src/index.js --outfile=build/culori.iife.js", "benchmark": "node benchmark/index.js", "prepublishOnly": "npm run lint && npm run build && npm run test", - "coverage:report": "nyc report --reporter=lcov", - "coverage:test": "nyc --produce-source-map tape -r esm 'test/*.js' | tap-spec", "docs:start": "eleventy --serve", "docs:build": "rm -rf www && eleventy", "docs:deploy": "npm run docs:build && gh-pages -d www --dotfiles", diff --git a/rollup.config.js b/rollup.config.js deleted file mode 100644 index bd032a5c..00000000 --- a/rollup.config.js +++ /dev/null @@ -1,26 +0,0 @@ -import buble from '@rollup/plugin-buble'; -import { terser } from 'rollup-plugin-terser'; -import pkg from './package.json'; - -export default [ - // UMD, minified - { - input: 'src/index.js', - output: { - file: pkg.main, - format: 'umd', - name: 'culori' - }, - plugins: [buble({ objectAssign: 'Object.assign' }), terser()] - }, - - // ES6 modules - { - input: 'src/index.js', - output: { - file: pkg.module, - format: 'es' - }, - plugins: [buble({ objectAssign: 'Object.assign' })] - } -]; diff --git a/src/rgb/parseHex.js b/src/rgb/parseHex.js index 3605d6d0..ff587717 100644 --- a/src/rgb/parseHex.js +++ b/src/rgb/parseHex.js @@ -3,6 +3,7 @@ import { hex } from '../util/regex.js'; const parseHex = color => { let match; + // eslint-disable-next-line no-cond-assign return (match = color.match(hex)) ? parseNumber(parseInt(match[1], 16), match[1].length) : undefined; diff --git a/test/hsl.test.js b/test/hsl.test.js index fea9eb9c..bb913200 100644 --- a/test/hsl.test.js +++ b/test/hsl.test.js @@ -108,7 +108,7 @@ tape('hsl() parses hsl / hsla CSS strings', function (test) { test.deepEqual( hsl('hsl(0, 100%, 50%)'), - { h: 0, s: 1, l: 0.5, h: 0, mode: 'hsl' }, + { h: 0, s: 1, l: 0.5, mode: 'hsl' }, 'red' ); diff --git a/test/interpolate.test.js b/test/interpolate.test.js index 4b015652..46fa3ab9 100644 --- a/test/interpolate.test.js +++ b/test/interpolate.test.js @@ -243,10 +243,9 @@ tape('Easing fn returning outside [0,1], issue #140', t => { // From: https://github.com/mattdesl/eases/blob/master/back-in-out.js function backInOut(t) { var s = 1.70158 * 1.525; - return (t *= - 2 < 1 - ? 0.5 * (t * t * ((s + 1) * t - s)) - : 0.5 * ((t -= 2) * t * ((s + 1) * t + s) + 2)); + return (t *= 2) < 1 + ? 0.5 * (t * t * ((s + 1) * t - s)) + : 0.5 * ((t -= 2) * t * ((s + 1) * t + s) + 2); } const it = interpolate([backInOut, '#ff0000', '#cc8833', '#3344cc']); t.equal(isNaN(it(0.05).r), false); From 7d0585c48d0131536367dedb8a611d6ec923c9c6 Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Sat, 18 Sep 2021 16:19:14 +0300 Subject: [PATCH 03/40] Updates to package.json --- .eleventy.js | 6 +++--- package-lock.json | 3 +++ package.json | 6 +++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.eleventy.js b/.eleventy.js index 9970838d..883bf443 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,6 +1,6 @@ -import highlight from '@11ty/eleventy-plugin-syntaxhighlight'; +const highlight = require('@11ty/eleventy-plugin-syntaxhighlight'); -export default function (env) { +module.exports = function (env) { env.addPassthroughCopy('docs/img'); env.addPassthroughCopy('docs/css'); env.addPassthroughCopy({ 'docs/static': '.' }); @@ -25,4 +25,4 @@ export default function (env) { }, htmlTemplateEngine: 'njk' }; -} +}; diff --git a/package-lock.json b/package-lock.json index 7e78427d..af63461d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,6 +20,9 @@ "pretty-quick": "^3.1.1", "tap-spec": "^5.0.0", "tape": "^5.3.1" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, "node_modules/@11ty/dependency-tree": { diff --git a/package.json b/package.json index 4818951f..7e509af9 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "0.20.1", "main": "build/culori.js", "type": "module", + "exports": "./index.js", "repository": "git@github.com:Evercoder/culori.git", "author": "Dan Burzo ", "description": "A general-purpose color library for JavaScript", @@ -72,5 +73,8 @@ "arrowParens": "avoid", "printWidth": 80 }, - "sideEffects": false + "sideEffects": false, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } } From 716907671eb172283db92483b2a6c6fe54d12de1 Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Sat, 18 Sep 2021 17:40:58 +0300 Subject: [PATCH 04/40] Add build.js script, add src/ folder to npm, rename build/ to bundled/ --- .gitignore | 1 + build.js | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 16 +++++++------- tools/ranges.js | 2 +- 4 files changed, 66 insertions(+), 8 deletions(-) create mode 100644 build.js diff --git a/.gitignore b/.gitignore index 7b7dd5dc..316ccb69 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *.sublime-workspace .DS_Store build/ +bundled/ node_modules *.log .nyc_output/ diff --git a/build.js b/build.js new file mode 100644 index 00000000..2cc4efa7 --- /dev/null +++ b/build.js @@ -0,0 +1,55 @@ +import { build } from 'esbuild'; + +function task(config) { + return build({ + entryPoints: ['./src/index.js'], + logLevel: 'info', + bundle: true, + ...config + }); +} + +/* + Bundled CJS, unminified / minified. + */ + +task({ + format: 'cjs', + outfile: 'bundled/culori.cjs.js' +}); + +task({ + format: 'cjs', + minify: true, + outfile: 'bundled/culori.cjs.min.js' +}); + +/* + Bundled ESM, unminified / minified. + */ + +task({ + format: 'esm', + outfile: 'bundled/culori.mjs' +}); + +task({ + format: 'esm', + minify: true, + outfile: 'bundled/culori.min.mjs' +}); + +/* + Bundled IIFE, unminified / minified. + */ + +task({ + format: 'iife', + outfile: 'bundled/culori.js' +}); + +task({ + format: 'iife', + minify: true, + outfile: 'bundled/culori.min.js' +}); diff --git a/package.json b/package.json index 7e509af9..6e03a5a5 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,13 @@ { "name": "culori", "version": "0.20.1", - "main": "build/culori.js", "type": "module", - "exports": "./index.js", + "main": "bundled/culori.cjs.js", + "module": "bundled/culori.min.mjs", + "browser": "bundled/culori.min.js", + "exports": { + ".": "./src/index.js" + }, "repository": "git@github.com:Evercoder/culori.git", "author": "Dan Burzo ", "description": "A general-purpose color library for JavaScript", @@ -30,7 +34,8 @@ ], "license": "MIT", "files": [ - "build" + "bundled", + "src" ], "devDependencies": { "@11ty/eleventy": "^0.12.1", @@ -47,10 +52,7 @@ }, "scripts": { "test": "tape 'test/*.js' | tap-spec", - "build": "npm run build:esm && npm run build:cjs && npm run build:iife", - "build:esm": "esbuild --bundle --minify --format=esm src/index.js --outfile=build/culori.js", - "build:cjs": "esbuild --bundle --format=cjs src/index.js --outfile=build/culori.cjs.js", - "build:iife": "esbuild --bundle --minify --format=iife src/index.js --outfile=build/culori.iife.js", + "build": "node build.js", "benchmark": "node benchmark/index.js", "prepublishOnly": "npm run lint && npm run build && npm run test", "docs:start": "eleventy --serve", diff --git a/tools/ranges.js b/tools/ranges.js index 89b9b422..dad9b5bc 100644 --- a/tools/ranges.js +++ b/tools/ranges.js @@ -1,4 +1,4 @@ -let culori = require('..'); +let culori = require('../src/index.js'); /* Find the channel value ranges (minimum & maximum) From 480ee80a687d3eb5bb6d6e95cecd9133373be060 Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Sat, 18 Sep 2021 18:00:21 +0300 Subject: [PATCH 05/40] 1.0.0-alpha.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index af63461d..0914dcf6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "culori", - "version": "0.20.1", + "version": "1.0.0-alpha.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "culori", - "version": "0.20.1", + "version": "1.0.0-alpha.0", "license": "MIT", "devDependencies": { "@11ty/eleventy": "^0.12.1", diff --git a/package.json b/package.json index 6e03a5a5..d3d0578a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "culori", - "version": "0.20.1", + "version": "1.0.0-alpha.0", "type": "module", "main": "bundled/culori.cjs.js", "module": "bundled/culori.min.mjs", From 50a45ddffbc60dc4552d29c59837a2a445197d0c Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Sat, 18 Sep 2021 18:13:58 +0300 Subject: [PATCH 06/40] Change names of bundles, update exports in package.json --- build.js | 8 ++++---- package.json | 9 +++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/build.js b/build.js index 2cc4efa7..935d2466 100644 --- a/build.js +++ b/build.js @@ -15,13 +15,13 @@ function task(config) { task({ format: 'cjs', - outfile: 'bundled/culori.cjs.js' + outfile: 'bundled/culori.cjs' }); task({ format: 'cjs', minify: true, - outfile: 'bundled/culori.cjs.min.js' + outfile: 'bundled/culori-min.cjs' }); /* @@ -36,7 +36,7 @@ task({ task({ format: 'esm', minify: true, - outfile: 'bundled/culori.min.mjs' + outfile: 'bundled/culori-min.mjs' }); /* @@ -51,5 +51,5 @@ task({ task({ format: 'iife', minify: true, - outfile: 'bundled/culori.min.js' + outfile: 'bundled/culori-min.js' }); diff --git a/package.json b/package.json index d3d0578a..03e279bf 100644 --- a/package.json +++ b/package.json @@ -2,11 +2,12 @@ "name": "culori", "version": "1.0.0-alpha.0", "type": "module", - "main": "bundled/culori.cjs.js", - "module": "bundled/culori.min.mjs", - "browser": "bundled/culori.min.js", + "main": "bundled/culori.cjs", + "module": "bundled/culori-min.mjs", + "browser": "bundled/culori-min.js", "exports": { - ".": "./src/index.js" + "require": "bundled/culori.cjs", + "import": "./src/index.js" }, "repository": "git@github.com:Evercoder/culori.git", "author": "Dan Burzo ", From 5da032a926e3f84a55ba7f9f1bf4cf56a9d6ec09 Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Sat, 18 Sep 2021 18:15:16 +0300 Subject: [PATCH 07/40] 1.0.0-alpha.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0914dcf6..fce66e0f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "culori", - "version": "1.0.0-alpha.0", + "version": "1.0.0-alpha.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "culori", - "version": "1.0.0-alpha.0", + "version": "1.0.0-alpha.1", "license": "MIT", "devDependencies": { "@11ty/eleventy": "^0.12.1", diff --git a/package.json b/package.json index 03e279bf..3e9408c9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "culori", - "version": "1.0.0-alpha.0", + "version": "1.0.0-alpha.1", "type": "module", "main": "bundled/culori.cjs", "module": "bundled/culori-min.mjs", From 5ecc0f338254abeb6de5440667137b434076ef5a Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Sat, 18 Sep 2021 18:17:00 +0300 Subject: [PATCH 08/40] Fix relative exports --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3e9408c9..8e494cce 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "module": "bundled/culori-min.mjs", "browser": "bundled/culori-min.js", "exports": { - "require": "bundled/culori.cjs", + "require": "./bundled/culori.cjs", "import": "./src/index.js" }, "repository": "git@github.com:Evercoder/culori.git", From cd87bd2870f8d34407b37cc456816e824439329a Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Sat, 18 Sep 2021 18:17:03 +0300 Subject: [PATCH 09/40] 1.0.0-alpha.2 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index fce66e0f..9159a5a7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "culori", - "version": "1.0.0-alpha.1", + "version": "1.0.0-alpha.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "culori", - "version": "1.0.0-alpha.1", + "version": "1.0.0-alpha.2", "license": "MIT", "devDependencies": { "@11ty/eleventy": "^0.12.1", diff --git a/package.json b/package.json index 8e494cce..a309177a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "culori", - "version": "1.0.0-alpha.1", + "version": "1.0.0-alpha.2", "type": "module", "main": "bundled/culori.cjs", "module": "bundled/culori-min.mjs", From be1cec12cb6218312486eae3d0dd9596db36e20a Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Sat, 18 Sep 2021 18:21:23 +0300 Subject: [PATCH 10/40] 1.0.0-alpha.3 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9159a5a7..15c26abb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "culori", - "version": "1.0.0-alpha.2", + "version": "1.0.0-alpha.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "culori", - "version": "1.0.0-alpha.2", + "version": "1.0.0-alpha.3", "license": "MIT", "devDependencies": { "@11ty/eleventy": "^0.12.1", diff --git a/package.json b/package.json index a309177a..57315dcb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "culori", - "version": "1.0.0-alpha.2", + "version": "1.0.0-alpha.3", "type": "module", "main": "bundled/culori.cjs", "module": "bundled/culori-min.mjs", From a207c6f4b97d8b89a680a7064360ebae34f974da Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Sat, 18 Sep 2021 19:03:45 +0300 Subject: [PATCH 11/40] Split in packs, provide entry points --- build.js | 40 ++++++- package.json | 5 +- src/difference.js | 20 +--- src/index.js | 223 +------------------------------------- src/packs/core.js | 82 ++++++++++++++ src/packs/extra-spaces.js | 55 ++++++++++ src/packs/fns.js | 97 +++++++++++++++++ 7 files changed, 279 insertions(+), 243 deletions(-) create mode 100644 src/packs/core.js create mode 100644 src/packs/extra-spaces.js create mode 100644 src/packs/fns.js diff --git a/build.js b/build.js index 935d2466..382a49a9 100644 --- a/build.js +++ b/build.js @@ -21,7 +21,7 @@ task({ task({ format: 'cjs', minify: true, - outfile: 'bundled/culori-min.cjs' + outfile: 'bundled/culori.min.cjs' }); /* @@ -36,7 +36,7 @@ task({ task({ format: 'esm', minify: true, - outfile: 'bundled/culori-min.mjs' + outfile: 'bundled/culori.min.mjs' }); /* @@ -51,5 +51,39 @@ task({ task({ format: 'iife', minify: true, - outfile: 'bundled/culori-min.js' + outfile: 'bundled/culori.min.js' +}); + +/* + Packs + */ + +task({ + format: 'esm', + entryPoints: ['src/packs/core.js'], + outfile: 'bundled/culori-core.mjs' +}); + +task({ + format: 'esm', + entryPoints: ['src/packs/core.js'], + minify: true, + outfile: 'bundled/culori-core.min.mjs' +}); + +/* + Bundled IIFE, unminified / minified. + */ + +task({ + format: 'iife', + entryPoints: ['src/packs/core.js'], + outfile: 'bundled/culori-core.js' +}); + +task({ + format: 'iife', + entryPoints: ['src/packs/core.js'], + minify: true, + outfile: 'bundled/culori-core.min.js' }); diff --git a/package.json b/package.json index 57315dcb..d66eb80b 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,10 @@ "browser": "bundled/culori-min.js", "exports": { "require": "./bundled/culori.cjs", - "import": "./src/index.js" + "core": "./src/entry-points/core.js", + "fns": "./src/entry-points/fns.js", + "extra-spaces": "./src/entry-points/extra-spaces.js", + "default": "./src/index.js" }, "repository": "git@github.com:Evercoder/culori.git", "author": "Dan Burzo ", diff --git a/src/difference.js b/src/difference.js index 0a01ca9f..f32ee22c 100644 --- a/src/difference.js +++ b/src/difference.js @@ -278,22 +278,6 @@ const differenceHyab = () => { }; }; -const differenceDin99o = () => differenceEuclidean('dlab'); - -/* - "Measuring perceived color difference using YIQ NTSC - transmission color space in mobile applications" - - by Yuriy Kotsarenko, Fernando Ramos in: - Programación Matemática y Software (2010) - - Available at: - - http://www.progmat.uaem.mx:8080/artVol2Num2/Articulo3Vol2Num2.pdf - */ -const differenceKotsarenkoRamos = () => - differenceEuclidean('yiq', [0.5053, 0.299, 0.1957]); - export { differenceHueChroma, differenceHueSaturation, @@ -303,7 +287,5 @@ export { differenceCie94, differenceCiede2000, differenceCmc, - differenceHyab, - differenceDin99o, - differenceKotsarenkoRamos + differenceHyab }; diff --git a/src/index.js b/src/index.js index 70e2f61c..f58ffbae 100644 --- a/src/index.js +++ b/src/index.js @@ -1,220 +1,3 @@ -import rgbDef from './rgb/definition.js'; -import lrgbDef from './lrgb/definition.js'; -import a98Def from './a98/definition.js'; -import p3Def from './p3/definition.js'; -import prophotoDef from './prophoto/definition.js'; -import rec2020Def from './rec2020/definition.js'; -import hslDef from './hsl/definition.js'; -import hsvDef from './hsv/definition.js'; -import hsiDef from './hsi/definition.js'; -import hwbDef from './hwb/definition.js'; -import jabDef from './jab/definition.js'; -import jchDef from './jch/definition.js'; -import labDef from './lab/definition.js'; -import lab65Def from './lab65/definition.js'; -import lchDef from './lch/definition.js'; -import lch65Def from './lch65/definition.js'; -import luvDef from './luv/definition.js'; -import lchuvDef from './lchuv/definition.js'; -import cubehelixDef from './cubehelix/definition.js'; -import dlabDef from './dlab/definition.js'; -import dlchDef from './dlch/definition.js'; -import xyzDef from './xyz/definition.js'; -import xyz65Def from './xyz65/definition.js'; -import yiqDef from './yiq/definition.js'; -import oklabDef from './oklab/definition.js'; -import oklchDef from './oklch/definition.js'; - -import { defineMode } from './modes.js'; -import converter from './converter.js'; - -defineMode(a98Def); -defineMode(cubehelixDef); -defineMode(dlabDef); -defineMode(dlchDef); -defineMode(hsiDef); -defineMode(hslDef); -defineMode(hsvDef); -defineMode(hwbDef); -defineMode(jabDef); -defineMode(jchDef); -defineMode(labDef); -defineMode(lab65Def); -defineMode(lchDef); -defineMode(lch65Def); -defineMode(lchuvDef); -defineMode(lrgbDef); -defineMode(luvDef); -defineMode(p3Def); -defineMode(prophotoDef); -defineMode(rec2020Def); -defineMode(rgbDef); -defineMode(xyz65Def); -defineMode(xyzDef); -defineMode(yiqDef); -defineMode(oklabDef); -defineMode(oklchDef); - -let a98 = converter('a98'); -let cubehelix = converter('cubehelix'); -let dlab = converter('dlab'); -let dlch = converter('dlch'); -let hsi = converter('hsi'); -let hsl = converter('hsl'); -let hsv = converter('hsv'); -let hwb = converter('hwb'); -let jab = converter('jab'); -let jch = converter('jch'); -let lab = converter('lab'); -let lab65 = converter('lab65'); -let lch = converter('lch'); -let lch65 = converter('lch65'); -let lchuv = converter('lchuv'); -let lrgb = converter('lrgb'); -let luv = converter('luv'); -let p3 = converter('p3'); -let prophoto = converter('prophoto'); -let rec2020 = converter('rec2020'); -let rgb = converter('rgb'); -let xyz = converter('xyz'); -let xyz65 = converter('xyz65'); -let yiq = converter('yiq'); -let oklab = converter('oklab'); -let oklch = converter('oklch'); - -export { - a98, - converter, - cubehelix, - defineMode, - dlab, - dlch, - hsi, - hsl, - hsv, - hwb, - jab, - jch, - lab, - lab65, - lch, - lch65, - lchuv, - lrgb, - luv, - p3, - prophoto, - rec2020, - rgb, - xyz, - xyz65, - yiq, - oklab, - oklch -}; - -export { - formatHex, - formatHex8, - formatRgb, - formatHsl, - formatCss -} from './formatter.js'; -export { default as round } from './round.js'; -export { - interpolate, - interpolateWith, - interpolateWithPremultipliedAlpha -} from './interpolate/interpolate.js'; - -export { interpolatorLinear } from './interpolate/linear.js'; - -export { interpolatorPiecewise } from './interpolate/piecewise.js'; - -export { - interpolatorSplineBasis, - interpolatorSplineBasisClosed -} from './interpolate/splineBasis.js'; - -export { - interpolatorSplineNatural, - interpolatorSplineNaturalClosed -} from './interpolate/splineNatural.js'; - -export { - interpolatorSplineMonotone, - interpolatorSplineMonotone2, - interpolatorSplineMonotoneClosed -} from './interpolate/splineMonotone.js'; - -export { default as lerp } from './interpolate/lerp.js'; -export { default as samples } from './samples.js'; -export { default as displayable } from './displayable.js'; -export { clampRgb, clampChroma } from './clamp.js'; -export { default as nearest } from './nearest.js'; -export { getModeDefinition } from './modes.js'; -export { default as parse } from './parse.js'; - -export { - differenceEuclidean, - differenceCie76, - differenceCie94, - differenceCiede2000, - differenceCmc, - differenceHyab, - differenceDin99o, - differenceKotsarenkoRamos, - differenceHueSaturation, - differenceHueChroma, - differenceHueNaive -} from './difference.js'; -export { default as colorsNamed } from './colors/named.js'; -export { default as blend } from './blend.js'; -export { default as random } from './random.js'; - -// Easings -export { default as easingMidpoint } from './easing/midpoint.js'; -export { default as easingSmoothstep } from './easing/smoothstep.js'; -export { default as easingSmootherstep } from './easing/smootherstep.js'; -export { default as easingInOutSine } from './easing/inOutSine.js'; -export { default as easingGamma } from './easing/gamma.js'; - -export { - luminance as wcagLuminance, - contrast as wcagContrast -} from './wcag.js'; - -export { - filterDeficiencyProt, - filterDeficiencyDeuter, - filterDeficiencyTrit -} from './deficiency.js'; - -export { - fixupHueShorter, - fixupHueLonger, - fixupHueIncreasing, - fixupHueDecreasing -} from './fixup/hue.js'; - -export { fixupAlpha } from './fixup/alpha.js'; - -export { - mapper, - mapAlphaMultiply, - mapAlphaDivide, - mapTransferLinear, - mapTransferGamma -} from './map.js'; - -export { - filterBrightness, - filterContrast, - filterSepia, - filterInvert, - filterSaturate, - filterGrayscale, - filterHueRotate -} from './filter.js'; - -export { average, averageAngle, averageNumber } from './average.js'; +export * from './packs/core.js'; +export * from './packs/fns.js'; +export * from './packs/extra-spaces.js'; diff --git a/src/packs/core.js b/src/packs/core.js new file mode 100644 index 00000000..facd019c --- /dev/null +++ b/src/packs/core.js @@ -0,0 +1,82 @@ +import rgbDef from '../rgb/definition.js'; +import lrgbDef from '../lrgb/definition.js'; +import a98Def from '../a98/definition.js'; +import p3Def from '../p3/definition.js'; +import prophotoDef from '../prophoto/definition.js'; +import rec2020Def from '../rec2020/definition.js'; +import hslDef from '../hsl/definition.js'; +import hsvDef from '../hsv/definition.js'; +import hwbDef from '../hwb/definition.js'; + +import labDef from '../lab/definition.js'; +import lchDef from '../lch/definition.js'; +import xyzDef from '../xyz/definition.js'; + +import lab65Def from '../lab65/definition.js'; +import lch65Def from '../lch65/definition.js'; +import xyz65Def from '../xyz65/definition.js'; + +import { defineMode } from '../modes.js'; +import converter from '../converter.js'; + +defineMode(a98Def); +defineMode(hslDef); +defineMode(hsvDef); +defineMode(hwbDef); +defineMode(labDef); +defineMode(lchDef); +defineMode(lrgbDef); +defineMode(p3Def); +defineMode(prophotoDef); +defineMode(rec2020Def); +defineMode(rgbDef); +defineMode(xyzDef); + +defineMode(lab65Def); +defineMode(lch65Def); +defineMode(xyz65Def); + +let lab65 = converter('lab65'); +let lch65 = converter('lch65'); +let xyz65 = converter('xyz65'); + +let a98 = converter('a98'); +let hsl = converter('hsl'); +let hsv = converter('hsv'); +let hwb = converter('hwb'); +let lab = converter('lab'); +let lch = converter('lch'); +let lrgb = converter('lrgb'); +let p3 = converter('p3'); +let prophoto = converter('prophoto'); +let rec2020 = converter('rec2020'); +let rgb = converter('rgb'); +let xyz = converter('xyz'); + +export { + a98, + converter, + defineMode, + hsl, + hsv, + hwb, + lab, + lch, + lrgb, + p3, + prophoto, + rec2020, + rgb, + xyz, + lab65, + lch65, + xyz65 +}; + +export { + formatHex, + formatHex8, + formatRgb, + formatHsl, + formatCss +} from '../formatter.js'; diff --git a/src/packs/extra-spaces.js b/src/packs/extra-spaces.js new file mode 100644 index 00000000..43a879ee --- /dev/null +++ b/src/packs/extra-spaces.js @@ -0,0 +1,55 @@ +import jabDef from '../jab/definition.js'; +import jchDef from '../jch/definition.js'; +import luvDef from '../luv/definition.js'; +import lchuvDef from '../lchuv/definition.js'; +import cubehelixDef from '../cubehelix/definition.js'; +import dlabDef from '../dlab/definition.js'; +import dlchDef from '../dlch/definition.js'; +import yiqDef from '../yiq/definition.js'; +import oklabDef from '../oklab/definition.js'; +import oklchDef from '../oklch/definition.js'; +import hsiDef from '../hsi/definition.js'; + +import { defineMode } from '../modes.js'; +import converter from '../converter.js'; +import { differenceEuclidean } from '../difference.js'; + +defineMode(jabDef); +defineMode(jchDef); +defineMode(cubehelixDef); +defineMode(dlabDef); +defineMode(dlchDef); +defineMode(hsiDef); +defineMode(luvDef); +defineMode(lchuvDef); +defineMode(yiqDef); +defineMode(oklabDef); +defineMode(oklchDef); + +let jab = converter('jab'); +let jch = converter('jch'); +let cubehelix = converter('cubehelix'); +let dlab = converter('dlab'); +let dlch = converter('dlch'); +let hsi = converter('hsi'); +let yiq = converter('yiq'); +let luv = converter('luv'); +let lchuv = converter('lchuv'); +let oklab = converter('oklab'); +let oklch = converter('oklch'); + +export { jab, jch, cubehelix, dlab, dlch, hsi, lchuv, luv, yiq, oklab, oklch }; + +/* + "Measuring perceived color difference using YIQ NTSC + transmission color space in mobile applications" + + by Yuriy Kotsarenko, Fernando Ramos in: + Programación Matemática y Software (2010) + + Available at: + + http://www.progmat.uaem.mx:8080/artVol2Num2/Articulo3Vol2Num2.pdf + */ +export const differenceKotsarenkoRamos = () => + differenceEuclidean('yiq', [0.5053, 0.299, 0.1957]); diff --git a/src/packs/fns.js b/src/packs/fns.js new file mode 100644 index 00000000..b34416ce --- /dev/null +++ b/src/packs/fns.js @@ -0,0 +1,97 @@ +export { default as colorsNamed } from '../colors/named.js'; +export { default as blend } from '../blend.js'; +export { default as random } from '../random.js'; + +export { + fixupHueShorter, + fixupHueLonger, + fixupHueIncreasing, + fixupHueDecreasing +} from '../fixup/hue.js'; + +export { fixupAlpha } from '../fixup/alpha.js'; + +export { + mapper, + mapAlphaMultiply, + mapAlphaDivide, + mapTransferLinear, + mapTransferGamma +} from '../map.js'; + +export { average, averageAngle, averageNumber } from '../average.js'; + +export { default as round } from '../round.js'; +export { + interpolate, + interpolateWith, + interpolateWithPremultipliedAlpha +} from '../interpolate/interpolate.js'; + +export { interpolatorLinear } from '../interpolate/linear.js'; + +export { interpolatorPiecewise } from '../interpolate/piecewise.js'; + +export { + interpolatorSplineBasis, + interpolatorSplineBasisClosed +} from '../interpolate/splineBasis.js'; + +export { + interpolatorSplineNatural, + interpolatorSplineNaturalClosed +} from '../interpolate/splineNatural.js'; + +export { + interpolatorSplineMonotone, + interpolatorSplineMonotone2, + interpolatorSplineMonotoneClosed +} from '../interpolate/splineMonotone.js'; + +export { default as lerp } from '../interpolate/lerp.js'; +export { default as samples } from '../samples.js'; +export { default as displayable } from '../displayable.js'; +export { clampRgb, clampChroma } from '../clamp.js'; +export { default as nearest } from '../nearest.js'; +export { getModeDefinition } from '../modes.js'; +export { default as parse } from '../parse.js'; + +export { + differenceEuclidean, + differenceCie76, + differenceCie94, + differenceCiede2000, + differenceCmc, + differenceHyab, + differenceHueSaturation, + differenceHueChroma, + differenceHueNaive +} from '../difference.js'; + +export { + filterBrightness, + filterContrast, + filterSepia, + filterInvert, + filterSaturate, + filterGrayscale, + filterHueRotate +} from '../filter.js'; + +export { + filterDeficiencyProt, + filterDeficiencyDeuter, + filterDeficiencyTrit +} from '../deficiency.js'; + +// Easings +export { default as easingMidpoint } from '../easing/midpoint.js'; +export { default as easingSmoothstep } from '../easing/smoothstep.js'; +export { default as easingSmootherstep } from '../easing/smootherstep.js'; +export { default as easingInOutSine } from '../easing/inOutSine.js'; +export { default as easingGamma } from '../easing/gamma.js'; + +export { + luminance as wcagLuminance, + contrast as wcagContrast +} from '../wcag.js'; From 75fa5bde0ce4b008be65c86951db4951fb45f13d Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Sat, 18 Sep 2021 19:05:50 +0300 Subject: [PATCH 12/40] 1.0.0-alpha.4 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 15c26abb..f6af4028 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "culori", - "version": "1.0.0-alpha.3", + "version": "1.0.0-alpha.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "culori", - "version": "1.0.0-alpha.3", + "version": "1.0.0-alpha.4", "license": "MIT", "devDependencies": { "@11ty/eleventy": "^0.12.1", diff --git a/package.json b/package.json index d66eb80b..5e3f68f1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "culori", - "version": "1.0.0-alpha.3", + "version": "1.0.0-alpha.4", "type": "module", "main": "bundled/culori.cjs", "module": "bundled/culori-min.mjs", From f9381fd5bc2044f46a4c2f295efc8d3113ba6129 Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Sat, 18 Sep 2021 19:12:41 +0300 Subject: [PATCH 13/40] Retry exports --- package.json | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 5e3f68f1..45e9189f 100644 --- a/package.json +++ b/package.json @@ -6,11 +6,9 @@ "module": "bundled/culori-min.mjs", "browser": "bundled/culori-min.js", "exports": { - "require": "./bundled/culori.cjs", - "core": "./src/entry-points/core.js", - "fns": "./src/entry-points/fns.js", - "extra-spaces": "./src/entry-points/extra-spaces.js", - "default": "./src/index.js" + "core": "./src/packs/core.js", + "fns": "./src/packs/fns.js", + "extra-spaces": "./src/packs/extra-spaces.js" }, "repository": "git@github.com:Evercoder/culori.git", "author": "Dan Burzo ", From 4fe058c3dcc9a3977665238305d9e9cc9c82a108 Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Sat, 18 Sep 2021 19:12:58 +0300 Subject: [PATCH 14/40] 1.0.0-alpha.5 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index f6af4028..a9fe6a09 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "culori", - "version": "1.0.0-alpha.4", + "version": "1.0.0-alpha.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "culori", - "version": "1.0.0-alpha.4", + "version": "1.0.0-alpha.5", "license": "MIT", "devDependencies": { "@11ty/eleventy": "^0.12.1", diff --git a/package.json b/package.json index 45e9189f..1a2584a5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "culori", - "version": "1.0.0-alpha.4", + "version": "1.0.0-alpha.5", "type": "module", "main": "bundled/culori.cjs", "module": "bundled/culori-min.mjs", From 79f69cbb00135ad1fd128bb5bd24c5b66499a656 Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Sat, 18 Sep 2021 19:35:03 +0300 Subject: [PATCH 15/40] attempt 'require' export --- package.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 1a2584a5..02dfa653 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,10 @@ "module": "bundled/culori-min.mjs", "browser": "bundled/culori-min.js", "exports": { - "core": "./src/packs/core.js", - "fns": "./src/packs/fns.js", - "extra-spaces": "./src/packs/extra-spaces.js" + "./require": "./bundled/culori.cjs", + "./core": "./src/packs/core.js", + "./fns": "./src/packs/fns.js", + "./extra-spaces": "./src/packs/extra-spaces.js" }, "repository": "git@github.com:Evercoder/culori.git", "author": "Dan Burzo ", From 0a04d8087fb774fa1844890e5b10e291cbf74e7a Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Sat, 18 Sep 2021 19:35:37 +0300 Subject: [PATCH 16/40] 1.0.0-alpha.6 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index a9fe6a09..1aebd99d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "culori", - "version": "1.0.0-alpha.5", + "version": "1.0.0-alpha.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "culori", - "version": "1.0.0-alpha.5", + "version": "1.0.0-alpha.6", "license": "MIT", "devDependencies": { "@11ty/eleventy": "^0.12.1", diff --git a/package.json b/package.json index 02dfa653..378dc7d6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "culori", - "version": "1.0.0-alpha.5", + "version": "1.0.0-alpha.6", "type": "module", "main": "bundled/culori.cjs", "module": "bundled/culori-min.mjs", From f217ccc005e42a67ff6a868e98dcdbb693b8be98 Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Sat, 18 Sep 2021 19:38:38 +0300 Subject: [PATCH 17/40] Add main export --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 378dc7d6..0e483d1d 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "browser": "bundled/culori-min.js", "exports": { "./require": "./bundled/culori.cjs", + ".": "./src/index.js", "./core": "./src/packs/core.js", "./fns": "./src/packs/fns.js", "./extra-spaces": "./src/packs/extra-spaces.js" From a153a5820047e2cf55662dc936cf68b72acad334 Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Sat, 18 Sep 2021 19:38:47 +0300 Subject: [PATCH 18/40] 1.0.0-alpha.7 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1aebd99d..921b1509 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "culori", - "version": "1.0.0-alpha.6", + "version": "1.0.0-alpha.7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "culori", - "version": "1.0.0-alpha.6", + "version": "1.0.0-alpha.7", "license": "MIT", "devDependencies": { "@11ty/eleventy": "^0.12.1", diff --git a/package.json b/package.json index 0e483d1d..57254646 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "culori", - "version": "1.0.0-alpha.6", + "version": "1.0.0-alpha.7", "type": "module", "main": "bundled/culori.cjs", "module": "bundled/culori-min.mjs", From 74dec2639fc59ab20806054e47dbf176a0bfd2a0 Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Sat, 18 Sep 2021 20:43:15 +0300 Subject: [PATCH 19/40] Remove 'fns' entry for exports --- package.json | 1 - src/index.js | 1 - src/packs/core.js | 98 +++++++++++++++++++++++++++++++++++++++++++++++ src/packs/fns.js | 97 ---------------------------------------------- 4 files changed, 98 insertions(+), 99 deletions(-) delete mode 100644 src/packs/fns.js diff --git a/package.json b/package.json index 57254646..2dd76e5c 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,6 @@ "./require": "./bundled/culori.cjs", ".": "./src/index.js", "./core": "./src/packs/core.js", - "./fns": "./src/packs/fns.js", "./extra-spaces": "./src/packs/extra-spaces.js" }, "repository": "git@github.com:Evercoder/culori.git", diff --git a/src/index.js b/src/index.js index f58ffbae..e4c6f43e 100644 --- a/src/index.js +++ b/src/index.js @@ -1,3 +1,2 @@ export * from './packs/core.js'; -export * from './packs/fns.js'; export * from './packs/extra-spaces.js'; diff --git a/src/packs/core.js b/src/packs/core.js index facd019c..e3c24dea 100644 --- a/src/packs/core.js +++ b/src/packs/core.js @@ -80,3 +80,101 @@ export { formatHsl, formatCss } from '../formatter.js'; + +export { default as colorsNamed } from '../colors/named.js'; +export { default as blend } from '../blend.js'; +export { default as random } from '../random.js'; + +export { + fixupHueShorter, + fixupHueLonger, + fixupHueIncreasing, + fixupHueDecreasing +} from '../fixup/hue.js'; + +export { fixupAlpha } from '../fixup/alpha.js'; + +export { + mapper, + mapAlphaMultiply, + mapAlphaDivide, + mapTransferLinear, + mapTransferGamma +} from '../map.js'; + +export { average, averageAngle, averageNumber } from '../average.js'; + +export { default as round } from '../round.js'; +export { + interpolate, + interpolateWith, + interpolateWithPremultipliedAlpha +} from '../interpolate/interpolate.js'; + +export { interpolatorLinear } from '../interpolate/linear.js'; + +export { interpolatorPiecewise } from '../interpolate/piecewise.js'; + +export { + interpolatorSplineBasis, + interpolatorSplineBasisClosed +} from '../interpolate/splineBasis.js'; + +export { + interpolatorSplineNatural, + interpolatorSplineNaturalClosed +} from '../interpolate/splineNatural.js'; + +export { + interpolatorSplineMonotone, + interpolatorSplineMonotone2, + interpolatorSplineMonotoneClosed +} from '../interpolate/splineMonotone.js'; + +export { default as lerp } from '../interpolate/lerp.js'; +export { default as samples } from '../samples.js'; +export { default as displayable } from '../displayable.js'; +export { clampRgb, clampChroma } from '../clamp.js'; +export { default as nearest } from '../nearest.js'; +export { getModeDefinition } from '../modes.js'; +export { default as parse } from '../parse.js'; + +export { + differenceEuclidean, + differenceCie76, + differenceCie94, + differenceCiede2000, + differenceCmc, + differenceHyab, + differenceHueSaturation, + differenceHueChroma, + differenceHueNaive +} from '../difference.js'; + +export { + filterBrightness, + filterContrast, + filterSepia, + filterInvert, + filterSaturate, + filterGrayscale, + filterHueRotate +} from '../filter.js'; + +export { + filterDeficiencyProt, + filterDeficiencyDeuter, + filterDeficiencyTrit +} from '../deficiency.js'; + +// Easings +export { default as easingMidpoint } from '../easing/midpoint.js'; +export { default as easingSmoothstep } from '../easing/smoothstep.js'; +export { default as easingSmootherstep } from '../easing/smootherstep.js'; +export { default as easingInOutSine } from '../easing/inOutSine.js'; +export { default as easingGamma } from '../easing/gamma.js'; + +export { + luminance as wcagLuminance, + contrast as wcagContrast +} from '../wcag.js'; diff --git a/src/packs/fns.js b/src/packs/fns.js deleted file mode 100644 index b34416ce..00000000 --- a/src/packs/fns.js +++ /dev/null @@ -1,97 +0,0 @@ -export { default as colorsNamed } from '../colors/named.js'; -export { default as blend } from '../blend.js'; -export { default as random } from '../random.js'; - -export { - fixupHueShorter, - fixupHueLonger, - fixupHueIncreasing, - fixupHueDecreasing -} from '../fixup/hue.js'; - -export { fixupAlpha } from '../fixup/alpha.js'; - -export { - mapper, - mapAlphaMultiply, - mapAlphaDivide, - mapTransferLinear, - mapTransferGamma -} from '../map.js'; - -export { average, averageAngle, averageNumber } from '../average.js'; - -export { default as round } from '../round.js'; -export { - interpolate, - interpolateWith, - interpolateWithPremultipliedAlpha -} from '../interpolate/interpolate.js'; - -export { interpolatorLinear } from '../interpolate/linear.js'; - -export { interpolatorPiecewise } from '../interpolate/piecewise.js'; - -export { - interpolatorSplineBasis, - interpolatorSplineBasisClosed -} from '../interpolate/splineBasis.js'; - -export { - interpolatorSplineNatural, - interpolatorSplineNaturalClosed -} from '../interpolate/splineNatural.js'; - -export { - interpolatorSplineMonotone, - interpolatorSplineMonotone2, - interpolatorSplineMonotoneClosed -} from '../interpolate/splineMonotone.js'; - -export { default as lerp } from '../interpolate/lerp.js'; -export { default as samples } from '../samples.js'; -export { default as displayable } from '../displayable.js'; -export { clampRgb, clampChroma } from '../clamp.js'; -export { default as nearest } from '../nearest.js'; -export { getModeDefinition } from '../modes.js'; -export { default as parse } from '../parse.js'; - -export { - differenceEuclidean, - differenceCie76, - differenceCie94, - differenceCiede2000, - differenceCmc, - differenceHyab, - differenceHueSaturation, - differenceHueChroma, - differenceHueNaive -} from '../difference.js'; - -export { - filterBrightness, - filterContrast, - filterSepia, - filterInvert, - filterSaturate, - filterGrayscale, - filterHueRotate -} from '../filter.js'; - -export { - filterDeficiencyProt, - filterDeficiencyDeuter, - filterDeficiencyTrit -} from '../deficiency.js'; - -// Easings -export { default as easingMidpoint } from '../easing/midpoint.js'; -export { default as easingSmoothstep } from '../easing/smoothstep.js'; -export { default as easingSmootherstep } from '../easing/smootherstep.js'; -export { default as easingInOutSine } from '../easing/inOutSine.js'; -export { default as easingGamma } from '../easing/gamma.js'; - -export { - luminance as wcagLuminance, - contrast as wcagContrast -} from '../wcag.js'; From f789d2a6bbbfd46e9cdca1c1fb3e9969418114c1 Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Sat, 18 Sep 2021 20:43:22 +0300 Subject: [PATCH 20/40] 1.0.0-alpha.8 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 921b1509..d1eed91b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "culori", - "version": "1.0.0-alpha.7", + "version": "1.0.0-alpha.8", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "culori", - "version": "1.0.0-alpha.7", + "version": "1.0.0-alpha.8", "license": "MIT", "devDependencies": { "@11ty/eleventy": "^0.12.1", diff --git a/package.json b/package.json index 2dd76e5c..907ccbff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "culori", - "version": "1.0.0-alpha.7", + "version": "1.0.0-alpha.8", "type": "module", "main": "bundled/culori.cjs", "module": "bundled/culori-min.mjs", From f05b0504369a408a77912a9e586a0835397328c9 Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Mon, 20 Sep 2021 20:31:23 +0300 Subject: [PATCH 21/40] switch to .cjs for 11ty config --- .eleventy.js => eleventy.config.cjs | 0 package.json | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename .eleventy.js => eleventy.config.cjs (100%) diff --git a/.eleventy.js b/eleventy.config.cjs similarity index 100% rename from .eleventy.js rename to eleventy.config.cjs diff --git a/package.json b/package.json index 907ccbff..4c7611a3 100644 --- a/package.json +++ b/package.json @@ -58,8 +58,8 @@ "build": "node build.js", "benchmark": "node benchmark/index.js", "prepublishOnly": "npm run lint && npm run build && npm run test", - "docs:start": "eleventy --serve", - "docs:build": "rm -rf www && eleventy", + "docs:start": "eleventy --config=eleventy.config.cjs --serve", + "docs:build": "rm -rf www && eleventy --config=eleventy.config.cjs", "docs:deploy": "npm run docs:build && gh-pages -d www --dotfiles", "lint": "eslint '{src,test}/**/*.js'" }, From 3cf81ece80541b105390562ef71c0ee059692458 Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Fri, 24 Sep 2021 21:19:12 +0200 Subject: [PATCH 22/40] Use husky 7.x --- .husky/pre-commit | 2 + package-lock.json | 278 ++-------------------------------------------- package.json | 12 +- 3 files changed, 17 insertions(+), 275 deletions(-) create mode 100755 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 00000000..e29abb23 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,2 @@ +#!/bin/sh +npx pretty-quick --staged diff --git a/package-lock.json b/package-lock.json index d1eed91b..1600db1e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "eslint": "^7.32.0", "eslint-plugin-import": "^2.24.2", "gh-pages": "^3.2.3", - "husky": "^4.2.5", + "husky": "^7.0.0", "prettier": "^2.4.1", "pretty-quick": "^3.1.1", "tap-spec": "^5.0.0", @@ -290,12 +290,6 @@ "integrity": "sha512-1z8k4wzFnNjVK/tlxvrWuK5WMt6mydWWP7+zvH5eFep4oj+UkrfiJTRtjCeBXNpwaA/FYqqtb4/QS4ianFpIRA==", "dev": true }, - "node_modules/@types/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", - "dev": true - }, "node_modules/@ungap/event-target": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/@ungap/event-target/-/event-target-0.2.3.tgz", @@ -887,12 +881,6 @@ "fsevents": "~2.3.1" } }, - "node_modules/ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "dev": true - }, "node_modules/cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -952,12 +940,6 @@ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, - "node_modules/compare-versions": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", - "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", - "dev": true - }, "node_modules/component-bind": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", @@ -1076,22 +1058,6 @@ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "dev": true }, - "node_modules/cosmiconfig": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz", - "integrity": "sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==", - "dev": true, - "dependencies": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.2.1", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.10.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -2267,18 +2233,6 @@ "node": ">=4" } }, - "node_modules/find-versions": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-3.2.0.tgz", - "integrity": "sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww==", - "dev": true, - "dependencies": { - "semver-regex": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/flat-cache": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", @@ -2842,42 +2796,18 @@ } }, "node_modules/husky": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/husky/-/husky-4.3.6.tgz", - "integrity": "sha512-o6UjVI8xtlWRL5395iWq9LKDyp/9TE7XMOTvIpEVzW638UcGxTmV5cfel6fsk/jbZSTlvfGVJf2svFtybcIZag==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/husky/-/husky-7.0.2.tgz", + "integrity": "sha512-8yKEWNX4z2YsofXAMT7KvA1g8p+GxtB1ffV8XtpAEGuXNAbCV5wdNKH+qTpw8SM9fh4aMPDR+yQuKfgnreyZlg==", "dev": true, - "hasInstallScript": true, - "dependencies": { - "chalk": "^4.0.0", - "ci-info": "^2.0.0", - "compare-versions": "^3.6.0", - "cosmiconfig": "^7.0.0", - "find-versions": "^3.2.0", - "opencollective-postinstall": "^2.0.2", - "pkg-dir": "^4.2.0", - "please-upgrade-node": "^3.2.0", - "slash": "^3.0.0", - "which-pm-runs": "^1.0.0" - }, "bin": { - "husky-run": "bin/run.js", - "husky-upgrade": "lib/upgrader/bin.js" + "husky": "lib/bin.js" }, "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/husky" - } - }, - "node_modules/husky/node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" + "url": "https://github.com/sponsors/typicode" } }, "node_modules/iconv-lite": { @@ -3445,12 +3375,6 @@ "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true }, - "node_modules/json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true - }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -3519,12 +3443,6 @@ "integrity": "sha512-FWWMIEOxz3GwUI4Ts/IvgVy6LPvoMPgjMdQ185nN6psJyBJ4yOpzqm695/h5umdLJg2vW3GR5iG11MAkR2AzJA==", "dev": true }, - "node_modules/lines-and-columns": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", - "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", - "dev": true - }, "node_modules/linkedom": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/linkedom/-/linkedom-0.11.1.tgz", @@ -4248,15 +4166,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/opencollective-postinstall": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz", - "integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==", - "dev": true, - "bin": { - "opencollective-postinstall": "index.js" - } - }, "node_modules/openurl": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/openurl/-/openurl-1.1.1.tgz", @@ -4375,24 +4284,6 @@ "node": ">=0.8" } }, - "node_modules/parse-json": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz", - "integrity": "sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/parse-ms": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-0.1.2.tgz", @@ -4483,15 +4374,6 @@ "node": ">=0.10.0" } }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/picomatch": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", @@ -5412,15 +5294,6 @@ "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", "dev": true }, - "node_modules/semver-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-2.0.0.tgz", - "integrity": "sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/semver/node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -6663,12 +6536,6 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, - "node_modules/which-pm-runs": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", - "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", - "dev": true - }, "node_modules/which-typed-array": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.4.tgz", @@ -6848,15 +6715,6 @@ "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", "dev": true }, - "node_modules/yaml": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz", - "integrity": "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==", - "dev": true, - "engines": { - "node": ">= 6" - } - }, "node_modules/yargs": { "version": "15.4.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", @@ -7250,12 +7108,6 @@ "integrity": "sha512-1z8k4wzFnNjVK/tlxvrWuK5WMt6mydWWP7+zvH5eFep4oj+UkrfiJTRtjCeBXNpwaA/FYqqtb4/QS4ianFpIRA==", "dev": true }, - "@types/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", - "dev": true - }, "@ungap/event-target": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/@ungap/event-target/-/event-target-0.2.3.tgz", @@ -7729,12 +7581,6 @@ "readdirp": "~3.5.0" } }, - "ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "dev": true - }, "cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -7790,12 +7636,6 @@ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, - "compare-versions": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", - "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", - "dev": true - }, "component-bind": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", @@ -7903,19 +7743,6 @@ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "dev": true }, - "cosmiconfig": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz", - "integrity": "sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==", - "dev": true, - "requires": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.2.1", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.10.0" - } - }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -8869,15 +8696,6 @@ "locate-path": "^2.0.0" } }, - "find-versions": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-3.2.0.tgz", - "integrity": "sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww==", - "dev": true, - "requires": { - "semver-regex": "^2.0.0" - } - }, "flat-cache": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", @@ -9299,30 +9117,10 @@ "dev": true }, "husky": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/husky/-/husky-4.3.6.tgz", - "integrity": "sha512-o6UjVI8xtlWRL5395iWq9LKDyp/9TE7XMOTvIpEVzW638UcGxTmV5cfel6fsk/jbZSTlvfGVJf2svFtybcIZag==", - "dev": true, - "requires": { - "chalk": "^4.0.0", - "ci-info": "^2.0.0", - "compare-versions": "^3.6.0", - "cosmiconfig": "^7.0.0", - "find-versions": "^3.2.0", - "opencollective-postinstall": "^2.0.2", - "pkg-dir": "^4.2.0", - "please-upgrade-node": "^3.2.0", - "slash": "^3.0.0", - "which-pm-runs": "^1.0.0" - }, - "dependencies": { - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - } - } + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/husky/-/husky-7.0.2.tgz", + "integrity": "sha512-8yKEWNX4z2YsofXAMT7KvA1g8p+GxtB1ffV8XtpAEGuXNAbCV5wdNKH+qTpw8SM9fh4aMPDR+yQuKfgnreyZlg==", + "dev": true }, "iconv-lite": { "version": "0.4.24", @@ -9728,12 +9526,6 @@ "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true }, - "json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true - }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -9793,12 +9585,6 @@ "integrity": "sha512-FWWMIEOxz3GwUI4Ts/IvgVy6LPvoMPgjMdQ185nN6psJyBJ4yOpzqm695/h5umdLJg2vW3GR5iG11MAkR2AzJA==", "dev": true }, - "lines-and-columns": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", - "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", - "dev": true - }, "linkedom": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/linkedom/-/linkedom-0.11.1.tgz", @@ -10355,12 +10141,6 @@ "mimic-fn": "^2.1.0" } }, - "opencollective-postinstall": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz", - "integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==", - "dev": true - }, "openurl": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/openurl/-/openurl-1.1.1.tgz", @@ -10451,18 +10231,6 @@ "path-root": "^0.1.1" } }, - "parse-json": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz", - "integrity": "sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - } - }, "parse-ms": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-0.1.2.tgz", @@ -10532,12 +10300,6 @@ "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=", "dev": true }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - }, "picomatch": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", @@ -11280,12 +11042,6 @@ "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", "dev": true }, - "semver-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-2.0.0.tgz", - "integrity": "sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw==", - "dev": true - }, "send": { "version": "0.16.2", "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", @@ -12306,12 +12062,6 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, - "which-pm-runs": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", - "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", - "dev": true - }, "which-typed-array": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.4.tgz", @@ -12440,12 +12190,6 @@ "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", "dev": true }, - "yaml": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz", - "integrity": "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==", - "dev": true - }, "yargs": { "version": "15.4.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", diff --git a/package.json b/package.json index 4c7611a3..d14ef258 100644 --- a/package.json +++ b/package.json @@ -43,11 +43,11 @@ "devDependencies": { "@11ty/eleventy": "^0.12.1", "@11ty/eleventy-plugin-syntaxhighlight": "^3.1.2", - "esbuild": "^0.12.28", + "esbuild": "^0.13.2", "eslint": "^7.32.0", "eslint-plugin-import": "^2.24.2", "gh-pages": "^3.2.3", - "husky": "^4.2.5", + "husky": "^7.0.2", "prettier": "^2.4.1", "pretty-quick": "^3.1.1", "tap-spec": "^5.0.0", @@ -61,12 +61,8 @@ "docs:start": "eleventy --config=eleventy.config.cjs --serve", "docs:build": "rm -rf www && eleventy --config=eleventy.config.cjs", "docs:deploy": "npm run docs:build && gh-pages -d www --dotfiles", - "lint": "eslint '{src,test}/**/*.js'" - }, - "husky": { - "hooks": { - "pre-commit": "pretty-quick --staged" - } + "lint": "eslint '{src,test}/**/*.js'", + "prepare": "husky install" }, "prettier": { "bracketSpacing": true, From 1baa8697bdb17c6a1ebcb17698eb073c4600d7ef Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Fri, 24 Sep 2021 21:23:11 +0200 Subject: [PATCH 23/40] ...actually just use the 'prepare' script instead of husky 7.x --- {.husky => .hooks}/pre-commit | 0 package-lock.json | 396 +++++++++++++++++++++++++++++++--- package.json | 3 +- 3 files changed, 366 insertions(+), 33 deletions(-) rename {.husky => .hooks}/pre-commit (100%) diff --git a/.husky/pre-commit b/.hooks/pre-commit similarity index 100% rename from .husky/pre-commit rename to .hooks/pre-commit diff --git a/package-lock.json b/package-lock.json index 1600db1e..6afbef50 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,11 +11,10 @@ "devDependencies": { "@11ty/eleventy": "^0.12.1", "@11ty/eleventy-plugin-syntaxhighlight": "^3.1.2", - "esbuild": "^0.12.28", + "esbuild": "^0.13.2", "eslint": "^7.32.0", "eslint-plugin-import": "^2.24.2", "gh-pages": "^3.2.3", - "husky": "^7.0.0", "prettier": "^2.4.1", "pretty-quick": "^3.1.1", "tap-spec": "^5.0.0", @@ -1640,14 +1639,240 @@ } }, "node_modules/esbuild": { - "version": "0.12.28", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.12.28.tgz", - "integrity": "sha512-pZ0FrWZXlvQOATlp14lRSk1N9GkeJ3vLIwOcUoo3ICQn9WNR4rWoNi81pbn6sC1iYUy7QPqNzI3+AEzokwyVcA==", + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.13.2.tgz", + "integrity": "sha512-/tpIqo45hyRREGqh7hsIut8GwY1X2n9IhKbIwRIXUO6IohzG3/RarSGX7dT2eNvYzIbQmelpX+ZyuIphE5u+Bw==", "dev": true, "hasInstallScript": true, "bin": { "esbuild": "bin/esbuild" - } + }, + "optionalDependencies": { + "esbuild-android-arm64": "0.13.2", + "esbuild-darwin-64": "0.13.2", + "esbuild-darwin-arm64": "0.13.2", + "esbuild-freebsd-64": "0.13.2", + "esbuild-freebsd-arm64": "0.13.2", + "esbuild-linux-32": "0.13.2", + "esbuild-linux-64": "0.13.2", + "esbuild-linux-arm": "0.13.2", + "esbuild-linux-arm64": "0.13.2", + "esbuild-linux-mips64le": "0.13.2", + "esbuild-linux-ppc64le": "0.13.2", + "esbuild-openbsd-64": "0.13.2", + "esbuild-sunos-64": "0.13.2", + "esbuild-windows-32": "0.13.2", + "esbuild-windows-64": "0.13.2", + "esbuild-windows-arm64": "0.13.2" + } + }, + "node_modules/esbuild-android-arm64": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.13.2.tgz", + "integrity": "sha512-Eh2paXUWYqf5JgikdkC0LnhtjSC8tGAz/L2kJRlMC0o3DzOBIxcmT2fdzBerdhW4roY0bOExfcO6deI1qsxI/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/esbuild-darwin-64": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.13.2.tgz", + "integrity": "sha512-jqp6uXHIIAWZ8kxRqFjxyMmIE1cuSbINellwwigOgk44eLg74ls82oqjY72MbDAowPivQkOU/fF7tsyaGQf5Zg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/esbuild-darwin-arm64": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.13.2.tgz", + "integrity": "sha512-bD4oAyPZdzOWEA/JoX0sAitOhjJRwhomhWMeyRyowtlVQhQleG2ijRUKTvkq4CAvSobrW5EnZxjvHNKJ5L7zJg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/esbuild-freebsd-64": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.13.2.tgz", + "integrity": "sha512-fFJ0yc3lZyfwca+F5OPN/s+izozWryUQpN8aUMIdUkOa7UKX0h3xXrKnkDgdOo8vy3d1A6zHH0/4f2VJfEzLCg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/esbuild-freebsd-arm64": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.13.2.tgz", + "integrity": "sha512-DWBZauEfjmqdfWxIacI+KBEim3ulOjtvK+WVm1bX67XlfyUVIkD915OIfT2EBhQUWmv+Z0tZZwskSMNj5DKojw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/esbuild-linux-32": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.13.2.tgz", + "integrity": "sha512-Gt2rNqqRCRh1QQC2d83KP0iWIXWQYpns7l2+41a1n0PQxXkQ5AarpjjL9mUzdXtcZauNXbUvWwBKAuBTCW+XQg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/esbuild-linux-64": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.13.2.tgz", + "integrity": "sha512-yT0D5Xly8oGHuqq975k1XUyULHzk3fN/ZlTY+awlU+nCFsYPZ43NE5msGpxlNQu8i6KOXQEke5GXN3y5d+Zd4g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/esbuild-linux-arm": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.13.2.tgz", + "integrity": "sha512-KXeyotqj9jbvCjbSpwnxDE8E8jKoBgrgbJpOvvY5Zz7Pp2fAwu/94vWQtE/jPEJndY4C4MSs+ryJLFWzmLOa4w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/esbuild-linux-arm64": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.13.2.tgz", + "integrity": "sha512-qwXL+3NDCWiC8RMKBBETpuOWdC+pUAUS+pwg9jJmapYblLdVKkyRtwF/ogj06TdYs6riSSNikW8HK/Xs0HHbbQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/esbuild-linux-mips64le": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.13.2.tgz", + "integrity": "sha512-sx8eheRX2XC2ppNAsbQm8/VUcU8XPYGpJK0BEyRefqHONz6u5Ib2guUdOz2Wh4YlbA7oOd482lHjprXSTwUcrQ==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/esbuild-linux-ppc64le": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.13.2.tgz", + "integrity": "sha512-y8iZ3qy2TIAKKsZ6xSopCztHOtGW9oiYDl22vQ0UIoVWjnfRKrbSzX7Y2F94y32hSvRWle6OhAIC+UpS5nQmIA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/esbuild-openbsd-64": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.13.2.tgz", + "integrity": "sha512-g6AYrjBeV9OK624bw0KQ1TjHJQSW+X1Yicyd1NvDWqSFpMqKAjw7EUX4tA87mOFqv8BflPGr4f43ySgNvSVzIw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/esbuild-sunos-64": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.13.2.tgz", + "integrity": "sha512-hIXvFIyrqwFd6v62XSra0ctCUXDS9Tu5D6QYbvnbhEoBmvD/TmEJRYRH48/+xmRifKJLzu6aegcrjAsDmaww7g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ] + }, + "node_modules/esbuild-windows-32": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.13.2.tgz", + "integrity": "sha512-Y767LG0NFkw0sPoDVOTKC5gaj4vURjjWfSCCDV5awpXXxBKOF2zsIp3aia4KvVoivoSSeRPk3emDd0OPHuPrKg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/esbuild-windows-64": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.13.2.tgz", + "integrity": "sha512-01b59kVJUMasctn6lzswC0drchr7zO75QtF22o5w0nlOw0Zorw0loY/8i5choFuWc30gXJId9qBSc1zPvt7uEw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/esbuild-windows-arm64": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.13.2.tgz", + "integrity": "sha512-HxyY604ytmh8NkPYyS1TdIB/bFS7DWd1hP90e8Ovo/elEdN5I13h0tyIatDYZkXKS0Ztk+9T/3h6K0fI1a/4tQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] }, "node_modules/escalade": { "version": "3.1.1", @@ -2795,21 +3020,6 @@ "node": ">=8.12.0" } }, - "node_modules/husky": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/husky/-/husky-7.0.2.tgz", - "integrity": "sha512-8yKEWNX4z2YsofXAMT7KvA1g8p+GxtB1ffV8XtpAEGuXNAbCV5wdNKH+qTpw8SM9fh4aMPDR+yQuKfgnreyZlg==", - "dev": true, - "bin": { - "husky": "lib/bin.js" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/typicode" - } - }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -8222,10 +8432,140 @@ } }, "esbuild": { - "version": "0.12.28", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.12.28.tgz", - "integrity": "sha512-pZ0FrWZXlvQOATlp14lRSk1N9GkeJ3vLIwOcUoo3ICQn9WNR4rWoNi81pbn6sC1iYUy7QPqNzI3+AEzokwyVcA==", - "dev": true + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.13.2.tgz", + "integrity": "sha512-/tpIqo45hyRREGqh7hsIut8GwY1X2n9IhKbIwRIXUO6IohzG3/RarSGX7dT2eNvYzIbQmelpX+ZyuIphE5u+Bw==", + "dev": true, + "requires": { + "esbuild-android-arm64": "0.13.2", + "esbuild-darwin-64": "0.13.2", + "esbuild-darwin-arm64": "0.13.2", + "esbuild-freebsd-64": "0.13.2", + "esbuild-freebsd-arm64": "0.13.2", + "esbuild-linux-32": "0.13.2", + "esbuild-linux-64": "0.13.2", + "esbuild-linux-arm": "0.13.2", + "esbuild-linux-arm64": "0.13.2", + "esbuild-linux-mips64le": "0.13.2", + "esbuild-linux-ppc64le": "0.13.2", + "esbuild-openbsd-64": "0.13.2", + "esbuild-sunos-64": "0.13.2", + "esbuild-windows-32": "0.13.2", + "esbuild-windows-64": "0.13.2", + "esbuild-windows-arm64": "0.13.2" + } + }, + "esbuild-android-arm64": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.13.2.tgz", + "integrity": "sha512-Eh2paXUWYqf5JgikdkC0LnhtjSC8tGAz/L2kJRlMC0o3DzOBIxcmT2fdzBerdhW4roY0bOExfcO6deI1qsxI/A==", + "dev": true, + "optional": true + }, + "esbuild-darwin-64": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.13.2.tgz", + "integrity": "sha512-jqp6uXHIIAWZ8kxRqFjxyMmIE1cuSbINellwwigOgk44eLg74ls82oqjY72MbDAowPivQkOU/fF7tsyaGQf5Zg==", + "dev": true, + "optional": true + }, + "esbuild-darwin-arm64": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.13.2.tgz", + "integrity": "sha512-bD4oAyPZdzOWEA/JoX0sAitOhjJRwhomhWMeyRyowtlVQhQleG2ijRUKTvkq4CAvSobrW5EnZxjvHNKJ5L7zJg==", + "dev": true, + "optional": true + }, + "esbuild-freebsd-64": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.13.2.tgz", + "integrity": "sha512-fFJ0yc3lZyfwca+F5OPN/s+izozWryUQpN8aUMIdUkOa7UKX0h3xXrKnkDgdOo8vy3d1A6zHH0/4f2VJfEzLCg==", + "dev": true, + "optional": true + }, + "esbuild-freebsd-arm64": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.13.2.tgz", + "integrity": "sha512-DWBZauEfjmqdfWxIacI+KBEim3ulOjtvK+WVm1bX67XlfyUVIkD915OIfT2EBhQUWmv+Z0tZZwskSMNj5DKojw==", + "dev": true, + "optional": true + }, + "esbuild-linux-32": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.13.2.tgz", + "integrity": "sha512-Gt2rNqqRCRh1QQC2d83KP0iWIXWQYpns7l2+41a1n0PQxXkQ5AarpjjL9mUzdXtcZauNXbUvWwBKAuBTCW+XQg==", + "dev": true, + "optional": true + }, + "esbuild-linux-64": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.13.2.tgz", + "integrity": "sha512-yT0D5Xly8oGHuqq975k1XUyULHzk3fN/ZlTY+awlU+nCFsYPZ43NE5msGpxlNQu8i6KOXQEke5GXN3y5d+Zd4g==", + "dev": true, + "optional": true + }, + "esbuild-linux-arm": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.13.2.tgz", + "integrity": "sha512-KXeyotqj9jbvCjbSpwnxDE8E8jKoBgrgbJpOvvY5Zz7Pp2fAwu/94vWQtE/jPEJndY4C4MSs+ryJLFWzmLOa4w==", + "dev": true, + "optional": true + }, + "esbuild-linux-arm64": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.13.2.tgz", + "integrity": "sha512-qwXL+3NDCWiC8RMKBBETpuOWdC+pUAUS+pwg9jJmapYblLdVKkyRtwF/ogj06TdYs6riSSNikW8HK/Xs0HHbbQ==", + "dev": true, + "optional": true + }, + "esbuild-linux-mips64le": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.13.2.tgz", + "integrity": "sha512-sx8eheRX2XC2ppNAsbQm8/VUcU8XPYGpJK0BEyRefqHONz6u5Ib2guUdOz2Wh4YlbA7oOd482lHjprXSTwUcrQ==", + "dev": true, + "optional": true + }, + "esbuild-linux-ppc64le": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.13.2.tgz", + "integrity": "sha512-y8iZ3qy2TIAKKsZ6xSopCztHOtGW9oiYDl22vQ0UIoVWjnfRKrbSzX7Y2F94y32hSvRWle6OhAIC+UpS5nQmIA==", + "dev": true, + "optional": true + }, + "esbuild-openbsd-64": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.13.2.tgz", + "integrity": "sha512-g6AYrjBeV9OK624bw0KQ1TjHJQSW+X1Yicyd1NvDWqSFpMqKAjw7EUX4tA87mOFqv8BflPGr4f43ySgNvSVzIw==", + "dev": true, + "optional": true + }, + "esbuild-sunos-64": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.13.2.tgz", + "integrity": "sha512-hIXvFIyrqwFd6v62XSra0ctCUXDS9Tu5D6QYbvnbhEoBmvD/TmEJRYRH48/+xmRifKJLzu6aegcrjAsDmaww7g==", + "dev": true, + "optional": true + }, + "esbuild-windows-32": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.13.2.tgz", + "integrity": "sha512-Y767LG0NFkw0sPoDVOTKC5gaj4vURjjWfSCCDV5awpXXxBKOF2zsIp3aia4KvVoivoSSeRPk3emDd0OPHuPrKg==", + "dev": true, + "optional": true + }, + "esbuild-windows-64": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.13.2.tgz", + "integrity": "sha512-01b59kVJUMasctn6lzswC0drchr7zO75QtF22o5w0nlOw0Zorw0loY/8i5choFuWc30gXJId9qBSc1zPvt7uEw==", + "dev": true, + "optional": true + }, + "esbuild-windows-arm64": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.13.2.tgz", + "integrity": "sha512-HxyY604ytmh8NkPYyS1TdIB/bFS7DWd1hP90e8Ovo/elEdN5I13h0tyIatDYZkXKS0Ztk+9T/3h6K0fI1a/4tQ==", + "dev": true, + "optional": true }, "escalade": { "version": "3.1.1", @@ -9116,12 +9456,6 @@ "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", "dev": true }, - "husky": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/husky/-/husky-7.0.2.tgz", - "integrity": "sha512-8yKEWNX4z2YsofXAMT7KvA1g8p+GxtB1ffV8XtpAEGuXNAbCV5wdNKH+qTpw8SM9fh4aMPDR+yQuKfgnreyZlg==", - "dev": true - }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", diff --git a/package.json b/package.json index d14ef258..c5863f4d 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,6 @@ "eslint": "^7.32.0", "eslint-plugin-import": "^2.24.2", "gh-pages": "^3.2.3", - "husky": "^7.0.2", "prettier": "^2.4.1", "pretty-quick": "^3.1.1", "tap-spec": "^5.0.0", @@ -62,7 +61,7 @@ "docs:build": "rm -rf www && eleventy --config=eleventy.config.cjs", "docs:deploy": "npm run docs:build && gh-pages -d www --dotfiles", "lint": "eslint '{src,test}/**/*.js'", - "prepare": "husky install" + "prepare": "git config --local --add core.hooksPath .hooks" }, "prettier": { "bracketSpacing": true, From b7d4bf530c5aef67c541f6a7f5387d106aaa850a Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Fri, 24 Sep 2021 21:27:07 +0200 Subject: [PATCH 24/40] git-config: we're looking for --replace-all, not --add --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c5863f4d..2d2271e3 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "docs:build": "rm -rf www && eleventy --config=eleventy.config.cjs", "docs:deploy": "npm run docs:build && gh-pages -d www --dotfiles", "lint": "eslint '{src,test}/**/*.js'", - "prepare": "git config --local --add core.hooksPath .hooks" + "prepare": "git config --replace-all core.hooksPath .hooks" }, "prettier": { "bracketSpacing": true, From a4bc86fafa8825f99056629d1e0e75605a3e91c2 Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Fri, 1 Oct 2021 14:04:22 +0300 Subject: [PATCH 25/40] [Breaking] Extending culori: changed names of methods and color space properties. Changed methods: * defineMode() => useMode(); * getModeDefinition() => getMode(); Changes in color space definition: * input{} => fromMode{} * output{} => toMode{} * parsers[] => parse[] * serialize: don't include the awkward "color(" part --- {.hooks => .git-hooks}/pre-commit | 0 docs/api.md | 155 ++++++++++++++++++++---------- package.json | 4 +- src/a98/definition.js | 8 +- src/average.js | 4 +- src/blend.js | 4 +- src/clamp.js | 4 +- src/cubehelix/definition.js | 8 +- src/difference.js | 4 +- src/dlab/definition.js | 8 +- src/dlch/definition.js | 8 +- src/filter.js | 4 +- src/formatter.js | 6 +- src/hsi/definition.js | 8 +- src/hsl/definition.js | 6 +- src/hsv/definition.js | 8 +- src/hwb/definition.js | 6 +- src/interpolate/interpolate.js | 4 +- src/jab/definition.js | 8 +- src/jch/definition.js | 8 +- src/lab/definition.js | 6 +- src/lab65/definition.js | 8 +- src/lch/definition.js | 6 +- src/lch65/definition.js | 8 +- src/lchuv/definition.js | 8 +- src/lrgb/definition.js | 8 +- src/luv/definition.js | 8 +- src/map.js | 6 +- src/modes.js | 25 +++-- src/oklab/definition.js | 8 +- src/oklch/definition.js | 8 +- src/p3/definition.js | 8 +- src/packs/core.js | 38 ++++---- src/packs/extra-spaces.js | 24 ++--- src/parse.js | 4 +- src/prophoto/definition.js | 8 +- src/random.js | 4 +- src/rec2020/definition.js | 8 +- src/rgb/definition.js | 4 +- src/xyz/definition.js | 8 +- src/xyz65/definition.js | 8 +- src/yiq/definition.js | 8 +- tools/ranges.js | 2 +- 43 files changed, 271 insertions(+), 217 deletions(-) rename {.hooks => .git-hooks}/pre-commit (100%) diff --git a/.hooks/pre-commit b/.git-hooks/pre-commit similarity index 100% rename from .hooks/pre-commit rename to .git-hooks/pre-commit diff --git a/docs/api.md b/docs/api.md index 954b1fd3..53ee61d0 100644 --- a/docs/api.md +++ b/docs/api.md @@ -17,7 +17,6 @@ menu-order: 2
  • colorsNamed
  • converter
  • cubehelix
  • -
  • defineMode
  • differenceCie76
  • differenceCie94
  • differenceCiede2000
  • @@ -57,7 +56,7 @@ menu-order: 2
  • formatHex8
  • formatHsl
  • formatRgb
  • -
  • getModeDefinition
  • +
  • getMode
  • hsi
  • hsl
  • hsv
  • @@ -100,6 +99,7 @@ menu-order: 2
  • rgb
  • round
  • samples
  • +
  • useMode
  • wcagContrast
  • wcagLuminance
  • xyz
  • @@ -1348,62 +1348,79 @@ approx(0.38393993); ## Extending culori -> **Warning:** This part of the API is not yet finalized and may change. - -# culori.**defineMode**(_definition_) +# culori.**useMode**(_definition_) → _function_. [src/modes.js](https://github.com/evercoder/culori/blob/main/src/modes.js) -Defines a new color space through a _definition_ object. Here's the full definition of the HSL color space: +Defines a new color space based on its _definition_. See [Color mode definition](#color-mode-def) for the expected object shape. + +Returns a converter function for the newly defined mode. ```js -{ - mode: 'hsl', - output: { - rgb: convertHslToRgb - }, - input: { - rgb: convertRgbToHsl - }, - channels: ['h', 's', 'l', 'alpha'], - ranges: { - h: [0, 360] - }, - parsers: [parseHsl], - serialize: serializeHsl, - interpolate: { - h: { - use: interpolatorLinear, - fixup: fixupHueShorter - }, - s: interpolatorLinear, - l: interpolatorLinear, - alpha: { - use: interpolatorLinear, - fixup: fixupAlpha - } - }, - difference: { - h: differenceHueSaturation - }, - average: { - h: averageAngle - } -}; +import { useMode } from 'culori'; + +const hsl = useMode({ + mode: 'hsl' + // ... +}); + +hsl('hsl(50 100% 100% / 100)'); ``` +# culori.**getMode**(_mode_) + + [src/modes.js](https://github.com/evercoder/culori/blob/main/src/modes.js) + +Returns the definition object for the _mode_ color space. + +

    + # + Color mode definition +

    + The properties a definition needs are the following: -- `mode`: the string identifier for the color space -- `output`: a set of functions to convert from the color space we're defining to other color spaces. At least `rgb` needs to be included; in case a specific conversion pair between two color spaces is missing, RGB is used as the "buffer" for the conversion. -- `input`: opposite of `output`; a set of function to convert from various color spaces to the color space we're defining. At least `rgb` needs to be included. -- `channels`: a list of channels for the color space. -- `ranges`: the ranges for values in specific channels; if left unspecified, defaults to `[0, 1]`. -- `parsers`: any parsers for the color space that can transform strings into colors. These can be either functions, or strings — the latter is used as the color space's identifier to parse the `color()` CSS syntax. -- `serialize`: when a string is provided, it's used as the prefix when producing a string with `culori.formatCss`; when missing, it defaults to `color(--${color.mode} `. -- `interpolate`: the default interpolations for the color space, one for each channel. Each interpolation is defined by its interpolator (the `use` key) and its fixup function (the `fixup` key). When defined as a function, a channel interpolation is meant to define its interpolator, with the fixup being a no-op. -- `difference`: the default Euclidean distance method for each channel in the color space; mostly used for the `h` channel in cylindrical color spaces. -- `average`: the default average function for each channel in the color space; when left unspecified, defaults to [`averageNumber`](#averageNumber). +#### `mode` (_string_) + +The string identifier for the color space. + +#### `channels` (_array_) + +A list of channels for the color space. + +#### `toMode` (_object_) + +A set of functions to convert from the color space we're defining to other color spaces. At least `rgb` needs to be included; in case a specific conversion pair between two color spaces is missing, RGB is used as the "buffer" for the conversion. + +#### `fromMode` (_object_) + +The opposite of `toMode`. A set of function to convert from various color spaces to the color space we're defining. At least `rgb` needs to be included. + +#### `ranges` (_object_, optional) + +The ranges for values in specific channels; if left unspecified, defaults to `[0, 1]`. + +#### `parse` (_array_, optional) + +Any parsers for the color space that can transform strings into colors. These can be either functions, or strings — the latter is used as the color space's identifier to parse the `color()` CSS syntax. + +#### `serialize` (_function_ or _string_, optional) + +Defines how to serialize the color space to a CSS string with [`formatCss()`](#formatCss). + +If you pass in a function, it receives a color object as its only argument, and should return a string that can be used in CSS. If you pass in a string, it's used as a color profile identifier, and the color is serialized using the `color()` CSS syntax. When omitted altogether, the default color profile identifier is `--${mode}`. + +#### `interpolate` + +The default interpolations for the color space, one for each channel. Each interpolation is defined by its interpolator (the `use` key) and its fixup function (the `fixup` key). When defined as a function, a channel interpolation is meant to define its interpolator, with the fixup being a no-op. + +#### `difference` + +The default Euclidean distance method for each channel in the color space; mostly used for the `h` channel in cylindrical color spaces. + +#### `average` + +The default average function for each channel in the color space; when left unspecified, defaults to [`averageNumber`](#averageNumber). All built-in color spaces follow these conventions in regards to the `channels` array follows: @@ -1412,11 +1429,43 @@ All built-in color spaces follow these conventions in regards to the `channels` This makes sure [`culori.differenceEuclidean()`](#differenceEuclidean) works as expected, but there may be more hidden assumptions in the codebase. -# culori.**getModeDefinition**(_mode_) +Here's a sample definition for the HSL color space: - [src/modes.js](https://github.com/evercoder/culori/blob/main/src/modes.js) - -Returns the definition object for the _mode_ color space. As with all methods in this section, the definition object may change before the first stable release, so keep an eye on the [release notes](https://github.com/evercoder/culori/releases) for any breaking changes. +```js +{ + mode: 'hsl', + fromMode: { + rgb: convertRgbToHsl + }, + toMode: { + rgb: convertHslToRgb + }, + channels: ['h', 's', 'l', 'alpha'], + ranges: { + h: [0, 360] + }, + parse: [parseHsl], + serialize: serializeHsl, + interpolate: { + h: { + use: interpolatorLinear, + fixup: fixupHueShorter + }, + s: interpolatorLinear, + l: interpolatorLinear, + alpha: { + use: interpolatorLinear, + fixup: fixupAlpha + } + }, + difference: { + h: differenceHueSaturation + }, + average: { + h: averageAngle + } +}; +``` [css-images-4]: https://drafts.csswg.org/css-images-4/#color-stop-syntax [css-easing-1]: http://drafts.csswg.org/css-easing-1 diff --git a/package.json b/package.json index 2d2271e3..9d172b29 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "tape": "^5.3.1" }, "scripts": { + "prepare": "git config core.hooksPath .git-hooks", "test": "tape 'test/*.js' | tap-spec", "build": "node build.js", "benchmark": "node benchmark/index.js", @@ -60,8 +61,7 @@ "docs:start": "eleventy --config=eleventy.config.cjs --serve", "docs:build": "rm -rf www && eleventy --config=eleventy.config.cjs", "docs:deploy": "npm run docs:build && gh-pages -d www --dotfiles", - "lint": "eslint '{src,test}/**/*.js'", - "prepare": "git config --replace-all core.hooksPath .hooks" + "lint": "eslint '{src,test}/**/*.js'" }, "prettier": { "bracketSpacing": true, diff --git a/src/a98/definition.js b/src/a98/definition.js index 7b3f121b..6c35d078 100644 --- a/src/a98/definition.js +++ b/src/a98/definition.js @@ -8,15 +8,15 @@ import convertXyz65ToRgb from '../xyz65/convertXyz65ToRgb.js'; const definition = { ...rgb, mode: 'a98', - parsers: ['a98-rgb'], - serialize: 'color(a98-rgb ', + parse: ['a98-rgb'], + serialize: 'a98-rgb', - input: { + fromMode: { rgb: color => convertXyz65ToA98(convertRgbToXyz65(color)), xyz65: convertXyz65ToA98 }, - output: { + toMode: { rgb: color => convertXyz65ToRgb(convertA98ToXyz65(color)), xyz65: convertA98ToXyz65 } diff --git a/src/average.js b/src/average.js index 1546d09c..6fb6e673 100644 --- a/src/average.js +++ b/src/average.js @@ -1,5 +1,5 @@ import converter from './converter.js'; -import { getModeDefinition } from './modes.js'; +import { getMode } from './modes.js'; const averageAngle = val => { // See: https://en.wikipedia.org/wiki/Mean_of_circular_quantities @@ -25,7 +25,7 @@ const averageNumber = val => { const isfn = o => typeof o === 'function'; function average(colors, mode = 'rgb', overrides) { - let def = getModeDefinition(mode); + let def = getMode(mode); let cc = colors.map(converter(mode)); return def.channels.reduce( (res, ch) => { diff --git a/src/blend.js b/src/blend.js index 9947f451..451b35d9 100644 --- a/src/blend.js +++ b/src/blend.js @@ -9,7 +9,7 @@ */ import converter from './converter.js'; -import { getModeDefinition } from './modes.js'; +import { getMode } from './modes.js'; const BLENDS = { normal: (b, s) => s, @@ -40,7 +40,7 @@ const blend = (colors, type = 'normal', mode = 'rgb') => { let conv = converter(mode); // get mode channels - let channels = getModeDefinition(mode).channels; + let channels = getMode(mode).channels; // convert all colors to the mode // and assume undefined alphas are 1 diff --git a/src/clamp.js b/src/clamp.js index 9dd2c64c..26febfc9 100644 --- a/src/clamp.js +++ b/src/clamp.js @@ -1,7 +1,7 @@ import converter from './converter.js'; import displayable from './displayable.js'; import prepare from './_prepare.js'; -import { getModeDefinition } from './modes.js'; +import { getMode } from './modes.js'; let rgb = converter('rgb'); @@ -50,7 +50,7 @@ export const clampChroma = (color, mode = 'lch') => { // Find the displayable chroma through the bisection method. let start = 0; let end = color.c; - let range = getModeDefinition(mode).ranges.c; + let range = getMode(mode).ranges.c; let resolution = (range[1] - range[0]) / Math.pow(2, 13); let _last_good_c; diff --git a/src/cubehelix/definition.js b/src/cubehelix/definition.js index ab70adbb..81be15d1 100644 --- a/src/cubehelix/definition.js +++ b/src/cubehelix/definition.js @@ -42,8 +42,8 @@ import { averageAngle } from '../average.js'; const definition = { mode: 'cubehelix', channels: ['h', 's', 'l', 'alpha'], - parsers: ['--cubehelix'], - serialize: 'color(--cubehelix ', + parse: ['--cubehelix'], + serialize: '--cubehelix', ranges: { h: [0, 360], @@ -51,11 +51,11 @@ const definition = { l: [0, 1] }, - input: { + fromMode: { rgb: convertRgbToCubehelix }, - output: { + toMode: { rgb: convertCubehelixToRgb }, diff --git a/src/difference.js b/src/difference.js index f32ee22c..85b03eff 100644 --- a/src/difference.js +++ b/src/difference.js @@ -1,4 +1,4 @@ -import { getModeDefinition } from './modes.js'; +import { getMode } from './modes.js'; import converter from './converter.js'; import normalizeHue from './util/normalizeHue.js'; @@ -36,7 +36,7 @@ const differenceHueChroma = (std, smp) => { }; const differenceEuclidean = (mode = 'rgb', weights = [1, 1, 1, 0]) => { - let def = getModeDefinition(mode); + let def = getMode(mode); let channels = def.channels; let diffs = def.difference; let conv = converter(mode); diff --git a/src/dlab/definition.js b/src/dlab/definition.js index c7cb5aa1..b225f1bd 100644 --- a/src/dlab/definition.js +++ b/src/dlab/definition.js @@ -8,15 +8,15 @@ import { fixupAlpha } from '../fixup/alpha.js'; const definition = { mode: 'dlab', - parsers: ['--din99o-lab'], - serialize: 'color(--din99o-lab ', + parse: ['--din99o-lab'], + serialize: '--din99o-lab', - output: { + toMode: { lab65: convertDlabToLab65, rgb: c => convertLab65ToRgb(convertDlabToLab65(c)) }, - input: { + fromMode: { lab65: convertLab65ToDlab, rgb: c => convertLab65ToDlab(convertRgbToLab65(c)) }, diff --git a/src/dlch/definition.js b/src/dlch/definition.js index ca75408d..01c47bdb 100644 --- a/src/dlch/definition.js +++ b/src/dlch/definition.js @@ -14,16 +14,16 @@ import { averageAngle } from '../average.js'; const definition = { mode: 'dlch', - parsers: ['--din99o-lch'], - serialize: 'color(--din99o-lch ', + parse: ['--din99o-lch'], + serialize: '--din99o-lch', - output: { + toMode: { lab65: convertDlchToLab65, dlab: convertDlchToDlab, rgb: c => convertLab65ToRgb(convertDlchToLab65(c)) }, - input: { + fromMode: { lab65: convertLab65ToDlch, dlab: convertDlabToDlch, rgb: c => convertLab65ToDlch(convertRgbToLab65(c)) diff --git a/src/filter.js b/src/filter.js index 0a884a18..8b3c09c5 100644 --- a/src/filter.js +++ b/src/filter.js @@ -2,7 +2,7 @@ import { mapper, mapTransferLinear } from './map.js'; import converter from './converter.js'; import prepare from './_prepare.js'; import lerp from './util/lerp.js'; -import { getModeDefinition } from './modes.js'; +import { getMode } from './modes.js'; const minzero = v => Math.max(v, 0); const clamp = v => Math.max(Math.min(v, 1), 0); @@ -99,7 +99,7 @@ const matrixHueRotate = degrees => { const matrix = (values, mode, preserve_mode = false) => { let conv = converter(mode); - let channels = getModeDefinition(mode).channels; + let channels = getMode(mode).channels; return color => { let c = conv(color); if (!c) { diff --git a/src/formatter.js b/src/formatter.js index c52d2412..a8000a7b 100644 --- a/src/formatter.js +++ b/src/formatter.js @@ -1,7 +1,7 @@ import converter from './converter.js'; import round from './round.js'; import prepare from './_prepare.js'; -import { getModeDefinition } from './modes.js'; +import { getMode } from './modes.js'; let rgb = converter('rgb'); let hsl = converter('hsl'); @@ -81,9 +81,9 @@ export const formatCss = c => { if (!color) { return undefined; } - const def = getModeDefinition(color.mode); + const def = getMode(color.mode); if (!def.serialize || typeof def.serialize === 'string') { - let res = def.serialize || `color(--${color.mode} `; + let res = `color(${def.serialize || `--${color.mode}`} `; def.channels.forEach((ch, i) => { if (ch !== 'alpha') { res += (i ? ' ' : '') + (color[ch] || 0); diff --git a/src/hsi/definition.js b/src/hsi/definition.js index 2fc85030..d94a9641 100644 --- a/src/hsi/definition.js +++ b/src/hsi/definition.js @@ -9,14 +9,14 @@ import { averageAngle } from '../average.js'; const definition = { mode: 'hsi', - output: { + toMode: { rgb: convertHsiToRgb }, - parsers: ['--hsi'], - serialize: 'color(--hsi ', + parse: ['--hsi'], + serialize: '--hsi', - input: { + fromMode: { rgb: convertRgbToHsi }, diff --git a/src/hsl/definition.js b/src/hsl/definition.js index 93d9bb32..57063a6f 100644 --- a/src/hsl/definition.js +++ b/src/hsl/definition.js @@ -10,11 +10,11 @@ import { averageAngle } from '../average.js'; const definition = { mode: 'hsl', - output: { + toMode: { rgb: convertHslToRgb }, - input: { + fromMode: { rgb: convertRgbToHsl }, @@ -24,7 +24,7 @@ const definition = { h: [0, 360] }, - parsers: [parseHsl], + parse: [parseHsl], serialize: c => `hsl(${c.h || 0} ${c.s * 100}% ${c.l * 100}%${ c.alpha < 1 ? ` / ${c.alpha}` : '' diff --git a/src/hsv/definition.js b/src/hsv/definition.js index 7f6e8835..c9ebbe21 100644 --- a/src/hsv/definition.js +++ b/src/hsv/definition.js @@ -9,14 +9,14 @@ import { averageAngle } from '../average.js'; const definition = { mode: 'hsv', - output: { + toMode: { rgb: convertHsvToRgb }, - parsers: ['--hsv'], - serialize: 'color(--hsv ', + parse: ['--hsv'], + serialize: '--hsv', - input: { + fromMode: { rgb: convertRgbToHsv }, diff --git a/src/hwb/definition.js b/src/hwb/definition.js index c6ab6f9d..5ea58c5f 100644 --- a/src/hwb/definition.js +++ b/src/hwb/definition.js @@ -10,11 +10,11 @@ import { averageAngle } from '../average.js'; const definition = { mode: 'hwb', - output: { + toMode: { rgb: convertHwbToRgb }, - input: { + fromMode: { rgb: convertRgbToHwb }, @@ -24,7 +24,7 @@ const definition = { h: [0, 360] }, - parsers: [parseHwb], + parse: [parseHwb], serialize: c => `hwb(${c.h || 0} ${c.w * 100}% ${c.b * 100}%${ c.alpha < 1 ? ` / ${c.alpha}` : '' diff --git a/src/interpolate/interpolate.js b/src/interpolate/interpolate.js index d46df887..51b8c150 100644 --- a/src/interpolate/interpolate.js +++ b/src/interpolate/interpolate.js @@ -1,5 +1,5 @@ import converter from '../converter.js'; -import { getModeDefinition } from '../modes.js'; +import { getMode } from '../modes.js'; import normalizePositions from '../util/normalizePositions.js'; import easingMidpoint from '../easing/midpoint.js'; import { mapper, mapAlphaMultiply, mapAlphaDivide } from '../map.js'; @@ -9,7 +9,7 @@ const isobj = o => o && typeof o === 'object'; const isnum = o => typeof o === 'number'; const interpolate_fn = (colors, mode = 'rgb', overrides, premap) => { - let def = getModeDefinition(mode); + let def = getMode(mode); let conv = converter(mode); let conv_colors = []; diff --git a/src/jab/definition.js b/src/jab/definition.js index 5d2470de..26945c92 100644 --- a/src/jab/definition.js +++ b/src/jab/definition.js @@ -23,15 +23,15 @@ const definition = { mode: 'jab', channels: ['j', 'a', 'b', 'alpha'], - parsers: ['--jzazbz'], - serialize: 'color(--jzazbz ', + parse: ['--jzazbz'], + serialize: '--jzazbz', - input: { + fromMode: { rgb: convertRgbToJab, xyz65: convertXyz65ToJab }, - output: { + toMode: { rgb: convertJabToRgb, xyz65: convertJabToXyz65 }, diff --git a/src/jch/definition.js b/src/jch/definition.js index 1acfe341..dbf1c3da 100644 --- a/src/jch/definition.js +++ b/src/jch/definition.js @@ -12,15 +12,15 @@ import { averageAngle } from '../average.js'; const definition = { mode: 'jch', - parsers: ['--jzczhz'], - serialize: 'color(--jzczhz ', + parse: ['--jzczhz'], + serialize: '--jzczhz', - output: { + toMode: { jab: convertJchToJab, rgb: c => convertJabToRgb(convertJchToJab(c)) }, - input: { + fromMode: { rgb: c => convertJabToJch(convertRgbToJab(c)), jab: convertJabToJch }, diff --git a/src/lab/definition.js b/src/lab/definition.js index f442fdbc..10141974 100644 --- a/src/lab/definition.js +++ b/src/lab/definition.js @@ -9,12 +9,12 @@ import { fixupAlpha } from '../fixup/alpha.js'; const definition = { mode: 'lab', - output: { + toMode: { xyz: convertLabToXyz, rgb: convertLabToRgb }, - input: { + fromMode: { xyz: convertXyzToLab, rgb: convertRgbToLab }, @@ -27,7 +27,7 @@ const definition = { b: [-112.029, 93.388] }, - parsers: [parseLab], + parse: [parseLab], serialize: c => `lab(${c.l}% ${c.a} ${c.b}${c.alpha < 1 ? ` / ${c.alpha}` : ''})`, diff --git a/src/lab65/definition.js b/src/lab65/definition.js index 14c68882..c8f3397b 100644 --- a/src/lab65/definition.js +++ b/src/lab65/definition.js @@ -8,15 +8,15 @@ const definition = { ...lab, mode: 'lab65', - parsers: ['--lab-d65'], - serialize: 'color(--lab-d65 ', + parse: ['--lab-d65'], + serialize: '--lab-d65', - output: { + toMode: { xyz65: convertLab65ToXyz65, rgb: convertLab65ToRgb }, - input: { + fromMode: { xyz65: convertXyz65ToLab65, rgb: convertRgbToLab65 }, diff --git a/src/lch/definition.js b/src/lch/definition.js index 468fb28a..f782bdbb 100644 --- a/src/lch/definition.js +++ b/src/lch/definition.js @@ -12,12 +12,12 @@ import { averageAngle } from '../average.js'; const definition = { mode: 'lch', - output: { + toMode: { lab: convertLchToLab, rgb: c => convertLabToRgb(convertLchToLab(c)) }, - input: { + fromMode: { rgb: c => convertLabToLch(convertRgbToLab(c)), lab: convertLabToLch }, @@ -30,7 +30,7 @@ const definition = { h: [0, 360] }, - parsers: [parseLch], + parse: [parseLch], serialize: c => `lch(${c.l}% ${c.c} ${c.h || 0}${c.alpha < 1 ? ` / ${c.alpha}` : ''})`, diff --git a/src/lch65/definition.js b/src/lch65/definition.js index e9e65a0e..e16b1922 100644 --- a/src/lch65/definition.js +++ b/src/lch65/definition.js @@ -8,15 +8,15 @@ const definition = { ...lch, mode: 'lch65', - parsers: ['--lch-d65'], - serialize: 'color(--lch-d65 ', + parse: ['--lch-d65'], + serialize: '--lch-d65', - output: { + toMode: { lab65: c => convertLchToLab(c, 'lab65'), rgb: c => convertLab65ToRgb(convertLchToLab(c, 'lab65')) }, - input: { + fromMode: { rgb: c => convertLabToLch(convertRgbToLab65(c), 'lch65'), lab65: c => convertLabToLch(c, 'lch65') }, diff --git a/src/lchuv/definition.js b/src/lchuv/definition.js index 35c5ce22..36f34f48 100644 --- a/src/lchuv/definition.js +++ b/src/lchuv/definition.js @@ -20,20 +20,20 @@ import { averageAngle } from '../average.js'; const definition = { mode: 'lchuv', - output: { + toMode: { luv: convertLchuvToLuv, rgb: convertLchuvToRgb }, - input: { + fromMode: { rgb: convertRgbToLchuv, luv: convertLuvToLchuv }, channels: ['l', 'c', 'h', 'alpha'], - parsers: ['--lchuv'], - serialize: 'color(--lchuv ', + parse: ['--lchuv'], + serialize: '--lchuv', ranges: { l: [0, 100], diff --git a/src/lrgb/definition.js b/src/lrgb/definition.js index d00f9655..405134bd 100644 --- a/src/lrgb/definition.js +++ b/src/lrgb/definition.js @@ -6,16 +6,16 @@ const definition = { ...rgb, mode: 'lrgb', - output: { + toMode: { rgb: convertLrgbToRgb }, - input: { + fromMode: { rgb: convertRgbToLrgb }, - parsers: ['--srgb-linear'], - serialize: 'color(--srgb-linear ' + parse: ['--srgb-linear'], + serialize: '--srgb-linear' }; export default definition; diff --git a/src/luv/definition.js b/src/luv/definition.js index 1c285d3e..d668c9b1 100644 --- a/src/luv/definition.js +++ b/src/luv/definition.js @@ -17,20 +17,20 @@ import { fixupAlpha } from '../fixup/alpha.js'; const definition = { mode: 'luv', - output: { + toMode: { xyz: convertLuvToXyz, rgb: convertLuvToRgb }, - input: { + fromMode: { xyz: convertXyzToLuv, rgb: convertRgbToLuv }, channels: ['l', 'u', 'v', 'alpha'], - parsers: ['--luv'], - serialize: 'color(--luv ', + parse: ['--luv'], + serialize: '--luv', ranges: { l: [0, 100], diff --git a/src/map.js b/src/map.js index fd035edd..0b8da4e0 100644 --- a/src/map.js +++ b/src/map.js @@ -1,13 +1,13 @@ import converter from './converter.js'; import prepare from './_prepare.js'; -import { getModeDefinition } from './modes.js'; +import { getMode } from './modes.js'; const mapper = (fn, mode = 'rgb', preserve_mode = false) => { - let channels = mode ? getModeDefinition(mode).channels : null; + let channels = mode ? getMode(mode).channels : null; let conv = mode ? converter(mode) : prepare; return color => { let conv_color = conv(color); - let res = (channels || getModeDefinition(color.mode).channels).reduce( + let res = (channels || getMode(color.mode).channels).reduce( (res, ch) => { let v = fn(conv_color[ch], ch, conv_color, mode); if (v !== undefined && !isNaN(v)) { diff --git a/src/modes.js b/src/modes.js index 5caa38fd..95088cd0 100644 --- a/src/modes.js +++ b/src/modes.js @@ -1,3 +1,5 @@ +import converter from './converter.js'; + const converters = {}; const modes = {}; @@ -6,16 +8,17 @@ const colorProfiles = {}; const identity = v => v; -const defineMode = definition => { - converters[definition.mode] = Object.assign( - converters[definition.mode] || {}, - definition.output - ); - Object.keys(definition.input || {}).forEach(k => { +const useMode = definition => { + converters[definition.mode] = { + ...converters[definition.mode], + ...definition.toMode + }; + + Object.keys(definition.fromMode || {}).forEach(k => { if (!converters[k]) { converters[k] = {}; } - converters[k][definition.mode] = definition.input[k]; + converters[k][definition.mode] = definition.fromMode[k]; }); // Color space channel ranges @@ -49,15 +52,17 @@ const defineMode = definition => { }); modes[definition.mode] = definition; - (definition.parsers || []).forEach(parser => { + (definition.parse || []).forEach(parser => { if (typeof parser === 'function') { parsers.push(parser); } else if (typeof parser === 'string') { colorProfiles[parser] = definition.mode; } }); + + return converter(definition.mode); }; -const getModeDefinition = mode => modes[mode]; +const getMode = mode => modes[mode]; -export { defineMode, getModeDefinition, converters, parsers, colorProfiles }; +export { useMode, getMode, converters, parsers, colorProfiles }; diff --git a/src/oklab/definition.js b/src/oklab/definition.js index 178a2bdf..8abd739f 100644 --- a/src/oklab/definition.js +++ b/src/oklab/definition.js @@ -14,12 +14,12 @@ const definition = { ...lab, mode: 'oklab', - output: { + toMode: { lrgb: convertOklabToLrgb, rgb: convertOklabToRgb }, - input: { + fromMode: { lrgb: convertLrgbToOklab, rgb: convertRgbToOklab }, @@ -30,8 +30,8 @@ const definition = { b: [-0.311, 0.198] }, - parsers: ['--oklab'], - serialize: 'color(--oklab ' + parse: ['--oklab'], + serialize: '--oklab' }; export default definition; diff --git a/src/oklch/definition.js b/src/oklch/definition.js index 3a0045a8..418302b1 100644 --- a/src/oklch/definition.js +++ b/src/oklch/definition.js @@ -8,18 +8,18 @@ const definition = { ...lch, mode: 'oklch', - output: { + toMode: { oklab: c => convertLchToLab(c, 'oklab'), rgb: c => convertOklabToRgb(convertLchToLab(c, 'oklab')) }, - input: { + fromMode: { rgb: c => convertLabToLch(convertRgbToOklab(c), 'oklch'), oklab: c => convertLabToLch(c, 'oklch') }, - parsers: ['--oklch'], - serialize: 'color(--oklch ', + parse: ['--oklch'], + serialize: '--oklch', ranges: { l: [0, 0.999], diff --git a/src/p3/definition.js b/src/p3/definition.js index b04e061d..6b7e3c7a 100644 --- a/src/p3/definition.js +++ b/src/p3/definition.js @@ -7,15 +7,15 @@ import convertXyz65ToRgb from '../xyz65/convertXyz65ToRgb.js'; const definition = { ...rgb, mode: 'p3', - parsers: ['display-p3'], - serialize: 'color(display-p3 ', + parse: ['display-p3'], + serialize: 'display-p3', - input: { + fromMode: { rgb: color => convertXyz65ToP3(convertRgbToXyz65(color)), xyz65: convertXyz65ToP3 }, - output: { + toMode: { rgb: color => convertXyz65ToRgb(convertP3ToXyz65(color)), xyz65: convertP3ToXyz65 } diff --git a/src/packs/core.js b/src/packs/core.js index e3c24dea..1951ee9d 100644 --- a/src/packs/core.js +++ b/src/packs/core.js @@ -16,25 +16,25 @@ import lab65Def from '../lab65/definition.js'; import lch65Def from '../lch65/definition.js'; import xyz65Def from '../xyz65/definition.js'; -import { defineMode } from '../modes.js'; +import { useMode } from '../modes.js'; import converter from '../converter.js'; -defineMode(a98Def); -defineMode(hslDef); -defineMode(hsvDef); -defineMode(hwbDef); -defineMode(labDef); -defineMode(lchDef); -defineMode(lrgbDef); -defineMode(p3Def); -defineMode(prophotoDef); -defineMode(rec2020Def); -defineMode(rgbDef); -defineMode(xyzDef); - -defineMode(lab65Def); -defineMode(lch65Def); -defineMode(xyz65Def); +useMode(a98Def); +useMode(hslDef); +useMode(hsvDef); +useMode(hwbDef); +useMode(labDef); +useMode(lchDef); +useMode(lrgbDef); +useMode(p3Def); +useMode(prophotoDef); +useMode(rec2020Def); +useMode(rgbDef); +useMode(xyzDef); + +useMode(lab65Def); +useMode(lch65Def); +useMode(xyz65Def); let lab65 = converter('lab65'); let lch65 = converter('lch65'); @@ -56,7 +56,7 @@ let xyz = converter('xyz'); export { a98, converter, - defineMode, + useMode, hsl, hsv, hwb, @@ -136,7 +136,7 @@ export { default as samples } from '../samples.js'; export { default as displayable } from '../displayable.js'; export { clampRgb, clampChroma } from '../clamp.js'; export { default as nearest } from '../nearest.js'; -export { getModeDefinition } from '../modes.js'; +export { getMode } from '../modes.js'; export { default as parse } from '../parse.js'; export { diff --git a/src/packs/extra-spaces.js b/src/packs/extra-spaces.js index 43a879ee..5db9582a 100644 --- a/src/packs/extra-spaces.js +++ b/src/packs/extra-spaces.js @@ -10,21 +10,21 @@ import oklabDef from '../oklab/definition.js'; import oklchDef from '../oklch/definition.js'; import hsiDef from '../hsi/definition.js'; -import { defineMode } from '../modes.js'; +import { useMode } from '../modes.js'; import converter from '../converter.js'; import { differenceEuclidean } from '../difference.js'; -defineMode(jabDef); -defineMode(jchDef); -defineMode(cubehelixDef); -defineMode(dlabDef); -defineMode(dlchDef); -defineMode(hsiDef); -defineMode(luvDef); -defineMode(lchuvDef); -defineMode(yiqDef); -defineMode(oklabDef); -defineMode(oklchDef); +useMode(jabDef); +useMode(jchDef); +useMode(cubehelixDef); +useMode(dlabDef); +useMode(dlchDef); +useMode(hsiDef); +useMode(luvDef); +useMode(lchuvDef); +useMode(yiqDef); +useMode(oklabDef); +useMode(oklchDef); let jab = converter('jab'); let jch = converter('jch'); diff --git a/src/parse.js b/src/parse.js index a9cd5cc0..14a304a3 100644 --- a/src/parse.js +++ b/src/parse.js @@ -1,4 +1,4 @@ -import { parsers, colorProfiles, getModeDefinition } from './modes.js'; +import { parsers, colorProfiles, getMode } from './modes.js'; import { profiled } from './util/regex.js'; const parseColorSyntax = color => { @@ -12,7 +12,7 @@ const parseColorSyntax = color => { } const res = { mode }; let i = 2; - getModeDefinition(mode).channels.forEach(ch => { + getMode(mode).channels.forEach(ch => { if (m[i] !== undefined || m[i + 1] !== undefined) { res[ch] = m[i] !== undefined ? m[i] / 100 : +m[i + 1]; } diff --git a/src/prophoto/definition.js b/src/prophoto/definition.js index 82b41c5c..1ddb365d 100644 --- a/src/prophoto/definition.js +++ b/src/prophoto/definition.js @@ -16,15 +16,15 @@ import convertRgbToXyz from '../xyz/convertRgbToXyz.js'; const definition = { ...rgb, mode: 'prophoto', - parsers: ['prophoto-rgb'], - serialize: 'color(prophoto-rgb ', + parse: ['prophoto-rgb'], + serialize: 'prophoto-rgb', - input: { + fromMode: { xyz: convertXyzToProphoto, rgb: color => convertXyzToProphoto(convertRgbToXyz(color)) }, - output: { + toMode: { xyz: convertProphotoToXyz, rgb: color => convertXyzToRgb(convertProphotoToXyz(color)) } diff --git a/src/random.js b/src/random.js index 75cf0c01..212997cc 100644 --- a/src/random.js +++ b/src/random.js @@ -1,4 +1,4 @@ -import { getModeDefinition } from './modes.js'; +import { getMode } from './modes.js'; /* Generate a random number between `min` and `max` @@ -19,7 +19,7 @@ const to_intervals = constraints => Generate a random color. */ const random = (mode = 'rgb', constraints = {}) => { - let def = getModeDefinition(mode); + let def = getMode(mode); let limits = to_intervals(constraints); return def.channels.reduce( (res, ch) => { diff --git a/src/rec2020/definition.js b/src/rec2020/definition.js index c422f035..60a4e346 100644 --- a/src/rec2020/definition.js +++ b/src/rec2020/definition.js @@ -10,18 +10,18 @@ const definition = { ...rgb, mode: 'rec2020', - input: { + fromMode: { xyz: convertXyz65ToRec2020, rgb: color => convertXyz65ToRec2020(convertRgbToXyz65(color)) }, - output: { + toMode: { xyz: convertRec2020ToXyz65, rgb: color => convertXyz65ToRgb(convertRec2020ToXyz65(color)) }, - parsers: ['rec2020'], - serialize: 'color(rec2020 ' + parse: ['rec2020'], + serialize: 'rec2020' }; export default definition; diff --git a/src/rgb/definition.js b/src/rgb/definition.js index bb1e7150..57e124fe 100644 --- a/src/rgb/definition.js +++ b/src/rgb/definition.js @@ -12,8 +12,8 @@ import { fixupAlpha } from '../fixup/alpha.js'; const definition = { mode: 'rgb', channels: ['r', 'g', 'b', 'alpha'], - parsers: [parseHex, parseRgb, parseNamed, parseTransparent, 'srgb'], - serialize: 'color(srgb ', + parse: [parseHex, parseRgb, parseNamed, parseTransparent, 'srgb'], + serialize: 'srgb', interpolate: { r: interpolatorLinear, diff --git a/src/xyz/definition.js b/src/xyz/definition.js index 89821d64..de2b84b5 100644 --- a/src/xyz/definition.js +++ b/src/xyz/definition.js @@ -12,15 +12,15 @@ import { fixupAlpha } from '../fixup/alpha.js'; const definition = { mode: 'xyz', - parsers: ['xyz', '--xyz-d50'], - serialize: 'color(--xyz-d50 ', + parse: ['xyz', '--xyz-d50'], + serialize: '--xyz-d50', - output: { + toMode: { rgb: convertXyzToRgb, lab: convertXyzToLab }, - input: { + fromMode: { rgb: convertRgbToXyz, lab: convertLabToXyz }, diff --git a/src/xyz65/definition.js b/src/xyz65/definition.js index 9e5845a5..b662a720 100644 --- a/src/xyz65/definition.js +++ b/src/xyz65/definition.js @@ -14,14 +14,13 @@ import { fixupAlpha } from '../fixup/alpha.js'; const definition = { mode: 'xyz65', - serialize: 'color(--xyz-d65 ', - output: { + toMode: { rgb: convertXyz65ToRgb, xyz: convertXyz65ToXyz }, - input: { + fromMode: { rgb: convertRgbToXyz65, xyz: convertXyzToXyz65 }, @@ -34,7 +33,8 @@ const definition = { channels: ['x', 'y', 'z', 'alpha'], - parsers: ['--xyz-d65'], + parse: ['--xyz-d65'], + serialize: '--xyz-d65', interpolate: { x: interpolatorLinear, diff --git a/src/yiq/definition.js b/src/yiq/definition.js index 531bd2d6..15ce657b 100644 --- a/src/yiq/definition.js +++ b/src/yiq/definition.js @@ -26,18 +26,18 @@ import { fixupAlpha } from '../fixup/alpha.js'; const definition = { mode: 'yiq', - output: { + toMode: { rgb: convertYiqToRgb }, - input: { + fromMode: { rgb: convertRgbToYiq }, channels: ['y', 'i', 'q', 'alpha'], - parsers: ['--yiq'], - serialize: 'color(--yiq ', + parse: ['--yiq'], + serialize: '--yiq', ranges: { i: [-0.595, 0.595], diff --git a/tools/ranges.js b/tools/ranges.js index dad9b5bc..44281a4e 100644 --- a/tools/ranges.js +++ b/tools/ranges.js @@ -7,7 +7,7 @@ let culori = require('../src/index.js'); */ let ranges = (mode, step = 0.01) => { let conv = culori.converter(mode); - let chs = culori.getModeDefinition(mode).channels; + let chs = culori.getMode(mode).channels; let res = chs.reduce( (acc, ch) => ((acc[ch] = [Infinity, -Infinity]), acc), {} From a22b1e03dd4237b233b1afbaf64752bbb86e4932 Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Fri, 1 Oct 2021 15:25:25 +0300 Subject: [PATCH 26/40] Make culori tree-shakeable, fixes #143. Culori now provides three flavors: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 'culori' — full library, with all color spaces pre-registered; * 'culori/css' — with just the css-color-4-related color spaces; * 'culori/fn' - tree-shakeable collection of functions, no color spaces pre-registered. --- build.js | 16 +- package.json | 4 +- src/difference.js | 17 +- src/index-css.js | 160 +++++++++++++++++ src/index-fn.js | 136 +++++++++++++++ src/index.js | 195 ++++++++++++++++++++- src/packs/core.js | 180 ------------------- src/packs/extra-spaces.js | 55 ------ src/util/regex.js | 2 +- test/api.test.js | 351 ++++++++++++++++++++++++++++++++++++++ 10 files changed, 867 insertions(+), 249 deletions(-) create mode 100644 src/index-css.js create mode 100644 src/index-fn.js delete mode 100644 src/packs/core.js delete mode 100644 src/packs/extra-spaces.js create mode 100644 test/api.test.js diff --git a/build.js b/build.js index 382a49a9..a6e5e79d 100644 --- a/build.js +++ b/build.js @@ -60,15 +60,15 @@ task({ task({ format: 'esm', - entryPoints: ['src/packs/core.js'], - outfile: 'bundled/culori-core.mjs' + entryPoints: ['src/index-css.js'], + outfile: 'bundled/culori-css.mjs' }); task({ format: 'esm', - entryPoints: ['src/packs/core.js'], + entryPoints: ['src/index-css.js'], minify: true, - outfile: 'bundled/culori-core.min.mjs' + outfile: 'bundled/culori-css.min.mjs' }); /* @@ -77,13 +77,13 @@ task({ task({ format: 'iife', - entryPoints: ['src/packs/core.js'], - outfile: 'bundled/culori-core.js' + entryPoints: ['src/index-fn.js'], + outfile: 'bundled/culori-fn.js' }); task({ format: 'iife', - entryPoints: ['src/packs/core.js'], + entryPoints: ['src/index-fn.js'], minify: true, - outfile: 'bundled/culori-core.min.js' + outfile: 'bundled/culori-fn.min.js' }); diff --git a/package.json b/package.json index 9d172b29..f10774c0 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ "exports": { "./require": "./bundled/culori.cjs", ".": "./src/index.js", - "./core": "./src/packs/core.js", - "./extra-spaces": "./src/packs/extra-spaces.js" + "./css": "./src/index-css.js", + "./fn": "./src/index-fn.js" }, "repository": "git@github.com:Evercoder/culori.git", "author": "Dan Burzo ", diff --git a/src/difference.js b/src/difference.js index 85b03eff..198288fb 100644 --- a/src/difference.js +++ b/src/difference.js @@ -278,6 +278,20 @@ const differenceHyab = () => { }; }; +/* + "Measuring perceived color difference using YIQ NTSC + transmission color space in mobile applications" + + by Yuriy Kotsarenko, Fernando Ramos in: + Programación Matemática y Software (2010) + + Available at: + + http://www.progmat.uaem.mx:8080/artVol2Num2/Articulo3Vol2Num2.pdf + */ +const differenceKotsarenkoRamos = () => + differenceEuclidean('yiq', [0.5053, 0.299, 0.1957]); + export { differenceHueChroma, differenceHueSaturation, @@ -287,5 +301,6 @@ export { differenceCie94, differenceCiede2000, differenceCmc, - differenceHyab + differenceHyab, + differenceKotsarenkoRamos }; diff --git a/src/index-css.js b/src/index-css.js new file mode 100644 index 00000000..e2529a05 --- /dev/null +++ b/src/index-css.js @@ -0,0 +1,160 @@ +// Color space definitions +import modeA98 from './a98/definition.js'; +import modeHsl from './hsl/definition.js'; +import modeHsv from './hsv/definition.js'; +import modeHwb from './hwb/definition.js'; +import modeLab from './lab/definition.js'; +import modeLab65 from './lab65/definition.js'; +import modeLch from './lch/definition.js'; +import modeLch65 from './lch65/definition.js'; +import modeLrgb from './lrgb/definition.js'; +import modeP3 from './p3/definition.js'; +import modeProphoto from './prophoto/definition.js'; +import modeRec2020 from './rec2020/definition.js'; +import modeRgb from './rgb/definition.js'; +import modeXyz from './xyz/definition.js'; +import modeXyz65 from './xyz65/definition.js'; +import { useMode } from './modes.js'; + +export { default as converter } from './converter.js'; + +export { + formatHex, + formatHex8, + formatRgb, + formatHsl, + formatCss +} from './formatter.js'; + +export { default as colorsNamed } from './colors/named.js'; +export { default as blend } from './blend.js'; +export { default as random } from './random.js'; + +export { + fixupHueShorter, + fixupHueLonger, + fixupHueIncreasing, + fixupHueDecreasing +} from './fixup/hue.js'; + +export { fixupAlpha } from './fixup/alpha.js'; + +export { + mapper, + mapAlphaMultiply, + mapAlphaDivide, + mapTransferLinear, + mapTransferGamma +} from './map.js'; + +export { average, averageAngle, averageNumber } from './average.js'; + +export { default as round } from './round.js'; +export { + interpolate, + interpolateWith, + interpolateWithPremultipliedAlpha +} from './interpolate/interpolate.js'; + +export { interpolatorLinear } from './interpolate/linear.js'; + +export { interpolatorPiecewise } from './interpolate/piecewise.js'; + +export { + interpolatorSplineBasis, + interpolatorSplineBasisClosed +} from './interpolate/splineBasis.js'; + +export { + interpolatorSplineNatural, + interpolatorSplineNaturalClosed +} from './interpolate/splineNatural.js'; + +export { + interpolatorSplineMonotone, + interpolatorSplineMonotone2, + interpolatorSplineMonotoneClosed +} from './interpolate/splineMonotone.js'; + +export { default as lerp } from './interpolate/lerp.js'; +export { default as samples } from './samples.js'; +export { default as displayable } from './displayable.js'; +export { clampRgb, clampChroma } from './clamp.js'; +export { default as nearest } from './nearest.js'; +export { useMode, getMode } from './modes.js'; +export { default as parse } from './parse.js'; + +export { + differenceEuclidean, + differenceCie76, + differenceCie94, + differenceCiede2000, + differenceCmc, + differenceHyab, + differenceHueSaturation, + differenceHueChroma, + differenceHueNaive, + differenceKotsarenkoRamos +} from './difference.js'; + +export { + filterBrightness, + filterContrast, + filterSepia, + filterInvert, + filterSaturate, + filterGrayscale, + filterHueRotate +} from './filter.js'; + +export { + filterDeficiencyProt, + filterDeficiencyDeuter, + filterDeficiencyTrit +} from './deficiency.js'; + +// Easings +export { default as easingMidpoint } from './easing/midpoint.js'; +export { default as easingSmoothstep } from './easing/smoothstep.js'; +export { default as easingSmootherstep } from './easing/smootherstep.js'; +export { default as easingInOutSine } from './easing/inOutSine.js'; +export { default as easingGamma } from './easing/gamma.js'; + +export { + luminance as wcagLuminance, + contrast as wcagContrast +} from './wcag.js'; + +export { + modeA98, + modeHsl, + modeHsv, + modeHwb, + modeLab, + modeLch, + modeLrgb, + modeP3, + modeProphoto, + modeRec2020, + modeRgb, + modeXyz, + modeLab65, + modeLch65, + modeXyz65 +}; + +export const a98 = useMode(modeA98); +export const hsl = useMode(modeHsl); +export const hsv = useMode(modeHsv); +export const hwb = useMode(modeHwb); +export const lab = useMode(modeLab); +export const lab65 = useMode(modeLab65); +export const lch = useMode(modeLch); +export const lch65 = useMode(modeLch65); +export const lrgb = useMode(modeLrgb); +export const p3 = useMode(modeP3); +export const prophoto = useMode(modeProphoto); +export const rec2020 = useMode(modeRec2020); +export const rgb = useMode(modeRgb); +export const xyz = useMode(modeXyz); +export const xyz65 = useMode(modeXyz65); diff --git a/src/index-fn.js b/src/index-fn.js new file mode 100644 index 00000000..d69d9412 --- /dev/null +++ b/src/index-fn.js @@ -0,0 +1,136 @@ +// Color space definitions +export { default as modeA98 } from './a98/definition.js'; +export { default as modeCubehelix } from './cubehelix/definition.js'; +export { default as modeDlab } from './dlab/definition.js'; +export { default as modeDlch } from './dlch/definition.js'; +export { default as modeHsi } from './hsi/definition.js'; +export { default as modeHsl } from './hsl/definition.js'; +export { default as modeHsv } from './hsv/definition.js'; +export { default as modeHwb } from './hwb/definition.js'; +export { default as modeJab } from './jab/definition.js'; +export { default as modeJch } from './jch/definition.js'; +export { default as modeLab } from './lab/definition.js'; +export { default as modeLab65 } from './lab65/definition.js'; +export { default as modeLch } from './lch/definition.js'; +export { default as modeLch65 } from './lch65/definition.js'; +export { default as modeLchuv } from './lchuv/definition.js'; +export { default as modeLrgb } from './lrgb/definition.js'; +export { default as modeLuv } from './luv/definition.js'; +export { default as modeOklab } from './oklab/definition.js'; +export { default as modeOklch } from './oklch/definition.js'; +export { default as modeP3 } from './p3/definition.js'; +export { default as modeProphoto } from './prophoto/definition.js'; +export { default as modeRec2020 } from './rec2020/definition.js'; +export { default as modeRgb } from './rgb/definition.js'; +export { default as modeXyz } from './xyz/definition.js'; +export { default as modeXyz65 } from './xyz65/definition.js'; +export { default as modeYiq } from './yiq/definition.js'; + +export { default as converter } from './converter.js'; + +export { + formatHex, + formatHex8, + formatRgb, + formatHsl, + formatCss +} from './formatter.js'; + +export { default as colorsNamed } from './colors/named.js'; +export { default as blend } from './blend.js'; +export { default as random } from './random.js'; + +export { + fixupHueShorter, + fixupHueLonger, + fixupHueIncreasing, + fixupHueDecreasing +} from './fixup/hue.js'; + +export { fixupAlpha } from './fixup/alpha.js'; + +export { + mapper, + mapAlphaMultiply, + mapAlphaDivide, + mapTransferLinear, + mapTransferGamma +} from './map.js'; + +export { average, averageAngle, averageNumber } from './average.js'; + +export { default as round } from './round.js'; +export { + interpolate, + interpolateWith, + interpolateWithPremultipliedAlpha +} from './interpolate/interpolate.js'; + +export { interpolatorLinear } from './interpolate/linear.js'; + +export { interpolatorPiecewise } from './interpolate/piecewise.js'; + +export { + interpolatorSplineBasis, + interpolatorSplineBasisClosed +} from './interpolate/splineBasis.js'; + +export { + interpolatorSplineNatural, + interpolatorSplineNaturalClosed +} from './interpolate/splineNatural.js'; + +export { + interpolatorSplineMonotone, + interpolatorSplineMonotone2, + interpolatorSplineMonotoneClosed +} from './interpolate/splineMonotone.js'; + +export { default as lerp } from './interpolate/lerp.js'; +export { default as samples } from './samples.js'; +export { default as displayable } from './displayable.js'; +export { clampRgb, clampChroma } from './clamp.js'; +export { default as nearest } from './nearest.js'; +export { useMode, getMode } from './modes.js'; +export { default as parse } from './parse.js'; + +export { + differenceEuclidean, + differenceCie76, + differenceCie94, + differenceCiede2000, + differenceCmc, + differenceHyab, + differenceHueSaturation, + differenceHueChroma, + differenceHueNaive, + differenceKotsarenkoRamos +} from './difference.js'; + +export { + filterBrightness, + filterContrast, + filterSepia, + filterInvert, + filterSaturate, + filterGrayscale, + filterHueRotate +} from './filter.js'; + +export { + filterDeficiencyProt, + filterDeficiencyDeuter, + filterDeficiencyTrit +} from './deficiency.js'; + +// Easings +export { default as easingMidpoint } from './easing/midpoint.js'; +export { default as easingSmoothstep } from './easing/smoothstep.js'; +export { default as easingSmootherstep } from './easing/smootherstep.js'; +export { default as easingInOutSine } from './easing/inOutSine.js'; +export { default as easingGamma } from './easing/gamma.js'; + +export { + luminance as wcagLuminance, + contrast as wcagContrast +} from './wcag.js'; diff --git a/src/index.js b/src/index.js index e4c6f43e..d2935f0f 100644 --- a/src/index.js +++ b/src/index.js @@ -1,2 +1,193 @@ -export * from './packs/core.js'; -export * from './packs/extra-spaces.js'; +// Color space definitions +import modeA98 from './a98/definition.js'; +import modeCubehelix from './cubehelix/definition.js'; +import modeDlab from './dlab/definition.js'; +import modeDlch from './dlch/definition.js'; +import modeHsi from './hsi/definition.js'; +import modeHsl from './hsl/definition.js'; +import modeHsv from './hsv/definition.js'; +import modeHwb from './hwb/definition.js'; +import modeJab from './jab/definition.js'; +import modeJch from './jch/definition.js'; +import modeLab from './lab/definition.js'; +import modeLab65 from './lab65/definition.js'; +import modeLch from './lch/definition.js'; +import modeLch65 from './lch65/definition.js'; +import modeLchuv from './lchuv/definition.js'; +import modeLrgb from './lrgb/definition.js'; +import modeLuv from './luv/definition.js'; +import modeOklab from './oklab/definition.js'; +import modeOklch from './oklch/definition.js'; +import modeP3 from './p3/definition.js'; +import modeProphoto from './prophoto/definition.js'; +import modeRec2020 from './rec2020/definition.js'; +import modeRgb from './rgb/definition.js'; +import modeXyz from './xyz/definition.js'; +import modeXyz65 from './xyz65/definition.js'; +import modeYiq from './yiq/definition.js'; +import { useMode } from './modes.js'; + +export { default as converter } from './converter.js'; + +export { + formatHex, + formatHex8, + formatRgb, + formatHsl, + formatCss +} from './formatter.js'; + +export { default as colorsNamed } from './colors/named.js'; +export { default as blend } from './blend.js'; +export { default as random } from './random.js'; + +export { + fixupHueShorter, + fixupHueLonger, + fixupHueIncreasing, + fixupHueDecreasing +} from './fixup/hue.js'; + +export { fixupAlpha } from './fixup/alpha.js'; + +export { + mapper, + mapAlphaMultiply, + mapAlphaDivide, + mapTransferLinear, + mapTransferGamma +} from './map.js'; + +export { average, averageAngle, averageNumber } from './average.js'; + +export { default as round } from './round.js'; +export { + interpolate, + interpolateWith, + interpolateWithPremultipliedAlpha +} from './interpolate/interpolate.js'; + +export { interpolatorLinear } from './interpolate/linear.js'; + +export { interpolatorPiecewise } from './interpolate/piecewise.js'; + +export { + interpolatorSplineBasis, + interpolatorSplineBasisClosed +} from './interpolate/splineBasis.js'; + +export { + interpolatorSplineNatural, + interpolatorSplineNaturalClosed +} from './interpolate/splineNatural.js'; + +export { + interpolatorSplineMonotone, + interpolatorSplineMonotone2, + interpolatorSplineMonotoneClosed +} from './interpolate/splineMonotone.js'; + +export { default as lerp } from './interpolate/lerp.js'; +export { default as samples } from './samples.js'; +export { default as displayable } from './displayable.js'; +export { clampRgb, clampChroma } from './clamp.js'; +export { default as nearest } from './nearest.js'; +export { useMode, getMode } from './modes.js'; +export { default as parse } from './parse.js'; + +export { + differenceEuclidean, + differenceCie76, + differenceCie94, + differenceCiede2000, + differenceCmc, + differenceHyab, + differenceHueSaturation, + differenceHueChroma, + differenceHueNaive, + differenceKotsarenkoRamos +} from './difference.js'; + +export { + filterBrightness, + filterContrast, + filterSepia, + filterInvert, + filterSaturate, + filterGrayscale, + filterHueRotate +} from './filter.js'; + +export { + filterDeficiencyProt, + filterDeficiencyDeuter, + filterDeficiencyTrit +} from './deficiency.js'; + +// Easings +export { default as easingMidpoint } from './easing/midpoint.js'; +export { default as easingSmoothstep } from './easing/smoothstep.js'; +export { default as easingSmootherstep } from './easing/smootherstep.js'; +export { default as easingInOutSine } from './easing/inOutSine.js'; +export { default as easingGamma } from './easing/gamma.js'; + +export { + luminance as wcagLuminance, + contrast as wcagContrast +} from './wcag.js'; + +export { + modeA98, + modeCubehelix, + modeDlab, + modeDlch, + modeHsi, + modeHsl, + modeHsv, + modeHwb, + modeJab, + modeJch, + modeLab, + modeLab65, + modeLch, + modeLch65, + modeLchuv, + modeLrgb, + modeLuv, + modeOklab, + modeOklch, + modeP3, + modeProphoto, + modeRec2020, + modeRgb, + modeXyz, + modeXyz65, + modeYiq +}; + +export const a98 = useMode(modeA98); +export const cubehelix = useMode(modeCubehelix); +export const dlab = useMode(modeDlab); +export const dlch = useMode(modeDlch); +export const hsi = useMode(modeHsi); +export const hsl = useMode(modeHsl); +export const hsv = useMode(modeHsv); +export const hwb = useMode(modeHwb); +export const jab = useMode(modeJab); +export const jch = useMode(modeJch); +export const lab = useMode(modeLab); +export const lab65 = useMode(modeLab65); +export const lch = useMode(modeLch); +export const lch65 = useMode(modeLch65); +export const lchuv = useMode(modeLchuv); +export const lrgb = useMode(modeLrgb); +export const luv = useMode(modeLuv); +export const oklab = useMode(modeOklab); +export const oklch = useMode(modeOklch); +export const p3 = useMode(modeP3); +export const prophoto = useMode(modeProphoto); +export const rec2020 = useMode(modeRec2020); +export const rgb = useMode(modeRgb); +export const xyz = useMode(modeXyz); +export const xyz65 = useMode(modeXyz65); +export const yiq = useMode(modeYiq); diff --git a/src/packs/core.js b/src/packs/core.js deleted file mode 100644 index 1951ee9d..00000000 --- a/src/packs/core.js +++ /dev/null @@ -1,180 +0,0 @@ -import rgbDef from '../rgb/definition.js'; -import lrgbDef from '../lrgb/definition.js'; -import a98Def from '../a98/definition.js'; -import p3Def from '../p3/definition.js'; -import prophotoDef from '../prophoto/definition.js'; -import rec2020Def from '../rec2020/definition.js'; -import hslDef from '../hsl/definition.js'; -import hsvDef from '../hsv/definition.js'; -import hwbDef from '../hwb/definition.js'; - -import labDef from '../lab/definition.js'; -import lchDef from '../lch/definition.js'; -import xyzDef from '../xyz/definition.js'; - -import lab65Def from '../lab65/definition.js'; -import lch65Def from '../lch65/definition.js'; -import xyz65Def from '../xyz65/definition.js'; - -import { useMode } from '../modes.js'; -import converter from '../converter.js'; - -useMode(a98Def); -useMode(hslDef); -useMode(hsvDef); -useMode(hwbDef); -useMode(labDef); -useMode(lchDef); -useMode(lrgbDef); -useMode(p3Def); -useMode(prophotoDef); -useMode(rec2020Def); -useMode(rgbDef); -useMode(xyzDef); - -useMode(lab65Def); -useMode(lch65Def); -useMode(xyz65Def); - -let lab65 = converter('lab65'); -let lch65 = converter('lch65'); -let xyz65 = converter('xyz65'); - -let a98 = converter('a98'); -let hsl = converter('hsl'); -let hsv = converter('hsv'); -let hwb = converter('hwb'); -let lab = converter('lab'); -let lch = converter('lch'); -let lrgb = converter('lrgb'); -let p3 = converter('p3'); -let prophoto = converter('prophoto'); -let rec2020 = converter('rec2020'); -let rgb = converter('rgb'); -let xyz = converter('xyz'); - -export { - a98, - converter, - useMode, - hsl, - hsv, - hwb, - lab, - lch, - lrgb, - p3, - prophoto, - rec2020, - rgb, - xyz, - lab65, - lch65, - xyz65 -}; - -export { - formatHex, - formatHex8, - formatRgb, - formatHsl, - formatCss -} from '../formatter.js'; - -export { default as colorsNamed } from '../colors/named.js'; -export { default as blend } from '../blend.js'; -export { default as random } from '../random.js'; - -export { - fixupHueShorter, - fixupHueLonger, - fixupHueIncreasing, - fixupHueDecreasing -} from '../fixup/hue.js'; - -export { fixupAlpha } from '../fixup/alpha.js'; - -export { - mapper, - mapAlphaMultiply, - mapAlphaDivide, - mapTransferLinear, - mapTransferGamma -} from '../map.js'; - -export { average, averageAngle, averageNumber } from '../average.js'; - -export { default as round } from '../round.js'; -export { - interpolate, - interpolateWith, - interpolateWithPremultipliedAlpha -} from '../interpolate/interpolate.js'; - -export { interpolatorLinear } from '../interpolate/linear.js'; - -export { interpolatorPiecewise } from '../interpolate/piecewise.js'; - -export { - interpolatorSplineBasis, - interpolatorSplineBasisClosed -} from '../interpolate/splineBasis.js'; - -export { - interpolatorSplineNatural, - interpolatorSplineNaturalClosed -} from '../interpolate/splineNatural.js'; - -export { - interpolatorSplineMonotone, - interpolatorSplineMonotone2, - interpolatorSplineMonotoneClosed -} from '../interpolate/splineMonotone.js'; - -export { default as lerp } from '../interpolate/lerp.js'; -export { default as samples } from '../samples.js'; -export { default as displayable } from '../displayable.js'; -export { clampRgb, clampChroma } from '../clamp.js'; -export { default as nearest } from '../nearest.js'; -export { getMode } from '../modes.js'; -export { default as parse } from '../parse.js'; - -export { - differenceEuclidean, - differenceCie76, - differenceCie94, - differenceCiede2000, - differenceCmc, - differenceHyab, - differenceHueSaturation, - differenceHueChroma, - differenceHueNaive -} from '../difference.js'; - -export { - filterBrightness, - filterContrast, - filterSepia, - filterInvert, - filterSaturate, - filterGrayscale, - filterHueRotate -} from '../filter.js'; - -export { - filterDeficiencyProt, - filterDeficiencyDeuter, - filterDeficiencyTrit -} from '../deficiency.js'; - -// Easings -export { default as easingMidpoint } from '../easing/midpoint.js'; -export { default as easingSmoothstep } from '../easing/smoothstep.js'; -export { default as easingSmootherstep } from '../easing/smootherstep.js'; -export { default as easingInOutSine } from '../easing/inOutSine.js'; -export { default as easingGamma } from '../easing/gamma.js'; - -export { - luminance as wcagLuminance, - contrast as wcagContrast -} from '../wcag.js'; diff --git a/src/packs/extra-spaces.js b/src/packs/extra-spaces.js deleted file mode 100644 index 5db9582a..00000000 --- a/src/packs/extra-spaces.js +++ /dev/null @@ -1,55 +0,0 @@ -import jabDef from '../jab/definition.js'; -import jchDef from '../jch/definition.js'; -import luvDef from '../luv/definition.js'; -import lchuvDef from '../lchuv/definition.js'; -import cubehelixDef from '../cubehelix/definition.js'; -import dlabDef from '../dlab/definition.js'; -import dlchDef from '../dlch/definition.js'; -import yiqDef from '../yiq/definition.js'; -import oklabDef from '../oklab/definition.js'; -import oklchDef from '../oklch/definition.js'; -import hsiDef from '../hsi/definition.js'; - -import { useMode } from '../modes.js'; -import converter from '../converter.js'; -import { differenceEuclidean } from '../difference.js'; - -useMode(jabDef); -useMode(jchDef); -useMode(cubehelixDef); -useMode(dlabDef); -useMode(dlchDef); -useMode(hsiDef); -useMode(luvDef); -useMode(lchuvDef); -useMode(yiqDef); -useMode(oklabDef); -useMode(oklchDef); - -let jab = converter('jab'); -let jch = converter('jch'); -let cubehelix = converter('cubehelix'); -let dlab = converter('dlab'); -let dlch = converter('dlch'); -let hsi = converter('hsi'); -let yiq = converter('yiq'); -let luv = converter('luv'); -let lchuv = converter('lchuv'); -let oklab = converter('oklab'); -let oklch = converter('oklch'); - -export { jab, jch, cubehelix, dlab, dlch, hsi, lchuv, luv, yiq, oklab, oklch }; - -/* - "Measuring perceived color difference using YIQ NTSC - transmission color space in mobile applications" - - by Yuriy Kotsarenko, Fernando Ramos in: - Programación Matemática y Software (2010) - - Available at: - - http://www.progmat.uaem.mx:8080/artVol2Num2/Articulo3Vol2Num2.pdf - */ -export const differenceKotsarenkoRamos = () => - differenceEuclidean('yiq', [0.5053, 0.299, 0.1957]); diff --git a/src/util/regex.js b/src/util/regex.js index bfa66cad..5a0b243f 100644 --- a/src/util/regex.js +++ b/src/util/regex.js @@ -6,7 +6,7 @@ to be interpolated in the color regexes. */ -const num = (/([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)/ + '').replace(/^\/|\/$/g, ''); // +const num = '([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)'; // const per = `${num}%`; // const num_per = `(?:${num}%|${num})`; // and const hue = `(?:${num}(deg|grad|rad|turn)|${num})`; // hue diff --git a/test/api.test.js b/test/api.test.js new file mode 100644 index 00000000..b64277ae --- /dev/null +++ b/test/api.test.js @@ -0,0 +1,351 @@ +/* + Keep an eye on the API surface of the various bundles + */ +import tape from 'tape'; + +import * as full from '../src/index.js'; +import * as css from '../src/index-css.js'; +import * as fn from '../src/index-fn.js'; + +const API_FULL = [ + 'a98', + 'average', + 'averageAngle', + 'averageNumber', + 'blend', + 'clampChroma', + 'clampRgb', + 'colorsNamed', + 'converter', + 'cubehelix', + 'differenceCie76', + 'differenceCie94', + 'differenceCiede2000', + 'differenceCmc', + 'differenceEuclidean', + 'differenceHueChroma', + 'differenceHueNaive', + 'differenceHueSaturation', + 'differenceHyab', + 'differenceKotsarenkoRamos', + 'displayable', + 'dlab', + 'dlch', + 'easingGamma', + 'easingInOutSine', + 'easingMidpoint', + 'easingSmootherstep', + 'easingSmoothstep', + 'filterBrightness', + 'filterContrast', + 'filterDeficiencyDeuter', + 'filterDeficiencyProt', + 'filterDeficiencyTrit', + 'filterGrayscale', + 'filterHueRotate', + 'filterInvert', + 'filterSaturate', + 'filterSepia', + 'fixupAlpha', + 'fixupHueDecreasing', + 'fixupHueIncreasing', + 'fixupHueLonger', + 'fixupHueShorter', + 'formatCss', + 'formatHex', + 'formatHex8', + 'formatHsl', + 'formatRgb', + 'getMode', + 'hsi', + 'hsl', + 'hsv', + 'hwb', + 'interpolate', + 'interpolateWith', + 'interpolateWithPremultipliedAlpha', + 'interpolatorLinear', + 'interpolatorPiecewise', + 'interpolatorSplineBasis', + 'interpolatorSplineBasisClosed', + 'interpolatorSplineMonotone', + 'interpolatorSplineMonotone2', + 'interpolatorSplineMonotoneClosed', + 'interpolatorSplineNatural', + 'interpolatorSplineNaturalClosed', + 'jab', + 'jch', + 'lab', + 'lab65', + 'lch', + 'lch65', + 'lchuv', + 'lerp', + 'lrgb', + 'luv', + 'mapAlphaDivide', + 'mapAlphaMultiply', + 'mapTransferGamma', + 'mapTransferLinear', + 'mapper', + 'modeA98', + 'modeCubehelix', + 'modeDlab', + 'modeDlch', + 'modeHsi', + 'modeHsl', + 'modeHsv', + 'modeHwb', + 'modeJab', + 'modeJch', + 'modeLab', + 'modeLab65', + 'modeLch', + 'modeLch65', + 'modeLchuv', + 'modeLrgb', + 'modeLuv', + 'modeOklab', + 'modeOklch', + 'modeP3', + 'modeProphoto', + 'modeRec2020', + 'modeRgb', + 'modeXyz', + 'modeXyz65', + 'modeYiq', + 'nearest', + 'oklab', + 'oklch', + 'p3', + 'parse', + 'prophoto', + 'random', + 'rec2020', + 'rgb', + 'round', + 'samples', + 'useMode', + 'wcagContrast', + 'wcagLuminance', + 'xyz', + 'xyz65', + 'yiq' +]; +const API_CSS = [ + 'a98', + 'average', + 'averageAngle', + 'averageNumber', + 'blend', + 'clampChroma', + 'clampRgb', + 'colorsNamed', + 'converter', + 'differenceCie76', + 'differenceCie94', + 'differenceCiede2000', + 'differenceCmc', + 'differenceEuclidean', + 'differenceHueChroma', + 'differenceHueNaive', + 'differenceHueSaturation', + 'differenceHyab', + 'differenceKotsarenkoRamos', + 'displayable', + 'easingGamma', + 'easingInOutSine', + 'easingMidpoint', + 'easingSmootherstep', + 'easingSmoothstep', + 'filterBrightness', + 'filterContrast', + 'filterDeficiencyDeuter', + 'filterDeficiencyProt', + 'filterDeficiencyTrit', + 'filterGrayscale', + 'filterHueRotate', + 'filterInvert', + 'filterSaturate', + 'filterSepia', + 'fixupAlpha', + 'fixupHueDecreasing', + 'fixupHueIncreasing', + 'fixupHueLonger', + 'fixupHueShorter', + 'formatCss', + 'formatHex', + 'formatHex8', + 'formatHsl', + 'formatRgb', + 'getMode', + 'hsl', + 'hsv', + 'hwb', + 'interpolate', + 'interpolateWith', + 'interpolateWithPremultipliedAlpha', + 'interpolatorLinear', + 'interpolatorPiecewise', + 'interpolatorSplineBasis', + 'interpolatorSplineBasisClosed', + 'interpolatorSplineMonotone', + 'interpolatorSplineMonotone2', + 'interpolatorSplineMonotoneClosed', + 'interpolatorSplineNatural', + 'interpolatorSplineNaturalClosed', + 'lab', + 'lab65', + 'lch', + 'lch65', + 'lerp', + 'lrgb', + 'mapAlphaDivide', + 'mapAlphaMultiply', + 'mapTransferGamma', + 'mapTransferLinear', + 'mapper', + 'modeA98', + 'modeHsl', + 'modeHsv', + 'modeHwb', + 'modeLab', + 'modeLab65', + 'modeLch', + 'modeLch65', + 'modeLrgb', + 'modeP3', + 'modeProphoto', + 'modeRec2020', + 'modeRgb', + 'modeXyz', + 'modeXyz65', + 'nearest', + 'p3', + 'parse', + 'prophoto', + 'random', + 'rec2020', + 'rgb', + 'round', + 'samples', + 'useMode', + 'wcagContrast', + 'wcagLuminance', + 'xyz', + 'xyz65' +]; +const API_FN = [ + 'average', + 'averageAngle', + 'averageNumber', + 'blend', + 'clampChroma', + 'clampRgb', + 'colorsNamed', + 'converter', + 'differenceCie76', + 'differenceCie94', + 'differenceCiede2000', + 'differenceCmc', + 'differenceEuclidean', + 'differenceHueChroma', + 'differenceHueNaive', + 'differenceHueSaturation', + 'differenceHyab', + 'differenceKotsarenkoRamos', + 'displayable', + 'easingGamma', + 'easingInOutSine', + 'easingMidpoint', + 'easingSmootherstep', + 'easingSmoothstep', + 'filterBrightness', + 'filterContrast', + 'filterDeficiencyDeuter', + 'filterDeficiencyProt', + 'filterDeficiencyTrit', + 'filterGrayscale', + 'filterHueRotate', + 'filterInvert', + 'filterSaturate', + 'filterSepia', + 'fixupAlpha', + 'fixupHueDecreasing', + 'fixupHueIncreasing', + 'fixupHueLonger', + 'fixupHueShorter', + 'formatCss', + 'formatHex', + 'formatHex8', + 'formatHsl', + 'formatRgb', + 'getMode', + 'interpolate', + 'interpolateWith', + 'interpolateWithPremultipliedAlpha', + 'interpolatorLinear', + 'interpolatorPiecewise', + 'interpolatorSplineBasis', + 'interpolatorSplineBasisClosed', + 'interpolatorSplineMonotone', + 'interpolatorSplineMonotone2', + 'interpolatorSplineMonotoneClosed', + 'interpolatorSplineNatural', + 'interpolatorSplineNaturalClosed', + 'lerp', + 'mapAlphaDivide', + 'mapAlphaMultiply', + 'mapTransferGamma', + 'mapTransferLinear', + 'mapper', + 'modeA98', + 'modeCubehelix', + 'modeDlab', + 'modeDlch', + 'modeHsi', + 'modeHsl', + 'modeHsv', + 'modeHwb', + 'modeJab', + 'modeJch', + 'modeLab', + 'modeLab65', + 'modeLch', + 'modeLch65', + 'modeLchuv', + 'modeLrgb', + 'modeLuv', + 'modeOklab', + 'modeOklch', + 'modeP3', + 'modeProphoto', + 'modeRec2020', + 'modeRgb', + 'modeXyz', + 'modeXyz65', + 'modeYiq', + 'nearest', + 'parse', + 'random', + 'round', + 'samples', + 'useMode', + 'wcagContrast', + 'wcagLuminance' +]; + +tape('culori', t => { + t.deepEqual(Object.keys(full).sort(), API_FULL); + t.end(); +}); + +tape('culori/css', t => { + t.deepEqual(Object.keys(css).sort(), API_CSS); + t.end(); +}); + +tape('culori/fn', t => { + t.deepEqual(Object.keys(fn).sort(), API_FN); + t.end(); +}); From 7c32bebd27d6f9da48f94f71e61ad68e5be618f5 Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Fri, 1 Oct 2021 15:36:18 +0300 Subject: [PATCH 27/40] 1.0.0-alpha.9 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6afbef50..28d18d7e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "culori", - "version": "1.0.0-alpha.8", + "version": "1.0.0-alpha.9", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "culori", - "version": "1.0.0-alpha.8", + "version": "1.0.0-alpha.9", "license": "MIT", "devDependencies": { "@11ty/eleventy": "^0.12.1", diff --git a/package.json b/package.json index f10774c0..6d49690a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "culori", - "version": "1.0.0-alpha.8", + "version": "1.0.0-alpha.9", "type": "module", "main": "bundled/culori.cjs", "module": "bundled/culori-min.mjs", From 7ec79e88b566f907102d31078c4f2be9d088b458 Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Fri, 1 Oct 2021 16:43:39 +0300 Subject: [PATCH 28/40] Docs: add migration guide, update API to ESM --- docs/_includes/partials/header.html | 5 +- docs/api.md | 503 ++++++++++++++++------------ docs/colophon.md | 2 +- docs/guides/guides.json | 3 + docs/guides/index.md | 6 + docs/guides/migration.md | 55 +++ docs/resources.md | 2 +- 7 files changed, 364 insertions(+), 212 deletions(-) create mode 100644 docs/guides/guides.json create mode 100644 docs/guides/index.md create mode 100644 docs/guides/migration.md diff --git a/docs/_includes/partials/header.html b/docs/_includes/partials/header.html index b00fc533..398fef50 100644 --- a/docs/_includes/partials/header.html +++ b/docs/_includes/partials/header.html @@ -13,11 +13,12 @@ diff --git a/docs/api.md b/docs/api.md index 53ee61d0..e1d6234b 100644 --- a/docs/api.md +++ b/docs/api.md @@ -127,41 +127,45 @@ The object needs to have a `mode` property that identifies the color space, and ## Parsing and conversion -# culori.**parse**(_string_) → _color_ or _undefined_ +# **parse**(_string_) → _color_ or _undefined_ [src/parse.js](https://github.com/evercoder/culori/blob/main/src/parse.js) Parses a string and returns the corresponding _color_. The color will be in the matching color space, e.g. RGB for hex strings, HSL for `hsl(…, …, …)` strings, et cetera. If no built-in parsers can match the string, the function will return `undefined`. ```js +import { parse } from 'culori'; + /* A named color */ -culori.parse('red'); +parse('red'); // ⇒ { r: 1, g: 0, b: 0, mode: 'rgb' } /* A hex color */ -culori.parse('#ff0000'); +parse('#ff0000'); // ⇒ { r: 1, g: 0, b: 0, mode: 'rgb' } /* A HSL color */ -culori.parse('hsl(60 50% 10% / 100%)'); +parse('hsl(60 50% 10% / 100%)'); // ⇒ { h: 60, s: 0.5, b: 0.1, alpha: 1, mode: 'hsl' } /* A Lab color */ -culori.parse('lab(100% -50 50)'); +parse('lab(100% -50 50)'); // ⇒ { l: 100, a: -50, b: 50, mode: 'lab' } ``` In most cases, instead of using `parse()` directly (which only operates on strings), you'll want to use a [`converter()`](#converter), which accepts strings and color objects and returns objects in a predictable color space. -# culori.**converter**(_mode = "rgb"_) → _function (color or String)_ +# **converter**(_mode = "rgb"_) → _function (color or String)_ [src/converter.js](https://github.com/evercoder/culori/blob/main/src/converter.js) Returns a _converter_: a function that can convert any color to the _mode_ color space. ```js -let rgb = culori.converter('rgb'); -let lab = culori.converter('lab'); +import { converter } from 'culori'; + +let rgb = converter('rgb'); +let lab = converter('lab'); rgb('#f0f0f0'); // ⇒ { mode: "rgb", r: 0.49…, g: 0.49…, b: 0.49… } @@ -170,88 +174,96 @@ lab('#f0f0f0'); // ⇒ { mode: "lab", l: 94.79…, a: 0, b: 0 } ``` -Converters accept either strings (which will be parsed with `culori.parse` under the hood) or color objects. If the `mode` key is absent from the color object passed to a converter, it's assumed to be in the converter's color space. - -The available modes (color spaces) are listed below. For convenience, each color space built into Culori has a shortcut to its converter. For example, instead of `culori.converter('hsl')`, you can use `culori.hsl`. - -| Mode | Color space | Shortcut | -| ----------- | ----------------------------------------------------------- | ----------------------------- | -| `a98` | A98 RGB color space, compatible with Adobe RGB (1998) | culori.**a98**(_color_) | -| `cubehelix` | Cubehelix color space | culori.**cubehelix**(_color_) | -| `dlab` | DIN99o Lab color space | culori.**dlab**(_color_) | -| `dlch` | DIN99o LCh color space | culori.**dlch**(_color_) | -| `hsi` | HSI color space | culori.**hsi**(_color_) | -| `hsl` | HSL color space | culori.**hsl**(_color_) | -| `hsv` | HSV color space | culori.**hsv**(_color_) | -| `hwb` | HWB color space | culori.**hwb**(_color_) | -| `jab` | Jzazbz color space | culori.**jab**(_color_) | -| `jch` | Jzazbz in cylindrical form | culori.**jch**(_color_) | -| `lab` | CIELAB color space (D50 Illuminant) | culori.**lab**(_color_) | -| `lab65` | CIELAB color space (D65 Illuminant) | culori.**lab65**(_color_) | -| `lch` | CIELCh color space (D50 Illuminant) | culori.**lch**(_color_) | -| `lch65` | CIELCh color space (D65 Illuminant) | culori.**lch65**(_color_) | -| `lchuv` | CIELCHuv color space (D50 Illuminant) | culori.**lchuv**(_color_) | -| `lrgb` | Linear-light sRGB color space | culori.**lrgb**(_color_) | -| `luv` | CIELUV color space (D50 Illuminant) | culori.**luv**(_color_) | -| `oklab` | Oklab color space | culori.**oklab**(_color_) | -| `oklch` | Oklab color space, cylindrical form | culori.**oklch**(_color_) | -| `p3` | Display P3 color space | culori.**p3**(_color_) | -| `prophoto` | ProPhoto RGB color space | culori.**prophoto**(_color_) | -| `rec2020` | Rec. 2020 RGB color space | culori.**rec2020**(_color_) | -| `rgb` | sRGB color space | culori.**rgb**(_color_) | -| `xyz65` | XYZ D65 color space | culori.**xyz65**(_color_) | -| `xyz` | XYZ D50 color space | culori.**xyz**(_color_) | -| `yiq` | YIQ color space | culori.**yiq**(_color_) | +Converters accept either strings (which will be parsed with `parse()` under the hood) or color objects. If the `mode` key is absent from the color object passed to a converter, it's assumed to be in the converter's color space. + +The available modes (color spaces) are listed below. For convenience, each color space built into Culori has a shortcut to its converter. For example, instead of `converter('hsl')`, you can use `hsl`. + +| Mode | Color space | Shortcut | +| ----------- | ----------------------------------------------------------- | ---------------------- | +| `a98` | A98 RGB color space, compatible with Adobe RGB (1998) | **a98**(_color_) | +| `cubehelix` | Cubehelix color space | **cubehelix**(_color_) | +| `dlab` | DIN99o Lab color space | **dlab**(_color_) | +| `dlch` | DIN99o LCh color space | **dlch**(_color_) | +| `hsi` | HSI color space | **hsi**(_color_) | +| `hsl` | HSL color space | **hsl**(_color_) | +| `hsv` | HSV color space | **hsv**(_color_) | +| `hwb` | HWB color space | **hwb**(_color_) | +| `jab` | Jzazbz color space | **jab**(_color_) | +| `jch` | Jzazbz in cylindrical form | **jch**(_color_) | +| `lab` | CIELAB color space (D50 Illuminant) | **lab**(_color_) | +| `lab65` | CIELAB color space (D65 Illuminant) | **lab65**(_color_) | +| `lch` | CIELCh color space (D50 Illuminant) | **lch**(_color_) | +| `lch65` | CIELCh color space (D65 Illuminant) | **lch65**(_color_) | +| `lchuv` | CIELCHuv color space (D50 Illuminant) | **lchuv**(_color_) | +| `lrgb` | Linear-light sRGB color space | **lrgb**(_color_) | +| `luv` | CIELUV color space (D50 Illuminant) | **luv**(_color_) | +| `oklab` | Oklab color space | **oklab**(_color_) | +| `oklch` | Oklab color space, cylindrical form | **oklch**(_color_) | +| `p3` | Display P3 color space | **p3**(_color_) | +| `prophoto` | ProPhoto RGB color space | **prophoto**(_color_) | +| `rec2020` | Rec. 2020 RGB color space | **rec2020**(_color_) | +| `rgb` | sRGB color space | **rgb**(_color_) | +| `xyz65` | XYZ D65 color space | **xyz65**(_color_) | +| `xyz` | XYZ D50 color space | **xyz**(_color_) | +| `yiq` | YIQ color space | **yiq**(_color_) | ## Formatting These methods serialize colors to strings, in various formats. -# culori.**formatHex**(_color_ or _string_) → _string_ +# **formatHex**(_color_ or _string_) → _string_ [src/formatter.js](https://github.com/evercoder/culori/blob/main/src/formatter.js) Returns the hex string for the given color. The color's `alpha` channel is omitted, and the red, green, and blue channels are clamped to the the interval `[0, 255]`, i.e. colors that are not displayable are serialized as if they'd been passed through the `clampRgb` method. ```js -culori.formatHex('red'); +import { formatHex } from 'culori'; + +formatHex('red'); // ⇒ "#ff0000" ``` -# culori.**formatHex8**(_color_ or _string_) → _string_ +# **formatHex8**(_color_ or _string_) → _string_ [src/formatter.js](https://github.com/evercoder/culori/blob/main/src/formatter.js) Returns the 8-character hex string for the given color. The red, green, blue, and alpha channels are clamped to the the interval `[0, 255]`, i.e. colors that are not displayable are serialized as if they'd been passed through the `clampRgb` method. ```js -culori.formatHex8({ mode: 'rgb', r: 1, g: 0, b: 0, alpha: 0.5 }); +import { formatHex8 } from 'culori'; + +formatHex8({ mode: 'rgb', r: 1, g: 0, b: 0, alpha: 0.5 }); // ⇒ "#ff000080" ``` -# culori.**formatRgb**(_color_ or _string_) → _string_ +# **formatRgb**(_color_ or _string_) → _string_ [src/formatter.js](https://github.com/evercoder/culori/blob/main/src/formatter.js) Returns the `rgb(…)` / `rgba(…)` string for the given color. Fully opaque colors will be serialized as `rgb()`, and semi-transparent colors as `rgba()`, in accordance with the [CSSOM standard serialization](https://drafts.csswg.org/cssom/#serialize-a-css-component-value). Like in the case of `formatHex`, the red, green, and blue channels are clamped to the interval `[0, 255]`. ```js -culori.formatRgb('lab(50 0 0 / 25%)'); +import { formatRgb } from 'culori'; + +formatRgb('lab(50 0 0 / 25%)'); // ⇒ "rgba(119, 119, 119, 0.25)" ``` -# culori.**formatHsl**(_color_ or _string_) → _string_ +# **formatHsl**(_color_ or _string_) → _string_ [src/formatter.js](https://github.com/evercoder/culori/blob/main/src/formatter.js) Returns the `hsl(…)` / `hsla(…)` string for the given color. Fully opaque colors will be serialized as `hsl()`, and semi-transparent colors as `hsla()`. All values are rounded to a precision of two digits. The Saturation and Lightness are clamped to the interval `[0%, 100%]`. ```js -culori.formatHsl('lab(50 0 0 / 25%)'); +import { formatHsl } from 'culori'; + +formatHsl('lab(50 0 0 / 25%)'); // ⇒ 'hsla(194.33, 0%, 46.63%, 0.25)' ``` -# culori.**formatCss**(_color_ or _string_) → _string_ +# **formatCss**(_color_ or _string_) → _string_ [src/formatter.js](https://github.com/evercoder/culori/blob/main/src/formatter.js) @@ -266,28 +278,30 @@ An alpha of exactly `1` is omitted from the representation. **Note:** The strings returned by these methods are not widely supported in current browsers and should not be used in CSS as-is. ```js +import { formatCss } from 'culori'; + /* A mode with its own function notation. */ -culori.formatCss({ mode: 'hsl', h: 30, s: 1, l: 0.5, alpha: 0.5 }); +formatCss({ mode: 'hsl', h: 30, s: 1, l: 0.5, alpha: 0.5 }); // ⇒ 'hsl(30 100% 50% / 0.5)' /* A predefined color space. */ -culori.formatCss({ mode: 'p3', r: 0.5, s: 0.25, b: 1, alpha: 1 }); +formatCss({ mode: 'p3', r: 0.5, s: 0.25, b: 1, alpha: 1 }); // ⇒ 'color(display-p3 0.5 0.25 1)' /* sRGB colors. */ -culori.formatCss({ mode: 'rgb', r: 0.5, s: 0.25, b: 1, alpha: 0.25 }); +formatCss({ mode: 'rgb', r: 0.5, s: 0.25, b: 1, alpha: 0.25 }); // ⇒ 'color(srgb 0.5 0.25 1 / 0.25)' /* A custom color space. */ -culori.formatCss({ mode: 'lrgb', r: 0.5, s: 0.25, b: 1, alpha: 0.25 }); +formatCss({ mode: 'lrgb', r: 0.5, s: 0.25, b: 1, alpha: 0.25 }); // ⇒ 'color(--srgb-linear 0.5 0.25 1 / 0.25)' ``` @@ -295,21 +309,23 @@ culori.formatCss({ mode: 'lrgb', r: 0.5, s: 0.25, b: 1, alpha: 0.25 }); Some color spaces (Lab and LCh in particular) allow you to express colors that can't be displayed on-screen. The methods below allow you to identify when that's the case and to produce displayable versions of the colors. -# culori.**displayable**(_color_ or _string_) → _boolean_ +# **displayable**(_color_ or _string_) → _boolean_ [src/displayable.js](https://github.com/evercoder/culori/blob/main/src/displayable.js) Checks whether a particular color fits inside the sRGB gamut, by verifying that the `r`, `g`, and `b` channels are all in the interval `[0, 1]`. ```js -culori.displayable('red'); +import { displayable } from 'culori'; + +displayable('red'); // ⇒ true -culori.displayable('rgb(300 255 255)'); +displayable('rgb(300 255 255)'); // ⇒ false ``` -# culori.**clampRgb**(_color_ or _string_) → _color_ +# **clampRgb**(_color_ or _string_) → _color_ [src/clamp.js](https://github.com/evercoder/culori/blob/main/src/clamp.js) @@ -320,33 +336,41 @@ This is the faster, simpler, way to make a color displayable. It's what browsers Because clamping individual red, green, and blue values independently can alter their proportions in the final color, it often changes the color's hue. ```js +import { clampRgb } from 'culori'; + // RGB clamping: -culori.clampRgb('lab(50% 100 100)'); +clampRgb('lab(50% 100 100)'); // ⇒ { mode: "lab", l: 54.29…, a: 80.81…, b: 69.88… } ``` -# culori.**clampChroma**(_color_ or _string_, _mode = 'lch'_) → _color_ +# **clampChroma**(_color_ or _string_, _mode = 'lch'_) → _color_ [src/clamp.js](https://github.com/evercoder/culori/blob/main/src/clamp.js) Obtains a displayable version of the color by converting it to a temporary color space containing a Chroma channel, then looking for the closest Chroma value that's displayable for the given Lightness and Hue. Compared to `clampRgb`, the function has the advantage of preserving the hue of the original color. The displayable color returned by this function will be converted back to the original color space. ```js -culori.clampChroma('lab(50% 100 100)'); +import { clampChroma } from 'culori'; + +clampChroma('lab(50% 100 100)'); // ⇒ { mode: 'lab', l:50.00…, a: 63.11…, b: 63.11… } ``` By default, the color is converted to `lch` to perform the clamping, but any color space that contains a Chroma dimension can be used by sending an explicit `mode` argument. ```js -culori.clampChroma({ mode: 'oklch', l: 0.5, c: 0.16, h: 180 }, 'oklch'); +import { clampChroma } from 'culori'; + +clampChroma({ mode: 'oklch', l: 0.5, c: 0.16, h: 180 }, 'oklch'); // => { mode: 'oklch', l: 0.5, c: 0.09, h: 180 } ``` In general, chroma clamping is more accurate and computationally simpler when performed in the color's original space, where possible. Here's some sample code that uses the color's own `mode` for color spaces containing a Chroma dimension, and `lch` otherwise: ```js -culori.clampChroma(color, color.c !== undefined ? color.mode : 'lch'); +import { clampChroma } from 'culori'; + +clampChroma(color, color.c !== undefined ? color.mode : 'lch'); ``` If the chroma-finding algorithm fails to find a displayable color (which can happen when not even the achromatic version, with `Chroma = 0`, is displayable), the method falls back to the `clampRgb` method, as a last resort. @@ -361,7 +385,7 @@ In any color space, colors occupy positions given by their values for each chann Above is the path between red and blue in the RGB color space. Going from left to right, we start at red and steadily blend in more and more blue as we progress, until the color is fully blue at destination. This is a _linear interpolation_ between two colors. -# culori.**interpolate**(_colors_, _mode = "rgb"_, _overrides_) +# **interpolate**(_colors_, _mode = "rgb"_, _overrides_) [src/interpolate/interpolate.js](https://github.com/evercoder/culori/blob/main/src/interpolate/interpolate.js) @@ -370,7 +394,9 @@ Returns an _interpolator_ in the _mode_ color space for an array of _colors_. Th The colors in the array can be in any color space, or they can even be strings. ```js -let grays = culori.interpolate(['#fff', '#000']); +import { interpolate } from 'culori'; + +let grays = interpolate(['#fff', '#000']); grays(0.5); // ⇒ { mode: 'rgb', r: 0.5, g: 0.5, b: 0.5 } ``` @@ -378,9 +404,11 @@ grays(0.5); By default, colors in all spaces are interpolated linearly across all channels. You can override the way specific channels are interpolated with the _overrides_ object, the third argument of `interpolate()`. ```js -let my_interpolator = culori.interpolate(['blue', 'red'], 'lch', { +import { interpolate, interpolatorSplineBasis } from 'culori'; + +let my_interpolator = interpolate(['blue', 'red'], 'lch', { // spline instead of linear interpolation: - h: culori.interpolatorSplineBasis + h: interpolatorSplineBasis }); ``` @@ -391,7 +419,9 @@ There are a few interpolation methods available, listed below. Depending on the You can specify positions of color stops to interpolate in the way they're defined in the [CSS Images Module Level 4][css-images-4] specification: ```js -culori.interpolate(['red', ['green', 0.25], 'blue']); +import { interpolate } from 'culori'; + +interpolate(['red', ['green', 0.25], 'blue']); ``` In the image below, you can see the effect of interpolating with evenly-spaced colors (1) vs. positioned colors stops (2): @@ -410,8 +440,10 @@ For omitted (implicit) positions, we apply the rules [from the spec][css-images- You can add easing functions between any two colors in the array: ```js +import { interpolate } from 'culori'; + const easeIn = t => t * t; -culori.interpolate(['red', easeIn, 'green']); +interpolate(['red', easeIn, 'green']); ``` Any function in the _colors_ array will be interpreted as an easing function, which is (for our purposes), a function that takes an argument `t ∈ [0, 1]` and returns a value `v ∈ [0, 1]`. @@ -419,35 +451,40 @@ Any function in the _colors_ array will be interpreted as an easing function, wh To apply the same easing function between all color pairs, instead of individual ones, add the easing as the first element in the array: ```js +import { interpolate } from 'culori'; + const easeIn = t => t * t; // this form: -culori.interpolate([easeIn, 'red', 'green', 'blue']); +interpolate([easeIn, 'red', 'green', 'blue']); // is equivalent to: -culori.interpolate(['red', easeIn, 'green', easeIn, 'blue']); +interpolate(['red', easeIn, 'green', easeIn, 'blue']); ``` The easing function can alternatively be applied the hard way: ```js -culori.interpolate( +import { interpolate, interpolatorPiecewise, lerp } from 'culori'; + +const easeIn = t => t * t; + +interpolate( ['red', 'green', 'blue'], 'rgb', - culori.interpolatorPiecewise((a, b, t) => culori.lerp(a, b)(easeIn(t))) + interpolatorPiecewise((a, b, t) => lerp(a, b)(easeIn(t))) ); ``` This formula can be helpful if you wanted to apply a different easing function per channel: ```js +import { interpolate, interpolatorPiecewise, lerp } from 'culori'; function piecewiseEasing(easingFn) { - return culori.interpolatorPiecewise((a, b, t) => - culori.lerp(a, b)(easingFn(t)) - ); + return interpolatorPiecewise((a, b, t) => lerp(a, b)(easingFn(t))); } -culori.interpolate(['red', 'green', 'blue'], 'rgb', { +interpolate(['red', 'green', 'blue'], 'rgb', { r: piecewiseEasing(easeIn), g: piecewiseEasing(easeOut), b: piecewiseEasing(easeInOut) @@ -466,58 +503,63 @@ Culori comes with [just a few](#built-in-easing-functions) easing functions, but Any number in he _colors_ array will be interpreted as an [interpolation hint](https://drafts.csswg.org/css-images-4/#color-stop-syntax): ```js +import { interpolate } from 'culori'; + // interpolation hint: -culori.interpolate(['red', 0.25, 'green']); +interpolate(['red', 0.25, 'green']); ``` As opposed to how current browsers implement the CSS spec ([see discussion](https://github.com/w3c/csswg-drafts/issues/3931)), interpolation hints _do not_ affect color stop positions in Culori. ### Built-in easing functions -# culori.**easingMidpoint**(_H = 0.5_) +# **easingMidpoint**(_H = 0.5_) [src/easing/midpoint.js](https://github.com/evercoder/culori/blob/main/src/easing/midpoint.js) -[Proposed here][midpoint], the `midpoint` easing function lets you shift the midpoint of a gradient like in tools such as Adobe Photoshop. You can use it with [`culori.interpolate()`](#interpolate) as an alternative to interpolation hints: +[Proposed here][midpoint], the `midpoint` easing function lets you shift the midpoint of a gradient like in tools such as Adobe Photoshop. You can use it with [`interpolate()`](#interpolate) as an alternative to interpolation hints: ```js +import { interpolate, easingMidpoint } from 'culori'; // Explicit midpoint easing: -culori.interpolate(['red', culori.easingMidpoint(0.25), 'blue']); +interpolate(['red', easingMidpoint(0.25), 'blue']); // ...is equivalent to: -culori.interpolate(['red', 0.25, 'blue']); +interpolate(['red', 0.25, 'blue']); ``` -# culori.**easingSmoothstep** +# **easingSmoothstep** [src/easing/smoothstep.js](https://github.com/evercoder/culori/blob/main/src/easing/smoothstep.js) The [Smoothstep][smoothstep] easing function. -# culori.**easingSmootherstep** +# **easingSmootherstep** [src/easing/smootherstep.js](https://github.com/evercoder/culori/blob/main/src/easing/smootherstep.js) Smootherstep is a variant of the [Smoothstep][smoothstep] easing function. -# culori.**easingInOutSine** +# **easingInOutSine** [src/easing/inOutSine.js](https://github.com/evercoder/culori/blob/main/src/easing/inOutSine.js) Sinusoidal in-out easing. Can be used to create, for example, a cosine interpolation [as described by Paul Bourke](paulbourke.net/miscellaneous/interpolation/): ```js -culori.interpolate([culori.easingInOutSine, 'red', 'green', 'blue']); +import { interpolate, easingInOutSine } from 'culori'; +interpolate([easingInOutSine, 'red', 'green', 'blue']); ``` -# culori.**easingGamma**(_γ = 1_) → _function(t)_ +# **easingGamma**(_γ = 1_) → _function(t)_ [src/easing/gamma.js](https://github.com/evercoder/culori/blob/main/src/easing/gamma.js) The [gamma](https://en.wikipedia.org/wiki/Gamma_correction) easing. ```js -culori.samples(5).map(culori.easingGamma(2)); +import { samples, easingGamma } from 'culori'; +samples(5).map(easingGamma(2)); // ⇒ [0, 0.0625, 0.25, 0.5625, 1] ``` @@ -528,7 +570,7 @@ culori.samples(5).map(culori.easingGamma(2));
    - culori.interpolatorLinear + interpolatorLinear
    @@ -536,7 +578,7 @@ culori.samples(5).map(culori.easingGamma(2));
    - culori.interpolatorSplineBasis + interpolatorSplineBasis
    @@ -544,7 +586,7 @@ culori.samples(5).map(culori.easingGamma(2));
    - culori.interpolatorSplineBasisClosed + interpolatorSplineBasisClosed
    @@ -552,7 +594,7 @@ culori.samples(5).map(culori.easingGamma(2));
    - culori.interpolatorSplineNatural + interpolatorSplineNatural
    @@ -560,7 +602,7 @@ culori.samples(5).map(culori.easingGamma(2));
    - culori.interpolatorSplineNaturalClosed + interpolatorSplineNaturalClosed
    @@ -568,7 +610,7 @@ culori.samples(5).map(culori.easingGamma(2));
    - culori.interpolatorSplineMonotone + interpolatorSplineMonotone
    @@ -576,7 +618,7 @@ culori.samples(5).map(culori.easingGamma(2));
    - culori.interpolatorSplineMonotone2 + interpolatorSplineMonotone2
    @@ -584,7 +626,7 @@ culori.samples(5).map(culori.easingGamma(2));
    - culori.interpolatorSplineMonotoneClosed + interpolatorSplineMonotoneClosed
    @@ -592,7 +634,7 @@ culori.samples(5).map(culori.easingGamma(2)); You'll use these methods when you want to override how colors get interpolated in a specific color space, or when defining the default interpolation for custom color spaces. -# culori.**interpolatorLinear**(_values_) +# **interpolatorLinear**(_values_) [src/interpolate/linear.js](https://github.com/evercoder/culori/blob/main/src/interpolate/linear.js) @@ -604,7 +646,7 @@ A linear interpolator for values in a channel. [Basis splines](https://en.wikipedia.org/wiki/B-spline) (also called _B-splines_) are available in the following variants: -# culori.**interpolatorSplineBasis**(_values_) +# **interpolatorSplineBasis**(_values_) [src/interpolate/splineBasis.js](https://github.com/evercoder/culori/blob/main/src/interpolate/splineBasis.js) @@ -612,7 +654,7 @@ A linear interpolator for values in a channel. A basis spline which uses one-sided finite differences for the slopes at the boundaries. -# culori.**interpolatorSplineBasisClosed**(_values_) +# **interpolatorSplineBasisClosed**(_values_) [src/interpolate/splineBasis.js](https://github.com/evercoder/culori/blob/main/src/interpolate/splineBasis.js) @@ -624,7 +666,7 @@ A basis spline which considers the _values_ array to be periodic. [Natural interpolating splines](https://en.wikipedia.org/wiki/Spline_interpolation) are related to basis splines, as explained in [this handout](https://www.math.ucla.edu/~baker/149.1.02w/handouts/dd_splines.pdf) by Kirby A. Baker (sections 4 and 5). -# culori.**interpolatorSplineNatural**(_values_) +# **interpolatorSplineNatural**(_values_) [src/interpolate/splineNatural.js](https://github.com/evercoder/culori/blob/main/src/interpolate/splineNatural.js) @@ -632,7 +674,7 @@ A basis spline which considers the _values_ array to be periodic. A natural spline which uses one-sided finite differences for the slopes at the boundaries. -# culori.**interpolatorSplineNaturalClosed**(_values_) +# **interpolatorSplineNaturalClosed**(_values_) [src/interpolate/splineNatural.js](https://github.com/evercoder/culori/blob/main/src/interpolate/splineNatural.js) @@ -648,7 +690,7 @@ The monotone splines are based on the following paper (via [d3-shape](https://gi The following variants are available: -# culori.**interpolatorSplineMonotone**(_values_) +# **interpolatorSplineMonotone**(_values_) [src/interpolate/splineMonotone.js](https://github.com/evercoder/culori/blob/main/src/interpolate/splineMonotone.js) @@ -656,7 +698,7 @@ The following variants are available: A monotone spline that uses one-sided finite differences to find the slopes at the boundaries. -# culori.**interpolatorSplineMonotone2**(_values_) +# **interpolatorSplineMonotone2**(_values_) [src/interpolate/splineMonotone.js](https://github.com/evercoder/culori/blob/main/src/interpolate/splineMonotone.js) @@ -664,7 +706,7 @@ A monotone spline that uses one-sided finite differences to find the slopes at t A monotone spline for which we derive the slopes at the boundaries by tracing a parabola through the first/last three values. -# culori.**interpolatorSplineMonotoneClosed**(_values_) +# **interpolatorSplineMonotoneClosed**(_values_) [src/interpolate/splineMonotone.js](https://github.com/evercoder/culori/blob/main/src/interpolate/splineMonotone.js) @@ -674,18 +716,20 @@ A monotone spline which considers the _values_ array to be periodic. #### Custom piecewise interpolation -# culori.**interpolatorPiecewise**(_interpolator_) [src/interpolate/piecewise.js](https://github.com/evercoder/culori/blob/main/src/interpolate/piecewise.js) +# **interpolatorPiecewise**(_interpolator_) [src/interpolate/piecewise.js](https://github.com/evercoder/culori/blob/main/src/interpolate/piecewise.js) Use a custom piecewise interpolator function in the form `function (a, b, t) => value`: ```js +import { interpolate, interpolatorPiecewise } from 'culori'; + let linear = (a, b, t) => (1 - t) * a + t * b; -culori.interpolate(['red', 'green'], culori.interpolatorPiecewise(linear)); +interpolate(['red', 'green'], interpolatorPiecewise(linear)); ``` When one of the two values to be interpolated is undefined, it will mirror the defined value: `[undefined, b]` becomes `[b, b]`. If both values are undefined, they are left as-is. -The [`culori.interpolatorLinear()`](#interpolatorLinear) function uses `interpolatorPiecewise()` under the hood. +The [`interpolatorLinear()`](#interpolatorLinear) function uses `interpolatorPiecewise()` under the hood. ### Interpolation Fixup @@ -697,7 +741,7 @@ Hue is a circular value, so there are two directions in which to interpolate bet Adjusted hues will not necessarily be in the `[0, 360)` interval. All fixup methods leave undefined values, and the values immediately following them, unaltered. The names of the methods come from [this discussion](https://github.com/w3c/csswg-drafts/issues/4735). -# culori.**fixupHueShorter**(_values_) → _Array_ +# **fixupHueShorter**(_values_) → _Array_ [src/fixup/hue.js](https://github.com/evercoder/culori/blob/main/src/fixup/hue.js) @@ -728,7 +772,9 @@ export default { To omit the fixup and treat hues as normal numbers, use a custom interpolation on the `h` channel, and overwrite the `fixup` function with an identity function: ```js -let hsl_long = culori.interpolate(['blue', 'red', 'green'], 'hsl', { +import { interpolate } from 'culori'; + +let hsl_long = interpolate(['blue', 'red', 'green'], 'hsl', { h: { fixup: arr => arr } @@ -737,19 +783,19 @@ let hsl_long = culori.interpolate(['blue', 'red', 'green'], 'hsl', { Treating the hues array as-is (with an _identity function_) corresponds to the `specified` fixup method [in the CSSWG issue](https://github.com/w3c/csswg-drafts/issues/4735) mentioned earlier. -# culori.**fixupHueLonger**(_values_) → _Array_ +# **fixupHueLonger**(_values_) → _Array_ [src/fixup/hue.js](https://github.com/evercoder/culori/blob/main/src/fixup/hue.js) Adjusts the hues so that they are interpolated along the _longest path around the hue circle_. -# culori.**fixupHueIncreasing**(_values_) → _Array_ +# **fixupHueIncreasing**(_values_) → _Array_ [src/fixup/hue.js](https://github.com/evercoder/culori/blob/main/src/fixup/hue.js) Adjusts the hues so that every hue is larger than the previous. -# culori.**fixupHueDecreasing**(_values_) → _Array_ +# **fixupHueDecreasing**(_values_) → _Array_ [src/fixup/hue.js](https://github.com/evercoder/culori/blob/main/src/fixup/hue.js) @@ -757,7 +803,7 @@ Adjusts the hues so that every hue is smaller than the previous. #### Alpha fixup -# culori.**fixupAlpha**(_values_) → _Array_ +# **fixupAlpha**(_values_) → _Array_ [src/fixup/alpha.js](https://github.com/evercoder/culori/blob/main/src/fixup/alpha.js) @@ -767,58 +813,63 @@ This is the default method for the alpha channel in all built-in color spaces. ### Evenly-spaced samples -# culori.**samples**(_n = 2_) +# **samples**(_n = 2_) [src/samples.js](https://github.com/evercoder/culori/blob/main/src/samples.js) Returns an array of _n_ equally-spaced samples in the `[0, 1]` range, with `0` and `1` at the ends. ```js -culori.samples(3); +import { samples } from 'culori'; + +samples(3); // ⇒ [0, 0.5, 1] -culori.samples(5); +samples(5); // ⇒ [0, 0.25, 0.5, 0.75, 1] ``` -The samples are useful for [`culori.interpolate()`](#interpolate) to generate color scales: +The samples are useful for [`interpolate()`](#interpolate) to generate color scales: ```js -let grays = culori.interpolate(['#fff', '#000']); -culori.samples(5).map(grays).map(culori.formatHex); +import { samples, interpolate, formatHex } from 'culori'; + +let grays = interpolate(['#fff', '#000']); +samples(5).map(grays).map(formatHex); // ⇒ ["#ffffff", "#bfbfbf", "#808080", "#404040", "#000000"] ``` -As with the [`culori.interpolate()`](#interpolate) method, you can map the samples through an easing function or scale to obtain a different distribution of the samples. +As with the [`interpolate()`](#interpolate) method, you can map the samples through an easing function or scale to obtain a different distribution of the samples. ```js -let culori = require('culori'); -let easing = require('bezier-easing'); +import { samples } from 'culori'; +import easing from 'bezier-easing'; // Bezier easing: let bezier = easing(0, 0, 1, 0.5); -culori.samples(10).map(bezier); +samples(10).map(bezier); // easeInQuad: -culori.samples(10).map(t => t * t); +samples(10).map(t => t * t); ``` ### Lerp -# culori.**lerp**(_a_, _b_, _t_) → _value_ +# **lerp**(_a_, _b_, _t_) → _value_ [src/samples.js](https://github.com/evercoder/culori/blob/main/src/samples.js) Interpolates between the values `a` and `b` at the point `t ∈ [0, 1]`. ```js -culori.lerp(5, 10, 0.5); +import { lerp } from 'culori'; +lerp(5, 10, 0.5); // ⇒ 7.5 ``` ### Mappings -# culori.**mapper**(_fn_, _mode = "rgb"_) → _function (color | string)_ +# **mapper**(_fn_, _mode = "rgb"_) → _function (color | string)_ [src/map.js](https://github.com/evercoder/culori/blob/main/src/map.js) @@ -837,12 +888,14 @@ where: - `value` is the current value; - `channel` is the current channel; - `color` is a reference to the entire color object; -- `mode` is forwarded from the call to `culori.mapper`. +- `mode` is forwarded from the call to `mapper`. Here's the implementation of alpha premultiplication: ```js -const multiplyAlpha = culori.mapper((val, ch, color) => { +import { mapper } from 'culori'; + +const multiplyAlpha = mapper((val, ch, color) => { if (ch !== 'alpha') { return (val || 0) / (color.alpha !== undefined ? color.alpha : 1); } @@ -859,29 +912,33 @@ Returning `undefined` or `NaN` from the function will omit that channel from the #### Built-in mappings -# culori.**mapAlphaMultiply** +# **mapAlphaMultiply** [src/map.js](https://github.com/evercoder/culori/blob/main/src/map.js) Multiplies the color's alpha value into all its other channels: ```js -let multiplyAlpha = culori.mapper(culori.mapAlphaMultiply, 'rgb'); +import { mapper, mapAlphaMultiply } from 'culori'; + +let multiplyAlpha = mapper(mapAlphaMultiply, 'rgb'); multiplyAlpha({ r: 1, g: 0.6, b: 0.4, a: 0.5 }); // ⇒ { mode: 'rgb', r: 0.5, g: 0.3, b: 0.2, a: 0.5 } ``` Any `undefined` channel value will be considered to be `0` (zero), to enable alpha-premultiplied interpolation with achromatic colors in hue-based color spaces (HSL, LCh, etc.). -# culori.**mapAlphaDivide** +# **mapAlphaDivide** [src/map.js](https://github.com/evercoder/culori/blob/main/src/map.js) -Divides a color's other channels by its alpha value. It's the opposite of `culori.mapAlphaMultiply`, and is used in interpolation with alpha premultiplication: +Divides a color's other channels by its alpha value. It's the opposite of `mapAlphaMultiply`, and is used in interpolation with alpha premultiplication: ```js -let multiplyAlpha = culori.mapper(culori.mapAlphaMultiply, 'rgb'); -let divideAlpha = culori.mapper(culori.mapAlphaDivide, 'rgb'); +import { mapper, mapAlphaMultiply, mapAlphaDivide } from 'culori'; + +let multiplyAlpha = mapper(mapAlphaMultiply, 'rgb'); +let divideAlpha = mapper(mapAlphaDivide, 'rgb'); divideAlpha(multiplyAlpha({ r: 1, g: 0.6, b: 0.4, a: 0.5 })); // ⇒ { mode: 'rgb', r: 1, g: 0.6, b: 0.4, a: 0.5 } @@ -889,26 +946,28 @@ divideAlpha(multiplyAlpha({ r: 1, g: 0.6, b: 0.4, a: 0.5 })); Any `undefined` channel value will be considered to be `0` (zero), to enable alpha-premultiplied interpolation with achromatic colors in hue-based color spaces (HSL, LCh, etc.). -# culori.**mapTransferLinear**(_slope = 1_, _intercept = 0_) +# **mapTransferLinear**(_slope = 1_, _intercept = 0_) [src/map.js](https://github.com/evercoder/culori/blob/main/src/map.js) -# culori.**mapTransferGamma**(_amplitude = 1_, _exponent = 1_, _offset = 0_) +# **mapTransferGamma**(_amplitude = 1_, _exponent = 1_, _offset = 0_) [src/map.js](https://github.com/evercoder/culori/blob/main/src/map.js) #### Interpolating with mappings -# culori.**interpolateWith**(_premap_, _postmap_) +# **interpolateWith**(_premap_, _postmap_) [src/interpolate.js](https://github.com/evercoder/culori/blob/main/src/interpolate.js) Adds a _pre-mapping_ and a _post-mapping_ to an interpolation, to enable things like alpha premultiplication: ```js -let interpolateWithAlphaPremult = culori.interpolateWith( - culori.mapAlphaMultiply, - culori.mapAlphaDivide +import { interpolateWith, mapAlphaMultiply, mapAlphaDivide } from 'culori'; + +let interpolateWithAlphaPremult = interpolateWith( + mapAlphaMultiply, + mapAlphaDivide ); interpolateWithAlphaPremult(['red', 'transparent', 'blue'])(0.25); @@ -917,6 +976,8 @@ interpolateWithAlphaPremult(['red', 'transparent', 'blue'])(0.25); To chain more than one mapping: ```js +import { interpolateWith, mapAlphaMultiply, mapAlphaDivide } from 'culori'; + const mapChromaMultiply = (v, ch, c, mode) => { // ... }; @@ -925,28 +986,29 @@ const mapChromaDivide = (v, ch, c, mode) => { // ... }; -let interpolateWithAlphaChromaPremult = culori.interpolateWith( - (...args) => mapChromaMultiply(culori.mapAlphaMultiply(...args)), - (...args) => culori.mapAlphaDivide(mapChromaDivide(...args)) +let interpolateWithAlphaChromaPremult = interpolateWith( + (...args) => mapChromaMultiply(mapAlphaMultiply(...args)), + (...args) => mapAlphaDivide(mapChromaDivide(...args)) ); interpolateWithAlphaPremult(['red', 'transparent', 'blue'])(0.25); ``` -# culori.**interpolateWithPremultipliedAlpha**(_colors_, _mode = "rgb"_, _overrides_) +# **interpolateWithPremultipliedAlpha**(_colors_, _mode = "rgb"_, _overrides_) [src/interpolate.js](https://github.com/evercoder/culori/blob/main/src/interpolate.js) -Takes the same arguments as [`culori.interpolate()`](#interpolate), but applies [alpha premultiplication](https://drafts.csswg.org/css-images-4/#premultiplied). +Takes the same arguments as [`interpolate()`](#interpolate), but applies [alpha premultiplication](https://drafts.csswg.org/css-images-4/#premultiplied). ```js +import { interpolate, interpolateWithPremultipliedAlpha } from 'culori'; let colors = ['red', 'transparent', 'blue']; // alpha ignored for the R/G/B channels: -culori.interpolate(colors, 'rgb'); +interpolate(colors, 'rgb'); // alpha premultiplied into the R/G/B channels: -culori.interpolateWithPremultipliedAlpha(colors, 'rgb'); +interpolateWithPremultipliedAlpha(colors, 'rgb'); ``` ## Color Difference @@ -955,7 +1017,7 @@ These methods are concerned to finding the [distance between two colors](https:/ ### Euclidean distance -# culori.**differenceEuclidean**(_mode = 'rgb'_, _weights = [1, 1, 1, 0]_) +# **differenceEuclidean**(_mode = 'rgb'_, _weights = [1, 1, 1, 0]_) [src/difference.js](https://github.com/evercoder/culori/blob/main/src/difference.js) @@ -967,55 +1029,55 @@ The default weights `[1, 1, 1, 0]` mean that the _alpha_, which is the fourth ch In cylindrical spaces, the hue is factored into the Euclidean distance in a variety of ways. The functions below are used internally: -# culori.**differenceHueChroma**(_colorA_, _colorB_) +# **differenceHueChroma**(_colorA_, _colorB_) [src/difference.js](https://github.com/evercoder/culori/blob/main/src/difference.js) Computes the hue contribution as the geometric mean of chord lengths belonging to the chromas of the two colors. This is the handling of hue in cylindrical forms of CIE-related color spaces: `lch`, `lchuv`, `dlch`, `oklch`, `jch`. -# culori.**differenceHueSaturation**(_colorA_, _colorB_) +# **differenceHueSaturation**(_colorA_, _colorB_) [src/difference.js](https://github.com/evercoder/culori/blob/main/src/difference.js) Computes the hue contribution as the geometric mean of chord lengths belonging to the saturations of the two colors. This is the handling of hue in the HSL / HSV / HSI family of color spaces. -# culori.**differenceHueNaive**(_colorA_, _colorB_) +# **differenceHueNaive**(_colorA_, _colorB_) [src/difference.js](https://github.com/evercoder/culori/blob/main/src/difference.js) -For remaining color spaces (HWB), we consider hues numbers, but apply a _shortest path around the hue circle_ (analogous to [`culori.fixupHueShorter`](#fixupHueShorter)). If you insist on using Euclidean distances on these spaces, you can use the `weights` to control the contribution of the hue difference towards the total difference. +For remaining color spaces (HWB), we consider hues numbers, but apply a _shortest path around the hue circle_ (analogous to [`fixupHueShorter`](#fixupHueShorter)). If you insist on using Euclidean distances on these spaces, you can use the `weights` to control the contribution of the hue difference towards the total difference. ### CIE color difference formulas All these color difference functions operate on the `lab65` color space. -# culori.**differenceCie76**() +# **differenceCie76**() [src/difference.js](https://github.com/evercoder/culori/blob/main/src/difference.js) -Computes the [CIE76][cie76] ΔE\*ab color difference between the colors _a_ and _b_. The function is identical to [`culori.differenceEuclidean('lab65')`](#differenceEuclidean). +Computes the [CIE76][cie76] ΔE\*ab color difference between the colors _a_ and _b_. The function is identical to [`differenceEuclidean('lab65')`](#differenceEuclidean). -# culori.**differenceCie94**(_kL = 1_, _K1 = 0.045_, _K2 = 0.015_) +# **differenceCie94**(_kL = 1_, _K1 = 0.045_, _K2 = 0.015_) [src/difference.js](https://github.com/evercoder/culori/blob/main/src/difference.js) Computes the [CIE94][cie94] ΔE\*94 color difference between the colors _a_ and _b_. -# culori.**differenceCiede2000**(_Kl = 1_, _Kc = 1_, _Kh = 1_) +# **differenceCiede2000**(_Kl = 1_, _Kc = 1_, _Kh = 1_) [src/difference.js](https://github.com/evercoder/culori/blob/main/src/difference.js) Computes the [CIEDE2000][ciede2000] ΔE\*00 color difference between the colors _a_ and _b_ as implemented by [G. Sharma](http://www2.ece.rochester.edu/~gsharma/ciede2000/). -# culori.**differenceCmc**() +# **differenceCmc**() [src/difference.js](https://github.com/evercoder/culori/blob/main/src/difference.js) Computes the [CMC l:c (1984)][cmc] ΔE\*CMC color difference between the colors _a_ and _b_. -ΔE\*CMC is not considered a metric since it's not symmetrical, that is the distance from _a_ to _b_ is not always equal to the distance from _b_ to _a_. Therefore it cannot be reliably used with [`culori.nearest()`](#nearest). +ΔE\*CMC is not considered a metric since it's not symmetrical, that is the distance from _a_ to _b_ is not always equal to the distance from _b_ to _a_. Therefore it cannot be reliably used with [`nearest()`](#nearest). -# culori.**differenceHyab**() +# **differenceHyab**() [src/difference.js](https://github.com/evercoder/culori/blob/main/src/difference.js) @@ -1027,13 +1089,13 @@ The HyAB formula combines the Euclidean and [city block](https://en.wikipedia.or ### Other difference formulas -# culori.**differenceDin99o**() +# **differenceDin99o**() [src/difference.js](https://github.com/evercoder/culori/blob/main/src/difference.js) Computes the [DIN99o][din99ode] ΔE\*99o color difference between the colors _a_ and _b_. The computation is done in the `dlab` color space. -# culori.**differenceKotsarenkoRamos**() +# **differenceKotsarenkoRamos**() [src/difference.js](https://github.com/evercoder/culori/blob/main/src/difference.js) @@ -1041,7 +1103,7 @@ Computes the [Kotsarenko/Ramos][kotsarekno-ramos] color difference between the c ### Nearest color(s) -# culori.**nearest**(_colors_, _metric = differenceEuclidean()_, _accessor = identity_) → _function(color, n = 1, τ = Infinity)_ +# **nearest**(_colors_, _metric = differenceEuclidean()_, _accessor = identity_) → _function(color, n = 1, τ = Infinity)_ [src/nearest.js](https://github.com/evercoder/culori/blob/main/src/nearest.js) @@ -1051,9 +1113,10 @@ Takes a _colors_ array and a _metric_ color difference formula, and returns a fu /* Example: get three CSS named colors closest to any color */ +import { colorsNamed, nearest, differenceCiede2000 } from 'culori'; -let colors = Object.keys(culori.colorsNamed); -let nearestNamedColors = culori.nearest(colors, culori.differenceCiede2000()); +let colors = Object.keys(colorsNamed); +let nearestNamedColors = nearest(colors, differenceCiede2000()); nearestNamedColors('lch(50% 70 60)', 3); // => ["chocolate", "sienna", "peru"] @@ -1064,6 +1127,8 @@ By default, _colors_ needs to be an array of color values. If your array contain The example below shows a common data structure for a color palette: an object whose keys are the names and whose values are their associated color representations. ```js +import { nearest, differenceEuclidean } from 'culori'; + /* Example: get the closest color from a palette */ @@ -1077,9 +1142,9 @@ let palette = { let names = Object.keys(palette); -let nearestColors = culori.nearest( +let nearestColors = nearest( names, - culori.differenceEuclidean(), + differenceEuclidean(), name => palette[name] ); @@ -1091,7 +1156,7 @@ nearestColors('red', 1); Culori makes available the separable blend modes defined in the W3C [Compositing and Blending Level 2](https://drafts.fxtf.org/compositing-2/) specification. -# culori.**blend**(_colors_, _type = 'normal'_, _mode = 'rgb'_) → _color_ +# **blend**(_colors_, _type = 'normal'_, _mode = 'rgb'_) → _color_ [src/blend.js](https://github.com/evercoder/culori/blob/main/src/blend.js) @@ -1101,7 +1166,9 @@ A separable blend mode is a simple formula that gets applied to each channel in An example of blending three colors: ```js -culori.blend( +import { blend } from 'culori'; + +blend( ['rgba(255, 0, 0, 0.5)', 'rgba(0, 255, 0, 0.5)', 'rgba(0, 0, 255, 0.5)'], 'screen' ); @@ -1111,7 +1178,9 @@ culori.blend( In addition to strings, the _type_ parameter supports a _function (b, s) → v_ that takes the values of the _backdrop_ and _source_ color to return the blended value. This allows you to write your own (separable) blending functions. For example, an _average_ blending mode: ```js -culori.blend(['red', 'green'], function average(b, s) { +import { blend } from 'culori'; + +blend(['red', 'green'], function average(b, s) { return (b + s) / 2; }); ``` @@ -1120,7 +1189,7 @@ The non-separable blend modes — `color`, `hue`, `saturation`, and `lightness` ## Average color -# culori.**average**(_colors_, _mode = 'rgb'_, _overrides_) +# **average**(_colors_, _mode = 'rgb'_, _overrides_) [src/average.js](https://github.com/evercoder/culori/blob/main/src/average.js) @@ -1129,17 +1198,19 @@ Returns the average color of the _colors_ array, in the color space specified by Colors with undefined values on a channel don't participate in the average for that channel. ```js -culori.average(['salmon', 'tomato'], 'lab'); +import { average } from 'culori'; + +average(['salmon', 'tomato'], 'lab'); // ⇒ { 'mode': 'lab', l: 65.41…, a: 53.00…, b: 39.01… } ``` -# culori.**averageNumber**(_values_) +# **averageNumber**(_values_) [src/average.js](https://github.com/evercoder/culori/blob/main/src/average.js) The arithmetic mean of values in the _values_ array. -# culori.**averageAngle**(_values_) +# **averageAngle**(_values_) [src/average.js](https://github.com/evercoder/culori/blob/main/src/average.js) @@ -1147,7 +1218,7 @@ The function used by default to average hue values in all built-in color spaces, ## Random colors -# culori.**random**(_mode = 'rgb'_, _constraints = {}_) +# **random**(_mode = 'rgb'_, _constraints = {}_) [src/random.js](https://github.com/evercoder/culori/blob/main/src/random.js) @@ -1156,7 +1227,9 @@ Obtain a random color from a particular color space, with optional constraints. Basic usage: ```js -culori.random(); +import { random } from 'culori'; + +random(); // ⇒ { mode: 'rgb', r: 0.75, g: 0.12, b: 0.99 } ``` @@ -1167,7 +1240,9 @@ Random colors are, by definition, all over the color space and not all of them w For more control on how the colors are generated, you can specify constraints for each individual channel in the color space. Constraints can be either a _constant number_ or an _interval_ from where to pick the channel value: ```js -culori.random('hsv', { +import { random } from 'culori'; + +random('hsv', { h: 120, // number s: [0.25, 0.75] // interval }); @@ -1177,10 +1252,12 @@ culori.random('hsv', { The _alpha_ channel is excluded by default. To obtain colors with random alpha values, include a constraint for `alpha`: ```js -culori.random('lrgb'); +import { random } from 'culori'; + +random('lrgb'); // ⇒ { mode: 'lrgb', r: 0.74…, g: 0.15…, b: 0.34… } -culori.random('lrgb', { alpha: [0, 1] }); +random('lrgb', { alpha: [0, 1] }); // ⇒ { mode: 'lrgb', r: 0.33…, g: 0.72…, b: 0.04…, alpha: 0.12… } ``` @@ -1188,31 +1265,35 @@ culori.random('lrgb', { alpha: [0, 1] }); The value for any channel in the color space for which there are no constraints will be picked from the entire range of that channel. However, some color spaces, such as CIELAB or CIELCH, don't have explicit ranges for certain channels; for these, some approximate ranges [have been pre-computed](https://github.com/evercoder/culori/blob/main/tools/ranges.js) as the limits of the displayable sRGB gamut. -Even with these ranges in place, a combination of channel values may not be displayable. Check if that's the case with [`culori.displayable()`](#displayable), and pass the color through a [`culori.clamp*`](#clampRgb) function to obtain a displayable version. +Even with these ranges in place, a combination of channel values may not be displayable. Check if that's the case with [`displayable()`](#displayable), and pass the color through a [`clamp*`](#clampRgb) function to obtain a displayable version. ## WCAG utilities A couple of utility functions based on the [Web Content Acccessibility Guidelines 2.0 specification](https://www.w3.org/TR/WCAG20/). -# culori.**wcagLuminance**(_color_) +# **wcagLuminance**(_color_) [src/wcag.js](https://github.com/evercoder/culori/blob/main/src/wcag.js) Computes the [relative luminance](https://www.w3.org/TR/WCAG20/#relativeluminancedef) of a color. ```js -culori.wcagLuminance('red'); +import { wcagLuminance } from 'culori'; + +wcagLuminance('red'); // ⇒ 0.2126 ``` -# culori.**wcagContrast**(_colorA_, _colorB_) +# **wcagContrast**(_colorA_, _colorB_) [src/wcag.js](https://github.com/evercoder/culori/blob/main/src/wcag.js) Computes the [contrast ratio](https://www.w3.org/TR/WCAG20/#contrast-ratiodef) between two colors. ```js -culori.wcagContrast('red', 'black'); +import { wcagContrast } from 'culori'; + +wcagContrast('red', 'black'); // ⇒ 5.252 ``` @@ -1228,60 +1309,63 @@ The _amount_ parameter is usually in the `[0, 1]` interval, but may go above `1` The resulting color is returned in the color space of the original color. -# culori.**filterBrightness**(_amount = 1_, _mode = 'rgb'_) +# **filterBrightness**(_amount = 1_, _mode = 'rgb'_) [src/filter.js](https://github.com/evercoder/culori/blob/main/src/filter.js) The [`brightness()`](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/brightness) CSS filter. An _amount_ of `1` leaves the color unchanged. Smaller values darken the color (with `0` being fully black), while larger values brighten it. ```js -let brighten = culori.filterBrightness(2, 'lrgb'); +import { filterBrightness } from 'culori'; + +let brighten = filterBrightness(2, 'lrgb'); brighten('salmon'); // ⇒ { mode: 'rgb', r: 1.32…, g: 0.68…, b: 0.61… } ``` -# culori.**filterContrast**(_amount = 1_, _mode = 'rgb'_) +# **filterContrast**(_amount = 1_, _mode = 'rgb'_) [src/filter.js](https://github.com/evercoder/culori/blob/main/src/filter.js) The [`contrast()`](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/contrast) filter. An _amount_ of `1` leaves the color unchanged. Smaller values decrease the contrast (with `0` being fully gray), while larger values increase it. -# culori.**filterSepia**(_amount = 1_, _mode = 'rgb'_) +# **filterSepia**(_amount = 1_, _mode = 'rgb'_) [src/filter.js](https://github.com/evercoder/culori/blob/main/src/filter.js) The [`sepia()`](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/sepia) filter. An _amount_ of `0` leaves the color unchanged, and `1` applies the sepia effect fully. -# culori.**filterGrayscale**(_amount = 1_, _mode = 'rgb'_) +# **filterGrayscale**(_amount = 1_, _mode = 'rgb'_) [src/filter.js](https://github.com/evercoder/culori/blob/main/src/filter.js) The [`grayscale()`](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/grayscale) filter. An _amount_ of `0` leaves the color unchanged, and `1` makes the color fully achromatic. -# culori.**filterSaturate**(_amount = 1_, _mode = 'rgb'_) +# **filterSaturate**(_amount = 1_, _mode = 'rgb'_) [src/filter.js](https://github.com/evercoder/culori/blob/main/src/filter.js) The [`saturate()`](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/saturate) filter. An _amount_ of `1` leaves the color unchanged. Smaller values desaturate the color (with `0` being fully achromatic), while larger values saturate it. -# culori.**filterInvert**(_amount = 1_, _mode = 'rgb'_) +# **filterInvert**(_amount = 1_, _mode = 'rgb'_) [src/filter.js](https://github.com/evercoder/culori/blob/main/src/filter.js) The [`invert()`](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/invert) filter. An _amount_ of `0` leaves the color unchanged, and `1` makes the color fully inverted. -# culori.**filterHueRotate**(_degrees = 0_, _mode = 'rgb'_) +# **filterHueRotate**(_degrees = 0_, _mode = 'rgb'_) [src/filter.js](https://github.com/evercoder/culori/blob/main/src/filter.js) The [`hue-rotate()`](https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/hue-rotate) filter. ```js -culori - .samples(5) - .map(culori.interpolate(['red', 'green', 'blue'])) - .map(culori.filterSepia(0.5)) - .map(culori.formatHex); +import { samples, interpolate, filterSepia, formatHex } from 'culori'; + +samples(5) + .map(interpolate(['red', 'green', 'blue'])) + .map(filterSepia(0.5)) + .map(formatHex); // ⇒ ["#751800", "#664200", "#576c00", "#1a3e82", "#0010ff"]; ``` @@ -1292,19 +1376,19 @@ Some of the effects may be obtained more straightforwardly with simple calculati Simulate how a color may be perceived by people with color vision deficiencies (CVD). -# culori.**filterDeficiencyProt**(_severity = 1_) → _function (color)_ +# **filterDeficiencyProt**(_severity = 1_) → _function (color)_ [src/deficiency.js](https://github.com/evercoder/culori/blob/main/src/deficiency.js) Simulate protanomaly and protanopia. The `severity` parameter is in the interval `[0, 1]`, where `0` corresponds to normal vision and `1` (the default value) corresponds to protanopia. -# culori.**filterDeficiencyDeuter**(_severity = 1_) → _function (color)_ +# **filterDeficiencyDeuter**(_severity = 1_) → _function (color)_ [src/deficiency.js](https://github.com/evercoder/culori/blob/main/src/deficiency.js) Simulate deuteranomaly and deuteranopia. The `severity` parameter is in the interval `[0, 1]`, where `0` corresponds to normal vision and `1` (the default value) corresponds to deuteranopia. -# culori.**filterDeficiencyTrit**(_severity = 1_) → _function (color)_ +# **filterDeficiencyTrit**(_severity = 1_) → _function (color)_ [src/deficiency.js](https://github.com/evercoder/culori/blob/main/src/deficiency.js) @@ -1313,11 +1397,12 @@ Simuate tritanomaly and tritanopia. The `severity` parameter is in the interval Examples: ```js +import { interpolate, filterDeficiencyProt, formatHex } from 'culori'; culori .samples(5) - .map(culori.interpolate(['red', 'green', 'blue'])) - .map(culori.filterDeficiencyProt(0.5)) - .map(culori.formatHex); + .map(interpolate(['red', 'green', 'blue'])) + .map(filterDeficiencyProt(0.5)) + .map(formatHex); // ⇒ ["#751800", "#664200", "#576c00", "#1a3e82", "#0010ff"]; ``` @@ -1328,27 +1413,29 @@ Based on the work of Machado, Oliveira and Fernandes (2009), using [precomputed ## Miscellaneous -# culori.**colorsNamed** +# **colorsNamed** [src/colors/named.js](https://github.com/evercoder/culori/blob/main/src/colors/named.js) An object whose keys are all the CSS named colors. -# culori.**round**(_n = 8_) +# **round**(_n = 8_) [src/round.js](https://github.com/evercoder/culori/blob/main/src/round.js) Returns a _rounder_: a function with which to round numbers to at most _n_ digits of precision. ```js -let approx = culori.round(4); +import { round } from 'culori'; + +let approx = round(4); approx(0.38393993); // ⇒ 0.3839 ``` ## Extending culori -# culori.**useMode**(_definition_) → _function_. +# **useMode**(_definition_) → _function_. [src/modes.js](https://github.com/evercoder/culori/blob/main/src/modes.js) @@ -1367,7 +1454,7 @@ const hsl = useMode({ hsl('hsl(50 100% 100% / 100)'); ``` -# culori.**getMode**(_mode_) +# **getMode**(_mode_) [src/modes.js](https://github.com/evercoder/culori/blob/main/src/modes.js) @@ -1427,7 +1514,7 @@ All built-in color spaces follow these conventions in regards to the `channels` - there are four channels in the color space; - the fourth channel is always `alpha`. -This makes sure [`culori.differenceEuclidean()`](#differenceEuclidean) works as expected, but there may be more hidden assumptions in the codebase. +This makes sure [`differenceEuclidean()`](#differenceEuclidean) works as expected, but there may be more hidden assumptions in the codebase. Here's a sample definition for the HSL color space: diff --git a/docs/colophon.md b/docs/colophon.md index c12a048e..8aa2bdcf 100644 --- a/docs/colophon.md +++ b/docs/colophon.md @@ -1,7 +1,7 @@ --- layout: layouts/default title: Colophon -menu-order: 5 +menu-order: 6 --- Authored by [Dan Burzo](http://danburzo.ro), and released under the MIT license. diff --git a/docs/guides/guides.json b/docs/guides/guides.json new file mode 100644 index 00000000..7a518dca --- /dev/null +++ b/docs/guides/guides.json @@ -0,0 +1,3 @@ +{ + "layout": "layouts/default" +} diff --git a/docs/guides/index.md b/docs/guides/index.md new file mode 100644 index 00000000..53563041 --- /dev/null +++ b/docs/guides/index.md @@ -0,0 +1,6 @@ +--- +title: 'Guides' +menu-order: 4 +--- + +- [Migration guide](./migration) diff --git a/docs/guides/migration.md b/docs/guides/migration.md new file mode 100644 index 00000000..fabdd003 --- /dev/null +++ b/docs/guides/migration.md @@ -0,0 +1,55 @@ +--- +title: 'Migration guide' +--- + +## Migrating from version 0.x to 1.0 + +### Using the library + +Starting with version 1.0, Culori will be published to npm as an ES Module (ESM) package. That means that if you use the library via npm (with `npm install culori`), you will need to be running **Node.js version 12 or later**. + +If you've switched your own project to ESM (by using `type: module` in your `package.json` file), you can import the library as usual: + +```js +import * as culori from 'culori'; +``` + +If you're not ready to switch to native ESM, we also provide a CommonJS export that can be used with `require()`: + +```js +const culori = require('culori/require'); +``` + +### Removed methods + +The `clamp(method)` function has been removed. Use `clampRgb()` and `clampChroma()` instead. + +The `formatter(method)` function has been removed. Use `formatHex()`, `formatRgb()` etc. instead. + +The following undocumented interpolation functions have been removed (note the `interpolate` prefix): + +- `interpolateLinear()` +- `interpolateCosine()` +- `interpolateSplineBasis()` +- `interpolateSplineNatural()` +- `interpolateSplineMonotone()` + +The `differenceDino99()` color difference function has been removed. Use `differenceEuclidean('dlab')` instead. + +The methods `deficiencyProt`, `deficiencyDeuter`, and `deficiencyTrit` have been removed. Use `filterDeficiencyProt`, `filterDeficiencyDeuter`, and `filterDeficiencyTrit` instead. + +### Renamed methods + +The following methods have been renamed: + +- `defineMode()` → `useMode()`; +- `getModeDefinition()` → `getMode()`. + +### Color space definitions + +A few properties on the [color space definition object](/api#color-space-def) have been changed for better clarity. + +- `input` → `fromMode` +- `output` → `toMode` +- `parsers` → `parse` +- `serialize` as string now only includes the color profile identifier, without the `color(` prefix, eg. from `serialize: "color(--hsv "` to `serialize: "--hsv"`. diff --git a/docs/resources.md b/docs/resources.md index 7bf7e214..910d4a64 100644 --- a/docs/resources.md +++ b/docs/resources.md @@ -1,7 +1,7 @@ --- layout: layouts/default title: Resources -menu-order: 4 +menu-order: 5 --- ## Culori extras From b8b49a65c8ca7c97b0a8680a043018fe5d50b79a Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Fri, 1 Oct 2021 16:45:57 +0300 Subject: [PATCH 29/40] Fix legacy package exports --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6d49690a..1545e35a 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,8 @@ "version": "1.0.0-alpha.9", "type": "module", "main": "bundled/culori.cjs", - "module": "bundled/culori-min.mjs", - "browser": "bundled/culori-min.js", + "module": "bundled/culori.min.mjs", + "browser": "bundled/culori.min.js", "exports": { "./require": "./bundled/culori.cjs", ".": "./src/index.js", From 511fc828227991d0b61748afe2bab77ae950a50a Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Fri, 1 Oct 2021 16:46:02 +0300 Subject: [PATCH 30/40] 1.0.0-alpha.10 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 28d18d7e..38970dff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "culori", - "version": "1.0.0-alpha.9", + "version": "1.0.0-alpha.10", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "culori", - "version": "1.0.0-alpha.9", + "version": "1.0.0-alpha.10", "license": "MIT", "devDependencies": { "@11ty/eleventy": "^0.12.1", diff --git a/package.json b/package.json index 1545e35a..61f7574e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "culori", - "version": "1.0.0-alpha.9", + "version": "1.0.0-alpha.10", "type": "module", "main": "bundled/culori.cjs", "module": "bundled/culori.min.mjs", From 18423e3923ded7b63b4a5344f17e539f90c54963 Mon Sep 17 00:00:00 2001 From: Dan Burzo Date: Fri, 1 Oct 2021 16:53:08 +0300 Subject: [PATCH 31/40] IIFE build: include globalName --- build.js | 4 ++++ docs/_includes/layouts/default.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build.js b/build.js index a6e5e79d..4a3b2346 100644 --- a/build.js +++ b/build.js @@ -45,11 +45,13 @@ task({ task({ format: 'iife', + globalName: 'culori', outfile: 'bundled/culori.js' }); task({ format: 'iife', + globalName: 'culori', minify: true, outfile: 'bundled/culori.min.js' }); @@ -77,12 +79,14 @@ task({ task({ format: 'iife', + globalName: 'culori', entryPoints: ['src/index-fn.js'], outfile: 'bundled/culori-fn.js' }); task({ format: 'iife', + globalName: 'culori', entryPoints: ['src/index-fn.js'], minify: true, outfile: 'bundled/culori-fn.min.js' diff --git a/docs/_includes/layouts/default.html b/docs/_includes/layouts/default.html index 0f857611..1f2ee106 100644 --- a/docs/_includes/layouts/default.html +++ b/docs/_includes/layouts/default.html @@ -21,7 +21,7 @@

    {{ title }}

    {% include 'partials/footer.html' %} - + +``` -To import Culori as a ` @@ -46,3 +48,26 @@ To import Culori as a ` ``` + +## Use it online + +### In your browser's console + +The library is added to every page of this website, so you can try the API in your browser's console as you read through the examples. + +### Runkit + +You can also use Culori in the Runkit npm playground ([npm.runkit.com/culori](https://npm.runkit.com/culori)) to test the API without installing anything. + +### Observable + +If you prefer to see the results visually, [Observable](https://beta.observablehq.com) is a great place to tinker with the library. + +Add this cell and you're good to go: + +```js +culori = import('culori@{{pkg.version}}'); +``` + +It's often useful to pin the library to a specific version, to make sure your old notebooks don't break if the API changes in a new major version of the library. + diff --git a/docs/guides/index.md b/docs/guides/index.md index 53563041..548a5235 100644 --- a/docs/guides/index.md +++ b/docs/guides/index.md @@ -4,3 +4,4 @@ menu-order: 4 --- - [Migration guide](./migration) +- [Optimize bundle size with tree-shaking](./tree-shaking) diff --git a/docs/guides/migration.md b/docs/guides/migration.md index fabdd003..3790e54b 100644 --- a/docs/guides/migration.md +++ b/docs/guides/migration.md @@ -6,15 +6,17 @@ title: 'Migration guide' ### Using the library -Starting with version 1.0, Culori will be published to npm as an ES Module (ESM) package. That means that if you use the library via npm (with `npm install culori`), you will need to be running **Node.js version 12 or later**. +Starting with version 1.0, Culori will be published to npm as an ES Module (ESM) package, with `type: module` and a set of `exports` in its `package.json` file. -If you've switched your own project to ESM (by using `type: module` in your `package.json` file), you can import the library as usual: +If you're using Node.js 10, you should be able to continue using Culori as before. + +If you're on Node.js 12 or later, and you've switched to native ES modules (by adding `type: module` to your `package.json`), you need to use `import`: ```js import * as culori from 'culori'; ``` -If you're not ready to switch to native ESM, we also provide a CommonJS export that can be used with `require()`: +If you're on Node.js 12 or later, and you're still using CommonJS modules, there's a separate export that can be used with `require()` calls: ```js const culori = require('culori/require'); diff --git a/docs/guides/tree-shaking.md b/docs/guides/tree-shaking.md new file mode 100644 index 00000000..99f543e7 --- /dev/null +++ b/docs/guides/tree-shaking.md @@ -0,0 +1,66 @@ +--- +title: 'Optimize bundle size with tree-shaking' +--- + +The default `culori` import comes with the full set of color spaces and functions to let you prototype quickly and with fewer errors. + +However, the way color spaces are initialized prevents the library from being tree-shaken, so when you use a bundler such as Webpack or Parcel, the entire Culori library is bundled regardless of what you're actually using. + +To optimize the bundle size, you can opt into the tree-shakeable version by importing from `culori/fn` instead of `culori`: + +```js +import { …, …, … } from 'culori/fn'; +``` + +It works like the default import, with one key difference: __none of the color spaces are pre-registered into the library__. In fact, if you'd try to `parse()` a valid CSS color without having registered any color space, you'd get back `undefined`: + +```js +import { parse } from 'culori/fn'; + +parse('tomato'); +// ⇒ undefined +``` + +Instead, you need to import the definitions of the color spaces you want to support and register them manually with the `useMode()` method. + +Since none of the color spaces are pre-registered the shortcuts to `converter(mode)`, such as `culori.rgb` or `culori.hsl`, are also missing. They are, however, helpfully returned by `useMode()`: + +```js +import { useMode, modeRgb } from 'culori/fn'; + +const rgb = useMode(modeRgb); + +console.log(rgb('tomato')); +// ⇒ Object { mode: "rgb", r: 1, g: 0.38823529411764707, b: 0.2784313725490196 } +``` + +To recreate a subset of Culori that only deals with valid CSS colors, you would use this: + +```js +import { + useMode, + modeA98, + modeHsl, + modeHwb, + modeLab, + modeLch, + modeP3, + modeProphoto, + modeRec2020, + modeRgb, + modeXyz +} from 'culori/fn'; + +const a98 = useMode(modeA98); +const hsl = useMode(modeHsl); +const hwb = useMode(modeHwb); +const lab = useMode(modeLab); +const lch = useMode(modeLch); +const p3 = useMode(modeP3); +const prophoto = useMode(modeProphoto); +const rec2020 = useMode(modeRec2020); +const rgb = useMode(modeRgb); +const xyz = useMode(modeXyz); +``` + +> __Note:__ It's essential to register all the color spaces available in CSS with `useMode()` to make each color space's parsers available to functions such as `parse()` and `converter()`. \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 9df7cac7..54e8c871 100644 --- a/docs/index.md +++ b/docs/index.md @@ -4,26 +4,31 @@ layout: layouts/default menu-order: 0 --- -Culori is a color library for JavaScript that supports most color spaces and formats defined in the [CSS Colors Level 4][css4-colors] spec ([named colors][css4-named-colors], [hex colors](hex-colors) with 3 to 8 digits, [RGB](rgb-colors), [HSL](hsl-colors), [HWB](hwb-colors), [Lab and LCh](lab-colors)), plus [additional color spaces](./color-spaces). +[css4-colors]: https://drafts.csswg.org/css-color/ +[css4-named-colors]: https://drafts.csswg.org/css-color/#named-colors +[din99o]: https://de.wikipedia.org/wiki/DIN99-Farbraum +[hex-colors]: https://drafts.csswg.org/css-color/#hex-notation +[rgb-colors]: https://drafts.csswg.org/css-color/#rgb-functions +[hsl-colors]: https://drafts.csswg.org/css-color/#the-hsl-notation +[hwb-colors]: https://drafts.csswg.org/css-color/#the-hwb-notation +[lab-colors]: https://drafts.csswg.org/css-color/#lab-colors + +Culori is a color library for JavaScript that supports most color spaces and formats defined in the [CSS Colors Level 4][css4-colors] specification ([named colors][css4-named-colors], [hex colors][hex-colors] with 3 to 8 digits, [RGB][rgb-colors], [HSL][hsl-colors], [HWB][hwb-colors], [Lab and LCh][lab-colors]), plus [additional color spaces](./color-spaces). It handles [color differences](https://en.wikipedia.org/wiki/Color_difference), interpolation, gradients, blend modes [and more](./api). +```bash +npm install culori +``` + Get started -## Another JS color library? +## What sets Culori apart? -Mike Bostock's [d3-color](https://github.com/d3/d3-color), and Gregor Aisch's [chroma.js](https://github.com/gka/chroma.js) are two excellent, robust libraries that provide most of what you need for working with colors on the web. The [Resources](./resources) section for even more libraries you can try. +__A function-oriented API.__ Colors are represented as plain JavaScript objects you pass through a series of [functions](./api), which makes it super easy to extend. -Culori does a few things differently: +__Accurate alpha.__ On the `alpha` channel, the library doesn't equate an `undefined` value with an opaque color, but rather with a color for which we don't care about the opacity. This gives you the opportunity to interpret `undefined` as you see fit. The hex string #ff0000 _should_ probably be rendered as fully opaque red, but for running functions on colors it's useful to discern #ff0000 from #ff0000ff — the former has an implicit alpha of 1, while for the latter it's explicit. -- The API is function-oriented rather than [fluent](https://en.wikipedia.org/wiki/Fluent_interface). Colors are represented as plain JavaScript objects you pass through a series of [functions](./api). -- On the `alpha` channel, the library doesn't equate an `undefined` value with an opaque color, but rather with a color for which we don't care about the opacity. This gives you the opportunity to interpret `undefined` as you see fit. The hex string #ff0000 _should_ probably be rendered as fully opaque red, but for running functions on colors it's useful to discern #ff0000 from #ff0000ff — the former has an implicit alpha of 1, while for the latter it's explicit. +__Comprehensive functionality.__ Build advanced color tools with Culori's rich collection of color spaces and functions. -[css4-colors]: https://drafts.csswg.org/css-color/ -[css4-named-colors]: https://drafts.csswg.org/css-color/#named-colors -[din99o]: https://de.wikipedia.org/wiki/DIN99-Farbraum -[hex-colors]: https://drafts.csswg.org/css-color/#hex-notation -[rgb-colors]: https://drafts.csswg.org/css-color/#rgb-functions -[hsl-colors]: https://drafts.csswg.org/css-color/#the-hsl-notation -[hwb-colors]: https://drafts.csswg.org/css-color/#the-hwb-notation -[lab-colors]: https://drafts.csswg.org/css-color/#lab-colors +__Tree-shakeable version available.__ When you're ready to optimize for bundle size, switch to [a tree-shakeable version of the library](./guides/tree-shaking). diff --git a/docs/resources.md b/docs/resources.md index 910d4a64..b56ce5c7 100644 --- a/docs/resources.md +++ b/docs/resources.md @@ -16,7 +16,7 @@ These projects add more functionality to Culori, but they're separate as to keep - [Moqups](https://moqups.com) — all our color-manipulation functions are handled by Culori. -_Does your product/project use Culori? Create a PR and add yourself to this list!_ +Does your product/project use Culori? Create a PR and add yourself to this list. ## Similar projects