File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 174174 "description" : " You can use `typeof` and `Object.prototype.toString.call` to check if a value is a generator function" ,
175175 "example" : " const isGeneratorFunction = (obj) => typeof obj === \" function\" && Object.prototype.toString.call(obj) === \" [object GeneratorFunction]\" "
176176 },
177+ "snippet::is-gzip-buffer" : {
178+ "id" : " snippet::is-gzip-buffer" ,
179+ "type" : " simple" ,
180+ "description" : " You can check first three bytes of a buffer to detect if it is a gzip file." ,
181+ "example" : " function isGzip(buf) {\n if (buf.length < 3) return false;\n return buf[0] === 31 && buf[1] === 139 && buf[2] === 8;\n }"
182+ },
177183 "snippet::is-in-ssh" : {
178184 "id" : " snippet::is-in-ssh" ,
179185 "type" : " simple" ,
539545 "moduleName" : " is-generator-function" ,
540546 "replacements" : [" snippet::is-generator-function" ]
541547 },
548+ "is-gzip" : {
549+ "type" : " module" ,
550+ "moduleName" : " is-gzip" ,
551+ "replacements" : [" snippet::is-gzip-buffer" ]
552+ },
542553 "is-in-ssh" : {
543554 "type" : " module" ,
544555 "moduleName" : " is-in-ssh" ,
You can’t perform that action at this time.
0 commit comments