Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

file-fetch

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

file-fetch - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

10

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc