From bc290e45329fc134b09b51316e335a2f30827a07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Fri, 5 Jun 2020 16:19:46 +0200 Subject: [PATCH] deliberate ES6 syntax (rationale: don't let people install @2 in a build system that will not alert them that we have moved to ES6, only to cause trouble with a later release.) --- src/scheme.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/scheme.js b/src/scheme.js index 49a7208..a82a882 100644 --- a/src/scheme.js +++ b/src/scheme.js @@ -1,11 +1,5 @@ export default function(ranges) { - ranges = ranges.map(function(colors) { - return colors.match(/.{6}/g).map(function(x) { - return "#" + x; - }); - }); - var n0 = ranges[0].length; - return function(n) { - return ranges[n - n0]; - }; + ranges = ranges.map(colors => colors.match(/.{6}/g).map(x => `#${x}`)); + const n0 = ranges[0].length; + return n => ranges[n - n0]; }