-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from alewin/feature/rename-remoteDepsParser-op…
…tions Feature/rename remote deps parser options
- Loading branch information
Showing
6 changed files
with
18 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
/** | ||
* | ||
* Concatenates the dependencies into a comma separated string. | ||
* Concatenates the remote dependencies into a comma separated string. | ||
* this string will then be passed as an argument to the "importScripts" function | ||
* | ||
* @param {Array.<String>}} deps array of string | ||
* @returns {String} a string composed by the concatenation of the array | ||
* elements "deps" and "importScripts". | ||
* | ||
* @example | ||
* depsParser(['demo1', 'demo2']) // return importScripts('demo1, demo2') | ||
* remoteDepsParser(['http://js.com/1.js', 'http://js.com/2.js']) // return importScripts('http://js.com/1.js, http://js.com/2.js') | ||
*/ | ||
const depsParser = (deps: string[]) => { | ||
const remoteDepsParser = (deps: string[]) => { | ||
if (deps.length === 0) return '' | ||
|
||
const depsString = (deps.map(dep => `${dep}`)).toString() | ||
return `importScripts('${depsString}')` | ||
} | ||
|
||
export default depsParser | ||
export default remoteDepsParser |
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