generated from shgysk8zer0/npm-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #59 from AegisJSProject/feature/url-parser
Add URL parser & fix bad config passing
- Loading branch information
Showing
9 changed files
with
51 additions
and
23 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,4 +1,3 @@ | ||
import { ignoreFile } from '@shgysk8zer0/eslint-config/ignoreFile.js'; | ||
import browser from '@shgysk8zer0/eslint-config/browser.js'; | ||
|
||
export default [ignoreFile, browser()]; | ||
export default browser({ files: ['*.js', 'test/**/*.js'], ignores: ['**/*.min.js'] }); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { stringify } from './utils.js'; | ||
|
||
export function escape(str) { | ||
return encodeURIComponent(stringify(str).trim()).replaceAll('.', '%2E'); | ||
} | ||
|
||
export function url(strings, base, ...values) { | ||
if (base instanceof Blob && strings.length === 2 && strings[0] === '' && strings[1] === '') { | ||
return URL.createObjectURL(base); | ||
} else if (URL.canParse(base)) { | ||
return URL.parse(String.raw(strings, '', ...values.map(escape)), base); | ||
} else { | ||
return URL.parse(String.raw(strings, escape(base), ...values.map(escape))); | ||
} | ||
} |
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