-
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.
- Loading branch information
0 parents
commit 75ef0e0
Showing
15 changed files
with
7,705 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
env: | ||
browser: true | ||
es2021: true | ||
extends: | ||
- eslint:recommended | ||
- plugin:@typescript-eslint/recommended | ||
parserOptions: | ||
ecmaVersion: latest | ||
parser: '@typescript-eslint/parser' | ||
sourceType: module | ||
plugins: | ||
- '@typescript-eslint' | ||
rules: | ||
indent: | ||
- error | ||
- 4 | ||
- SwitchCase: 1 | ||
linebreak-style: | ||
- error | ||
- unix | ||
quotes: | ||
- error | ||
- single | ||
semi: | ||
- error | ||
- always |
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,30 @@ | ||
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | ||
|
||
name: Node.js CI | ||
|
||
on: | ||
push: | ||
branches: ['master'] | ||
pull_request: | ||
branches: ['master'] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [14.x, 16.x, 18.x] | ||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
- run: npm ci | ||
- run: npm run build --if-present | ||
- run: npm test |
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 @@ | ||
name: 'size' | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
jobs: | ||
size: | ||
runs-on: ubuntu-latest | ||
env: | ||
CI_JOB_NUMBER: 1 | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: andresz1/size-limit-action@v1 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
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,3 @@ | ||
node_modules | ||
coverage | ||
lib |
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,5 @@ | ||
{ | ||
"printWidth": 140, | ||
"tabWidth": 4, | ||
"singleQuote": true | ||
} |
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,37 @@ | ||
**beautify-url** is an opinionated, security-oriented library that transforms URLs into shorter, more aesthetic forms without compromising their functionality or security. | ||
|
||
## Installation | ||
|
||
```bash | ||
npm i --save beautify-url | ||
# or | ||
yarn add beautify-url | ||
``` | ||
|
||
## Usage | ||
|
||
Import the `beautifyUrl` function and use it to transform URLs: | ||
|
||
```javascript | ||
import beautifyUrl from 'beautify-url'; | ||
|
||
console.log(beautifyUrl('https://google.com')); | ||
// Outputs: 'google.com' | ||
|
||
console.log(beautifyUrl('ftp://google.com')); | ||
// Outputs: 'ftp://google.com' | ||
|
||
console.log(beautifyUrl('https://google.com?q=long&with=very-long-last-value')); | ||
// Outputs: 'google.com?[..]value' | ||
|
||
console.log(beautifyUrl('not an URL')); | ||
// Outputs: 'not an URL' | ||
``` | ||
|
||
## Contributing | ||
|
||
Having trouble? Found a bug? Want to contribute? Any kind of contribution is welcome. If you have any questions, please open an issue or create a pull request. | ||
|
||
## License | ||
|
||
This project is licensed under the MIT License. |
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,6 @@ | ||
module.exports = { | ||
presets: [ | ||
['@babel/preset-env', {targets: {node: 'current'}}], | ||
'@babel/preset-typescript', | ||
], | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module.exports = { | ||
collectCoverage: true, | ||
collectCoverageFrom: [ | ||
'src/**/*' | ||
], | ||
testPathIgnorePatterns: ['/node_modules/', '/dist/', '/lib/'], | ||
coverageProvider: 'v8', | ||
verbose: true, | ||
}; |
Oops, something went wrong.