Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions manifests/micro-utilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@
"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-gzip-buffer": {
"id": "snippet::is-gzip-buffer",
"type": "simple",
"description": "You can check first three bytes of a buffer to detect if it is a gzip file.",
"example": "function isGzip(buf) {\n if (buf.length < 3) return false;\n return buf[0] === 31 && buf[1] === 139 && buf[2] === 8;\n}"
},
"snippet::is-in-ssh": {
"id": "snippet::is-in-ssh",
"type": "simple",
Expand Down Expand Up @@ -539,6 +545,11 @@
"moduleName": "is-generator-function",
"replacements": ["snippet::is-generator-function"]
},
"is-gzip": {
"type": "module",
"moduleName": "is-gzip",
"replacements": ["snippet::is-gzip-buffer"]
},
"is-in-ssh": {
"type": "module",
"moduleName": "is-in-ssh",
Expand Down