From be66fb2bdf7c62960456f79da4d39ec6e759511f Mon Sep 17 00:00:00 2001 From: Roman Date: Sat, 7 Mar 2026 01:35:03 +0000 Subject: [PATCH 1/2] add `is-generator-function` to replacements --- manifests/micro-utilities.json | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/manifests/micro-utilities.json b/manifests/micro-utilities.json index b6d733c..805055d 100644 --- a/manifests/micro-utilities.json +++ b/manifests/micro-utilities.json @@ -132,6 +132,12 @@ "description": "You can use the modulo operator to check if a number is even.", "example": "(n % 2) === 0" }, + "snippet::is-generator-function": { + "id": "snippet::is-generator-function", + "type": "simple", + "description": "You can use `typeof` and `Object.prototype.toString.call` to check if it's a generator function", + "example": "const isGeneratorFunction = (obj) => typeof obj === \"function\" && Object.prototype.toString.call(obj) === \"[object GeneratorFunction]\"" + }, "snippet::is-in-ssh": { "id": "snippet::is-in-ssh", "type": "simple", @@ -438,6 +444,11 @@ "moduleName": "is-even", "replacements": ["snippet::is-even"] }, + "is-generator-function": { + "type": "module", + "moduleName": "is-generator-function", + "replacements": ["snippet::is-generator-function"] + }, "is-in-ssh": { "type": "module", "moduleName": "is-in-ssh", From 4afea681eb0d408c850c9ef1f768f7d732cf2c2f Mon Sep 17 00:00:00 2001 From: James Garbutt <43081j@users.noreply.github.com> Date: Sun, 8 Mar 2026 10:52:21 -0400 Subject: [PATCH 2/2] Apply suggestion from @43081j --- manifests/micro-utilities.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/micro-utilities.json b/manifests/micro-utilities.json index 805055d..91128d4 100644 --- a/manifests/micro-utilities.json +++ b/manifests/micro-utilities.json @@ -135,7 +135,7 @@ "snippet::is-generator-function": { "id": "snippet::is-generator-function", "type": "simple", - "description": "You can use `typeof` and `Object.prototype.toString.call` to check if it's a generator function", + "description": "You can use `typeof` and `Object.prototype.toString.call` to check if a value is a generator function", "example": "const isGeneratorFunction = (obj) => typeof obj === \"function\" && Object.prototype.toString.call(obj) === \"[object GeneratorFunction]\"" }, "snippet::is-in-ssh": {