-
-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(prefixes): Add improved prefixing (#4)
* feat(prefixes): Add improved prefixing Leverage prefix-matches module to support nested prefixes (e.g. "w.j" ==> watch.javascript) * feat(prefixes): Wholly remove non-prefix resolution Fallback to lodash.get no longer required. If prefixMatches doesn't find it, neither will lodash.get. This also gets code coverage up to 100% again :) * feat(prefixes): Bump dependency version ... to avoid strict mode + const complaints in build * feat(prefixes): Bump dependency version ... again, to reverse strict-mode removal of prefix-matches module * feat(prefixes): Bump dependency version Bump version of prefix-matches, to fix 'use strict' / const issues * feat(prefixes): Bump dependency version Adds support for node 0.12 + 0.10 * docs(prefixes): Add notes about deeper prefixing support * docs(prefixes): Adjust for bad merge * docs(prefixes): Pure vanity: adding self to contributors list
- Loading branch information
1 parent
c75cba6
commit bf877ab
Showing
7 changed files
with
28 additions
and
41 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
import resolveScriptObjectToString from './resolve-script-object-to-string' | ||
import get from 'lodash.get' | ||
import prefixToScriptName from './prefix-to-script-name' | ||
import prefixMatches from 'prefix-matches' | ||
import kebabAndCamelCasify from './kebab-and-camel-casify' | ||
|
||
export default getScriptToRun | ||
|
||
function getScriptToRun(config, input) { | ||
config = kebabAndCamelCasify(config) | ||
input = prefixToScriptName(input, config)[0] || input // allow prefix | ||
const script = get(config, input) | ||
const script = prefixMatches(input, config)[0] | ||
return resolveScriptObjectToString(script) | ||
} |
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.