-
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 #493 from swrlab/dev/update
Update v1.1.0
- Loading branch information
Showing
17 changed files
with
514 additions
and
326 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,31 @@ | ||
name: Test | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- chore/* | ||
- feat/* | ||
- dev/* | ||
- main | ||
|
||
jobs: | ||
test: | ||
name: Run Mocha Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 👀 Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: ⛺️ Install Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: "yarn" | ||
cache-dependency-path: "**/yarn.lock" | ||
|
||
- name: 📦 Install Dependencies | ||
run: yarn | ||
|
||
- name: 🧪 Run Tests | ||
run: yarn lint && yarn 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
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,6 +1,6 @@ | ||
{ | ||
"name": "@swrlab/utils", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Wrapping common SWR Audio Lab utils", | ||
"main": "./src/index.js", | ||
"engines": { | ||
|
@@ -15,29 +15,30 @@ | |
"ard:categories": "node -r dotenv/config scripts/ard/categories.js", | ||
"ard:publishers": "node -r dotenv/config scripts/ard/publishers.js", | ||
"ard:pub-sort": "node -r dotenv/config scripts/ard/sortPubByExtId.js", | ||
"lint": "eslint .", | ||
"test": "mocha test/test.js -r dotenv/config", | ||
"reinstall": "rm -rf node_modules && rm yarn.lock && yarn" | ||
}, | ||
"author": "SWR Audio Lab <[email protected]>", | ||
"license": "MIT", | ||
"private": false, | ||
"dependencies": { | ||
"@google-cloud/storage": "^6.3.0", | ||
"@google-cloud/storage": "^6.8.0", | ||
"abort-controller": "^3.0.0", | ||
"aws-sdk": "^2.1190.0", | ||
"chai": "^4.3.6", | ||
"node-crc": "swrlab/node-crc#v2.0.15", | ||
"undici": "^5.8.2", | ||
"uuid": "8.3.2" | ||
"aws-sdk": "^2.1277.0", | ||
"chai": "^4.3.7", | ||
"node-crc": "swrlab/node-crc#v2.1.0", | ||
"undici": "^5.14.0", | ||
"uuid": "9.0.0" | ||
}, | ||
"devDependencies": { | ||
"@swrlab/eslint-plugin-swr": "^0.2.0", | ||
"@swrlab/swr-prettier-config": "^0.2.0", | ||
"dotenv": "^16.0.1", | ||
"eslint": "^8.21.0", | ||
"dotenv": "^16.0.3", | ||
"eslint": "^8.30.0", | ||
"eslint-plugin-json": "^3.1.0", | ||
"mocha": "^10.0.0", | ||
"prettier": "^2.7.1" | ||
"mocha": "^10.2.0", | ||
"prettier": "^2.8.1" | ||
}, | ||
"prettier": "@swrlab/swr-prettier-config" | ||
} |
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,32 @@ | ||
# SWR Audio Lab / Helpers | ||
|
||
Common functions and helpers. | ||
|
||
- [SWR Audio Lab / Helpers](#swr-audio-lab--helpers) | ||
- [Install](#install) | ||
- [`sleep` - sleep a given time (async)](#sleep---sleep-a-given-time-async) | ||
|
||
## Install | ||
|
||
Add the parent package to your dependencies: | ||
|
||
```sh | ||
yarn add @swrlab/utils | ||
``` | ||
|
||
## `sleep` - sleep a given time (async) | ||
|
||
- `value` (required) - Value to sleep (in ms) | ||
|
||
Import the library: | ||
|
||
```js | ||
const { sleep } = require('@swrlab/utils/packages/helpers') | ||
``` | ||
|
||
Then use the toolkit: | ||
|
||
```js | ||
await sleep(1e3) | ||
// will sleep 1s | ||
``` |
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,7 @@ | ||
// import packages | ||
const sleep = require('../../utils/helpers/sleep') | ||
|
||
// export packages | ||
module.exports = { | ||
sleep, | ||
} |
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,53 @@ | ||
# SWR Audio Lab / Numbers | ||
|
||
Common number and math helpers. | ||
|
||
- [SWR Audio Lab / Numbers](#swr-audio-lab--numbers) | ||
- [Install](#install) | ||
- [`isEven` - check if a value is even](#iseven---check-if-a-value-is-even) | ||
- [`toReadable` - get a number in readable format](#toreadable---get-a-number-in-readable-format) | ||
|
||
## Install | ||
|
||
Add the parent package to your dependencies: | ||
|
||
```sh | ||
yarn add @swrlab/utils | ||
``` | ||
|
||
## `isEven` - check if a value is even | ||
|
||
- `value` (required) - Value to check | ||
|
||
Import the library: | ||
|
||
```js | ||
const { isEven } = require('@swrlab/utils/packages/numbers') | ||
``` | ||
|
||
Then use the toolkit: | ||
|
||
```js | ||
isEven(2) | ||
// true | ||
|
||
isEven(1) | ||
// false | ||
``` | ||
|
||
## `toReadable` - get a number in readable format | ||
|
||
- `value` (required) - Value to convert | ||
|
||
Import the library: | ||
|
||
```js | ||
const { toReadable } = require('@swrlab/utils/packages/numbers') | ||
``` | ||
|
||
Then use the toolkit: | ||
|
||
```js | ||
toReadable(1234567) | ||
// 1.234.567 | ||
``` |
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 @@ | ||
// import packages | ||
const isEven = require('../../utils/numbers/isEven') | ||
const toReadable = require('../../utils/numbers/toReadable') | ||
|
||
// export packages | ||
module.exports = { | ||
isEven, | ||
toReadable, | ||
} |
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
Oops, something went wrong.