This repository has been archived by the owner on Oct 29, 2023. It is now read-only.
-
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.
1.1.0 ~ Remove Queue class, add Prettier to the project
- Loading branch information
Showing
37 changed files
with
3,612 additions
and
30,281 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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
{ | ||
"extends": "@augu/eslint-config/ts.js" | ||
} | ||
"extends": ["prettier", "@augu/eslint-config/ts.js"], | ||
"plugins": ["prettier"], | ||
"rules": { | ||
"@typescript-eslint/indent": "off", | ||
"quote-props": ["error", "consistent-as-needed"], | ||
"quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": 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
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,43 +1,43 @@ | ||
name: ESLint | ||
on: | ||
push: | ||
pull_request: | ||
branches: | ||
- 'feature/**' | ||
- 'issue/**' | ||
- 'master' | ||
paths-ignore: | ||
- 'examples/**' | ||
- '.github/**' | ||
- '.vscode/**' | ||
- 'docs/**' | ||
- '.eslintiginore' | ||
- '.gitignore' | ||
- '.npmignore' | ||
- '.travis.yml' | ||
- 'LICENSE' | ||
- '**.md' | ||
- 'renovate.json' | ||
jobs: | ||
eslint: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [14.x, 15.x, 16.x] | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Uses Node.js v${{ matrix.node-version }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Installs dependencies | ||
run: npm i -g eslint && npm ci | ||
|
||
- name: Lints the repository | ||
run: npm run lint | ||
|
||
- name: Runs Jest for unit testing | ||
run: npm test | ||
name: ESLint | ||
on: | ||
push: | ||
pull_request: | ||
branches: | ||
- 'feature/**' | ||
- 'issue/**' | ||
- 'master' | ||
paths-ignore: | ||
- 'examples/**' | ||
- '.github/**' | ||
- '.vscode/**' | ||
- 'docs/**' | ||
- '.eslintiginore' | ||
- '.gitignore' | ||
- '.npmignore' | ||
- '.travis.yml' | ||
- 'LICENSE' | ||
- '**.md' | ||
- 'renovate.json' | ||
jobs: | ||
eslint: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [14.x, 15.x, 16.x] | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Uses Node.js v${{ matrix.node-version }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Installs dependencies | ||
run: npm i -g eslint && npm ci | ||
|
||
- name: Lints the repository | ||
run: npm run lint | ||
|
||
- name: Runs Jest for unit testing | ||
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,3 @@ | ||
build | ||
node_modules | ||
docs |
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 @@ | ||
{ | ||
"semi": true, | ||
"tabWidth": 2, | ||
"singleQuote": true, | ||
"endOfLine": "lf", | ||
"printWidth": 120, | ||
"trailingComma": "es5", | ||
"bracketSpacing": 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 |
---|---|---|
|
@@ -9,4 +9,4 @@ node_js: | |
install: yarn | ||
script: | ||
- npm run lint | ||
- npm run test | ||
- npm run 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
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,51 +1,57 @@ | ||
# @augu/collections · [](https://badge.fury.io/js/%40augu%2Fcollections) [](https://github.com/auguwu/collections) [](https://github.com/auguwu/collections/tree/master/.github/workflows) [](https://travis-ci.org/auguwu/collections) [](https://github.com/auguwu/collections) | ||
|
||
> 📝 **Collections library made in TypeScript** | ||
## 0.x builds | ||
If you would like to use the 0.x builds or view it's source code, it'll be available under the [0.x](https://github.com/auguwu/collections/tree/0.x) branch and you can do so with `npm i @augu/immutable`. | ||
|
||
### Changes from 0.x -> 1.x | ||
- `Pair` and `TimedQueue` are remvoed | ||
- All deprecated methods are removed | ||
- Name is changed from `@augu/immutable` to `@augu/collections` | ||
|
||
## Usage | ||
```js | ||
// CommonJS | ||
const collections = require('@augu/collections'); | ||
|
||
// ES6+ | ||
import collections from '@augu/collections'; | ||
|
||
// Collection: Key-value pair that is an extension of [Map] | ||
const coll = new collections.Collection(); // Create a empty one | ||
const coll = new collections.Collection({ // Create one with key-value pairs | ||
key: 'value', | ||
[Symbol('key')]: 'value' | ||
}); | ||
|
||
coll.get('key'); // the value if added or undefined | ||
coll.set('key', 'value'); // the value if the key isn't added | ||
|
||
coll.filter(value => value === 'value'); // Returns a Array of values if the predicate is true | ||
coll.map(v => v); // Returns a Array of values that are mapped by it's predicate function | ||
coll.reduce((curr, acc) => curr + acc, 0); // Implementation of Array.reduce | ||
coll.sort((a, b) => a - b); // Implementation of Array.sort | ||
|
||
// Queue: Queue-based system with a timer extension to do time-based queues | ||
const queue = new collections.Queue(); // Create a empty Queue | ||
const queue = new collections.Queue(['a', 'b', 'c']); // Create one with values being added | ||
|
||
queue.get(0); // Get a item from it's index | ||
queue.add('c'); // Add a item to the queue | ||
queue.delete(2); // Delete a item from it's index | ||
queue.filter(c => c === 'a'); // Filter out the queue from a predicate function | ||
queue.map(u => u); // Map out anything from a predicate function | ||
``` | ||
|
||
## Maintainers | ||
- [August](https://floofy.dev) | ||
|
||
## License | ||
**@augu/collections** is released under [MIT](/LICENSE). 💖 | ||
# @augu/collections · [](https://badge.fury.io/js/%40augu%2Fcollections) [](https://github.com/auguwu/collections) [](https://github.com/auguwu/collections/tree/master/.github/workflows) [](https://travis-ci.org/auguwu/collections) [](https://github.com/auguwu/collections) | ||
|
||
> 📝 **Collections library made in TypeScript** | ||
## 0.x builds | ||
|
||
If you would like to use the 0.x builds or view it's source code, it'll be available under the [0.x](https://github.com/auguwu/collections/tree/0.x) branch and you can do so with `npm i @augu/immutable`. | ||
|
||
### Changes from 0.x -> 1.x | ||
|
||
- `Pair` and `TimedQueue` are remvoed | ||
- All deprecated methods are removed | ||
- Name is changed from `@augu/immutable` to `@augu/collections` | ||
|
||
## Usage | ||
|
||
```js | ||
// CommonJS | ||
const collections = require('@augu/collections'); | ||
|
||
// ES6+ | ||
import collections from '@augu/collections'; | ||
|
||
// Collection: Key-value pair that is an extension of [Map] | ||
const coll = new collections.Collection(); // Create a empty one | ||
const coll = new collections.Collection({ | ||
// Create one with key-value pairs | ||
key: 'value', | ||
[Symbol('key')]: 'value', | ||
}); | ||
|
||
coll.get('key'); // the value if added or undefined | ||
coll.set('key', 'value'); // the value if the key isn't added | ||
|
||
coll.filter((value) => value === 'value'); // Returns a Array of values if the predicate is true | ||
coll.map((v) => v); // Returns a Array of values that are mapped by it's predicate function | ||
coll.reduce((curr, acc) => curr + acc, 0); // Implementation of Array.reduce | ||
coll.sort((a, b) => a - b); // Implementation of Array.sort | ||
|
||
// Queue: Queue-based system with a timer extension to do time-based queues | ||
const queue = new collections.Queue(); // Create a empty Queue | ||
const queue = new collections.Queue(['a', 'b', 'c']); // Create one with values being added | ||
|
||
queue.get(0); // Get a item from it's index | ||
queue.add('c'); // Add a item to the queue | ||
queue.delete(2); // Delete a item from it's index | ||
queue.filter((c) => c === 'a'); // Filter out the queue from a predicate function | ||
queue.map((u) => u); // Map out anything from a predicate function | ||
``` | ||
|
||
## Maintainers | ||
|
||
- [August](https://floofy.dev) | ||
|
||
## License | ||
|
||
**@augu/collections** is released under [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 |
---|---|---|
@@ -1 +1 @@ | ||
collections.floofy.dev | ||
collections.floofy.dev |
Oops, something went wrong.