added node modules back to the example bot, so it exports with the required modules
This commit is contained in:
148
example_bot/node_modules/@sapphire/async-queue/CHANGELOG.md
generated
vendored
Normal file
148
example_bot/node_modules/@sapphire/async-queue/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,148 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
# [@sapphire/async-queue@1.5.0](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.4.0...@sapphire/async-queue@1.5.0) - (2022-08-16)
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
- **deps:** Update all non-major dependencies ([2308bd7](https://github.com/sapphiredev/utilities/commit/2308bd74356b6b2e0c12995b25f4d8ade4803fe9))
|
||||
|
||||
## 🚀 Features
|
||||
|
||||
- Add `AsyncQueue#abortAll` (#429) ([b351e70](https://github.com/sapphiredev/utilities/commit/b351e70ebef329009daaebba89729ee84bb5704c))
|
||||
|
||||
# [@sapphire/async-queue@1.4.0](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.3.1...@sapphire/async-queue@1.4.0) - (2022-08-07)
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
- **deps:** Update all non-major dependencies ([84af0db](https://github.com/sapphiredev/utilities/commit/84af0db2db749223b036aa99fe19a2e9af5681c6))
|
||||
- **deps:** Update all non-major dependencies ([50cd8de](https://github.com/sapphiredev/utilities/commit/50cd8dea593b6f5ae75571209456b3421e2ca59a))
|
||||
|
||||
## 📝 Documentation
|
||||
|
||||
- Add @muchnameless as a contributor ([a1221fe](https://github.com/sapphiredev/utilities/commit/a1221fea68506e99591d5d00ec552a07c26833f9))
|
||||
- Add @enxg as a contributor ([d2382f0](https://github.com/sapphiredev/utilities/commit/d2382f04e3909cb4ad11798a0a10e683f6cf5383))
|
||||
- Add @EvolutionX-10 as a contributor ([efc3a32](https://github.com/sapphiredev/utilities/commit/efc3a320a72ae258996dd62866d206c33f8d4961))
|
||||
- Add @MajesticString as a contributor ([295b3e9](https://github.com/sapphiredev/utilities/commit/295b3e9849a4b0fe64074bae02f6426378a303c3))
|
||||
- Add @Mzato0001 as a contributor ([c790ef2](https://github.com/sapphiredev/utilities/commit/c790ef25df2d7e22888fa9f8169167aa555e9e19))
|
||||
- Add @NotKaskus as a contributor ([00da8f1](https://github.com/sapphiredev/utilities/commit/00da8f199137b9277119823f322d1f2d168d928a))
|
||||
- Add @imranbarbhuiya as a contributor ([fb674c2](https://github.com/sapphiredev/utilities/commit/fb674c2c5594d41e71662263553dcb4bac9e37f4))
|
||||
- Add @axisiscool as a contributor ([ce1aa31](https://github.com/sapphiredev/utilities/commit/ce1aa316871a88d3663efbdf2a42d3d8dfe6a27f))
|
||||
- Add @dhruv-kaushikk as a contributor ([ebbf43f](https://github.com/sapphiredev/utilities/commit/ebbf43f63617daba96e72c50a234bf8b64f6ddc4))
|
||||
- Add @Commandtechno as a contributor ([f1d69fa](https://github.com/sapphiredev/utilities/commit/f1d69fabe1ee0abe4be08b19e63dbec03102f7ce))
|
||||
- Fix typedoc causing OOM crashes ([63ba41c](https://github.com/sapphiredev/utilities/commit/63ba41c4b6678554b1c7043a22d3296db4f59360))
|
||||
|
||||
## 🚀 Features
|
||||
|
||||
- **AsyncQueue:** Add AbortSignal support (#417) ([c0629e7](https://github.com/sapphiredev/utilities/commit/c0629e781ebc3f48e496a0851191b32e91f62fe9))
|
||||
|
||||
## 🧪 Testing
|
||||
|
||||
- Migrate to vitest (#380) ([075ec73](https://github.com/sapphiredev/utilities/commit/075ec73c7a8e3374fad3ada612d37eb4ac36ec8d))
|
||||
|
||||
## [1.3.1](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.3.0...@sapphire/async-queue@1.3.1) (2022-04-01)
|
||||
|
||||
**Note:** Version bump only for package @sapphire/async-queue
|
||||
|
||||
# [1.3.0](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.2.0...@sapphire/async-queue@1.3.0) (2022-03-06)
|
||||
|
||||
### Features
|
||||
|
||||
- allow module: NodeNext ([#306](https://github.com/sapphiredev/utilities/issues/306)) ([9dc6dd6](https://github.com/sapphiredev/utilities/commit/9dc6dd619efab879bb2b0b3c9e64304e10a67ed6))
|
||||
- **ts-config:** add multi-config structure ([#281](https://github.com/sapphiredev/utilities/issues/281)) ([b5191d7](https://github.com/sapphiredev/utilities/commit/b5191d7f2416dc5838590c4ff221454925553e37))
|
||||
|
||||
# [1.2.0](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.1.9...@sapphire/async-queue@1.2.0) (2022-01-28)
|
||||
|
||||
### Features
|
||||
|
||||
- change build system to tsup ([#270](https://github.com/sapphiredev/utilities/issues/270)) ([365a53a](https://github.com/sapphiredev/utilities/commit/365a53a5517a01a0926cf28a83c96b63f32ed9f8))
|
||||
|
||||
## [1.1.9](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.1.8...@sapphire/async-queue@1.1.9) (2021-11-06)
|
||||
|
||||
**Note:** Version bump only for package @sapphire/async-queue
|
||||
|
||||
## [1.1.8](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.1.7...@sapphire/async-queue@1.1.8) (2021-10-26)
|
||||
|
||||
**Note:** Version bump only for package @sapphire/async-queue
|
||||
|
||||
## [1.1.7](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.1.6...@sapphire/async-queue@1.1.7) (2021-10-17)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- allow more node & npm versions in engines field ([5977d2a](https://github.com/sapphiredev/utilities/commit/5977d2a30a4b2cfdf84aff3f33af03ffde1bbec5))
|
||||
|
||||
## [1.1.6](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.1.5...@sapphire/async-queue@1.1.6) (2021-10-11)
|
||||
|
||||
**Note:** Version bump only for package @sapphire/async-queue
|
||||
|
||||
## [1.1.5](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.1.4...@sapphire/async-queue@1.1.5) (2021-10-04)
|
||||
|
||||
**Note:** Version bump only for package @sapphire/async-queue
|
||||
|
||||
## [1.1.4](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.1.3...@sapphire/async-queue@1.1.4) (2021-06-27)
|
||||
|
||||
**Note:** Version bump only for package @sapphire/async-queue
|
||||
|
||||
## [1.1.3](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.1.2...@sapphire/async-queue@1.1.3) (2021-06-06)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- remove peer deps, update dev deps, update READMEs ([#124](https://github.com/sapphiredev/utilities/issues/124)) ([67256ed](https://github.com/sapphiredev/utilities/commit/67256ed43b915b02a8b5c68230ba82d6210c5032))
|
||||
|
||||
## [1.1.2](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.1.1...@sapphire/async-queue@1.1.2) (2021-05-20)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **async-queue:** mark package as side effect free ([1c4b901](https://github.com/sapphiredev/utilities/commit/1c4b901cda3d14bd085c35cc74e160f844567ba7))
|
||||
|
||||
## [1.1.1](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.1.0...@sapphire/async-queue@1.1.1) (2021-05-02)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- drop the `www.` from the SapphireJS URL ([494d89f](https://github.com/sapphiredev/utilities/commit/494d89ffa04f78c195b93d7905b3232884f7d7e2))
|
||||
- update all the SapphireJS URLs from `.com` to `.dev` ([f59b46d](https://github.com/sapphiredev/utilities/commit/f59b46d1a0ebd39cad17b17d71cd3b9da808d5fd))
|
||||
|
||||
# [1.1.0](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.0.7...@sapphire/async-queue@1.1.0) (2021-04-21)
|
||||
|
||||
### Features
|
||||
|
||||
- add @sapphire/embed-jsx ([#100](https://github.com/sapphiredev/utilities/issues/100)) ([7277a23](https://github.com/sapphiredev/utilities/commit/7277a236015236ed8e81b7882875410facc4ce17))
|
||||
|
||||
## [1.0.7](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.0.6...@sapphire/async-queue@1.0.7) (2021-04-19)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- change all Sapphire URLs from "project"->"community" & use our domain where applicable 👨🌾🚜 ([#102](https://github.com/sapphiredev/utilities/issues/102)) ([835b408](https://github.com/sapphiredev/utilities/commit/835b408e8e57130c3787aca2e32613346ff23e4d))
|
||||
|
||||
## [1.0.6](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.0.5...@sapphire/async-queue@1.0.6) (2021-04-03)
|
||||
|
||||
**Note:** Version bump only for package @sapphire/async-queue
|
||||
|
||||
## [1.0.5](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.0.4...@sapphire/async-queue@1.0.5) (2021-03-16)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- remove terser from all packages ([#79](https://github.com/sapphiredev/utilities/issues/79)) ([1cfe4e7](https://github.com/sapphiredev/utilities/commit/1cfe4e7c804e62c142495686d2b83b81d0026c02))
|
||||
|
||||
## [1.0.4](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.0.3...@sapphire/async-queue@1.0.4) (2021-02-16)
|
||||
|
||||
**Note:** Version bump only for package @sapphire/async-queue
|
||||
|
||||
## [1.0.3](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.0.2...@sapphire/async-queue@1.0.3) (2021-02-13)
|
||||
|
||||
**Note:** Version bump only for package @sapphire/async-queue
|
||||
|
||||
## [1.0.2](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.0.1...@sapphire/async-queue@1.0.2) (2021-01-25)
|
||||
|
||||
**Note:** Version bump only for package @sapphire/async-queue
|
||||
|
||||
## [1.0.1](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.0.0...@sapphire/async-queue@1.0.1) (2021-01-16)
|
||||
|
||||
**Note:** Version bump only for package @sapphire/async-queue
|
||||
|
||||
# 1.0.0 (2021-01-13)
|
||||
|
||||
### Features
|
||||
|
||||
- **async-queue:** add async-queue package ([#56](https://github.com/sapphiredev/utilities/issues/56)) ([ba81832](https://github.com/sapphiredev/utilities/commit/ba8183287dbbc3f3d7d79af6d5a2d3dd8d62f63e))
|
||||
116
example_bot/node_modules/@sapphire/async-queue/README.md
generated
vendored
Normal file
116
example_bot/node_modules/@sapphire/async-queue/README.md
generated
vendored
Normal file
@@ -0,0 +1,116 @@
|
||||
<div align="center">
|
||||
|
||||

|
||||
|
||||
# @sapphire/async-queue
|
||||
|
||||
**Sequential asynchronous lock-based queue for promises.**
|
||||
|
||||
[](https://github.com/sapphiredev/utilities/blob/main/LICENSE.md)
|
||||
[](https://codecov.io/gh/sapphiredev/utilities)
|
||||
[](https://bundlephobia.com/result?p=@sapphire/async-queue)
|
||||
[](https://www.npmjs.com/package/@sapphire/async-queue)
|
||||
|
||||
</div>
|
||||
|
||||
## Description
|
||||
|
||||
Ever needed a queue for a set of promises? This is the package for you.
|
||||
|
||||
## Features
|
||||
|
||||
- Written in TypeScript
|
||||
- Bundled with esbuild so it can be used in NodeJS and browsers
|
||||
- Offers CommonJS, ESM and UMD bundles
|
||||
- Fully tested
|
||||
|
||||
## Installation
|
||||
|
||||
You can use the following command to install this package, or replace `npm install` with your package manager of choice.
|
||||
|
||||
```sh
|
||||
npm install @sapphire/async-queue
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Buy us some doughnuts
|
||||
|
||||
Sapphire Community is and always will be open source, even if we don't get donations. That being said, we know there are amazing people who may still want to donate just to show their appreciation. Thank you very much in advance!
|
||||
|
||||
We accept donations through Open Collective, Ko-fi, PayPal, Patreon and GitHub Sponsorships. You can use the buttons below to donate through your method of choice.
|
||||
|
||||
| Donate With | Address |
|
||||
| :-------------: | :-------------------------------------------------: |
|
||||
| Open Collective | [Click Here](https://sapphirejs.dev/opencollective) |
|
||||
| Ko-fi | [Click Here](https://sapphirejs.dev/kofi) |
|
||||
| Patreon | [Click Here](https://sapphirejs.dev/patreon) |
|
||||
| PayPal | [Click Here](https://sapphirejs.dev/paypal) |
|
||||
|
||||
## Contributors ✨
|
||||
|
||||
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
||||
<!-- prettier-ignore-start -->
|
||||
<!-- markdownlint-disable -->
|
||||
<table>
|
||||
<tr>
|
||||
<td align="center"><a href="https://favware.tech/"><img src="https://avatars3.githubusercontent.com/u/4019718?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jeroen Claassens</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=favna" title="Code">💻</a> <a href="#infra-favna" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#projectManagement-favna" title="Project Management">📆</a> <a href="https://github.com/sapphiredev/utilities/commits?author=favna" title="Documentation">📖</a> <a href="https://github.com/sapphiredev/utilities/commits?author=favna" title="Tests">⚠️</a></td>
|
||||
<td align="center"><a href="https://github.com/kyranet"><img src="https://avatars0.githubusercontent.com/u/24852502?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Antonio Román</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=kyranet" title="Code">💻</a> <a href="#projectManagement-kyranet" title="Project Management">📆</a> <a href="https://github.com/sapphiredev/utilities/pulls?q=is%3Apr+reviewed-by%3Akyranet" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/sapphiredev/utilities/commits?author=kyranet" title="Tests">⚠️</a></td>
|
||||
<td align="center"><a href="https://github.com/PyroTechniac"><img src="https://avatars2.githubusercontent.com/u/39341355?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Gryffon Bellish</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=PyroTechniac" title="Code">💻</a> <a href="https://github.com/sapphiredev/utilities/pulls?q=is%3Apr+reviewed-by%3APyroTechniac" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/sapphiredev/utilities/commits?author=PyroTechniac" title="Tests">⚠️</a></td>
|
||||
<td align="center"><a href="https://github.com/vladfrangu"><img src="https://avatars3.githubusercontent.com/u/17960496?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Vlad Frangu</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=vladfrangu" title="Code">💻</a> <a href="https://github.com/sapphiredev/utilities/issues?q=author%3Avladfrangu" title="Bug reports">🐛</a> <a href="https://github.com/sapphiredev/utilities/pulls?q=is%3Apr+reviewed-by%3Avladfrangu" title="Reviewed Pull Requests">👀</a> <a href="#userTesting-vladfrangu" title="User Testing">📓</a> <a href="https://github.com/sapphiredev/utilities/commits?author=vladfrangu" title="Tests">⚠️</a></td>
|
||||
<td align="center"><a href="https://github.com/Stitch07"><img src="https://avatars0.githubusercontent.com/u/29275227?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Stitch07</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=Stitch07" title="Code">💻</a> <a href="#projectManagement-Stitch07" title="Project Management">📆</a> <a href="https://github.com/sapphiredev/utilities/commits?author=Stitch07" title="Tests">⚠️</a></td>
|
||||
<td align="center"><a href="https://github.com/apps/depfu"><img src="https://avatars3.githubusercontent.com/in/715?v=4?s=100" width="100px;" alt=""/><br /><sub><b>depfu[bot]</b></sub></a><br /><a href="#maintenance-depfu[bot]" title="Maintenance">🚧</a></td>
|
||||
<td align="center"><a href="https://github.com/apps/allcontributors"><img src="https://avatars0.githubusercontent.com/in/23186?v=4?s=100" width="100px;" alt=""/><br /><sub><b>allcontributors[bot]</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=allcontributors[bot]" title="Documentation">📖</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/Nytelife26"><img src="https://avatars1.githubusercontent.com/u/22531310?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Tyler J Russell</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=Nytelife26" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://github.com/Alcremie"><img src="https://avatars0.githubusercontent.com/u/54785334?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ivan Lieder</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=Alcremie" title="Code">💻</a> <a href="https://github.com/sapphiredev/utilities/issues?q=author%3AAlcremie" title="Bug reports">🐛</a></td>
|
||||
<td align="center"><a href="https://github.com/RealShadowNova"><img src="https://avatars3.githubusercontent.com/u/46537907?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Hezekiah Hendry</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=RealShadowNova" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/Vetlix"><img src="https://avatars.githubusercontent.com/u/31412314?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Vetlix</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=Vetlix" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/ethamitc"><img src="https://avatars.githubusercontent.com/u/27776796?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ethan Mitchell</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=ethamitc" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://github.com/noftaly"><img src="https://avatars.githubusercontent.com/u/34779161?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Elliot</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=noftaly" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://jurien.dev"><img src="https://avatars.githubusercontent.com/u/5418114?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jurien Hamaker</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=jurienhamaker" title="Code">💻</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://fanoulis.dev/"><img src="https://avatars.githubusercontent.com/u/38255093?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Charalampos Fanoulis</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=cfanoulis" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://github.com/apps/dependabot"><img src="https://avatars.githubusercontent.com/in/29110?v=4?s=100" width="100px;" alt=""/><br /><sub><b>dependabot[bot]</b></sub></a><br /><a href="#maintenance-dependabot[bot]" title="Maintenance">🚧</a></td>
|
||||
<td align="center"><a href="https://kaname.netlify.app/"><img src="https://avatars.githubusercontent.com/u/56084970?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Kaname</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=kaname-png" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/nandhagk"><img src="https://avatars.githubusercontent.com/u/62976649?v=4?s=100" width="100px;" alt=""/><br /><sub><b>nandhagk</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/issues?q=author%3Anandhagk" title="Bug reports">🐛</a></td>
|
||||
<td align="center"><a href="https://megatank58.me/"><img src="https://avatars.githubusercontent.com/u/51410502?v=4?s=100" width="100px;" alt=""/><br /><sub><b>megatank58</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=megatank58" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/UndiedGamer"><img src="https://avatars.githubusercontent.com/u/84702365?v=4?s=100" width="100px;" alt=""/><br /><sub><b>UndiedGamer</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=UndiedGamer" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/Lioness100"><img src="https://avatars.githubusercontent.com/u/65814829?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Lioness100</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=Lioness100" title="Documentation">📖</a> <a href="https://github.com/sapphiredev/utilities/commits?author=Lioness100" title="Code">💻</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://gitlab.com/DavidPH/"><img src="https://avatars.githubusercontent.com/u/44669930?v=4?s=100" width="100px;" alt=""/><br /><sub><b>David</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=DavidPHH" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/apps/renovate"><img src="https://avatars.githubusercontent.com/in/2740?v=4?s=100" width="100px;" alt=""/><br /><sub><b>renovate[bot]</b></sub></a><br /><a href="#maintenance-renovate[bot]" title="Maintenance">🚧</a></td>
|
||||
<td align="center"><a href="https://renovate.whitesourcesoftware.com/"><img src="https://avatars.githubusercontent.com/u/25180681?v=4?s=100" width="100px;" alt=""/><br /><sub><b>WhiteSource Renovate</b></sub></a><br /><a href="#maintenance-renovate-bot" title="Maintenance">🚧</a></td>
|
||||
<td align="center"><a href="https://fc5570.me/"><img src="https://avatars.githubusercontent.com/u/68158483?v=4?s=100" width="100px;" alt=""/><br /><sub><b>FC</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=FC5570" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/Tokipudi"><img src="https://avatars.githubusercontent.com/u/29551076?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jérémy de Saint Denis</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=Tokipudi" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/ItsMrCube"><img src="https://avatars.githubusercontent.com/u/25201357?v=4?s=100" width="100px;" alt=""/><br /><sub><b>MrCube</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=ItsMrCube" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/bitomic"><img src="https://avatars.githubusercontent.com/u/35199700?v=4?s=100" width="100px;" alt=""/><br /><sub><b>bitomic</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=bitomic" title="Code">💻</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://c43721.dev/"><img src="https://avatars.githubusercontent.com/u/55610086?v=4?s=100" width="100px;" alt=""/><br /><sub><b>c43721</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=c43721" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://commandtechno.com/"><img src="https://avatars.githubusercontent.com/u/68407783?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Commandtechno</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=Commandtechno" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/dhruv-kaushikk"><img src="https://avatars.githubusercontent.com/u/73697546?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Aura</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=dhruv-kaushikk" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://axis.moe/"><img src="https://avatars.githubusercontent.com/u/54381371?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jonathan</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=axisiscool" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/imranbarbhuiya"><img src="https://avatars.githubusercontent.com/u/74945038?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Parbez</b></sub></a><br /><a href="#maintenance-imranbarbhuiya" title="Maintenance">🚧</a></td>
|
||||
<td align="center"><a href="https://github.com/NotKaskus"><img src="https://avatars.githubusercontent.com/u/75168528?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Paul Andrew</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=NotKaskus" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://linktr.ee/mzato0001"><img src="https://avatars.githubusercontent.com/u/62367547?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Mzato</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=Mzato0001" title="Code">💻</a> <a href="https://github.com/sapphiredev/utilities/issues?q=author%3AMzato0001" title="Bug reports">🐛</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><a href="https://github.com/MajesticString"><img src="https://avatars.githubusercontent.com/u/66224939?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Harry Allen</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=MajesticString" title="Documentation">📖</a></td>
|
||||
<td align="center"><a href="https://github.com/EvolutionX-10"><img src="https://avatars.githubusercontent.com/u/85353424?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Evo</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=EvolutionX-10" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://enes.ovh/"><img src="https://avatars.githubusercontent.com/u/61084101?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Enes Genç</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=enxg" title="Code">💻</a></td>
|
||||
<td align="center"><a href="https://github.com/muchnameless"><img src="https://avatars.githubusercontent.com/u/12682826?v=4?s=100" width="100px;" alt=""/><br /><sub><b>muchnameless</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=muchnameless" title="Code">💻</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- markdownlint-restore -->
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
||||
|
||||
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
|
||||
65
example_bot/node_modules/@sapphire/async-queue/package.json
generated
vendored
Normal file
65
example_bot/node_modules/@sapphire/async-queue/package.json
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"name": "@sapphire/async-queue",
|
||||
"version": "1.5.0",
|
||||
"description": "Sequential asynchronous lock-based queue for promises",
|
||||
"author": "@sapphire",
|
||||
"license": "MIT",
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.mjs",
|
||||
"browser": "dist/index.global.js",
|
||||
"unpkg": "dist/index.global.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"exports": {
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"homepage": "https://github.com/sapphiredev/utilities/tree/main/packages/async-queue",
|
||||
"scripts": {
|
||||
"test": "vitest run",
|
||||
"lint": "eslint src tests --ext ts --fix -c ../../.eslintrc",
|
||||
"build": "tsup",
|
||||
"prepack": "yarn build",
|
||||
"bump": "cliff-jumper",
|
||||
"check-update": "cliff-jumper --dry-run"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sapphiredev/utilities.git",
|
||||
"directory": "packages/async-queue"
|
||||
},
|
||||
"files": [
|
||||
"dist/**/*.js*",
|
||||
"dist/**/*.mjs*",
|
||||
"dist/**/*.d*"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=v14.0.0",
|
||||
"npm": ">=7.0.0"
|
||||
},
|
||||
"keywords": [
|
||||
"@sapphire/async-queue",
|
||||
"bot",
|
||||
"typescript",
|
||||
"ts",
|
||||
"yarn",
|
||||
"discord",
|
||||
"sapphire",
|
||||
"standalone"
|
||||
],
|
||||
"bugs": {
|
||||
"url": "https://github.com/sapphiredev/utilities/issues"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@favware/cliff-jumper": "^1.8.6",
|
||||
"@vitest/coverage-c8": "^0.22.0",
|
||||
"c8": "^7.12.0",
|
||||
"tsup": "^6.2.2",
|
||||
"typescript": "^4.7.4",
|
||||
"vitest": "^0.22.0"
|
||||
}
|
||||
}
|
||||
298
example_bot/node_modules/@sapphire/shapeshift/CHANGELOG.md
generated
vendored
Normal file
298
example_bot/node_modules/@sapphire/shapeshift/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,298 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
# [3.9.3](https://github.com/sapphiredev/shapeshift/compare/v3.9.3...v3.9.3) - (2023-10-13)
|
||||
|
||||
## 🏠 Refactor
|
||||
|
||||
- Change email regex (#306) ([c5d49cf](https://github.com/sapphiredev/shapeshift/commit/c5d49cf32931aff24ab74ba87ee8d6d35f7231af))
|
||||
|
||||
# [3.9.2](https://github.com/sapphiredev/shapeshift/compare/v3.9.1...v3.9.2) - (2023-06-04)
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
- **arrayvalidator:** Fixed runaway type instantiation with TypeScript >=5.1 (#275) ([f59d901](https://github.com/sapphiredev/shapeshift/commit/f59d90112181e6625230c28e6a4f0f065ced6344))
|
||||
|
||||
# [3.9.1](https://github.com/sapphiredev/shapeshift/compare/v3.9.0...v3.9.1) - (2023-06-02)
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
- **types:** Move the `types` condition to the front (#273) ([5a3e202](https://github.com/sapphiredev/shapeshift/commit/5a3e202e9ceafb3d330a568e93c060dd5aac1dde))
|
||||
|
||||
# [3.9.0](https://github.com/sapphiredev/shapeshift/compare/v3.8.2...v3.9.0) - (2023-05-09)
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
- Resolve minor grammar mistake (#260) ([62df609](https://github.com/sapphiredev/shapeshift/commit/62df6094845ffa118aa93ea3c5f47f81f1c5d99f))
|
||||
|
||||
## 🚀 Features
|
||||
|
||||
- Add BaseValidator.describe (#267) ([d9e1a2d](https://github.com/sapphiredev/shapeshift/commit/d9e1a2d2f3c5e6378f0025becf8497138ee6d97c))
|
||||
|
||||
# [3.8.2](https://github.com/sapphiredev/shapeshift/compare/v3.8.1...v3.8.2) - (2023-04-02)
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
- ***:** TypeScript 5.x compatibility (#253) ([eba2a88](https://github.com/sapphiredev/shapeshift/commit/eba2a88b91fb6631f431313753299ec7a70cf6ce))
|
||||
- Remove `node:` prefix (#249) ([af766b5](https://github.com/sapphiredev/shapeshift/commit/af766b504c1013f3cd24f7bf803ac9ff7442a8d7))
|
||||
|
||||
# [3.8.1](https://github.com/sapphiredev/shapeshift/compare/v3.8.0...v3.8.1) - (2022-12-15)
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
- Fixed lodash esm import (#230) ([63def7b](https://github.com/sapphiredev/shapeshift/commit/63def7bcec6319b3792093945ba7ba9f871ced6f))
|
||||
|
||||
# [3.8.0](https://github.com/sapphiredev/shapeshift/compare/v3.7.1...v3.8.0) - (2022-12-11)
|
||||
|
||||
## 🏠 Refactor
|
||||
|
||||
- Remove `NonNullObject` (#227) ([04d3934](https://github.com/sapphiredev/shapeshift/commit/04d39343f55a4e1571f54870a84d8b95447bd682))
|
||||
|
||||
## 🚀 Features
|
||||
|
||||
- Add `when` constraint (#223) ([8eade90](https://github.com/sapphiredev/shapeshift/commit/8eade90cd4c02b80746ecdcdc612829d7f765178))
|
||||
|
||||
# [3.7.1](https://github.com/sapphiredev/shapeshift/compare/v3.7.0...v3.7.1) - (2022-11-27)
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
- Fixed "jump to definition" for `undefinedToOptional` going to wrong symbol (#226) ([6aab6d0](https://github.com/sapphiredev/shapeshift/commit/6aab6d01450fd7abbeaa95e91fb58568240e02ff))
|
||||
|
||||
## 📝 Documentation
|
||||
|
||||
- Add @legendhimslef as a contributor ([499522a](https://github.com/sapphiredev/shapeshift/commit/499522a782c3ecd4df80978d0811df1a75d08212))
|
||||
|
||||
# [3.7.0](https://github.com/sapphiredev/shapeshift/compare/v3.6.0...v3.7.0) - (2022-10-02)
|
||||
|
||||
## 📝 Documentation
|
||||
|
||||
- Add phone in readme (#203) ([4ec9b7a](https://github.com/sapphiredev/shapeshift/commit/4ec9b7ab85124d84b3404cb548b17b9221a716c5))
|
||||
- Add RealShadowNova as a contributor for tool (#185) ([6dfc442](https://github.com/sapphiredev/shapeshift/commit/6dfc442af6ef26d6bbca39078eca5727257b6dab))
|
||||
|
||||
## 🚀 Features
|
||||
|
||||
- Add `s.string.phone` (#202) ([7d122d5](https://github.com/sapphiredev/shapeshift/commit/7d122d5dc0eaa63c639b9cde1514e63566a681bd))
|
||||
|
||||
# [3.6.0](https://github.com/sapphiredev/shapeshift/compare/v3.5.1...v3.6.0) - (2022-08-29)
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
- Typescript 4.8 compatibility (#179) ([2281535](https://github.com/sapphiredev/shapeshift/commit/2281535f7589a987510828e46bf66accc8393c34))
|
||||
|
||||
## 🚀 Features
|
||||
|
||||
- Add `Validator#is` (#183) ([5114f95](https://github.com/sapphiredev/shapeshift/commit/5114f9516e5406cd1ca4a7ceb5ea5761158af1c6))
|
||||
|
||||
# [3.5.1](https://github.com/sapphiredev/shapeshift/compare/v3.5.0...v3.5.1) - (2022-07-17)
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
- Fast deep equal import (#155) ([5ce8ff6](https://github.com/sapphiredev/shapeshift/commit/5ce8ff6803b70624af07c3e406bc1cdc9e3cdafe))
|
||||
|
||||
# [3.5.0](https://github.com/sapphiredev/shapeshift/compare/v3.4.1...v3.5.0) - (2022-07-10)
|
||||
|
||||
## 🏠 Refactor
|
||||
|
||||
- Port net module (#149) ([5f26e32](https://github.com/sapphiredev/shapeshift/commit/5f26e32b0f87d2b100ca13471d5835c0067ddee8))
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
- Ensure browser compatibility (#150) ([92d05d8](https://github.com/sapphiredev/shapeshift/commit/92d05d83c1fbab53f98f61219fb01d49fc031bae))
|
||||
- Fixed `s.array` type inference (#153) ([a5948dc](https://github.com/sapphiredev/shapeshift/commit/a5948dc67ce6a0ea73986d32084898a4ce0b9c3a))
|
||||
- Fixed `shape#array` types (#146) ([43016a0](https://github.com/sapphiredev/shapeshift/commit/43016a025b04a676d906758ed065d26a17231888))
|
||||
|
||||
## 🚀 Features
|
||||
|
||||
- Lazy validator (#147) ([807666e](https://github.com/sapphiredev/shapeshift/commit/807666ef537c84d2e0f8bd9f4ce1a8060bfb3fb5))
|
||||
- Reshape finally (#148) ([d3751f6](https://github.com/sapphiredev/shapeshift/commit/d3751f6d3d99f415d797369f98158f932371e02c))
|
||||
- **arrays:** Add unique (#141) ([ad7af34](https://github.com/sapphiredev/shapeshift/commit/ad7af34eb811541253150b7ff0b58a6bd7200796))
|
||||
|
||||
# [3.4.1](https://github.com/sapphiredev/shapeshift/compare/v3.4.0...v3.4.1) - (2022-07-03)
|
||||
|
||||
## 🏠 Refactor
|
||||
|
||||
- Move all type utilities to one file (#139) ([61cab3d](https://github.com/sapphiredev/shapeshift/commit/61cab3d0e486d9dc74c8f6160ff8c75c91b595b2))
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
- Return array-validator from length* methods (#140) ([75b1f9a](https://github.com/sapphiredev/shapeshift/commit/75b1f9a6efffb6c27dcfd48eb4ec6269a3614633))
|
||||
|
||||
## 🧪 Testing
|
||||
|
||||
- Typechecking for tests (#145) ([273cdc8](https://github.com/sapphiredev/shapeshift/commit/273cdc82c1cf65ba4111ca6e70b050e02cbdf485))
|
||||
|
||||
# [3.4.0](https://github.com/sapphiredev/shapeshift/compare/v3.3.2...v3.4.0) - (2022-06-29)
|
||||
|
||||
## 🚀 Features
|
||||
|
||||
- Add `required` in object validation (#137) ([928f7be](https://github.com/sapphiredev/shapeshift/commit/928f7beb5e727b47868e9e46f2191f2def228080))
|
||||
|
||||
# [3.3.2](https://github.com/sapphiredev/shapeshift/compare/v3.3.1...v3.3.2) - (2022-06-26)
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
- Make keys optional in object parsing (#134) ([57a3719](https://github.com/sapphiredev/shapeshift/commit/57a37193d64399aae1431b041012d582e8defecf))
|
||||
|
||||
# [3.3.1](https://github.com/sapphiredev/shapeshift/compare/v3.3.0...v3.3.1) - (2022-06-22)
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
- Add generic type to parse (#133) ([90c91aa](https://github.com/sapphiredev/shapeshift/commit/90c91aad572d51a2bfbd1ed32a51e1d4201c5d4a))
|
||||
|
||||
# [3.3.0](https://github.com/sapphiredev/shapeshift/compare/v3.2.0...v3.3.0) - (2022-06-19)
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
- Compile for es2020 instead of es2021 (#128) ([051344d](https://github.com/sapphiredev/shapeshift/commit/051344debe1cf423713d7fc64b8908353348f301))
|
||||
|
||||
## 🚀 Features
|
||||
|
||||
- Allow passing functions in `setValidationEnabled` (#131) ([e1991cf](https://github.com/sapphiredev/shapeshift/commit/e1991cfef1ffe92f9167d11d7f2ded65379df8d2))
|
||||
|
||||
## 🧪 Testing
|
||||
|
||||
- Migrate to vitest (#126) ([4d80969](https://github.com/sapphiredev/shapeshift/commit/4d80969b714c39768499569456405a73c1444da8))
|
||||
|
||||
# [3.2.0](https://github.com/sapphiredev/shapeshift/compare/v3.1.0...v3.2.0) - (2022-06-11)
|
||||
|
||||
## 🚀 Features
|
||||
|
||||
- Add disabling of validators (#125) ([e17af95](https://github.com/sapphiredev/shapeshift/commit/e17af95d697be62796c57d03385b0c74b9d2d580))
|
||||
|
||||
# [3.1.0](https://github.com/sapphiredev/shapeshift/compare/v3.0.0...v3.1.0) - (2022-06-04)
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
- **ObjectValidator:** Fix #121 (#122) ([ecfad7e](https://github.com/sapphiredev/shapeshift/commit/ecfad7ec2cdd9e0cee0b3e227e55a91b28c29c30))
|
||||
|
||||
## 📝 Documentation
|
||||
|
||||
- **readme:** Clarify the difference between validations and schemas and add table of contents (#108) ([dc492a3](https://github.com/sapphiredev/shapeshift/commit/dc492a395349cc5bc680f313146127ea510b4ada))
|
||||
|
||||
## 🚀 Features
|
||||
|
||||
- **StringValidator:** Add date string checks (#106) ([1b72907](https://github.com/sapphiredev/shapeshift/commit/1b729078be32a88aeddf574c9cff3098990d4f94))
|
||||
|
||||
# [3.0.0](https://github.com/sapphiredev/shapeshift/compare/v2.2.0...v3.0.0) - (2022-05-06)
|
||||
|
||||
## 🏃 Performance
|
||||
|
||||
- Speed up object validation a LOT (#101) ([817278e](https://github.com/sapphiredev/shapeshift/commit/817278e6a3ac128ca342e5ae1737f40b98788c37))
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
- Expand method names (#100) ([741490f](https://github.com/sapphiredev/shapeshift/commit/741490fb6907f618fa25fe53808f7dcb5a59a96c))}
|
||||
|
||||
### 💥 Breaking Changes:
|
||||
- `date.eq` has been renamed to `date.equal`
|
||||
- `string.lengthLt` has been renamed to `string.lengthLessThan`
|
||||
- `string.lengthLe` has been renamed to `string.lengthLessThanOrEqual`
|
||||
- `string.lengthGt` has been renamed to `string.lengthGreaterThan`
|
||||
- `string.lengthGe` has been renamed to `string.lengthGreaterThanOrEqual`
|
||||
- `string.lengthEq` has been renamed to `string.lengthEqual`
|
||||
- `string.lengthNe` has been renamed to `string.lengthNotEqual`
|
||||
- `number.gt` has been renamed to `number.greaterThan`
|
||||
- `number.ge` has been renamed to `number.greaterThanOrEqual`
|
||||
- `number.lt` has been renamed to `number.lessThan`
|
||||
- `number.le` has been renamed to `number.lessThanOrEqual`
|
||||
- `number.eq` has been renamed to `number.equal`
|
||||
- `number.ne` has been renamed to `number.notEqual`
|
||||
- `bigint.gt` has been renamed to `bigint.greaterThan`
|
||||
- `bigint.ge` has been renamed to `bigint.greaterThanOrEqual`
|
||||
- `bigint.lt` has been renamed to `bigint.lessThan`
|
||||
- `bigint.le` has been renamed to `bigint.lessThanOrEqual`
|
||||
- `bigint.eq` has been renamed to `bigint.equal`
|
||||
- `bigint.ne` has been renamed to `bigint.notEqual`
|
||||
- `boolean.eq` has been renamed to `boolean.equal`
|
||||
- `boolean.ne` has been renamed to `boolean.notEqual`
|
||||
- `array.lengthLt` has been renamed to `array.lengthLessThan`
|
||||
- `array.lengthLe` has been renamed to `array.lengthLessThanOrEqual`
|
||||
- `array.lengthGt` has been renamed to `array.lengthGreaterThan`
|
||||
- `array.lengthGe` has been renamed to `array.lengthGreaterThanOrEqual`
|
||||
- `array.lengthEq` has been renamed to `array.lengthEqual`
|
||||
- `array.lengthNe` has been renamed to `array.lengthNotEqual`
|
||||
- `typedArray.lengthLt` has been renamed to `typedArray.lengthLessThan`
|
||||
- `typedArray.lengthLe` has been renamed to `typedArray.lengthLessThanOrEqual`
|
||||
- `typedArray.lengthGt` has been renamed to `typedArray.lengthGreaterThan`
|
||||
- `typedArray.lengthGe` has been renamed to `typedArray.lengthGreaterThanOrEqual`
|
||||
- `typedArray.lengthEq` has been renamed to `typedArray.lengthEqual`
|
||||
- `typedArray.lengthNe` has been renamed to `typedArray.lengthNotEqual`
|
||||
- `typedArray.byteLengthLt` has been renamed to `typedArray.byteLengthLessThan`
|
||||
- `typedArray.byteLengthLe` has been renamed to `typedArray.byteLengthLessThanOrEqual`
|
||||
- `typedArray.byteLengthGt` has been renamed to `typedArray.byteLengthGreaterThan`
|
||||
- `typedArray.byteLengthGe` has been renamed to `typedArray.byteLengthGreaterThanOrEqual`
|
||||
- `typedArray.byteLengthEq` has been renamed to `typedArray.byteLengthEqual`
|
||||
- `typedArray.byteLengthNe` has been renamed to `typedArray.byteLengthNotEqual`
|
||||
|
||||
- **ObjectValidator:** Don't run validation on arrays (#99) ([c83b3d0](https://github.com/sapphiredev/shapeshift/commit/c83b3d03a201d38cc230d9c831ca1d9b66ca533b))
|
||||
|
||||
## 🚀 Features
|
||||
|
||||
- Add 2 utility types inspired by yup and co (#102) ([2fef902](https://github.com/sapphiredev/shapeshift/commit/2fef9026c30f2f1825aa55511d0ab088a3dd13ab))
|
||||
|
||||
# [2.2.0](https://github.com/sapphiredev/shapeshift/compare/v2.0.0...v2.2.0) - (2022-04-29)
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
- Ensure `BaseError` is exported as value (#95) ([335d799](https://github.com/sapphiredev/shapeshift/commit/335d799ef7a8c1a19a12e3eeec07e6d210db113d))
|
||||
|
||||
## Documentation
|
||||
|
||||
- **readme:** Add todo notice for `reshape` and `function` validations (#75) ([d5f16f6](https://github.com/sapphiredev/shapeshift/commit/d5f16f615de83503187dc834c6245fafbf138f5e))
|
||||
|
||||
## Features
|
||||
|
||||
- Add Typed Array (#78) ([ca5ea5f](https://github.com/sapphiredev/shapeshift/commit/ca5ea5f568084bd5d3aa004911d4ea64329e1a89))
|
||||
|
||||
## Performance
|
||||
|
||||
- Optimize `NativeEnum` (#79) ([e9ae280](https://github.com/sapphiredev/shapeshift/commit/e9ae280f73e9ea08239bd8bd22165fe0b2178f82))
|
||||
|
||||
# [@sapphire/shapeshift@2.1.0](https://github.com/sapphiredev/shapeshift/compare/v2.0.0...@sapphire/shapeshift@2.1.0) - (2022-04-24)
|
||||
|
||||
## Documentation
|
||||
|
||||
- **readme:** Add todo notice for `reshape` and `function` validations (#75) ([d5f16f6](https://github.com/sapphiredev/shapeshift/commit/d5f16f615de83503187dc834c6245fafbf138f5e))
|
||||
|
||||
## Performance
|
||||
|
||||
- Optimize `NativeEnum` (#79) ([e9ae280](https://github.com/sapphiredev/shapeshift/commit/e9ae280f73e9ea08239bd8bd22165fe0b2178f82))
|
||||
|
||||
## [2.0.0](https://github.com/sapphiredev/shapeshift/compare/v1.0.0...v2.0.0) (2022-03-13)
|
||||
|
||||
### Features
|
||||
|
||||
- add `default` ([#25](https://github.com/sapphiredev/shapeshift/issues/25)) ([378c51f](https://github.com/sapphiredev/shapeshift/commit/378c51fb4ba2c501fd782387169db888d6bfe662))
|
||||
- add bigint methods ([#32](https://github.com/sapphiredev/shapeshift/issues/32)) ([4c444c1](https://github.com/sapphiredev/shapeshift/commit/4c444c15657c4610b99481b6dec9812bd136d72b))
|
||||
- add MapValidator ([#21](https://github.com/sapphiredev/shapeshift/issues/21)) ([c4d1258](https://github.com/sapphiredev/shapeshift/commit/c4d12586762d446b858454077b66635d9d11e2d6))
|
||||
- add NativeEnum validator ([#54](https://github.com/sapphiredev/shapeshift/issues/54)) ([7359042](https://github.com/sapphiredev/shapeshift/commit/7359042843d1119f396ac2c038aaff89dbd90c8e))
|
||||
- add RecordValidator ([#20](https://github.com/sapphiredev/shapeshift/issues/20)) ([8727427](https://github.com/sapphiredev/shapeshift/commit/8727427be4656792eebcdc5bddf6bcd61bc7e846))
|
||||
- add remaining string validations ([#38](https://github.com/sapphiredev/shapeshift/issues/38)) ([1c2fd7b](https://github.com/sapphiredev/shapeshift/commit/1c2fd7bbb20463f09ac461b697c312bec6ae9195))
|
||||
- add tuple ([#39](https://github.com/sapphiredev/shapeshift/issues/39)) ([b7704bf](https://github.com/sapphiredev/shapeshift/commit/b7704bf87cf5225021408cf4a6b9ceff8cba25b3))
|
||||
- added number transformers ([#17](https://github.com/sapphiredev/shapeshift/issues/17)) ([89a8ddd](https://github.com/sapphiredev/shapeshift/commit/89a8ddd8583774e68c43260c28ee1589ef44516c))
|
||||
- allow the use of module: NodeNext ([#55](https://github.com/sapphiredev/shapeshift/issues/55)) ([e6827c5](https://github.com/sapphiredev/shapeshift/commit/e6827c5a12b6a2803a137b71fe4c21bd1c35034b))
|
||||
- **array:** add array length Comparators ([#40](https://github.com/sapphiredev/shapeshift/issues/40)) ([1e564c2](https://github.com/sapphiredev/shapeshift/commit/1e564c204b6c9b0a798b3121d31dd4cc99165f60))
|
||||
- **Array:** generate tuple types with given length ([#52](https://github.com/sapphiredev/shapeshift/issues/52)) ([793648b](https://github.com/sapphiredev/shapeshift/commit/793648b4cde1f72c5b735ceebb0c48272179be06))
|
||||
- **ArrayValidator:** add length ranges ([#53](https://github.com/sapphiredev/shapeshift/issues/53)) ([e431d62](https://github.com/sapphiredev/shapeshift/commit/e431d6218b86fc1480fce14c4466cb36567cad2f))
|
||||
- display the property that errored ([#35](https://github.com/sapphiredev/shapeshift/issues/35)) ([fe188b0](https://github.com/sapphiredev/shapeshift/commit/fe188b0d17eeaa5f73b08085562903e23e91717c))
|
||||
- improve how errors are returned ([#29](https://github.com/sapphiredev/shapeshift/issues/29)) ([8bc7669](https://github.com/sapphiredev/shapeshift/commit/8bc7669a1a66a10449b321cc4447e411383977d9))
|
||||
- **s.object:** add passthrough ([#66](https://github.com/sapphiredev/shapeshift/issues/66)) ([ee9f6f3](https://github.com/sapphiredev/shapeshift/commit/ee9f6f367e513c0120a04cfafe05057c7907c327))
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- copy/paste error and `ge` ([#22](https://github.com/sapphiredev/shapeshift/issues/22)) ([fe6505f](https://github.com/sapphiredev/shapeshift/commit/fe6505f8e698bcaf9f8024b2d8f012559827cbb0))
|
||||
- fix union type and add test ([#41](https://github.com/sapphiredev/shapeshift/issues/41)) ([fbcf8a9](https://github.com/sapphiredev/shapeshift/commit/fbcf8a9c617c16b33fdddb0a44aa0fe506164fd3))
|
||||
- **s.union:** fix union overrides ([#62](https://github.com/sapphiredev/shapeshift/issues/62)) ([56e9b19](https://github.com/sapphiredev/shapeshift/commit/56e9b1947d9b2b129dbed374671114b2242e6d35))
|
||||
|
||||
## 1.0.0 (2022-01-16)
|
||||
|
||||
### Features
|
||||
|
||||
- added more primitives ([#2](https://github.com/sapphiredev/shapeshift/issues/2)) ([16af17b](https://github.com/sapphiredev/shapeshift/commit/16af17b5d9ee40dce284ee120e0b099f7b2cc0b8))
|
||||
- added more things ([7c73d82](https://github.com/sapphiredev/shapeshift/commit/7c73d82cf3740d5b2d4eebcac7767da9d3562437))
|
||||
- added ObjectValidator ([#3](https://github.com/sapphiredev/shapeshift/issues/3)) ([abe7ead](https://github.com/sapphiredev/shapeshift/commit/abe7eaddee981ef485713ff5e7b7f32ff97c645b))
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- resolved install error ([a5abe13](https://github.com/sapphiredev/shapeshift/commit/a5abe1362bb6d9ce6d6471bffa47fe8983b0d1a4))
|
||||
24
example_bot/node_modules/@sapphire/shapeshift/LICENSE.md
generated
vendored
Normal file
24
example_bot/node_modules/@sapphire/shapeshift/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
# The MIT License (MIT)
|
||||
|
||||
Copyright © `2021` `The Sapphire Community and its contributors`
|
||||
|
||||
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.
|
||||
934
example_bot/node_modules/@sapphire/shapeshift/README.md
generated
vendored
Normal file
934
example_bot/node_modules/@sapphire/shapeshift/README.md
generated
vendored
Normal file
@@ -0,0 +1,934 @@
|
||||
<div align="center">
|
||||
|
||||

|
||||
|
||||
# @sapphire/shapeshift
|
||||
|
||||
**Shapeshift**
|
||||
|
||||
Blazing fast input validation and transformation ⚡
|
||||
|
||||
[](https://github.com/sapphiredev/shapeshift/blob/main/LICENSE.md)
|
||||
[](https://codecov.io/gh/sapphiredev/shapeshift)
|
||||
[](https://www.npmjs.com/package/@sapphire/shapeshift)
|
||||
|
||||
</div>
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [@sapphire/shapeshift](#sapphireshapeshift)
|
||||
- [Table of Contents](#table-of-contents)
|
||||
- [Description](#description)
|
||||
- [Features](#features)
|
||||
- [Usage](#usage)
|
||||
- [Basic usage](#basic-usage)
|
||||
- [Defining validations](#defining-validations)
|
||||
- [Primitives](#primitives)
|
||||
- [Literals](#literals)
|
||||
- [Strings](#strings)
|
||||
- [Numbers](#numbers)
|
||||
- [BigInts](#bigints)
|
||||
- [Booleans](#booleans)
|
||||
- [Arrays](#arrays)
|
||||
- [Tuples](#tuples)
|
||||
- [Unions](#unions)
|
||||
- [Enums](#enums)
|
||||
- [Maps](#maps)
|
||||
- [Sets](#sets)
|
||||
- [Instances](#instances)
|
||||
- [Records](#records)
|
||||
- [Functions // TODO](#functions--todo)
|
||||
- [TypedArray](#typedarray)
|
||||
- [Defining schemas (objects)](#defining-schemas-objects)
|
||||
- [Utility types for TypeScript](#utility-types-for-typescript)
|
||||
- [Extracting an interface from a schema](#extracting-an-interface-from-a-schema)
|
||||
- [Defining the structure of a schema through an interface](#defining-the-structure-of-a-schema-through-an-interface)
|
||||
- [`.extend`:](#extend)
|
||||
- [`.pick` / `.omit`:](#pick--omit)
|
||||
- [`.partial`](#partial)
|
||||
- [`.required`](#required)
|
||||
- [Handling unrecognized keys](#handling-unrecognized-keys)
|
||||
- [`.strict`](#strict)
|
||||
- [`.ignore`](#ignore)
|
||||
- [`.passthrough`](#passthrough)
|
||||
- [BaseValidator: methods and properties](#basevalidator-methods-and-properties)
|
||||
- [`.run`](#rundata-unknown-resultt-error-given-a-validation-you-can-call-this-method-to-check-whether-or-not-the)
|
||||
- [`.parse`](#parsedata-unknown-t-given-a-validations-you-can-call-this-method-to-check-whether-or-not-the-input-is-valid)
|
||||
- [`.transform`](#transformrvalue-t--r-nopvalidatorr-adds-a-constraint-that-modifies-the-input)
|
||||
- [`.reshape`](#reshapervalue-t--resultr-error--iconstraint-nopvalidatorr-adds-a-constraint-able-to-both-validate)
|
||||
- [`.default`](#defaultvalue-t----t-transform-undefined-into-the-given-value-or-the-callbacks-returned-value)
|
||||
- [`.optional`](#optional-a-convenience-method-that-returns-a-union-of-the-type-with-sundefined)
|
||||
- [`.nullable`](#nullable-a-convenience-method-that-returns-a-union-of-the-type-with-snullable)
|
||||
- [`.nullish`](#nullish-a-convenience-method-that-returns-a-union-of-the-type-with-snullish)
|
||||
- [`.array`](#array-a-convenience-method-that-returns-an-arrayvalidator-with-the-type)
|
||||
- [`.or`](#or-a-convenience-method-that-returns-an-unionvalidator-with-the-type-this-method-is-also-overridden-in)
|
||||
- [`.when`](#when-adjust-the-schema-based-on-a-sibling-or-sinbling-children-fields)
|
||||
- [Available options for providing `is`](#available-options-for-providing-is)
|
||||
- [Resolving of the `key` (first) parameter](#resolving-of-the-key-first-parameter)
|
||||
- [Examples](#examples)
|
||||
- [Enabling and disabling validation](#enabling-and-disabling-validation)
|
||||
- [Buy us some doughnuts](#buy-us-some-doughnuts)
|
||||
- [Contributors](#contributors)
|
||||
|
||||
## Description
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
A very fast and lightweight input validation and transformation library for JavaScript.
|
||||
|
||||
> **Note**: Shapeshift requires Node.js v14.0.0 or higher to work.
|
||||
|
||||
## Features
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
- TypeScript friendly
|
||||
- Offers CJS, ESM and UMD builds
|
||||
- API similar to [`zod`]
|
||||
- Faster than ⚡
|
||||
|
||||
## Usage
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
**_For complete usages, please dive into our [documentation]_**
|
||||
|
||||
### Basic usage
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
Creating a simple string validation
|
||||
|
||||
```typescript
|
||||
import { s } from '@sapphire/shapeshift';
|
||||
|
||||
const myStringValidation = s.string;
|
||||
|
||||
// Parse
|
||||
myStringValidation.parse('sapphire'); // => returns 'sapphire'
|
||||
myStringValidation.parse(12); // throws ValidationError
|
||||
```
|
||||
|
||||
Creating an object schema
|
||||
|
||||
```typescript
|
||||
import { s } from '@sapphire/shapeshift';
|
||||
|
||||
const user = s.object({
|
||||
username: s.string
|
||||
});
|
||||
|
||||
user.parse({ username: 'Sapphire' });
|
||||
```
|
||||
|
||||
### Defining validations
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
#### Primitives
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
```typescript
|
||||
import { s } from '@sapphire/shapeshift';
|
||||
|
||||
// Primitives
|
||||
s.string;
|
||||
s.number;
|
||||
s.bigint;
|
||||
s.boolean;
|
||||
s.date;
|
||||
|
||||
// Empty Types
|
||||
s.undefined;
|
||||
s.null;
|
||||
s.nullish; // Accepts undefined | null
|
||||
|
||||
// Catch-all Types
|
||||
s.any;
|
||||
s.unknown;
|
||||
|
||||
// Never Type
|
||||
s.never;
|
||||
```
|
||||
|
||||
#### Literals
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
```typescript
|
||||
s.literal('sapphire');
|
||||
s.literal(12);
|
||||
s.literal(420n);
|
||||
s.literal(true);
|
||||
s.literal(new Date(1639278160000)); // s.date.equal(1639278160000);
|
||||
```
|
||||
|
||||
#### Strings
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
Shapeshift includes a handful of string-specific validations:
|
||||
|
||||
```typescript
|
||||
s.string.lengthLessThan(5);
|
||||
s.string.lengthLessThanOrEqual(5);
|
||||
s.string.lengthGreaterThan(5);
|
||||
s.string.lengthGreaterThanOrEqual(5);
|
||||
s.string.lengthEqual(5);
|
||||
s.string.lengthNotEqual(5);
|
||||
s.string.email;
|
||||
s.string.url();
|
||||
s.string.uuid();
|
||||
s.string.regex(regex);
|
||||
s.string.ip();
|
||||
s.string.ipv4;
|
||||
s.string.ipv6;
|
||||
s.string.phone();
|
||||
```
|
||||
|
||||
#### Numbers
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
Shapeshift includes a handful of number-specific validations:
|
||||
|
||||
```typescript
|
||||
s.number.greaterThan(5); // > 5
|
||||
s.number.greaterThanOrEqual(5); // >= 5
|
||||
s.number.lessThan(5); // < 5
|
||||
s.number.lessThanOrEqual(5); // <= 5
|
||||
s.number.equal(5); // === 5
|
||||
s.number.notEqual(5); // !== 5
|
||||
|
||||
s.number.equal(NaN); // special case: Number.isNaN
|
||||
s.number.notEqual(NaN); // special case: !Number.isNaN
|
||||
|
||||
s.number.int; // value must be an integer
|
||||
s.number.safeInt; // value must be a safe integer
|
||||
s.number.finite; // value must be finite
|
||||
|
||||
s.number.positive; // .greaterThanOrEqual(0)
|
||||
s.number.negative; // .lessThan(0)
|
||||
|
||||
s.number.divisibleBy(5); // Divisible by 5
|
||||
```
|
||||
|
||||
And transformations:
|
||||
|
||||
```typescript
|
||||
s.number.abs; // Transforms the number to an absolute number
|
||||
s.number.sign; // Gets the number's sign
|
||||
|
||||
s.number.trunc; // Transforms the number to the result of `Math.trunc`
|
||||
s.number.floor; // Transforms the number to the result of `Math.floor`
|
||||
s.number.fround; // Transforms the number to the result of `Math.fround`
|
||||
s.number.round; // Transforms the number to the result of `Math.round`
|
||||
s.number.ceil; // Transforms the number to the result of `Math.ceil`
|
||||
```
|
||||
|
||||
#### BigInts
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
Shapeshift includes a handful of number-specific validations:
|
||||
|
||||
```typescript
|
||||
s.bigint.greaterThan(5n); // > 5n
|
||||
s.bigint.greaterThanOrEqual(5n); // >= 5n
|
||||
s.bigint.lessThan(5n); // < 5n
|
||||
s.bigint.lessThanOrEqual(5n); // <= 5n
|
||||
s.bigint.equal(5n); // === 5n
|
||||
s.bigint.notEqual(5n); // !== 5n
|
||||
|
||||
s.bigint.positive; // .greaterThanOrEqual(0n)
|
||||
s.bigint.negative; // .lessThan(0n)
|
||||
|
||||
s.bigint.divisibleBy(5n); // Divisible by 5n
|
||||
```
|
||||
|
||||
And transformations:
|
||||
|
||||
```typescript
|
||||
s.bigint.abs; // Transforms the bigint to an absolute bigint
|
||||
|
||||
s.bigint.intN(5); // Clamps to a bigint to a signed bigint with 5 digits, see BigInt.asIntN
|
||||
s.bigint.uintN(5); // Clamps to a bigint to an unsigned bigint with 5 digits, see BigInt.asUintN
|
||||
```
|
||||
|
||||
#### Booleans
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
Shapeshift includes a few boolean-specific validations:
|
||||
|
||||
```typescript
|
||||
s.boolean.true; // value must be true
|
||||
s.boolean.false; // value must be false
|
||||
|
||||
s.boolean.equal(true); // s.boolean.true
|
||||
s.boolean.equal(false); // s.boolean.false
|
||||
|
||||
s.boolean.notEqual(true); // s.boolean.false
|
||||
s.boolean.notEqual(false); // s.boolean.true
|
||||
```
|
||||
|
||||
#### Arrays
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
```typescript
|
||||
const stringArray = s.array(s.string);
|
||||
const stringArray = s.string.array;
|
||||
```
|
||||
|
||||
Shapeshift includes a handful of array-specific validations:
|
||||
|
||||
```typescript
|
||||
s.string.array.lengthLessThan(5); // Must have less than 5 elements
|
||||
s.string.array.lengthLessThanOrEqual(5); // Must have 5 or less elements
|
||||
s.string.array.lengthGreaterThan(5); // Must have more than 5 elements
|
||||
s.string.array.lengthGreaterThanOrEqual(5); // Must have 5 or more elements
|
||||
s.string.array.lengthEqual(5); // Must have exactly 5 elements
|
||||
s.string.array.lengthNotEqual(5); // Must not have exactly 5 elements
|
||||
s.string.array.lengthRange(0, 4); // Must have at least 0 elements and less than 4 elements (in math, that is [0, 4))
|
||||
s.string.array.lengthRangeInclusive(0, 4); // Must have at least 0 elements and at most 4 elements (in math, that is [0, 4])
|
||||
s.string.array.lengthRangeExclusive(0, 4); // Must have more than 0 element and less than 4 elements (in math, that is (0, 4))
|
||||
s.string.array.unique; // All elements must be unique. Deep equality is used to check for uniqueness.
|
||||
```
|
||||
|
||||
> **Note**: All `.length` methods define tuple types with the given amount of elements. For example,
|
||||
> `s.string.array.lengthGreaterThanOrEqual(2)`'s inferred type is `[string, string, ...string[]]`
|
||||
|
||||
#### Tuples
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
Unlike arrays, tuples have a fixed number of elements and each element can have a different type:
|
||||
|
||||
```typescript
|
||||
const dish = s.tuple([
|
||||
s.string, // Dish's name
|
||||
s.number.int, // Table's number
|
||||
s.date // Date the dish was ready for delivery
|
||||
]);
|
||||
|
||||
dish.parse(['Iberian ham', 10, new Date()]);
|
||||
```
|
||||
|
||||
#### Unions
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
Shapeshift includes a built-in method for composing OR types:
|
||||
|
||||
```typescript
|
||||
const stringOrNumber = s.union(s.string, s.number);
|
||||
|
||||
stringOrNumber.parse('Sapphire'); // => 'Sapphire'
|
||||
stringOrNumber.parse(42); // => 42
|
||||
stringOrNumber.parse({}); // => throws CombinedError
|
||||
```
|
||||
|
||||
#### Enums
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
Enums are a convenience method that aliases `s.union(s.literal(a), s.literal(b), ...)`:
|
||||
|
||||
```typescript
|
||||
s.enum('Red', 'Green', 'Blue');
|
||||
// s.union(s.literal('Red'), s.literal('Green'), s.literal('Blue'));
|
||||
```
|
||||
|
||||
#### Maps
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
```typescript
|
||||
const map = s.map(s.string, s.number);
|
||||
// Map<string, number>
|
||||
```
|
||||
|
||||
#### Sets
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
```typescript
|
||||
const set = s.set(s.number);
|
||||
// Set<number>
|
||||
```
|
||||
|
||||
#### Instances
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
You can use `s.instance(Class)` to check that the input is an instance of a class. This is useful to validate inputs
|
||||
against classes:
|
||||
|
||||
```typescript
|
||||
class User {
|
||||
public constructor(public name: string) {}
|
||||
}
|
||||
|
||||
const userInstanceValidation = s.instance(User);
|
||||
userInstanceValidation.parse(new User('Sapphire')); // => User { name: 'Sapphire' }
|
||||
userInstanceValidation.parse('oops'); // => throws ValidatorError
|
||||
```
|
||||
|
||||
#### Records
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
Record validations are similar to objects, but validate `Record<string, T>` types. Keep in mind this does not check for
|
||||
the keys, and cannot support validation for specific ones:
|
||||
|
||||
```typescript
|
||||
const tags = s.record(s.string);
|
||||
|
||||
tags.parse({ foo: 'bar', hello: 'world' }); // => { foo: 'bar', hello: 'world' }
|
||||
tags.parse({ foo: 42 }); // => throws CombinedError
|
||||
tags.parse('Hello'); // => throws ValidateError
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
_**Function validation is not yet implemented and will be made available starting v2.1.0**_
|
||||
|
||||
#### Functions // TODO
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
You can define function validations. This checks for whether or not an input is a function:
|
||||
|
||||
```typescript
|
||||
s.function; // () => unknown
|
||||
```
|
||||
|
||||
You can define arguments by passing an array as the first argument, as well as the return type as the second:
|
||||
|
||||
```typescript
|
||||
s.function([s.string]); // (arg0: string) => unknown
|
||||
s.function([s.string, s.number], s.string); // (arg0: string, arg1: number) => string
|
||||
```
|
||||
|
||||
> **Note**: Shapeshift will transform the given function into one with validation on arguments and output. You can
|
||||
> access the `.raw` property of the function to get the unchecked function.
|
||||
|
||||
---
|
||||
|
||||
#### TypedArray
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
```ts
|
||||
const typedArray = s.typedArray();
|
||||
const int16Array = s.int16Array;
|
||||
const uint16Array = s.uint16Array;
|
||||
const uint8ClampedArray = s.uint8ClampedArray;
|
||||
const int16Array = s.int16Array;
|
||||
const uint16Array = s.uint16Array;
|
||||
const int32Array = s.int32Array;
|
||||
const uint32Array = s.uint32Array;
|
||||
const float32Array = s.float32Array;
|
||||
const float64Array = s.float64Array;
|
||||
const bigInt64Array = s.bigInt64Array;
|
||||
const bigUint64Array = s.bigUint64Array;
|
||||
```
|
||||
|
||||
Shapeshift includes a handful of validations specific to typed arrays.
|
||||
|
||||
```typescript
|
||||
s.typedArray().lengthLessThan(5); // Length must be less than 5
|
||||
s.typedArray().lengthLessThanOrEqual(5); // Length must be 5 or less
|
||||
s.typedArray().lengthGreaterThan(5); // Length must be more than 5
|
||||
s.typedArray().lengthGreaterThanOrEqual(5); // Length must be 5 or more
|
||||
s.typedArray().lengthEqual(5); // Length must be exactly 5
|
||||
s.typedArray().lengthNotEqual(5); // Length must not be 5
|
||||
s.typedArray().lengthRange(0, 4); // Length L must satisfy 0 <= L < 4
|
||||
s.typedArray().lengthRangeInclusive(0, 4); // Length L must satisfy 0 <= L <= 4
|
||||
s.typedArray().lengthRangeExclusive(0, 4); // Length L must satisfy 0 < L < 4
|
||||
```
|
||||
|
||||
Note that all of these methods have analogous methods for working with the typed array's byte length,
|
||||
`s.typedArray().byteLengthX()` - for instance, `s.typedArray().byteLengthLessThan(5)` is the same as
|
||||
`s.typedArray().lengthLessThan(5)` but for the array's byte length.
|
||||
|
||||
---
|
||||
|
||||
### Defining schemas (objects)
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
```typescript
|
||||
// Properties are required by default:
|
||||
const animal = s.object({
|
||||
name: s.string,
|
||||
age: s.number
|
||||
});
|
||||
```
|
||||
|
||||
#### Utility types for TypeScript
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
For object validation Shapeshift exports 2 utility types that can be used to extract interfaces from schemas and define
|
||||
the structure of a schema as an interface beforehand respectively.
|
||||
|
||||
##### Extracting an interface from a schema
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
You can use the `InferType` type to extract the interface from a schema, for example:
|
||||
|
||||
```typescript
|
||||
import { InferType, s } from '@sapphire/shapeshift';
|
||||
|
||||
const schema = s.object({
|
||||
foo: s.string,
|
||||
bar: s.number,
|
||||
baz: s.boolean,
|
||||
qux: s.bigint,
|
||||
quux: s.date
|
||||
});
|
||||
|
||||
type Inferredtype = InferType<typeof schema>;
|
||||
|
||||
// Expected type:
|
||||
type Inferredtype = {
|
||||
foo: string;
|
||||
bar: number;
|
||||
baz: boolean;
|
||||
qux: bigint;
|
||||
quux: Date;
|
||||
};
|
||||
```
|
||||
|
||||
##### Defining the structure of a schema through an interface
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
You can use the `SchemaOf` type to define the structure of a schema before defining the actual schema, for example:
|
||||
|
||||
```typescript
|
||||
import { s, SchemaOf } from '@sapphire/shapeshift';
|
||||
|
||||
interface IIngredient {
|
||||
ingredientId: string | undefined;
|
||||
name: string | undefined;
|
||||
}
|
||||
|
||||
interface IInstruction {
|
||||
instructionId: string | undefined;
|
||||
message: string | undefined;
|
||||
}
|
||||
|
||||
interface IRecipe {
|
||||
recipeId: string | undefined;
|
||||
title: string;
|
||||
description: string;
|
||||
instructions: IInstruction[];
|
||||
ingredients: IIngredient[];
|
||||
}
|
||||
|
||||
type InstructionSchemaType = SchemaOf<IInstruction>;
|
||||
// Expected Type: ObjectValidator<IInstruction>
|
||||
|
||||
type IngredientSchemaType = SchemaOf<IIngredient>;
|
||||
// Expected Type: ObjectValidator<IIngredient>
|
||||
|
||||
type RecipeSchemaType = SchemaOf<IRecipe>;
|
||||
// Expected Type: ObjectValidator<IRecipe>
|
||||
|
||||
const instructionSchema: InstructionSchemaType = s.object({
|
||||
instructionId: s.string.optional,
|
||||
message: s.string
|
||||
});
|
||||
|
||||
const ingredientSchema: IngredientSchemaType = s.object({
|
||||
ingredientId: s.string.optional,
|
||||
name: s.string
|
||||
});
|
||||
|
||||
const recipeSchema: RecipeSchemaType = s.object({
|
||||
recipeId: s.string.optional,
|
||||
title: s.string,
|
||||
description: s.string,
|
||||
instructions: s.array(instructionSchema),
|
||||
ingredients: s.array(ingredientSchema)
|
||||
});
|
||||
```
|
||||
|
||||
#### `.extend`:
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
You can add additional fields using either an object or an ObjectValidator, in this case, you will get a new object
|
||||
validator with the merged properties:
|
||||
|
||||
```typescript
|
||||
const animal = s.object({
|
||||
name: s.string.optional,
|
||||
age: s.number
|
||||
});
|
||||
|
||||
const pet = animal.extend({
|
||||
owner: s.string.nullish
|
||||
});
|
||||
|
||||
const pet = animal.extend(
|
||||
s.object({
|
||||
owner: s.string.nullish
|
||||
})
|
||||
);
|
||||
```
|
||||
|
||||
> If both schemas share keys, an error will be thrown. Please use `.omit` on the first object if you desire this
|
||||
> behaviour.
|
||||
|
||||
#### `.pick` / `.omit`:
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
Inspired by TypeScript's built-in `Pick` and `Omit` utility types, all object schemas have the aforementioned methods
|
||||
that return a modifier version:
|
||||
|
||||
```typescript
|
||||
const pkg = s.object({
|
||||
name: s.string,
|
||||
description: s.string,
|
||||
dependencies: s.string.array
|
||||
});
|
||||
|
||||
const justTheName = pkg.pick(['name']);
|
||||
// s.object({ name: s.string });
|
||||
|
||||
const noDependencies = pkg.omit(['dependencies']);
|
||||
// s.object({ name: s.string, description: s.string });
|
||||
```
|
||||
|
||||
#### `.partial`
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
Inspired by TypeScript's built-in `Partial` utility type, all object schemas have the aforementioned method that makes
|
||||
all properties optional:
|
||||
|
||||
```typescript
|
||||
const user = s.object({
|
||||
username: s.string,
|
||||
password: s.string
|
||||
}).partial;
|
||||
```
|
||||
|
||||
Which is the same as doing:
|
||||
|
||||
```typescript
|
||||
const user = s.object({
|
||||
username: s.string.optional,
|
||||
password: s.string.optional
|
||||
});
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
#### `.required`
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
Inspired by TypeScript's built-in `Required` utility type, all object schemas have the aforementioned method that makes
|
||||
all properties required:
|
||||
|
||||
```typescript
|
||||
const user = s.object({
|
||||
username: s.string.optional,
|
||||
password: s.string.optional
|
||||
}).required;
|
||||
```
|
||||
|
||||
Which is the same as doing:
|
||||
|
||||
```typescript
|
||||
const user = s.object({
|
||||
username: s.string,
|
||||
password: s.string
|
||||
});
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Handling unrecognized keys
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
By default, Shapeshift will not include keys that are not defined by the schema during parsing:
|
||||
|
||||
```typescript
|
||||
const person = s.object({
|
||||
framework: s.string
|
||||
});
|
||||
|
||||
person.parse({
|
||||
framework: 'Sapphire',
|
||||
awesome: true
|
||||
});
|
||||
// => { name: 'Sapphire' }
|
||||
```
|
||||
|
||||
#### `.strict`
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
You can disallow unknown keys with `.strict`. If the input includes any unknown keys, an error will be thrown.
|
||||
|
||||
```typescript
|
||||
const person = s.object({
|
||||
framework: s.string
|
||||
}).strict;
|
||||
|
||||
person.parse({
|
||||
framework: 'Sapphire',
|
||||
awesome: true
|
||||
});
|
||||
// => throws ValidationError
|
||||
```
|
||||
|
||||
#### `.ignore`
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
You can use the `.ignore` getter to reset an object schema to the default behaviour (ignoring unrecognized keys).
|
||||
|
||||
#### `.passthrough`
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
You can use the `.passthrough` getter to make the validator add the unrecognized properties the shape does not have,
|
||||
from the input.
|
||||
|
||||
---
|
||||
|
||||
### BaseValidator: methods and properties
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
All validations in Shapeshift contain certain methods.
|
||||
|
||||
- #### `.run(data: unknown): Result<T, Error>`: given a validation, you can call this method to check whether or not the
|
||||
|
||||
input is valid. If it is, a `Result` with `success: true` and a deep-cloned value will be returned with the given
|
||||
constraints and transformations. Otherwise, a `Result` with `success: false` and an error is returned.
|
||||
|
||||
- #### `.parse(data: unknown): T`: given a validations, you can call this method to check whether or not the input is valid.
|
||||
|
||||
If it is, a deep-cloned value will be returned with the given constraints and transformations. Otherwise, an error is
|
||||
thrown.
|
||||
|
||||
- #### `.transform<R>((value: T) => R): NopValidator<R>`: adds a constraint that modifies the input:
|
||||
|
||||
```typescript
|
||||
import { s } from '@sapphire/shapeshift';
|
||||
|
||||
const getLength = s.string.transform((value) => value.length);
|
||||
getLength.parse('Hello There'); // => 11
|
||||
```
|
||||
|
||||
> :warning: `.transform`'s functions **must not throw**. If a validation error is desired to be thrown, `.reshape`
|
||||
> instead.
|
||||
|
||||
- #### `.reshape<R>((value: T) => Result<R, Error> | IConstraint): NopValidator<R>`: adds a constraint able to both validate
|
||||
and modify the input:
|
||||
|
||||
```typescript
|
||||
import { s, Result } from '@sapphire/shapeshift';
|
||||
|
||||
const getLength = s.string.reshape((value) => Result.ok(value.length));
|
||||
getLength.parse('Hello There'); // => 11
|
||||
```
|
||||
|
||||
> :warning: `.reshape`'s functions **must not throw**. If a validation error is desired to be thrown, use
|
||||
> `Result.err(error)` instead.
|
||||
|
||||
- #### `.default(value: T | (() => T))`: transform `undefined` into the given value or the callback's returned value:
|
||||
|
||||
```typescript
|
||||
const name = s.string.default('Sapphire');
|
||||
name.parse('Hello'); // => 'Hello'
|
||||
name.parse(undefined); // => 'Sapphire'
|
||||
```
|
||||
|
||||
```typescript
|
||||
const number = s.number.default(Math.random);
|
||||
number.parse(12); // => 12
|
||||
number.parse(undefined); // => 0.989911985608602
|
||||
number.parse(undefined); // => 0.3224350185068794
|
||||
```
|
||||
|
||||
> :warning: The default values are not validated.
|
||||
|
||||
- #### `.optional`: a convenience method that returns a union of the type with `s.undefined`.
|
||||
|
||||
```typescript
|
||||
s.string.optional; // s.union(s.string, s.undefined)
|
||||
```
|
||||
|
||||
- #### `.nullable`: a convenience method that returns a union of the type with `s.nullable`.
|
||||
|
||||
```typescript
|
||||
s.string.nullable; // s.union(s.string, s.nullable)
|
||||
```
|
||||
|
||||
- #### `.nullish`: a convenience method that returns a union of the type with `s.nullish`.
|
||||
|
||||
```typescript
|
||||
s.string.nullish; // s.union(s.string, s.nullish)
|
||||
```
|
||||
|
||||
- #### `.array`: a convenience method that returns an ArrayValidator with the type.
|
||||
|
||||
```typescript
|
||||
s.string.array; // s.array(s.string)
|
||||
```
|
||||
|
||||
- #### `.or`: a convenience method that returns an UnionValidator with the type. This method is also overridden in
|
||||
UnionValidator to just append one more entry.
|
||||
|
||||
```typescript
|
||||
s.string.or(s.number);
|
||||
// => s.union(s.string, s.number)
|
||||
|
||||
s.object({ name: s.string }).or(s.string, s.number);
|
||||
// => s.union(s.object({ name: s.string }), s.string, s.number)
|
||||
```
|
||||
|
||||
- #### `.when`: Adjust the schema based on a sibling or sinbling children fields.
|
||||
|
||||
For using when you provide an object literal where the key `is` is undefined, a value, or a matcher function; `then`
|
||||
provides the schema when `is` resolves truthy, and `otherwise` provides the schema when `is` resolves falsey.
|
||||
|
||||
##### Available options for providing `is`
|
||||
|
||||
When `is` is not provided (`=== undefined`) it is strictly resolved as `Boolean(value)` wherein `value` is the current
|
||||
value of the referenced sibling. Note that if multiple siblings are referenced then all the values of the array need to
|
||||
resolve truthy for the `is` to resolve truthy.
|
||||
|
||||
When `is` is a primitive literal it is strictly compared (`===`) to the current value.
|
||||
|
||||
If you want to use a different form of equality you can provide a function like: `is: (value) => value === true`.
|
||||
|
||||
##### Resolving of the `key` (first) parameter
|
||||
|
||||
For resolving the `key` parameter to its respective value we use [lodash/get](https://lodash.com/docs#get). This means
|
||||
that every way that Lodash supports resolving a key to its respective value is also supported by Shapeshift. This
|
||||
includes:
|
||||
|
||||
- Simply providing a string or number like `'name'` or `1`.
|
||||
- Providing a string or number with a dot notation like `'name.first'` (representative of a nested object structure of
|
||||
`{ 'name': { 'first': 'Sapphire' } }` => resolves to `Sapphire`).
|
||||
- Providing a string or number with a bracket notation like `'name[0]'` (representative of an array structure of
|
||||
`{ 'name': ['Sapphire', 'Framework'] }` => resolves to `Sapphire`).
|
||||
- Providing a string or number with a dot and bracket notation like `'name[1].first'` (representative of a nested object
|
||||
structure of `{ 'name': [{ 'first': 'Sapphire' }, { 'first': 'Framework' }] }` => resolves to `Framework`).
|
||||
|
||||
##### Examples
|
||||
|
||||
Let's start with a basic example:
|
||||
|
||||
```typescript
|
||||
const whenPredicate = s.object({
|
||||
booleanLike: s.boolean,
|
||||
numberLike: s.number.when('booleanLike', {
|
||||
then: (schema) => schema.greaterThanOrEqual(5),
|
||||
otherwise: (schema) => schema.lessThanOrEqual(5)
|
||||
})
|
||||
});
|
||||
|
||||
whenPredicate.parse({ booleanLike: true, numberLike: 6 });
|
||||
// => { booleanLike: true, numberLike: 6 }
|
||||
|
||||
whenPredicate.parse({ booleanLike: true, numberLike: 4 });
|
||||
// => ExpectedConstraintError('s.number.greaterThanOrEqual', 'Invalid number value', 4, 'expected >= 5')
|
||||
|
||||
whenPredicate.parse({ booleanLike: false, numberLike: 4 });
|
||||
// => { booleanLike: false, numberLike: 4 }
|
||||
```
|
||||
|
||||
The provided key can also be an array of sibling children:
|
||||
|
||||
```typescript
|
||||
const whenPredicate = s.object({
|
||||
booleanLike: s.boolean,
|
||||
stringLike: s.string,
|
||||
numberLike: s.number.when(['booleanLike', 'stringLike'], {
|
||||
is: ([booleanLikeValue, stringLikeValue]) => booleanLikeValue === true && stringLikeValue === 'foobar',
|
||||
then: (schema) => schema.greaterThanOrEqual(5),
|
||||
otherwise: (schema) => schema.lessThanOrEqual(5)
|
||||
})
|
||||
});
|
||||
|
||||
whenPredicate.parse({ booleanLike: true, stringLike: 'foobar', numberLike: 6 });
|
||||
// => { booleanLike: true, numberLike: 6 }
|
||||
|
||||
whenPredicate.parse({ booleanLike: true, stringLike: 'barfoo', numberLike: 4 });
|
||||
// => ExpectedConstraintError('s.number.greaterThanOrEqual', 'Invalid number value', 4, 'expected >= 5')
|
||||
|
||||
whenPredicate.parse({ booleanLike: false, stringLike: 'foobar' numberLike: 4 });
|
||||
// => ExpectedConstraintError('s.number.greaterThanOrEqual', 'Invalid number value', 4, 'expected >= 5')
|
||||
```
|
||||
|
||||
### Enabling and disabling validation
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
At times, you might want to have a consistent code base with validation, but would like to keep validation to the strict
|
||||
necessities instead of the in-depth constraints available in shapeshift. By calling `setGlobalValidationEnabled` you can
|
||||
disable validation at a global level, and by calling `setValidationEnabled` you can disable validation on a
|
||||
per-validator level.
|
||||
|
||||
> When setting the validation enabled status per-validator, you can also set it to `null` to use the global setting.
|
||||
|
||||
```typescript
|
||||
import { setGlobalValidationEnabled } from '@sapphire/shapeshift';
|
||||
|
||||
setGlobalValidationEnabled(false);
|
||||
```
|
||||
|
||||
```typescript
|
||||
import { s } from '@sapphire/shapeshift';
|
||||
|
||||
const predicate = s.string.lengthGreaterThan(5).setValidationEnabled(false);
|
||||
```
|
||||
|
||||
## Buy us some doughnuts
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
Sapphire Community is and always will be open source, even if we don't get donations. That being said, we know there are
|
||||
amazing people who may still want to donate just to show their appreciation. Thank you very much in advance!
|
||||
|
||||
We accept donations through Open Collective, Ko-fi, Paypal, Patreon and GitHub Sponsorships. You can use the buttons
|
||||
below to donate through your method of choice.
|
||||
|
||||
| Donate With | Address |
|
||||
| :-------------: | :-------------------------------------------------: |
|
||||
| Open Collective | [Click Here](https://sapphirejs.dev/opencollective) |
|
||||
| Ko-fi | [Click Here](https://sapphirejs.dev/kofi) |
|
||||
| Patreon | [Click Here](https://sapphirejs.dev/patreon) |
|
||||
| PayPal | [Click Here](https://sapphirejs.dev/paypal) |
|
||||
|
||||
## Contributors
|
||||
|
||||
[Back to top][toc]
|
||||
|
||||
Please make sure to read the [Contributing Guide][contributing] before making a pull request.
|
||||
|
||||
Thank you to all the people who already contributed to Sapphire!
|
||||
|
||||
<a href="https://github.com/sapphiredev/shapeshift/graphs/contributors">
|
||||
<img src="https://contrib.rocks/image?repo=sapphiredev/shapeshift" />
|
||||
</a>
|
||||
|
||||
[contributing]: https://github.com/sapphiredev/.github/blob/main/.github/CONTRIBUTING.md
|
||||
[`zod`]: https://github.com/colinhacks/zod
|
||||
[documentation]: https://www.sapphirejs.dev/docs/Documentation/api-shapeshift/
|
||||
[toc]: #table-of-contents
|
||||
125
example_bot/node_modules/@sapphire/shapeshift/package.json
generated
vendored
Normal file
125
example_bot/node_modules/@sapphire/shapeshift/package.json
generated
vendored
Normal file
@@ -0,0 +1,125 @@
|
||||
{
|
||||
"name": "@sapphire/shapeshift",
|
||||
"version": "3.9.3",
|
||||
"description": "Blazing fast input validation and transformation ⚡",
|
||||
"author": "@sapphire",
|
||||
"license": "MIT",
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.mjs",
|
||||
"browser": "dist/index.global.js",
|
||||
"unpkg": "dist/index.global.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"exports": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.js"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"homepage": "https://www.sapphirejs.dev",
|
||||
"scripts": {
|
||||
"lint": "eslint src tests --ext ts --fix",
|
||||
"format": "prettier --write \"{src,tests}/**/*.ts\"",
|
||||
"docs": "typedoc-json-parser",
|
||||
"test": "vitest run",
|
||||
"build": "tsup",
|
||||
"clean": "node scripts/clean.mjs",
|
||||
"typecheck": "tsc -p tsconfig.eslint.json",
|
||||
"bump": "cliff-jumper",
|
||||
"check-update": "cliff-jumper --dry-run",
|
||||
"_postinstall": "husky install .github/husky",
|
||||
"prepack": "yarn build && pinst --disable",
|
||||
"postpack": "pinst --enable"
|
||||
},
|
||||
"dependencies": {
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"lodash": "^4.17.21"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^17.7.2",
|
||||
"@commitlint/config-conventional": "^17.7.0",
|
||||
"@favware/cliff-jumper": "^2.2.0",
|
||||
"@favware/npm-deprecate": "^1.0.7",
|
||||
"@sapphire/eslint-config": "^5.0.2",
|
||||
"@sapphire/prettier-config": "^2.0.0",
|
||||
"@sapphire/ts-config": "^5.0.0",
|
||||
"@types/jsdom": "^21.1.3",
|
||||
"@types/lodash": "^4.14.199",
|
||||
"@types/node": "^20.8.5",
|
||||
"@typescript-eslint/eslint-plugin": "^6.7.5",
|
||||
"@typescript-eslint/parser": "^6.7.5",
|
||||
"@vitest/coverage-v8": "^0.34.6",
|
||||
"cz-conventional-changelog": "^3.3.0",
|
||||
"esbuild-plugins-node-modules-polyfill": "^1.6.1",
|
||||
"eslint": "^8.51.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-plugin-prettier": "^5.0.1",
|
||||
"husky": "^8.0.3",
|
||||
"jsdom": "^22.1.0",
|
||||
"lint-staged": "^14.0.1",
|
||||
"pinst": "^3.0.0",
|
||||
"prettier": "^3.0.3",
|
||||
"ts-node": "^10.9.1",
|
||||
"tsup": "^7.2.0",
|
||||
"typedoc": "^0.25.2",
|
||||
"typedoc-json-parser": "^9.0.1",
|
||||
"typescript": "^5.2.2",
|
||||
"vite": "^4.4.11",
|
||||
"vitest": "^0.34.6"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sapphiredev/shapeshift.git"
|
||||
},
|
||||
"files": [
|
||||
"dist/**/*.js*",
|
||||
"dist/**/*.mjs*",
|
||||
"dist/**/*.d*"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=v14.0.0",
|
||||
"npm": ">=7.0.0"
|
||||
},
|
||||
"keywords": [
|
||||
"@sapphire/shapeshift",
|
||||
"shapeshift",
|
||||
"bot",
|
||||
"typescript",
|
||||
"ts",
|
||||
"yarn",
|
||||
"sapphire",
|
||||
"schema",
|
||||
"validation",
|
||||
"type-checking",
|
||||
"checking",
|
||||
"input-validation",
|
||||
"runtime-validation",
|
||||
"ow",
|
||||
"type-validation",
|
||||
"zod"
|
||||
],
|
||||
"bugs": {
|
||||
"url": "https://github.com/sapphiredev/shapeshift/issues"
|
||||
},
|
||||
"commitlint": {
|
||||
"extends": [
|
||||
"@commitlint/config-conventional"
|
||||
]
|
||||
},
|
||||
"lint-staged": {
|
||||
"*": "prettier --ignore-unknown --write",
|
||||
"*.{mjs,js,ts}": "eslint --fix --ext mjs,js,ts"
|
||||
},
|
||||
"config": {
|
||||
"commitizen": {
|
||||
"path": "./node_modules/cz-conventional-changelog"
|
||||
}
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"resolutions": {
|
||||
"ansi-regex": "^5.0.1",
|
||||
"minimist": "^1.2.8"
|
||||
},
|
||||
"packageManager": "yarn@3.6.4"
|
||||
}
|
||||
294
example_bot/node_modules/@sapphire/snowflake/CHANGELOG.md
generated
vendored
Normal file
294
example_bot/node_modules/@sapphire/snowflake/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,294 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
# [@sapphire/snowflake@3.5.1](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@3.5.0...@sapphire/snowflake@3.5.1) - (2023-05-12)
|
||||
|
||||
## 🏠 Refactor
|
||||
|
||||
- **snowflake:** Handle out-of-bounds `increment` correctly (#596) ([b5276d7](https://github.com/sapphiredev/utilities/commit/b5276d7372c33356975a302bafb5ae8aba604431))
|
||||
|
||||
# [@sapphire/snowflake@3.5.0](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@3.4.3...@sapphire/snowflake@3.5.0) - (2023-05-10)
|
||||
|
||||
## 🚀 Features
|
||||
|
||||
- **snowflake:** Expose `processId` and `workerId` (#595) ([b873c1c](https://github.com/sapphiredev/utilities/commit/b873c1cc3b30cb54d710a49f7618e125ac1132ad))
|
||||
|
||||
# [@sapphire/snowflake@3.4.2](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@3.4.1...@sapphire/snowflake@3.4.2) - (2023-04-12)
|
||||
|
||||
## 🏠 Refactor
|
||||
|
||||
- **Snowflake:** Simplify `compare` logic (#578) ([886254e](https://github.com/sapphiredev/utilities/commit/886254eea2f0cc5e8f63d015acffaf0e61489357))
|
||||
|
||||
# [@sapphire/snowflake@3.4.1](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@3.4.0...@sapphire/snowflake@3.4.1) - (2023-04-10)
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
- **snowflake:** Ensure strings are never compared with bigints ([22199a5](https://github.com/sapphiredev/utilities/commit/22199a5aa0c6150f46e01bfbe328deecb9f818ba))
|
||||
- **deps:** Update all non-major dependencies (#577) ([291dd67](https://github.com/sapphiredev/utilities/commit/291dd6783e57d8f075ce566218ba076ef6c4bbbd))
|
||||
- **deps:** Update all non-major dependencies (#545) ([40ca040](https://github.com/sapphiredev/utilities/commit/40ca040a21d8a0949682051a3a974538183a400e))
|
||||
- **deps:** Update all non-major dependencies (#544) ([cc78f17](https://github.com/sapphiredev/utilities/commit/cc78f17390c7f3db08af92bf46a5a70a9c11dd5f))
|
||||
|
||||
## 🧪 Testing
|
||||
|
||||
- Cleanup tests ([aec1bb2](https://github.com/sapphiredev/utilities/commit/aec1bb290d0f3c00a1ae4f4c86302ebbb161d348))
|
||||
|
||||
# [@sapphire/snowflake@3.4.0](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@3.3.0...@sapphire/snowflake@3.4.0) - (2022-12-27)
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
- **deps:** Update all non-major dependencies (#532) ([8033d1f](https://github.com/sapphiredev/utilities/commit/8033d1ff7a5a1974134c61f424f171cccb2915e1))
|
||||
|
||||
## 📝 Documentation
|
||||
|
||||
- Add @06000208 as a contributor ([fa3349e](https://github.com/sapphiredev/utilities/commit/fa3349e55ce4ad008785211dec7bf8e2b5d933df))
|
||||
|
||||
## 🚀 Features
|
||||
|
||||
- **snowflake:** Added `Snowflake.compare` (#531) ([6accd6d](https://github.com/sapphiredev/utilities/commit/6accd6d15eab12e312034f8ef43cff032835c972))
|
||||
|
||||
# [@sapphire/snowflake@3.3.0](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@3.2.2...@sapphire/snowflake@3.3.0) - (2022-12-03)
|
||||
|
||||
## 🏠 Refactor
|
||||
|
||||
- Split `@sapphire/time-utilities` into 4 sub-packages (#462) ([574299a](https://github.com/sapphiredev/utilities/commit/574299a99e658f6500a2a7efa587a0919b2d1313))
|
||||
|
||||
## 🐛 Bug Fixes
|
||||
|
||||
- **snowflake:** TwitterSnowflake using incorrect epoch (#522) ([4ad4117](https://github.com/sapphiredev/utilities/commit/4ad41170488161b2998bd72da5a8b7fea10539a0))
|
||||
- **deps:** Update all non-major dependencies (#514) ([21b07d5](https://github.com/sapphiredev/utilities/commit/21b07d5db529a0d982647a60de98e46f36f1ac93))
|
||||
- **deps:** Update all non-major dependencies (#505) ([6178296](https://github.com/sapphiredev/utilities/commit/617829649e1e4deeee02b14533b5377cd5bc1fb3))
|
||||
- **deps:** Update all non-major dependencies (#466) ([dc08606](https://github.com/sapphiredev/utilities/commit/dc08606a97154e47c65536123ac5f8b1262f7bd2))
|
||||
- **deps:** Update all non-major dependencies ([e20f299](https://github.com/sapphiredev/utilities/commit/e20f29906e83cee000aaba9c6827e3bec5173d28))
|
||||
- **deps:** Update all non-major dependencies ([2308bd7](https://github.com/sapphiredev/utilities/commit/2308bd74356b6b2e0c12995b25f4d8ade4803fe9))
|
||||
- **deps:** Update all non-major dependencies ([84af0db](https://github.com/sapphiredev/utilities/commit/84af0db2db749223b036aa99fe19a2e9af5681c6))
|
||||
- **deps:** Update all non-major dependencies ([50cd8de](https://github.com/sapphiredev/utilities/commit/50cd8dea593b6f5ae75571209456b3421e2ca59a))
|
||||
|
||||
## 📝 Documentation
|
||||
|
||||
- Add @didinele as a contributor ([42ef7b6](https://github.com/sapphiredev/utilities/commit/42ef7b656c48fd0e720119db1d622c8bba2791e9))
|
||||
- Add @goestav as a contributor ([0e56a92](https://github.com/sapphiredev/utilities/commit/0e56a92a4e2d0942bfa207f81a8cb03b32312034))
|
||||
- Add @CitTheDev as a contributor ([34169ea](https://github.com/sapphiredev/utilities/commit/34169eae1dc0476ccf5a6c4f36e28602a204829e))
|
||||
- Add @legendhimslef as a contributor ([059b6f1](https://github.com/sapphiredev/utilities/commit/059b6f1ab5362d46d58624d06c1aa39192b0716f))
|
||||
- Add @r-priyam as a contributor ([fb278ba](https://github.com/sapphiredev/utilities/commit/fb278bacf627ec6fc88752eafeb12df5f3177a2c))
|
||||
- Change name of @kyranet (#451) ([df4fdef](https://github.com/sapphiredev/utilities/commit/df4fdefce18659975a4ebc224723638507d02d35))
|
||||
- Update @RealShadowNova as a contributor ([a869ba0](https://github.com/sapphiredev/utilities/commit/a869ba0abfad041610b9115187d426aebe671af6))
|
||||
- Add @muchnameless as a contributor ([a1221fe](https://github.com/sapphiredev/utilities/commit/a1221fea68506e99591d5d00ec552a07c26833f9))
|
||||
- Add @enxg as a contributor ([d2382f0](https://github.com/sapphiredev/utilities/commit/d2382f04e3909cb4ad11798a0a10e683f6cf5383))
|
||||
- Add @EvolutionX-10 as a contributor ([efc3a32](https://github.com/sapphiredev/utilities/commit/efc3a320a72ae258996dd62866d206c33f8d4961))
|
||||
- Add @MajesticString as a contributor ([295b3e9](https://github.com/sapphiredev/utilities/commit/295b3e9849a4b0fe64074bae02f6426378a303c3))
|
||||
- Add @Mzato0001 as a contributor ([c790ef2](https://github.com/sapphiredev/utilities/commit/c790ef25df2d7e22888fa9f8169167aa555e9e19))
|
||||
|
||||
## 🚀 Features
|
||||
|
||||
- **utilities:** Add possibility to import single functions by appending them to the import path. (#454) ([374c145](https://github.com/sapphiredev/utilities/commit/374c145a5dd329cfc1a867ed6720abf408683a88))
|
||||
|
||||
## 🧪 Testing
|
||||
|
||||
- Migrate to vitest (#380) ([075ec73](https://github.com/sapphiredev/utilities/commit/075ec73c7a8e3374fad3ada612d37eb4ac36ec8d))
|
||||
|
||||
# [@sapphire/snowflake@3.2.2](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@3.2.1...@sapphire/snowflake@3.2.2) - (2022-04-24)
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
- Fix typo (#333) ([ae2f257](https://github.com/sapphiredev/utilities/commit/ae2f25766d5985735f2d9b257eebd27cdc8a7c52))
|
||||
|
||||
## Documentation
|
||||
|
||||
- Add @NotKaskus as a contributor ([00da8f1](https://github.com/sapphiredev/utilities/commit/00da8f199137b9277119823f322d1f2d168d928a))
|
||||
- Add @imranbarbhuiya as a contributor ([fb674c2](https://github.com/sapphiredev/utilities/commit/fb674c2c5594d41e71662263553dcb4bac9e37f4))
|
||||
- Add @axisiscool as a contributor ([ce1aa31](https://github.com/sapphiredev/utilities/commit/ce1aa316871a88d3663efbdf2a42d3d8dfe6a27f))
|
||||
- Add @dhruv-kaushikk as a contributor ([ebbf43f](https://github.com/sapphiredev/utilities/commit/ebbf43f63617daba96e72c50a234bf8b64f6ddc4))
|
||||
- Add @Commandtechno as a contributor ([f1d69fa](https://github.com/sapphiredev/utilities/commit/f1d69fabe1ee0abe4be08b19e63dbec03102f7ce))
|
||||
- Fix typedoc causing OOM crashes ([63ba41c](https://github.com/sapphiredev/utilities/commit/63ba41c4b6678554b1c7043a22d3296db4f59360))
|
||||
|
||||
## [3.2.1](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@3.2.0...@sapphire/snowflake@3.2.1) (2022-04-01)
|
||||
|
||||
**Note:** Version bump only for package @sapphire/snowflake
|
||||
|
||||
# [3.2.0](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@3.1.0...@sapphire/snowflake@3.2.0) (2022-03-06)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **snowflake:** fixed the examples for `DiscordSnowflake` and `TwitterSnowflake` ([#282](https://github.com/sapphiredev/utilities/issues/282)) ([2e5ed7f](https://github.com/sapphiredev/utilities/commit/2e5ed7fdadccf261967c45f73d0dc78e2497eed3))
|
||||
|
||||
### Features
|
||||
|
||||
- allow module: NodeNext ([#306](https://github.com/sapphiredev/utilities/issues/306)) ([9dc6dd6](https://github.com/sapphiredev/utilities/commit/9dc6dd619efab879bb2b0b3c9e64304e10a67ed6))
|
||||
- **ts-config:** add multi-config structure ([#281](https://github.com/sapphiredev/utilities/issues/281)) ([b5191d7](https://github.com/sapphiredev/utilities/commit/b5191d7f2416dc5838590c4ff221454925553e37))
|
||||
|
||||
# [3.1.0](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@3.0.1...@sapphire/snowflake@3.1.0) (2022-01-28)
|
||||
|
||||
### Features
|
||||
|
||||
- change build system to tsup ([#270](https://github.com/sapphiredev/utilities/issues/270)) ([365a53a](https://github.com/sapphiredev/utilities/commit/365a53a5517a01a0926cf28a83c96b63f32ed9f8))
|
||||
|
||||
## [3.0.1](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@3.0.0...@sapphire/snowflake@3.0.1) (2022-01-10)
|
||||
|
||||
**Note:** Version bump only for package @sapphire/snowflake
|
||||
|
||||
# [3.0.0](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@2.1.4...@sapphire/snowflake@3.0.0) (2021-12-08)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **snowflake:** remove env-based defaults ([#232](https://github.com/sapphiredev/utilities/issues/232)) ([10408e4](https://github.com/sapphiredev/utilities/commit/10408e4d3677e91490d967c3d89bf9575946090b))
|
||||
|
||||
### Features
|
||||
|
||||
- **Snowflake:** rework entire package ([#231](https://github.com/sapphiredev/utilities/issues/231)) ([1d02f1a](https://github.com/sapphiredev/utilities/commit/1d02f1a2f520efcbc194c3992af593d0e493873b))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- **Snowflake:** Renamed `processID` to `processId`
|
||||
- **Snowflake:** Renamed `workerID` to `workerId`
|
||||
- **Snowflake:** `workerId` now defaults to 0n instead of 1n
|
||||
- **Snowflake:** `DiscordSnowflake` is not longer a class, but a constructed Snowflake
|
||||
- **Snowflake:** `TwitterSnowflake` is not longer a class, but a constructed Snowflake
|
||||
|
||||
## [2.1.4](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@2.1.3...@sapphire/snowflake@2.1.4) (2021-11-06)
|
||||
|
||||
**Note:** Version bump only for package @sapphire/snowflake
|
||||
|
||||
## [2.1.3](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@2.1.2...@sapphire/snowflake@2.1.3) (2021-10-26)
|
||||
|
||||
**Note:** Version bump only for package @sapphire/snowflake
|
||||
|
||||
## [2.1.2](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@2.1.1...@sapphire/snowflake@2.1.2) (2021-10-17)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- allow more node & npm versions in engines field ([5977d2a](https://github.com/sapphiredev/utilities/commit/5977d2a30a4b2cfdf84aff3f33af03ffde1bbec5))
|
||||
|
||||
## [2.1.1](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@2.1.0...@sapphire/snowflake@2.1.1) (2021-10-11)
|
||||
|
||||
**Note:** Version bump only for package @sapphire/snowflake
|
||||
|
||||
# [2.1.0](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@2.0.0...@sapphire/snowflake@2.1.0) (2021-10-04)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **snowflake:** fixed snowflake generating duplicate IDs ([#166](https://github.com/sapphiredev/utilities/issues/166)) ([f0cf4ad](https://github.com/sapphiredev/utilities/commit/f0cf4ad6bc0b8b2447499ca36581d2b453e52715))
|
||||
|
||||
### Features
|
||||
|
||||
- **snowflake:** set minimum NodeJS to v14 ([11a61c7](https://github.com/sapphiredev/utilities/commit/11a61c72bc29e683f9a4492815db3db094103bbc))
|
||||
|
||||
# [2.0.0](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.3.6...@sapphire/snowflake@2.0.0) (2021-07-17)
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
- **rateLimits:** rewrite all of it ([#130](https://github.com/sapphiredev/utilities/issues/130)) ([320778c](https://github.com/sapphiredev/utilities/commit/320778ca65cbf3591bd1ce0b1f2eb430693eef9a))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- **rateLimits:** Removed `Bucket`
|
||||
|
||||
## [1.3.6](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.3.5...@sapphire/snowflake@1.3.6) (2021-07-11)
|
||||
|
||||
**Note:** Version bump only for package @sapphire/snowflake
|
||||
|
||||
## [1.3.5](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.3.4...@sapphire/snowflake@1.3.5) (2021-06-27)
|
||||
|
||||
**Note:** Version bump only for package @sapphire/snowflake
|
||||
|
||||
## [1.3.4](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.3.3...@sapphire/snowflake@1.3.4) (2021-06-19)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **doc:** change `[@link](https://github.com/link)` to `[@linkplain](https://github.com/linkplain)` for support in VSCode IntelliSense ([703d460](https://github.com/sapphiredev/utilities/commit/703d4605b547a8787aff62d6f1054ea26dfd9d1c))
|
||||
- **docs:** update-tsdoc-for-vscode-may-2021 ([#126](https://github.com/sapphiredev/utilities/issues/126)) ([f8581bf](https://github.com/sapphiredev/utilities/commit/f8581bfe97a1b2f8aac3a3d3ed342d8ba92d730b))
|
||||
|
||||
## [1.3.3](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.3.2...@sapphire/snowflake@1.3.3) (2021-06-06)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- remove peer deps, update dev deps, update READMEs ([#124](https://github.com/sapphiredev/utilities/issues/124)) ([67256ed](https://github.com/sapphiredev/utilities/commit/67256ed43b915b02a8b5c68230ba82d6210c5032))
|
||||
- **snowflake:** fixed parsing for timestamps as Date objects ([c17a515](https://github.com/sapphiredev/utilities/commit/c17a515b02931cf778ca69913132e8d4558504a1))
|
||||
|
||||
## [1.3.2](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.3.1...@sapphire/snowflake@1.3.2) (2021-05-20)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **snowflake:** mark package as side effect free ([6a9bafc](https://github.com/sapphiredev/utilities/commit/6a9bafc24caba4b0ebbdd6896ac245ae6d60dede))
|
||||
|
||||
## [1.3.1](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.3.0...@sapphire/snowflake@1.3.1) (2021-05-02)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- drop the `www.` from the SapphireJS URL ([494d89f](https://github.com/sapphiredev/utilities/commit/494d89ffa04f78c195b93d7905b3232884f7d7e2))
|
||||
- update all the SapphireJS URLs from `.com` to `.dev` ([f59b46d](https://github.com/sapphiredev/utilities/commit/f59b46d1a0ebd39cad17b17d71cd3b9da808d5fd))
|
||||
|
||||
# [1.3.0](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.2.8...@sapphire/snowflake@1.3.0) (2021-04-21)
|
||||
|
||||
### Features
|
||||
|
||||
- add @sapphire/embed-jsx ([#100](https://github.com/sapphiredev/utilities/issues/100)) ([7277a23](https://github.com/sapphiredev/utilities/commit/7277a236015236ed8e81b7882875410facc4ce17))
|
||||
|
||||
## [1.2.8](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.2.7...@sapphire/snowflake@1.2.8) (2021-04-19)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- change all Sapphire URLs from "project"->"community" & use our domain where applicable 👨🌾🚜 ([#102](https://github.com/sapphiredev/utilities/issues/102)) ([835b408](https://github.com/sapphiredev/utilities/commit/835b408e8e57130c3787aca2e32613346ff23e4d))
|
||||
|
||||
## [1.2.7](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.2.6...@sapphire/snowflake@1.2.7) (2021-04-03)
|
||||
|
||||
**Note:** Version bump only for package @sapphire/snowflake
|
||||
|
||||
## [1.2.6](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.2.5...@sapphire/snowflake@1.2.6) (2021-03-16)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- remove terser from all packages ([#79](https://github.com/sapphiredev/utilities/issues/79)) ([1cfe4e7](https://github.com/sapphiredev/utilities/commit/1cfe4e7c804e62c142495686d2b83b81d0026c02))
|
||||
|
||||
## [1.2.5](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.2.4...@sapphire/snowflake@1.2.5) (2021-02-16)
|
||||
|
||||
**Note:** Version bump only for package @sapphire/snowflake
|
||||
|
||||
## [1.2.4](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.2.3...@sapphire/snowflake@1.2.4) (2021-01-16)
|
||||
|
||||
**Note:** Version bump only for package @sapphire/snowflake
|
||||
|
||||
## [1.2.3](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.2.2...@sapphire/snowflake@1.2.3) (2021-01-01)
|
||||
|
||||
**Note:** Version bump only for package @sapphire/snowflake
|
||||
|
||||
## [1.2.2](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.2.1...@sapphire/snowflake@1.2.2) (2020-12-26)
|
||||
|
||||
**Note:** Version bump only for package @sapphire/snowflake
|
||||
|
||||
## [1.2.1](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.2.0...@sapphire/snowflake@1.2.1) (2020-12-22)
|
||||
|
||||
**Note:** Version bump only for package @sapphire/snowflake
|
||||
|
||||
# [1.2.0](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.1.0...@sapphire/snowflake@1.2.0) (2020-11-15)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **snowflake:** pass keep_classnames to terser ([76ea062](https://github.com/sapphiredev/utilities/commit/76ea062d07000b169d9781f1a199b85ad3db0ba6))
|
||||
- **snowflake:** pass keep_fnames to terser ([b52aa76](https://github.com/sapphiredev/utilities/commit/b52aa764d8b02535496e0ceea3204a37552ce3d1))
|
||||
|
||||
### Features
|
||||
|
||||
- added time-utilities package ([#26](https://github.com/sapphiredev/utilities/issues/26)) ([f17a333](https://github.com/sapphiredev/utilities/commit/f17a3339667a452e8745fad7884272176e5d65e8))
|
||||
|
||||
# [1.1.0](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.0.1...@sapphire/snowflake@1.1.0) (2020-11-04)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **ratelimits,snowflake,utilities:** fixed esm output target ([9fdab3f](https://github.com/sapphiredev/utilities/commit/9fdab3fca283c8c0b47cc32661c5cf8e0a5e583c))
|
||||
- **snowflake:** properly specify ESM and CommonJS exports ([e3278e6](https://github.com/sapphiredev/utilities/commit/e3278e6868a4f31d5b2a100710bcbce2b79bc218))
|
||||
|
||||
### Features
|
||||
|
||||
- added ratelimits package ([#15](https://github.com/sapphiredev/utilities/issues/15)) ([e0ae18c](https://github.com/sapphiredev/utilities/commit/e0ae18c5e1d0ae4e68a982829f1cf251fddfc80d))
|
||||
|
||||
## [1.0.1](https://github.com/sapphiredev/utilities/compare/@sapphire/snowflake@1.0.0...@sapphire/snowflake@1.0.1) (2020-09-20)
|
||||
|
||||
**Note:** Version bump only for package @sapphire/snowflake
|
||||
|
||||
# 1.0.0 (2020-09-05)
|
||||
|
||||
### Features
|
||||
|
||||
- implement snowflake ([5ba4e2d](https://github.com/sapphiredev/utilities/commit/5ba4e2d82557dd4ff60ffe891a7b46e46373bea2))
|
||||
- **decorators:** add decorators package ([#4](https://github.com/sapphiredev/utilities/issues/4)) ([677b3e5](https://github.com/sapphiredev/utilities/commit/677b3e59d5c6160cbe6fb410821cadd7c0f00e3c))
|
||||
170
example_bot/node_modules/@sapphire/snowflake/README.md
generated
vendored
Normal file
170
example_bot/node_modules/@sapphire/snowflake/README.md
generated
vendored
Normal file
@@ -0,0 +1,170 @@
|
||||
<div align="center">
|
||||
|
||||

|
||||
|
||||
# @sapphire/snowflake
|
||||
|
||||
**Deconstruct and generate snowflake IDs using BigInts.**
|
||||
|
||||
[](https://github.com/sapphiredev/utilities/blob/main/LICENSE.md)
|
||||
[](https://codecov.io/gh/sapphiredev/utilities)
|
||||
[](https://bundlephobia.com/result?p=@sapphire/snowflake)
|
||||
[](https://www.npmjs.com/package/@sapphire/snowflake)
|
||||
|
||||
</div>
|
||||
|
||||
**Table of Contents**
|
||||
|
||||
- [Description](#description)
|
||||
- [Features](#features)
|
||||
- [Installation](#installation)
|
||||
- [Usage](#usage)
|
||||
- [Constructing snowflakes](#constructing-snowflakes)
|
||||
- [Snowflakes with custom epoch](#snowflakes-with-custom-epoch)
|
||||
- [Snowflake with Discord epoch constant](#snowflake-with-discord-epoch-constant)
|
||||
- [Snowflake with Twitter epoch constant](#snowflake-with-twitter-epoch-constant)
|
||||
- [Deconstructing snowflakes](#deconstructing-snowflakes)
|
||||
- [Snowflakes with custom epoch](#snowflakes-with-custom-epoch-1)
|
||||
- [Snowflake with Discord epoch constant](#snowflake-with-discord-epoch-constant-1)
|
||||
- [Snowflake with Twitter epoch constant](#snowflake-with-twitter-epoch-constant-1)
|
||||
- [Buy us some doughnuts](#buy-us-some-doughnuts)
|
||||
- [Contributors ✨](#contributors-%E2%9C%A8)
|
||||
|
||||
## Description
|
||||
|
||||
There is often a need to get a unique ID for entities, be that for Discord messages/channels/servers, keys in a database or many other similar examples. There are many ways to get such a unique ID, and one of those is using a so-called "snowflake". You can read more about snowflake IDs in [this Medium article](https://medium.com/better-programming/uuid-generation-snowflake-identifiers-unique-2aed8b1771bc).
|
||||
|
||||
## Features
|
||||
|
||||
- Written in TypeScript
|
||||
- Bundled with esbuild so it can be used in NodeJS and browsers
|
||||
- Offers CommonJS, ESM and UMD bundles
|
||||
- Offers predefined epochs for Discord and Twitter
|
||||
- Fully tested
|
||||
|
||||
## Installation
|
||||
|
||||
You can use the following command to install this package, or replace `npm install` with your package manager of choice.
|
||||
|
||||
```sh
|
||||
npm install @sapphire/snowflake
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
**Note:** While this section uses `require`, the imports match 1:1 with ESM imports. For example `const { Snowflake } = require('@sapphire/snowflake')` equals `import { Snowflake } from '@sapphire/snowflake'`.
|
||||
|
||||
### Constructing snowflakes
|
||||
|
||||
#### Snowflakes with custom epoch
|
||||
|
||||
```typescript
|
||||
// Import the Snowflake class
|
||||
const { Snowflake } = require('@sapphire/snowflake');
|
||||
|
||||
// Define a custom epoch
|
||||
const epoch = new Date('2000-01-01T00:00:00.000Z');
|
||||
|
||||
// Create an instance of Snowflake
|
||||
const snowflake = new Snowflake(epoch);
|
||||
|
||||
// Generate a snowflake with the given epoch
|
||||
const uniqueId = snowflake.generate();
|
||||
```
|
||||
|
||||
#### Snowflake with Discord epoch constant
|
||||
|
||||
```typescript
|
||||
// Import the Snowflake class
|
||||
const { DiscordSnowflake } = require('@sapphire/snowflake');
|
||||
|
||||
// Generate a snowflake with Discord's epoch
|
||||
const uniqueId = DiscordSnowflake.generate();
|
||||
|
||||
// Alternatively, you can use the method directly
|
||||
const uniqueId = DiscordSnowflake.generate();
|
||||
```
|
||||
|
||||
#### Snowflake with Twitter epoch constant
|
||||
|
||||
```typescript
|
||||
// Import the Snowflake class
|
||||
const { TwitterSnowflake } = require('@sapphire/snowflake');
|
||||
|
||||
// Generate a snowflake with Twitter's epoch
|
||||
const uniqueId = TwitterSnowflake.generate();
|
||||
|
||||
// Alternatively, you can use the method directly
|
||||
const uniqueId = TwitterSnowflake.generate();
|
||||
```
|
||||
|
||||
### Deconstructing snowflakes
|
||||
|
||||
#### Snowflakes with custom epoch
|
||||
|
||||
```typescript
|
||||
// Import the Snowflake class
|
||||
const { Snowflake } = require('@sapphire/snowflake');
|
||||
|
||||
// Define a custom epoch
|
||||
const epoch = new Date('2000-01-01T00:00:00.000Z');
|
||||
|
||||
// Create an instance of Snowflake
|
||||
const snowflake = new Snowflake(epoch);
|
||||
|
||||
// Deconstruct a snowflake with the given epoch
|
||||
const uniqueId = snowflake.deconstruct('3971046231244935168');
|
||||
```
|
||||
|
||||
#### Snowflake with Discord epoch constant
|
||||
|
||||
```typescript
|
||||
// Import the Snowflake class
|
||||
const { DiscordSnowflake } = require('@sapphire/snowflake');
|
||||
|
||||
// Deconstruct a snowflake with Discord's epoch
|
||||
const uniqueId = DiscordSnowflake.deconstruct('3971046231244935168');
|
||||
|
||||
// Alternatively, you can use the method directly
|
||||
const uniqueId = DiscordSnowflake.deconstruct('3971046231244935168');
|
||||
```
|
||||
|
||||
#### Snowflake with Twitter epoch constant
|
||||
|
||||
```typescript
|
||||
// Import the Snowflake class
|
||||
const { TwitterSnowflake } = require('@sapphire/snowflake');
|
||||
|
||||
// Deconstruct a snowflake with Twitter's epoch
|
||||
const uniqueId = TwitterSnowflake.deconstruct('3971046231244935168');
|
||||
|
||||
// Alternatively, you can use the method directly
|
||||
const uniqueId = TwitterSnowflake.deconstruct('3971046231244935168');
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Buy us some doughnuts
|
||||
|
||||
Sapphire Community is and always will be open source, even if we don't get donations. That being said, we know there are amazing people who may still want to donate just to show their appreciation. Thank you very much in advance!
|
||||
|
||||
We accept donations through Open Collective, Ko-fi, PayPal, Patreon and GitHub Sponsorships. You can use the buttons below to donate through your method of choice.
|
||||
|
||||
| Donate With | Address |
|
||||
| :-------------: | :-------------------------------------------------: |
|
||||
| Open Collective | [Click Here](https://sapphirejs.dev/opencollective) |
|
||||
| Ko-fi | [Click Here](https://sapphirejs.dev/kofi) |
|
||||
| Patreon | [Click Here](https://sapphirejs.dev/patreon) |
|
||||
| PayPal | [Click Here](https://sapphirejs.dev/paypal) |
|
||||
|
||||
## Contributors
|
||||
|
||||
Please make sure to read the [Contributing Guide][contributing] before making a pull request.
|
||||
|
||||
Thank you to all the people who already contributed to Sapphire!
|
||||
|
||||
<a href="https://github.com/sapphiredev/utilities/graphs/contributors">
|
||||
<img src="https://contrib.rocks/image?repo=sapphiredev/utilities" />
|
||||
</a>
|
||||
|
||||
[contributing]: https://github.com/sapphiredev/.github/blob/main/.github/CONTRIBUTING.md
|
||||
67
example_bot/node_modules/@sapphire/snowflake/package.json
generated
vendored
Normal file
67
example_bot/node_modules/@sapphire/snowflake/package.json
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"name": "@sapphire/snowflake",
|
||||
"version": "3.5.1",
|
||||
"description": "Deconstructs and generates snowflake IDs using BigInts",
|
||||
"author": "@sapphire",
|
||||
"license": "MIT",
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.mjs",
|
||||
"browser": "dist/index.global.js",
|
||||
"unpkg": "dist/index.global.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"exports": {
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"homepage": "https://github.com/sapphiredev/utilities/tree/main/packages/snowflake",
|
||||
"scripts": {
|
||||
"test": "vitest run",
|
||||
"lint": "eslint src tests --ext ts --fix -c ../../.eslintrc",
|
||||
"build": "tsup",
|
||||
"docs": "typedoc-json-parser",
|
||||
"prepack": "yarn build",
|
||||
"bump": "cliff-jumper",
|
||||
"check-update": "cliff-jumper --dry-run"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sapphiredev/utilities.git",
|
||||
"directory": "packages/snowflake"
|
||||
},
|
||||
"files": [
|
||||
"dist/**/*.js*",
|
||||
"dist/**/*.mjs*",
|
||||
"dist/**/*.d*"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=v14.0.0",
|
||||
"npm": ">=7.0.0"
|
||||
},
|
||||
"keywords": [
|
||||
"@sapphire/snowflake",
|
||||
"bot",
|
||||
"typescript",
|
||||
"ts",
|
||||
"yarn",
|
||||
"discord",
|
||||
"sapphire",
|
||||
"standalone"
|
||||
],
|
||||
"bugs": {
|
||||
"url": "https://github.com/sapphiredev/utilities/issues"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@favware/cliff-jumper": "^2.0.0",
|
||||
"@vitest/coverage-c8": "^0.31.0",
|
||||
"tsup": "^6.7.0",
|
||||
"typedoc": "^0.24.7",
|
||||
"typedoc-json-parser": "^7.4.0",
|
||||
"typescript": "^5.0.4",
|
||||
"vitest": "^0.31.0"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user