file-fetch
Advanced tools
Comparing version 1.1.1 to 1.2.0
{ | ||
"name": "file-fetch", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "fetch for read and write access to the local file system", | ||
@@ -27,11 +27,11 @@ "main": "index.js", | ||
"dependencies": { | ||
"concat-stream": "^1.6.0", | ||
"concat-stream": "^2.0.0", | ||
"mime-types": "^2.1.17", | ||
"node-fetch": "^1.7.3", | ||
"node-fetch": "^2.3.0", | ||
"readable-error": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^4.0.1", | ||
"standard": "^10.0.3" | ||
"mocha": "^6.0.2", | ||
"standard": "^12.0.1" | ||
} | ||
} |
@@ -11,3 +11,3 @@ /* global describe, it */ | ||
it('should be a function', () => { | ||
assert.equal(typeof fileFetch, 'function') | ||
assert.strictEqual(typeof fileFetch, 'function') | ||
}) | ||
@@ -18,4 +18,4 @@ | ||
assert(res.body.readable) | ||
assert.equal(typeof res.body.pipe, 'function') | ||
assert.equal(typeof res.body.read, 'function') | ||
assert.strictEqual(typeof res.body.pipe, 'function') | ||
assert.strictEqual(typeof res.body.read, 'function') | ||
}) | ||
@@ -34,3 +34,3 @@ }) | ||
res.body.on('end', () => { | ||
assert.equal(content, 'test') | ||
assert.strictEqual(content, 'test') | ||
@@ -45,3 +45,3 @@ resolve() | ||
return fileFetch('file://' + path.join(__dirname, 'support/file.txt')).then((res) => { | ||
assert.equal(res.headers.get('content-type').split(';').shift(), 'text/plain') | ||
assert.strictEqual(res.headers.get('content-type').split(';').shift(), 'text/plain') | ||
}) | ||
@@ -62,3 +62,3 @@ }) | ||
res.body.on('end', () => { | ||
assert.equal(content, 'test') | ||
assert.strictEqual(content, 'test') | ||
@@ -85,3 +85,3 @@ resolve() | ||
}).then((res) => { | ||
assert.equal(fs.readFileSync(pathname), 'test') | ||
assert.strictEqual(fs.readFileSync(pathname), 'test') | ||
@@ -98,3 +98,3 @@ fs.unlinkSync(pathname) | ||
}).then((res) => { | ||
assert.equal(res.status, 406) | ||
assert.strictEqual(res.status, 406) | ||
@@ -113,3 +113,3 @@ return new Promise((resolve) => { | ||
}).then((res) => { | ||
assert.equal(res.status, 405) | ||
assert.strictEqual(res.status, 405) | ||
@@ -139,3 +139,3 @@ return new Promise((resolve) => { | ||
}).then((res) => { | ||
assert.equal(fs.readFileSync(pathname), 'test') | ||
assert.strictEqual(fs.readFileSync(pathname), 'test') | ||
@@ -151,4 +151,4 @@ fs.unlinkSync(pathname) | ||
assert(res.headers) | ||
assert.equal(typeof res.headers.has, 'function') | ||
assert.equal(typeof res.headers.get, 'function') | ||
assert.strictEqual(typeof res.headers.has, 'function') | ||
assert.strictEqual(typeof res.headers.get, 'function') | ||
}) | ||
@@ -160,3 +160,3 @@ }) | ||
return fileFetch('file://' + path.join(__dirname, 'support/file.txt')).then((res) => { | ||
assert.equal(typeof res.text, 'function') | ||
assert.strictEqual(typeof res.text, 'function') | ||
}) | ||
@@ -167,3 +167,3 @@ }) | ||
return fileFetch('file://' + path.join(__dirname, 'support/file.txt')).then(res => res.text()).then((text) => { | ||
assert.equal(text, 'test') | ||
assert.strictEqual(text, 'test') | ||
}) | ||
@@ -176,3 +176,3 @@ }) | ||
return fileFetch('file://' + path.join(__dirname, 'support/json.json')).then((res) => { | ||
assert.equal(typeof res.json, 'function') | ||
assert.strictEqual(typeof res.json, 'function') | ||
}) | ||
@@ -183,3 +183,3 @@ }) | ||
return fileFetch('file://' + path.join(__dirname, 'support/json.json')).then(res => res.json()).then((json) => { | ||
assert.deepEqual(json, { | ||
assert.deepStrictEqual(json, { | ||
key: 'value' | ||
@@ -193,3 +193,3 @@ }) | ||
it('should be a constructor', () => { | ||
assert.equal(typeof fileFetch.Headers, 'function') | ||
assert.strictEqual(typeof fileFetch.Headers, 'function') | ||
}) | ||
@@ -200,3 +200,3 @@ | ||
assert.equal(typeof headers.has, 'function') | ||
assert.strictEqual(typeof headers.has, 'function') | ||
}) | ||
@@ -207,5 +207,5 @@ | ||
assert.equal(typeof headers.get, 'function') | ||
assert.strictEqual(typeof headers.get, 'function') | ||
}) | ||
}) | ||
}) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8623
+ Addedconcat-stream@2.0.0(transitive)
+ Addednode-fetch@2.7.0(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)
- Removedconcat-stream@1.6.2(transitive)
- Removedencoding@0.1.13(transitive)
- Removediconv-lite@0.6.3(transitive)
- Removedis-stream@1.1.0(transitive)
- Removednode-fetch@1.7.3(transitive)
- Removedsafer-buffer@2.1.2(transitive)
Updatedconcat-stream@^2.0.0
Updatednode-fetch@^2.3.0