diff --git a/manifests/micro-utilities.json b/manifests/micro-utilities.json index b6d733c..91128d4 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 a value is 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",