From ed2aabf38b4cd02007d969c938a32d007a145af5 Mon Sep 17 00:00:00 2001 From: Roman Date: Sun, 26 Apr 2026 17:58:05 +0100 Subject: [PATCH 1/3] feat: improve mappings for some `lodash.*` modules --- manifests/micro-utilities.json | 79 +++++++++++++++++++++++ manifests/native.json | 40 ++++++++++++ manifests/preferred.json | 114 --------------------------------- 3 files changed, 119 insertions(+), 114 deletions(-) diff --git a/manifests/micro-utilities.json b/manifests/micro-utilities.json index 61ea2d0..bc4364b 100644 --- a/manifests/micro-utilities.json +++ b/manifests/micro-utilities.json @@ -150,6 +150,12 @@ "description": "You can use the modulo operator to check if a number is even.", "example": "(n % 2) === 0" }, + "snippet::is-function": { + "id": "snippet::is-function", + "type": "simple", + "description": "You can use `typeof` to check if a value is a function.", + "example": "const isString = (value) => typeof value === \"function\";" + }, "snippet::is-generator-function": { "id": "snippet::is-generator-function", "type": "simple", @@ -180,6 +186,12 @@ "description": "If the current environment is npm the `npm_config_user_agent` environment variable will be set and start with `\"npm\"`.", "example": "const isNpm = process.env.npm_config_user_agent?.startsWith(\"npm\")" }, + "snippet::is-null": { + "id": "snippet::is-null", + "type": "simple", + "description": "You can just check if a value is `null`.", + "example": "value === null" + }, "snippet::is-number": { "id": "snippet::is-number", "type": "simple", @@ -240,6 +252,12 @@ "description": "You can check if the current environment is Travis CI by checking if the `TRAVIS` environment variable is set.", "example": "const isTravis = () => \"TRAVIS\" in process.env;" }, + "snippet::is-undefined": { + "id": "snippet::is-undefined", + "type": "simple", + "description": "You can use `typeof` to check if a value is `undefined`.", + "example": "const isSymbol = (value) => typeof value === \"undefined\";" + }, "snippet::is-whitespace": { "id": "snippet::is-whitespace", "type": "simple", @@ -264,6 +282,12 @@ "description": "You can use `Math.random()` or `crypto.getRandomValues` if cryptographic randomness is required.", "example": "crypto.getRandomValues(new Uint32Array(1))[0] / (2 ** 32);\n// or\nMath.random();" }, + "snippet::noop": { + "id": "snippet::noop", + "type": "simple", + "description": "You can use an arrow function `() => {}` for a noop.", + "example": "const noop = () => {}" + }, "snippet::object-filter": { "id": "snippet::object-filter", "type": "simple", @@ -623,6 +647,61 @@ "moduleName": "kind-of", "replacements": ["snippet::typeof"] }, + "lodash.isboolean": { + "type": "module", + "moduleName": "lodash.isboolean", + "replacements": ["snippet::is-boolean"] + }, + "lodash.isfunction": { + "type": "module", + "moduleName": "lodash.isfunction", + "replacements": ["snippet::is-function"] + }, + "lodash.isnull": { + "type": "module", + "moduleName": "lodash.isnull", + "replacements": ["snippet::is-null"] + }, + "lodash.isnumber": { + "type": "module", + "moduleName": "lodash.isnumber", + "replacements": ["snippet::is-number"] + }, + "lodash.isobject": { + "type": "module", + "moduleName": "lodash.isobject", + "replacements": ["snippet::is-object"] + }, + "lodash.isplainobject": { + "type": "module", + "moduleName": "lodash.isplainobject", + "replacements": ["snippet::is-object"] + }, + "lodash.isregexp": { + "type": "module", + "moduleName": "lodash.isregexp", + "replacements": ["snippet::is-regexp"] + }, + "lodash.isstring": { + "type": "module", + "moduleName": "lodash.isstring", + "replacements": ["snippet::is-string"] + }, + "lodash.issymbol": { + "type": "module", + "moduleName": "lodash.issymbol", + "replacements": ["snippet::is-symbol"] + }, + "lodash.isundefined": { + "type": "module", + "moduleName": "lodash.isundefined", + "replacements": ["snippet::is-undefined"] + }, + "lodash.noop": { + "type": "module", + "moduleName": "lodash.noop", + "replacements": ["snippet::noop"] + }, "last-char": { "type": "module", "moduleName": "last-char", diff --git a/manifests/native.json b/manifests/native.json index 3bec23a..565021d 100644 --- a/manifests/native.json +++ b/manifests/native.json @@ -2277,6 +2277,46 @@ "moduleName": "left-pad", "replacements": ["String.prototype.padStart"] }, + "lodash.isarray": { + "type": "module", + "moduleName": "lodash.isarray", + "replacements": ["Array.isArray"] + }, + "lodash.isbuffer": { + "type": "module", + "moduleName": "lodash.isbuffer", + "replacements": ["Buffer.isBuffer"] + }, + "lodash.iserror": { + "type": "module", + "moduleName": "lodash.iserror", + "replacements": ["Error.isError"] + }, + "lodash.isfinite": { + "type": "module", + "moduleName": "lodash.isfinite", + "replacements": ["Number.isFinite"] + }, + "lodash.isinteger": { + "type": "module", + "moduleName": "lodash.isinteger", + "replacements": ["Number.isInteger"] + }, + "lodash.isnan": { + "type": "module", + "moduleName": "lodash.isnan", + "replacements": ["Number.isNaN"] + }, + "lodash.join": { + "type": "module", + "moduleName": "lodash.join", + "replacements": ["Array.prototype.join"] + }, + "lodash.lastindexof": { + "type": "module", + "moduleName": "lodash.lastindexof", + "replacements": ["Array.prototype.lastIndexOf"] + }, "long": { "type": "module", "moduleName": "long", diff --git a/manifests/preferred.json b/manifests/preferred.json index 9a26345..1fce0ec 100644 --- a/manifests/preferred.json +++ b/manifests/preferred.json @@ -1170,12 +1170,6 @@ "replacements": ["lodash-underscore", "es-toolkit"], "url": {"type": "e18e", "id": "lodash-underscore"} }, - "lodash.isarray": { - "type": "module", - "moduleName": "lodash.isarray", - "replacements": ["lodash-underscore", "es-toolkit"], - "url": {"type": "e18e", "id": "lodash-underscore"} - }, "lodash.isarraybuffer": { "type": "module", "moduleName": "lodash.isarraybuffer", @@ -1194,18 +1188,6 @@ "replacements": ["lodash-underscore", "es-toolkit"], "url": {"type": "e18e", "id": "lodash-underscore"} }, - "lodash.isboolean": { - "type": "module", - "moduleName": "lodash.isboolean", - "replacements": ["lodash-underscore", "es-toolkit"], - "url": {"type": "e18e", "id": "lodash-underscore"} - }, - "lodash.isbuffer": { - "type": "module", - "moduleName": "lodash.isbuffer", - "replacements": ["lodash-underscore", "es-toolkit"], - "url": {"type": "e18e", "id": "lodash-underscore"} - }, "lodash.isdate": { "type": "module", "moduleName": "lodash.isdate", @@ -1236,30 +1218,6 @@ "replacements": ["lodash-underscore", "es-toolkit"], "url": {"type": "e18e", "id": "lodash-underscore"} }, - "lodash.iserror": { - "type": "module", - "moduleName": "lodash.iserror", - "replacements": ["lodash-underscore", "es-toolkit"], - "url": {"type": "e18e", "id": "lodash-underscore"} - }, - "lodash.isfinite": { - "type": "module", - "moduleName": "lodash.isfinite", - "replacements": ["lodash-underscore", "es-toolkit"], - "url": {"type": "e18e", "id": "lodash-underscore"} - }, - "lodash.isfunction": { - "type": "module", - "moduleName": "lodash.isfunction", - "replacements": ["lodash-underscore", "es-toolkit"], - "url": {"type": "e18e", "id": "lodash-underscore"} - }, - "lodash.isinteger": { - "type": "module", - "moduleName": "lodash.isinteger", - "replacements": ["lodash-underscore", "es-toolkit"], - "url": {"type": "e18e", "id": "lodash-underscore"} - }, "lodash.islength": { "type": "module", "moduleName": "lodash.islength", @@ -1284,12 +1242,6 @@ "replacements": ["lodash-underscore", "es-toolkit"], "url": {"type": "e18e", "id": "lodash-underscore"} }, - "lodash.isnan": { - "type": "module", - "moduleName": "lodash.isnan", - "replacements": ["lodash-underscore", "es-toolkit"], - "url": {"type": "e18e", "id": "lodash-underscore"} - }, "lodash.isnative": { "type": "module", "moduleName": "lodash.isnative", @@ -1302,42 +1254,12 @@ "replacements": ["lodash-underscore", "es-toolkit"], "url": {"type": "e18e", "id": "lodash-underscore"} }, - "lodash.isnull": { - "type": "module", - "moduleName": "lodash.isnull", - "replacements": ["lodash-underscore", "es-toolkit"], - "url": {"type": "e18e", "id": "lodash-underscore"} - }, - "lodash.isnumber": { - "type": "module", - "moduleName": "lodash.isnumber", - "replacements": ["lodash-underscore", "es-toolkit"], - "url": {"type": "e18e", "id": "lodash-underscore"} - }, - "lodash.isobject": { - "type": "module", - "moduleName": "lodash.isobject", - "replacements": ["lodash-underscore", "es-toolkit"], - "url": {"type": "e18e", "id": "lodash-underscore"} - }, "lodash.isobjectlike": { "type": "module", "moduleName": "lodash.isobjectlike", "replacements": ["lodash-underscore", "es-toolkit"], "url": {"type": "e18e", "id": "lodash-underscore"} }, - "lodash.isplainobject": { - "type": "module", - "moduleName": "lodash.isplainobject", - "replacements": ["lodash-underscore", "es-toolkit"], - "url": {"type": "e18e", "id": "lodash-underscore"} - }, - "lodash.isregexp": { - "type": "module", - "moduleName": "lodash.isregexp", - "replacements": ["lodash-underscore", "es-toolkit"], - "url": {"type": "e18e", "id": "lodash-underscore"} - }, "lodash.issafeinteger": { "type": "module", "moduleName": "lodash.issafeinteger", @@ -1350,30 +1272,12 @@ "replacements": ["lodash-underscore", "es-toolkit"], "url": {"type": "e18e", "id": "lodash-underscore"} }, - "lodash.isstring": { - "type": "module", - "moduleName": "lodash.isstring", - "replacements": ["lodash-underscore", "es-toolkit"], - "url": {"type": "e18e", "id": "lodash-underscore"} - }, - "lodash.issymbol": { - "type": "module", - "moduleName": "lodash.issymbol", - "replacements": ["lodash-underscore", "es-toolkit"], - "url": {"type": "e18e", "id": "lodash-underscore"} - }, "lodash.istypedarray": { "type": "module", "moduleName": "lodash.istypedarray", "replacements": ["lodash-underscore", "es-toolkit"], "url": {"type": "e18e", "id": "lodash-underscore"} }, - "lodash.isundefined": { - "type": "module", - "moduleName": "lodash.isundefined", - "replacements": ["lodash-underscore", "es-toolkit"], - "url": {"type": "e18e", "id": "lodash-underscore"} - }, "lodash.isweakmap": { "type": "module", "moduleName": "lodash.isweakmap", @@ -1392,12 +1296,6 @@ "replacements": ["lodash-underscore", "es-toolkit"], "url": {"type": "e18e", "id": "lodash-underscore"} }, - "lodash.join": { - "type": "module", - "moduleName": "lodash.join", - "replacements": ["lodash-underscore", "es-toolkit"], - "url": {"type": "e18e", "id": "lodash-underscore"} - }, "lodash.kebabcase": { "type": "module", "moduleName": "lodash.kebabcase", @@ -1428,12 +1326,6 @@ "replacements": ["lodash-underscore", "es-toolkit"], "url": {"type": "e18e", "id": "lodash-underscore"} }, - "lodash.lastindexof": { - "type": "module", - "moduleName": "lodash.lastindexof", - "replacements": ["lodash-underscore", "es-toolkit"], - "url": {"type": "e18e", "id": "lodash-underscore"} - }, "lodash.lowercase": { "type": "module", "moduleName": "lodash.lowercase", @@ -1578,12 +1470,6 @@ "replacements": ["lodash-underscore", "es-toolkit"], "url": {"type": "e18e", "id": "lodash-underscore"} }, - "lodash.noop": { - "type": "module", - "moduleName": "lodash.noop", - "replacements": ["lodash-underscore", "es-toolkit"], - "url": {"type": "e18e", "id": "lodash-underscore"} - }, "lodash.now": { "type": "module", "moduleName": "lodash.now", From ebbb64406bcb0d0d680e54f1fb3c2c6341ed73bc Mon Sep 17 00:00:00 2001 From: Roman Date: Sun, 26 Apr 2026 18:01:54 +0100 Subject: [PATCH 2/3] fix --- manifests/micro-utilities.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/manifests/micro-utilities.json b/manifests/micro-utilities.json index bc4364b..042869d 100644 --- a/manifests/micro-utilities.json +++ b/manifests/micro-utilities.json @@ -647,6 +647,11 @@ "moduleName": "kind-of", "replacements": ["snippet::typeof"] }, + "last-char": { + "type": "module", + "moduleName": "last-char", + "replacements": ["snippet::char-last"] + }, "lodash.isboolean": { "type": "module", "moduleName": "lodash.isboolean", @@ -702,11 +707,6 @@ "moduleName": "lodash.noop", "replacements": ["snippet::noop"] }, - "last-char": { - "type": "module", - "moduleName": "last-char", - "replacements": ["snippet::char-last"] - }, "lower-case": { "type": "module", "moduleName": "lower-case", From a603f7883742c17ae605ddf3d30cee14193d02cc Mon Sep 17 00:00:00 2001 From: James Garbutt <43081j@users.noreply.github.com> Date: Mon, 27 Apr 2026 09:07:29 +0100 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: James Garbutt <43081j@users.noreply.github.com> --- manifests/micro-utilities.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/micro-utilities.json b/manifests/micro-utilities.json index 042869d..d5329a5 100644 --- a/manifests/micro-utilities.json +++ b/manifests/micro-utilities.json @@ -189,7 +189,7 @@ "snippet::is-null": { "id": "snippet::is-null", "type": "simple", - "description": "You can just check if a value is `null`.", + "description": "You can check if a value is `null` using regular equality checks.", "example": "value === null" }, "snippet::is-number": { @@ -256,7 +256,7 @@ "id": "snippet::is-undefined", "type": "simple", "description": "You can use `typeof` to check if a value is `undefined`.", - "example": "const isSymbol = (value) => typeof value === \"undefined\";" + "example": "typeof value === \"undefined\";" }, "snippet::is-whitespace": { "id": "snippet::is-whitespace", @@ -285,7 +285,7 @@ "snippet::noop": { "id": "snippet::noop", "type": "simple", - "description": "You can use an arrow function `() => {}` for a noop.", + "description": "You can use an arrow function `() => {}` for a noop function.", "example": "const noop = () => {}" }, "snippet::object-filter": {