You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
380 B
JavaScript
27 lines
380 B
JavaScript
"use strict";
|
|
|
|
const s = require("../");
|
|
|
|
let PersonName = s.createType(s.string({
|
|
matches: /^[a-z0-9 '-]+$/
|
|
}));
|
|
|
|
let Person = s.createType({
|
|
name: PersonName,
|
|
age: s.number(),
|
|
isAlive: s.boolean()
|
|
});
|
|
|
|
|
|
for (let i = 0; i < 500000; i++) {
|
|
let me = Person({
|
|
name: "somebody",
|
|
age: 42,
|
|
isAlive: true
|
|
});
|
|
|
|
let a = (me.name, me.age, me.isAlive);
|
|
}
|
|
|
|
console.log("Done");
|