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

Commit

Permalink
Use arrow functions
Browse files Browse the repository at this point in the history
  • Loading branch information
voxpelli committed Jan 15, 2018
1 parent 28502b5 commit e5fdc3a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module.exports.missing = function (pkg, deps, options) {
var missing = []
var config = configure(pkg, options)

deps.map(function (used) {
deps.map(used => {
if (config.allDeps.indexOf(used) === -1 && config.ignore.indexOf(used) === -1) {
missing.push(used)
}
Expand All @@ -61,7 +61,7 @@ module.exports.extra = function (pkg, deps, options) {
var missing = []
var config = configure(pkg, options)

config.allDeps.map(function (dep) {
config.allDeps.map(dep => {
if (deps.indexOf(dep) === -1 && config.ignore.indexOf(dep) === -1) {
missing.push(dep)
}
Expand Down Expand Up @@ -91,11 +91,11 @@ function getExtensions (extensions, detective) {
}

if (Array.isArray(extensions)) {
extensions.forEach(function (extension) {
extensions.forEach(extension => {
result[extension] = getDetective(detective)
})
} else if (typeof extensions === 'object') {
Object.keys(extensions).forEach(function (extension) {
Object.keys(extensions).forEach(extension => {
result[extension] = getDetective(extensions[extension] || detective)
})
}
Expand Down Expand Up @@ -152,7 +152,7 @@ function parse (opts) {
if (typeof pkg.bin === 'string') {
paths.push(path.resolve(path.join(path.dirname(pkgPath), pkg.bin)))
} else {
Object.keys(pkg.bin).forEach(function (cmdName) {
Object.keys(pkg.bin).forEach(cmdName => {
var cmd = pkg.bin[cmdName]
paths.push(path.resolve(path.join(path.dirname(pkgPath), cmd)))
})
Expand All @@ -162,7 +162,7 @@ function parse (opts) {
// pass in custom additional entries e.g. ['./test.js']
if (opts.entries) {
if (typeof opts.entries === 'string') opts.entries = [opts.entries]
opts.entries.forEach(function (entry) {
opts.entries.forEach(entry => {
entry = path.resolve(path.join(path.dirname(pkgPath), entry))
if (paths.indexOf(entry) === -1) {
paths.push(entry)
Expand All @@ -178,8 +178,8 @@ function parse (opts) {
.then(allDeps => {
var used = {}
// merge all deps into one unique list
allDeps.forEach(function (deps) {
Object.keys(deps).forEach(function (dep) {
allDeps.forEach(deps => {
Object.keys(deps).forEach(dep => {
used[dep] = true
})
})
Expand Down Expand Up @@ -223,7 +223,7 @@ function parse (opts) {
.then(contents => {
var requires = detective(contents)
var relatives = []
requires.map(function (req) {
requires.map(req => {
var isCore = builtins.indexOf(req) > -1
if (isNotRelative(req) && !isCore) {
// require('foo/bar') -> require('foo')
Expand Down

0 comments on commit e5fdc3a

Please sign in to comment.