Skip to content

Commit 1e01349

Browse files
authored
Bump the maximum variant to 19 for the cid helper function (#202)
1 parent 081419e commit 1e01349

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

lib/sdk.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ describe("cid", () => {
4040

4141
test("accepts a custom variant", () => {
4242
expect(OptableSDK.cid("abc", 0)).toEqual("c:abc");
43-
for (let i = 1; i < 10; i++) {
43+
for (let i = 1; i < 20; i++) {
4444
expect(OptableSDK.cid("abc", i)).toEqual(`c${i}:abc`);
4545
}
4646

4747
expect(() => OptableSDK.cid("abc", -1)).toThrow();
48-
expect(() => OptableSDK.cid("abc", 10)).toThrow();
48+
expect(() => OptableSDK.cid("abc", 20)).toThrow();
4949
expect(() => OptableSDK.cid("abc", "1" as unknown as number)).toThrow();
5050
});
5151

lib/sdk.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class OptableSDK {
128128
throw new Error("Invalid ppid");
129129
}
130130

131-
if (typeof variant !== "number" || isNaN(variant) || variant < 0 || variant > 9) {
131+
if (typeof variant !== "number" || isNaN(variant) || variant < 0 || variant > 19) {
132132
throw new Error("Invalid variant");
133133
}
134134

0 commit comments

Comments
 (0)