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

Commit f2ffb6c

Browse files
committed
fix: remove lodash
1 parent 576750e commit f2ffb6c

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,11 @@
4747
"is-ipfs": "~0.4.7",
4848
"is-pull-stream": "0.0.0",
4949
"is-stream": "^1.1.0",
50+
"just-kebab-case": "^1.1.0",
51+
"just-map-keys": "^1.1.0",
5052
"libp2p-crypto": "~0.14.0",
51-
"lodash": "^4.17.11",
52-
"lru-cache": "^5.1.1",
5353
"multiaddr": "^6.0.0",
54+
"lru-cache": "^4.1.3",
5455
"multibase": "~0.6.0",
5556
"multihashes": "~0.4.14",
5657
"ndjson": "^1.5.0",

src/files-mfs/stat.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict'
22

33
const promisify = require('promisify-es6')
4-
const mapKeys = require('lodash/mapKeys')
5-
const kebabCase = require('lodash/kebabCase')
4+
const mapKeys = require('just-map-keys')
5+
const kebabCase = require('just-kebab-case')
66

77
const transform = function (data, callback) {
88
callback(null, {

src/files-regular/add.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ const promisify = require('promisify-es6')
44
const ConcatStream = require('concat-stream')
55
const once = require('once')
66
const isStream = require('is-stream')
7-
const isString = require('lodash/isString')
87
const isSource = require('is-pull-stream').isSource
98
const FileResultStreamConverter = require('../utils/file-result-stream-converter')
109
const SendFilesStream = require('../utils/send-files-stream')
@@ -33,7 +32,7 @@ module.exports = (send) => {
3332
// path is optional if content is present
3433
if (obj.content) return isBufferOrStream(obj.content)
3534
// path must be a non-empty string if no content
36-
return Boolean(obj.path) && isString(obj.path)
35+
return Boolean(obj.path) && typeof obj.path === 'string'
3736
}
3837
// An input atom: a buffer, stream or content object
3938
const isInput = obj => isBufferOrStream(obj) || isContentObject(obj)

src/pin/ls.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict'
22

33
const promisify = require('promisify-es6')
4-
const keys = require('lodash/keys')
54

65
module.exports = (send) => {
76
return promisify((hash, opts, callback) => {
@@ -26,7 +25,7 @@ module.exports = (send) => {
2625
if (err) {
2726
return callback(err)
2827
}
29-
callback(null, keys(res.Keys).map(hash => (
28+
callback(null, Object.keys(res.Keys).map(hash => (
3029
{ hash, type: res.Keys[hash].Type }
3130
)))
3231
})

0 commit comments

Comments
 (0)