-
Notifications
You must be signed in to change notification settings - Fork 1
Refactor #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gagoar
wants to merge
18
commits into
main
Choose a base branch
from
refactor
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Refactor #3
Changes from 9 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
1b27030
new changes
mlacosta 6301801
refactoring
mlacosta e4d5f42
add test
mlacosta 3912a1d
add files
mlacosta 76f356f
debugging
74d2341
some split tests + functions next to refactors
gagoar f2093b5
more experimentation
gagoar fd6139b
create smaller dataset
52b3548
91% tested, working
gagoar c372513
fixing workflows and lint
gagoar b9893a9
remove old folder
842cdbc
latest changes
7445b02
work on readme
bfd7a83
update readme
ef43abb
update readme
1a0a275
Update README.md
mlacosta bb9f1b9
Update README.md
mlacosta 5bd1350
Update README.md
mlacosta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,20 @@ | ||
| on: | ||
| push: | ||
| # Sequence of patterns matched against refs/tags | ||
| tags: | ||
| - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
|
|
||
| jobs: | ||
| npm: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - uses: actions/setup-node@v2 | ||
| with: | ||
| node-version: '12.x' | ||
| registry-url: 'https://registry.npmjs.org' | ||
| - run: npm install | ||
| - run: npm run build | ||
| - run: npm publish | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains hidden or 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,64 @@ | ||
| name: Validation | ||
|
|
||
| on: [pull_request] | ||
|
|
||
| jobs: | ||
| lint: | ||
| name: Linting | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@master | ||
| - name: Use Node.js 12.x | ||
| uses: actions/setup-node@v2 | ||
| with: | ||
| node-version: 12.x | ||
| - name: Install dependencies | ||
| run: npm install | ||
| - name: ESLint | ||
| run: npm run lint | ||
| test: | ||
| name: Run unit tests | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@master | ||
| - name: Use Node.js 12.x | ||
| uses: actions/setup-node@v2 | ||
| with: | ||
| node-version: 12.x | ||
| - name: Install dependencies | ||
| run: npm install | ||
| - name: Jest | ||
| run: npm run test --coverage | ||
| - name: Send coverage to codecov | ||
| uses: codecov/codecov-action@v1 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| flags: unittests | ||
|
|
||
| build: | ||
| name: Run build | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@master | ||
| - name: Use Node.js 12.x | ||
| uses: actions/setup-node@v2 | ||
| with: | ||
| node-version: 12.x | ||
| - name: Install dependencies | ||
| run: npm install | ||
| - name: Build | ||
| run: npm run build | ||
|
|
||
| buildCli: | ||
| name: Run build-cli | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@master | ||
| - name: Use Node.js 12.x | ||
| uses: actions/setup-node@v2 | ||
| with: | ||
| node-version: 12.x | ||
| - name: Install dependencies | ||
| run: npm install | ||
| - name: Build | ||
| run: npm run build-cli |
This file contains hidden or 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 +1,8 @@ | ||
| dataset.js | ||
| node_modules | ||
| .vscode/ | ||
| # ignore codecoverage output | ||
| coverage/ | ||
| # ignore cli binary output | ||
| cli/ | ||
| # ignore dist/ output | ||
| dist/ |
This file contains hidden or 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 @@ | ||
| 12.20.2 |
This file contains hidden or 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,21 @@ | ||
| MIT License | ||
|
|
||
| Copyright (c) 2020 Gago | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
This file contains hidden or 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,33 +1,46 @@ | ||
| # Huffman-URL-Compressor-for-Nodejs | ||
| ## Author: Mariano L. Acosta | ||
| <p align="center"> | ||
| <h3 align="center">Template for typescript applications</h3> | ||
|
|
||
| # Description | ||
| Convert any kind of String into a url-friendly parameter using Huffman Encoding. | ||
| <p align="center"> | ||
| ⚙ Template repository for typescript applications meant to run in node ⚙ | ||
| <br /> | ||
| <a href="https://github.com/gagoar/ts-node-template#table-of-contents"><strong>Explore the docs »</strong></a> | ||
| <br /> | ||
| <a href="https://github.com/gagoar/ts-node-template/issues">Report Bug</a> | ||
| · | ||
| <a href="https://github.com/gagoar/ts-node-template/issues">Request Feature</a> | ||
| </p> | ||
| </p> | ||
|
|
||
| # Installation | ||
| ## Table of Contents | ||
|
|
||
| npm install --save huffman-url-compressor | ||
| - [Built With](#built-with) | ||
| - [Getting Started](#getting-started) | ||
| - [Contributing](#contributing) | ||
| - [License](#license) | ||
|
|
||
| # Usage | ||
| <!-- CONTRIBUTING --> | ||
|
|
||
| ## Parameters: | ||
| ### Built With | ||
|
|
||
| - **Train (string)**: Training set used to create the encoder. This is where the algorithm gets the frequency for each char. | ||
| - **Test (string)**: String that you want to encode. | ||
| - [ncc](https://github.com/vercel/ncc/) | ||
| - [jest](https://github.com/facebook/jest) | ||
| - [ora](https://github.com/sindresorhus/ora) | ||
| - [commander](https://github.com/tj/commander.js/) | ||
| - [cosmiconfig](https://github.com/davidtheclark/cosmiconfig) | ||
|
|
||
| ## Example: | ||
| ## Contributing | ||
|
|
||
| import {createEncoder, encodeConfig, decodeConfig} from 'huffman-url-compressor'; | ||
| Contributions are what makes the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated **greatly appreciated**. | ||
|
|
||
| //create encoder | ||
| 1. Fork the Project | ||
| 2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`) | ||
| 3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`) | ||
| 4. Push to the Branch (`git push origin feature/AmazingFeature`) | ||
| 5. Open a Pull Request | ||
|
|
||
| let Encoder = createEncoder(train); | ||
| <!-- LICENSE --> | ||
|
|
||
| //create a base64 encoded stream | ||
|
|
||
| let encodedParam = encodeConfig(test,Encoder) | ||
| //retrieve the original param | ||
|
|
||
| let decodParam= decodeConfig(encodedParam,Encoder) | ||
| ## License | ||
|
|
||
| Distributed under the MIT License. See `LICENSE` for more information. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this readme should be adjusted to your repo. @mlacosta