-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
style: Use CommonJs syntax for import/export
With the destructuring feature of ES6 is very easy to keep CommonJs syntax. Attempt to fix #55 As most of the tests are written using ES6 imports the esm dependecy is kept but moved to devDependencies.
- Loading branch information
Showing
26 changed files
with
168 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
import { flattenDeep, negate, isEmpty } from 'lodash' | ||
import { COMMAND_LETTERS } from './references.js' | ||
const flattenDeep = require('lodash/flattenDeep') | ||
const negate = require('lodash/negate') | ||
const isEmpty = require('lodash/isEmpty') | ||
const { COMMAND_LETTERS } = require('./references') | ||
|
||
// Transform user input into a args for child procress spawn | ||
export const fromOptions = options => { | ||
const fromOptions = options => { | ||
return [COMMAND_LETTERS[options._command]] | ||
.concat(flattenDeep(options._target)) | ||
.filter(negate(isEmpty)) | ||
} | ||
|
||
module.exports = { fromOptions } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import { defaultTo } from 'lodash' | ||
import { BIN_DEFAULT } from './references.js' | ||
const defaultTo = require('lodash/defaultTo') | ||
const { BIN_DEFAULT } = require('./references') | ||
|
||
// Transform user input into a args for child procress spawn | ||
export const fromOptions = options => { | ||
const fromOptions = options => { | ||
return defaultTo(options.$bin, BIN_DEFAULT) | ||
} | ||
|
||
module.exports = { fromOptions } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
export const standardFactory = ({ main, command }) => (archive, source, options = {}) => { | ||
const standardFactory = ({ main, command }) => (archive, source, options = {}) => { | ||
const { ..._options } = options | ||
_options._command = command | ||
_options._target = [archive, source] | ||
return main(_options) | ||
} | ||
|
||
export const extractFactory = ({ main, command }) => (archive, output, options = {}) => { | ||
const extractFactory = ({ main, command }) => (archive, output, options = {}) => { | ||
const { ..._options } = options | ||
_options._command = command | ||
_options._target = [archive, options.$cherryPick] | ||
_options.outputDir = output | ||
return main(_options) | ||
} | ||
|
||
export const simplexFactory = ({ main, command }) => (target, options = {}) => { | ||
const simplexFactory = ({ main, command }) => (target, options = {}) => { | ||
const { ..._options } = options | ||
_options._command = command | ||
_options._target = [target, options.$cherryPick] | ||
return main(_options) | ||
} | ||
|
||
module.exports = { standardFactory, extractFactory, simplexFactory } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.