tangled
alpha
login
or
join now
tylur.dev
/
prototypey
1
fork
atom
prototypey.org - atproto lexicon typescript toolkit - mirror https://github.com/tylersayshi/prototypey
1
fork
atom
overview
issues
pulls
pipelines
fix namespace test ids
Tyler
3 weeks ago
543542ef
64d0fe46
+10
-10
1 changed file
expand all
collapse all
unified
split
packages
prototypey
core
tests
validation-baseline.bench.ts
+10
-10
packages/prototypey/core/tests/validation-baseline.bench.ts
···
6
6
7
7
describe("baseline: lexicon instantiation", () => {
8
8
bench("simple lexicon instantiation", () => {
9
9
-
lx.lexicon("test.simple", {
9
9
+
lx.lexicon("test.ns.simple", {
10
10
main: lx.object({
11
11
id: lx.string({ required: true }),
12
12
name: lx.string({ required: true }),
···
24
24
const lexicons = new Lexicons();
25
25
lexicons.add({
26
26
lexicon: 1,
27
27
-
id: "test.simple",
27
27
+
id: "test.ns.simple",
28
28
defs: {
29
29
main: {
30
30
type: "object",
···
43
43
for (let i = 0; i < 10; i++) {
44
44
lexicons.add({
45
45
lexicon: 1,
46
46
-
id: `test.schema${i}`,
46
46
+
id: `test.ns.schema${i}`,
47
47
defs: {
48
48
main: {
49
49
type: "object",
···
63
63
for (let i = 0; i < 100; i++) {
64
64
lexicons.add({
65
65
lexicon: 1,
66
66
-
id: `test.schema${i}`,
66
66
+
id: `test.ns.schema${i}`,
67
67
defs: {
68
68
main: {
69
69
type: "object",
···
84
84
const lexicons = new Lexicons([
85
85
{
86
86
lexicon: 1,
87
87
-
id: "test.simple",
87
87
+
id: "test.ns.simple",
88
88
defs: {
89
89
main: {
90
90
type: "object",
···
97
97
},
98
98
},
99
99
]);
100
100
-
lexicons.validate("test.simple#main", {
100
100
+
lexicons.validate("test.ns.simple#main", {
101
101
id: "123",
102
102
name: "test",
103
103
});
···
107
107
const lexicons = new Lexicons([
108
108
{
109
109
lexicon: 1,
110
110
-
id: "test.complex",
110
110
+
id: "test.ns.complex",
111
111
defs: {
112
112
user: {
113
113
type: "object",
···
145
145
},
146
146
},
147
147
]);
148
148
-
lexicons.validate("test.complex#main", {
148
148
+
lexicons.validate("test.ns.complex#main", {
149
149
author: { handle: "alice.bsky.social", displayName: "Alice" },
150
150
replies: [
151
151
{
···
162
162
const lexicons = new Lexicons([
163
163
{
164
164
lexicon: 1,
165
165
-
id: "test.simple",
165
165
+
id: "test.ns.simple",
166
166
defs: {
167
167
main: {
168
168
type: "object",
···
176
176
},
177
177
]);
178
178
for (let i = 0; i < 1000; i++) {
179
179
-
lexicons.validate("test.simple#main", {
179
179
+
lexicons.validate("test.ns.simple#main", {
180
180
id: `${i}`,
181
181
name: `test${i}`,
182
182
});