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): slight perf optimization to record validation

Mary c061b2af a0372ec2

+8 -9
+5
.changeset/plenty-mammals-worry.md
··· 1 + --- 2 + '@atcute/lexicons': patch 3 + --- 4 + 5 + slight perf optimization to record validation
+3 -9
packages/lexicons/lexicons/lib/validations/index.ts
··· 116 116 export const FLAG_ABORT_EARLY = 1 << 0; 117 117 118 118 type MatcherResult = undefined | Ok<unknown> | IssueTree; 119 - type Matcher = (this: void, input: unknown, flags: number) => MatcherResult; 119 + type Matcher = (input: unknown, flags: number) => MatcherResult; 120 120 121 121 export interface BaseSchema<TInput = unknown, TOutput = TInput> { 122 122 readonly kind: 'schema'; ··· 1423 1423 get object() { 1424 1424 return lazyProperty(this, 'object', validatedObject.value); 1425 1425 }, 1426 - get '~run'() { 1427 - const object = validatedObject.value; 1428 - 1429 - const matcher: Matcher = (input, flags) => { 1430 - return object['~run'](input, flags); 1431 - }; 1432 - 1433 - return lazyProperty(this, '~run', matcher); 1426 + '~run'(input, flags) { 1427 + return lazyProperty(this, '~run', validatedObject.value['~run'])(input, flags); 1434 1428 }, 1435 1429 }; 1436 1430 };