@sapphire/string-store 1.1.0-next.2e9590be → 1.1.0-next.6f32caca
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ locations such as Discord's `custom_id` field in message components.
|
|
|
22
22
|
|
|
23
23
|
- Written in TypeScript
|
|
24
24
|
- Bundled with esbuild so it can be used in NodeJS and browsers
|
|
25
|
-
- Offers CommonJS, ESM and UMD bundles
|
|
25
|
+
- Offers CommonJS, ESM, and UMD bundles
|
|
26
26
|
- Fully tested
|
|
27
27
|
|
|
28
28
|
## Installation
|
|
@@ -39,7 +39,7 @@ npm install @sapphire/string-store
|
|
|
39
39
|
|
|
40
40
|
```ts
|
|
41
41
|
// Require the store classes
|
|
42
|
-
const { SchemaStore, Schema } = require('@sapphire/string-store');
|
|
42
|
+
const { SchemaStore, Schema, t } = require('@sapphire/string-store');
|
|
43
43
|
|
|
44
44
|
const Id = {
|
|
45
45
|
AgeUpdate: 0,
|
|
@@ -82,7 +82,7 @@ Adds an array with a dynamic length to the schema.
|
|
|
82
82
|
```ts
|
|
83
83
|
// A schema with a single field `names` that is an array of strings:
|
|
84
84
|
|
|
85
|
-
const schema = new Schema(Id.Planets).array('names',
|
|
85
|
+
const schema = new Schema(Id.Planets).array('names', t.string);
|
|
86
86
|
// → Schema<Id.Planets, { names: string[] }>
|
|
87
87
|
```
|
|
88
88
|
|
|
@@ -90,13 +90,13 @@ To track the length of the array, it will serialize a [16-bit](#int16) unsigned
|
|
|
90
90
|
|
|
91
91
|
### `fixedLengthArray`
|
|
92
92
|
|
|
93
|
-
An alternative to [`array`](#array) that has a fixed length
|
|
94
|
-
but it will save space by not storing the length of the array.
|
|
93
|
+
An alternative to [`array`](#array) that has a fixed length. This variant requires the exact number of elements to be
|
|
94
|
+
serialized, but it will save space by not storing the length of the array.
|
|
95
95
|
|
|
96
96
|
```ts
|
|
97
97
|
// A schema with a single field `names` that is an array of exactly 3 strings:
|
|
98
98
|
|
|
99
|
-
const schema = new Schema(Id.Planets).fixedLengthArray('names',
|
|
99
|
+
const schema = new Schema(Id.Planets).fixedLengthArray('names', t.string, 3);
|
|
100
100
|
// → Schema<Id.Planets, { names: [string, string, string] }>
|
|
101
101
|
```
|
|
102
102
|
|
|
@@ -354,7 +354,7 @@ const schema = new Schema(Id.User).snowflake('id');
|
|
|
354
354
|
|
|
355
355
|
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!
|
|
356
356
|
|
|
357
|
-
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.
|
|
357
|
+
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.
|
|
358
358
|
|
|
359
359
|
| Donate With | Address |
|
|
360
360
|
| :-------------: | :-------------------------------------------------: |
|