@sapphire/string-store 1.1.0-next.f63a9a11 → 1.1.0-next.fc35dd86

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.
Files changed (2) hide show
  1. package/README.md +16 -16
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -7,7 +7,6 @@
7
7
  **High-capacity raw data storage in UTF-16 strings.**
8
8
 
9
9
  [![GitHub](https://img.shields.io/github/license/sapphiredev/utilities)](https://github.com/sapphiredev/utilities/blob/main/LICENSE.md)
10
- [![codecov](https://codecov.io/gh/sapphiredev/utilities/branch/main/graph/badge.svg?token=OEGIV6RFDO)](https://codecov.io/gh/sapphiredev/utilities)
11
10
  [![npm bundle size](https://img.shields.io/bundlephobia/min/@sapphire/string-store?logo=webpack&style=flat-square)](https://bundlephobia.com/result?p=@sapphire/string-store)
12
11
  [![npm](https://img.shields.io/npm/v/@sapphire/string-store?color=crimson&logo=npm&style=flat-square)](https://www.npmjs.com/package/@sapphire/string-store)
13
12
 
@@ -42,20 +41,20 @@ npm install @sapphire/string-store
42
41
  const { SchemaStore, Schema, t } = require('@sapphire/string-store');
43
42
 
44
43
  const Id = {
45
- AgeUpdate: 0,
46
- StrengthUpdate: 1,
47
- Planet: 2,
48
- User: 3
44
+ AgeUpdate: 0,
45
+ StrengthUpdate: 1,
46
+ Planet: 2,
47
+ User: 3
49
48
  };
50
49
 
51
50
  // Create the store
52
51
  const store = new SchemaStore()
53
- // Add a schema with an age field stored as a int32:
54
- // Schema<Id.AgeUpdate, { age: number }>
55
- .add(new Schema(Id.AgeUpdate).int32('age'))
56
- // Add a schema with a strength field stored as a float32:
57
- // Schema<Id.StrengthUpdate, { strength: number }>
58
- .add(new Schema(Id.StrengthUpdate).float32('strength'));
52
+ // Add a schema with an age field stored as a int32:
53
+ // Schema<Id.AgeUpdate, { age: number }>
54
+ .add(new Schema(Id.AgeUpdate).int32('age'))
55
+ // Add a schema with a strength field stored as a float32:
56
+ // Schema<Id.StrengthUpdate, { strength: number }>
57
+ .add(new Schema(Id.StrengthUpdate).float32('strength'));
59
58
 
60
59
  // Serialize an `Id.AgeUpdate` object into a string containing:
61
60
  // - The schema ID (0)
@@ -65,11 +64,12 @@ const buffer = store.serialize(Id.AgeUpdate, { age: 20 }).toString();
65
64
 
66
65
  > [!Tip]
67
66
  > The serialized string is encoded in UTF-16, meaning it can store 16 bits per character. Each type stores a different number of bits, for example, a single character can store:
68
- > - 16 booleans
69
- > - 8 2-bit unsigned integers (0-3)
70
- > - 4 4-bit unsigned integers (0-15)
71
- > - 2 8-bit unsigned integers (0-255)
72
- > - 1 16-bit integer (0-65535)
67
+ >
68
+ > - 16 booleans
69
+ > - 8 2-bit unsigned integers (0-3)
70
+ > - 4 4-bit unsigned integers (0-15)
71
+ > - 2 8-bit unsigned integers (0-255)
72
+ > - 1 16-bit integer (0-65535)
73
73
  >
74
74
  > As a use-case, Discord's `custom_id` field in message components can store up to **100** UTF-16 characters, which means it has a storage of **1600 bits**, below you can see the supported types and their storage in bits. Keep in mind that the schema ID is stored as a [16-bit](#int16) integer, and that the property names are **not** stored.
75
75
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapphire/string-store",
3
- "version": "1.1.0-next.f63a9a11",
3
+ "version": "1.1.0-next.fc35dd86",
4
4
  "description": "High-capacity raw data storage in UTF-16 strings",
5
5
  "author": "@sapphire",
6
6
  "license": "MIT",
@@ -31,7 +31,7 @@
31
31
  "prepack": "yarn build",
32
32
  "bump": "cliff-jumper",
33
33
  "check-update": "cliff-jumper --dry-run",
34
- "gen-index": "tsx ../../scripts/gen-index.cts -w string-store"
34
+ "gen-index": "tsx ../../scripts/gen-index.cts string-store --write"
35
35
  },
36
36
  "repository": {
37
37
  "type": "git",
@@ -62,10 +62,10 @@
62
62
  "access": "public"
63
63
  },
64
64
  "devDependencies": {
65
- "@favware/cliff-jumper": "^4.0.3",
65
+ "@favware/cliff-jumper": "^4.1.0",
66
66
  "@vitest/coverage-v8": "^2.0.5",
67
67
  "tsup": "^8.2.4",
68
- "tsx": "^4.17.0",
68
+ "tsx": "^4.19.0",
69
69
  "typedoc": "^0.25.13",
70
70
  "typedoc-json-parser": "^10.0.0",
71
71
  "typescript": "~5.4.5",