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

chore: update deps and migrate to aegir workflow #6

Merged
merged 1 commit into from
Jul 4, 2018
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ node_modules

# Optional REPL history
.node_repl_history

# Lockfile
package-lock.json
4 changes: 4 additions & 0 deletions example.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
'use strict'

/* eslint-disable no-console */

const http = require('http')
const IPFSMultipart = require('.')

Expand Down
29 changes: 14 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@
"version": "0.1.0",
"description": "A set of utilities to help dealing with IPFS multipart.",
"leadMaintainer": "Hugo Dias <[email protected]>",
"main": "lib/index.js",
"main": "src/index.js",
"scripts": {
"test": "mocha test/index.js",
"lint": "standard --verbose | snazzy"
"lint": "aegir lint",
"build": "aegir build",
"test": "aegir test -t node",
"release": "aegir release --target node",
"release-minor": "aegir release --type minor --target node",
"release-major": "aegir release --type major --target node",
"coverage": "aegir coverage",
"coverage-publish": "aegir coverage --provider codecov"
},
"pre-commit": [
"test",
"lint"
],
"repository": {
"type": "git",
"url": "git+https://github.com/xicombd/ipfs-multipart.git"
Expand All @@ -28,16 +30,13 @@
},
"homepage": "https://github.com/xicombd/ipfs-multipart#readme",
"devDependencies": {
"chai": "^3.5.0",
"aegir": "^14.0.0",
"chai": "^4.1.2",
"ipfs-api": "github:ipfs/js-ipfs-api#1fd9749",
"mocha": "^2.4.5",
"pre-commit": "^1.1.2",
"request": "^2.69.0",
"snazzy": "^3.0.0",
"standard": "^6.0.7"
"request": "^2.87.0"
},
"dependencies": {
"content": "^3.0.0",
"dicer": "^0.2.5"
"content": "^4.0.5",
"dicer": "~0.2.5"
}
}
2 changes: 2 additions & 0 deletions lib/index.js → src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const content = require('content')
const Parser = require('./parser')

Expand Down
2 changes: 1 addition & 1 deletion lib/parser.js → src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const parseDisposition = (disposition) => {
const details = {}
details.type = disposition.split(';')[0]
if (details.type === 'file' || details.type === 'form-data') {
const namePattern = /\ filename=\"(.[^\"]+)\"/
const namePattern = / filename="(.[^"]+)"/
const matches = disposition.match(namePattern)
details.name = matches ? matches[1] : ''
}
Expand Down
3 changes: 3 additions & 0 deletions test/index.js → test/node.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
'use strict'

/* eslint-env mocha */

const fs = require('fs')

describe('multipart', () => {
Expand Down
6 changes: 4 additions & 2 deletions test/parser.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* eslint-env mocha */
'use strict'

/* eslint-env mocha */
/* eslint-disable no-unused-expressions */

const expect = require('chai').expect
const APIctl = require('ipfs-api')
const http = require('http')
Expand Down Expand Up @@ -187,7 +189,7 @@ describe('parser', () => {
})

it('parses ctl.add buffer correctly', (done) => {
ctl.add(new Buffer('hello world'), (err, res) => {
ctl.add(Buffer.from('hello world'), (err, res) => {
expect(err).to.not.exist

expect(files.length).to.equal(1)
Expand Down