Skip to content
This repository has been archived by the owner on Oct 29, 2023. It is now read-only.

Commit

Permalink
1.1.0 ~ Remove Queue class, add Prettier to the project
Browse files Browse the repository at this point in the history
  • Loading branch information
auguwu committed Sep 12, 2021
1 parent 9d9d72e commit 8178af4
Show file tree
Hide file tree
Showing 37 changed files with 3,612 additions and 30,281 deletions.
10 changes: 8 additions & 2 deletions .eslintrc.json
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 }]
}
}
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ labels: bug
---

# Issue in-hand

**Describe your bug report here**

```js
// If there is any code to reproduce, add it here
```

# Options

- Node.js Version:
- Library Version/Branch:
- Operating System:
86 changes: 43 additions & 43 deletions .github/workflows/ESLint.yml
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
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build
node_modules
docs
9 changes: 9 additions & 0 deletions .prettierrc.json
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
}
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ node_js:
install: yarn
script:
- npm run lint
- npm run test
- npm run test
1 change: 0 additions & 1 deletion CNAME

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) Noelware
Copyright (c) 2019-2021 Noelware

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
108 changes: 57 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,57 @@
# @augu/collections · [![npm version](https://badge.fury.io/js/%40augu%2Fcollections.svg)](https://badge.fury.io/js/%40augu%2Fcollections) [![Stars](https://img.shields.io/github/stars/auguwu/collections)](https://github.com/auguwu/collections) [![Workflow Status](https://github.com/auguwu/collections/workflows/ESLint/badge.svg)](https://github.com/auguwu/collections/tree/master/.github/workflows) [![Build Status](https://travis-ci.org/auguwu/collections.svg?branch=master)](https://travis-ci.org/auguwu/collections) [![Build Size](https://img.shields.io/bundlephobia/min/@augu/collections?style=flat-square)](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 · [![npm version](https://badge.fury.io/js/%40augu%2Fcollections.svg)](https://badge.fury.io/js/%40augu%2Fcollections) [![Stars](https://img.shields.io/github/stars/auguwu/collections)](https://github.com/auguwu/collections) [![Workflow Status](https://github.com/auguwu/collections/workflows/ESLint/badge.svg)](https://github.com/auguwu/collections/tree/master/.github/workflows) [![Build Status](https://travis-ci.org/auguwu/collections.svg?branch=master)](https://travis-ci.org/auguwu/collections) [![Build Size](https://img.shields.io/bundlephobia/min/@augu/collections?style=flat-square)](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). 💖
2 changes: 1 addition & 1 deletion docs/CNAME
Original file line number Diff line number Diff line change
@@ -1 +1 @@
collections.floofy.dev
collections.floofy.dev
Loading

0 comments on commit 8178af4

Please sign in to comment.