a collection of lightweight TypeScript packages for AT Protocol, the protocol powering Bluesky
atproto bluesky typescript npm
101
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor(lexicons): speed up literal enum validation

Mary 87c00bb0 157172a6

+8 -1
+5
.changeset/sharp-literals-search.md
··· 1 + --- 2 + '@atcute/lexicons': patch 3 + --- 4 + 5 + improve literal enum validation lookup performance
+3 -1
packages/lexicons/lexicons/lib/validations/index.ts
··· 561 561 }, 562 562 }; 563 563 564 + const set = new Set<Literal>(values); 565 + 564 566 return { 565 567 kind: 'schema', 566 568 type: 'literal_enum', 567 569 expected: values, 568 570 '~run'(input, _flags) { 569 - if (!values.includes(input as any)) { 571 + if (!set.has(input as Literal)) { 570 572 return issue; 571 573 } 572 574