Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
refactor: use typeof instead of lodash/isString
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
  • Loading branch information
Alan Shaw committed Dec 15, 2018
1 parent f9b4fa2 commit e24fc37
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/core/runtime/add-from-fs-nodejs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
const promisify = require('promisify-es6')
const pull = require('pull-stream')
const globSource = require('../../utils/files/glob-source')
const isString = require('lodash/isString')

module.exports = self => {
return promisify((...args) => {
const callback = args.pop()
const options = isString(args[args.length - 1]) ? {} : args.pop()
const options = typeof args[args.length - 1] === 'string' ? {} : args.pop()
const paths = args

pull(
Expand Down
3 changes: 1 addition & 2 deletions src/utils/files/glob-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

const fs = require('fs')
const Path = require('path')
const isString = require('lodash/isString')
const pull = require('pull-stream')
const glob = require('glob')
const cat = require('pull-cat')
Expand All @@ -25,7 +24,7 @@ const errCode = require('err-code')
* @returns {Function} pull stream source
*/
module.exports = (...args) => {
const options = isString(args[args.length - 1]) ? {} : args.pop()
const options = typeof args[args.length - 1] === 'string' ? {} : args.pop()
const paths = args
const deferred = defer.source()

Expand Down

0 comments on commit e24fc37

Please sign in to comment.