Skip to content
This repository was archived by the owner on Apr 29, 2020. It is now read-only.

Commit 01dd350

Browse files
mkg20001hugomrdias
authored andcommitted
chore: update deps and migrate to aegir workflow (#6)
This also contains the changes from #1
1 parent a60af08 commit 01dd350

File tree

7 files changed

+31
-18
lines changed

7 files changed

+31
-18
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@ node_modules
3131

3232
# Optional REPL history
3333
.node_repl_history
34+
35+
# Lockfile
36+
package-lock.json

example.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
'use strict'
2+
3+
/* eslint-disable no-console */
4+
15
const http = require('http')
26
const IPFSMultipart = require('.')
37

package.json

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@
33
"version": "0.1.0",
44
"description": "A set of utilities to help dealing with IPFS multipart.",
55
"leadMaintainer": "Hugo Dias <[email protected]>",
6-
"main": "lib/index.js",
6+
"main": "src/index.js",
77
"scripts": {
8-
"test": "mocha test/index.js",
9-
"lint": "standard --verbose | snazzy"
8+
"lint": "aegir lint",
9+
"build": "aegir build",
10+
"test": "aegir test -t node",
11+
"release": "aegir release --target node",
12+
"release-minor": "aegir release --type minor --target node",
13+
"release-major": "aegir release --type major --target node",
14+
"coverage": "aegir coverage",
15+
"coverage-publish": "aegir coverage --provider codecov"
1016
},
11-
"pre-commit": [
12-
"test",
13-
"lint"
14-
],
1517
"repository": {
1618
"type": "git",
1719
"url": "git+https://github.com/xicombd/ipfs-multipart.git"
@@ -28,16 +30,13 @@
2830
},
2931
"homepage": "https://github.com/xicombd/ipfs-multipart#readme",
3032
"devDependencies": {
31-
"chai": "^3.5.0",
33+
"aegir": "^14.0.0",
34+
"chai": "^4.1.2",
3235
"ipfs-api": "github:ipfs/js-ipfs-api#1fd9749",
33-
"mocha": "^2.4.5",
34-
"pre-commit": "^1.1.2",
35-
"request": "^2.69.0",
36-
"snazzy": "^3.0.0",
37-
"standard": "^6.0.7"
36+
"request": "^2.87.0"
3837
},
3938
"dependencies": {
40-
"content": "^3.0.0",
41-
"dicer": "^0.2.5"
39+
"content": "^4.0.5",
40+
"dicer": "~0.2.5"
4241
}
4342
}

lib/index.js renamed to src/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict'
2+
13
const content = require('content')
24
const Parser = require('./parser')
35

lib/parser.js renamed to src/parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const parseDisposition = (disposition) => {
1616
const details = {}
1717
details.type = disposition.split(';')[0]
1818
if (details.type === 'file' || details.type === 'form-data') {
19-
const namePattern = /\ filename=\"(.[^\"]+)\"/
19+
const namePattern = / filename="(.[^"]+)"/
2020
const matches = disposition.match(namePattern)
2121
details.name = matches ? matches[1] : ''
2222
}

test/index.js renamed to test/node.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
'use strict'
2+
13
/* eslint-env mocha */
4+
25
const fs = require('fs')
36

47
describe('multipart', () => {

test/parser.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
/* eslint-env mocha */
21
'use strict'
32

3+
/* eslint-env mocha */
4+
/* eslint-disable no-unused-expressions */
5+
46
const expect = require('chai').expect
57
const APIctl = require('ipfs-api')
68
const http = require('http')
@@ -187,7 +189,7 @@ describe('parser', () => {
187189
})
188190

189191
it('parses ctl.add buffer correctly', (done) => {
190-
ctl.add(new Buffer('hello world'), (err, res) => {
192+
ctl.add(Buffer.from('hello world'), (err, res) => {
191193
expect(err).to.not.exist
192194

193195
expect(files.length).to.equal(1)

0 commit comments

Comments
 (0)