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

Commit 68503cc

Browse files
author
Alan Shaw
authored
chore: require just functions needed from lodash (#865)
License: MIT Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
1 parent c510cb7 commit 68503cc

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/files/stat.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
'use strict'
22

33
const promisify = require('promisify-es6')
4-
const _ = require('lodash')
4+
const mapKeys = require('lodash/mapKeys')
5+
const kebabCase = require('lodash/kebabCase')
56

67
const transform = function (data, callback) {
78
callback(null, {
@@ -23,7 +24,7 @@ module.exports = (send) => {
2324
opts = {}
2425
}
2526

26-
opts = _.mapKeys(opts, (v, k) => _.kebabCase(k))
27+
opts = mapKeys(opts, (v, k) => kebabCase(k))
2728

2829
send.andTransform({
2930
path: 'files/stat',

src/pin/ls.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict'
22

33
const promisify = require('promisify-es6')
4-
const _ = require('lodash')
4+
const keys = require('lodash/keys')
55

66
module.exports = (send) => {
77
return promisify((hash, opts, callback) => {
@@ -28,7 +28,7 @@ module.exports = (send) => {
2828
if (err) {
2929
return callback(err)
3030
}
31-
callback(null, _.keys(res.Keys).map(hash => (
31+
callback(null, keys(res.Keys).map(hash => (
3232
{ hash, type: res.Keys[hash].Type }
3333
)))
3434
})

0 commit comments

Comments
 (0)