🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@ark/schema

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ark/schema - npm Package Compare versions

Comparing version
0.56.0
to
0.56.1
+4
-0
out/constraint.js

@@ -60,2 +60,6 @@ import { append, appendUnique, capitalize, isArray, throwInternalError, throwParseError } from "@ark/util";

const child = ctx.$.node(kind, schema);
// If the constraint was reduced to a root node (like unknown for minLength: 0),
// omit it from the schema since it's trivially satisfied
if (child.isRoot())
return;
return (child.hasOpenIntersection() ? [child] : child);

@@ -62,0 +66,0 @@ };

+1
-1

@@ -266,3 +266,3 @@ import { flatMorph, hasDomain, includes, isEmptyObject, isKeyOf, throwParseError } from "@ark/util";

.join(" & ");
const fullExpression = `${basisExpression}${basisExpression ? " " : ""}${refinementsExpression}`;
const fullExpression = `${basisExpression}${basisExpression && refinementsExpression ? " " : ""}${refinementsExpression}`;
if (fullExpression === "Array == 0")

@@ -269,0 +269,0 @@ return "[]";

@@ -306,3 +306,3 @@ import { appendUnique, arrayEquals, domainDescriptions, flatMorph, groupBy, hasKey, isArray, jsTypeOfDescriptions, printable, range, throwParseError, unset } from "@ark/util";

discriminate() {
if (this.branches.length < 2 || this.isCyclic)
if (this.branches.length < 2)
return null;

@@ -309,0 +309,0 @@ if (this.unitBranches.length === this.branches.length) {

@@ -22,7 +22,7 @@ import { ParseError, flatMorph, hasDomain, isArray, isThunk, printable, throwInternalError, throwParseError } from "@ark/util";

const precompile = (references) => bindPrecompilation(references, precompileReferences(references));
const bindPrecompilation = (references, precompiler) => {
const bindPrecompilation = (references, precompiler, owningScope) => {
const precompilation = precompiler.write(rootScopeFnName, 4);
const compiledTraversals = precompiler.compile()();
for (const node of references) {
if (node.precompilation) {
if (node.precompilation && (!owningScope || node.$ !== owningScope)) {
// if node has already been bound to another scope or anonymous type, don't rebind it

@@ -345,3 +345,3 @@ continue;

this.precompilation = precompiler.write(rootScopeFnName, 4);
bindPrecompilation(this.references, precompiler);
bindPrecompilation(this.references, precompiler, this);
}

@@ -348,0 +348,0 @@ this.resolved = true;

@@ -39,2 +39,8 @@ import { CastableBase, ReadonlyArray, ReadonlyPath, type JsonArray, type JsonObject, type array, type merge, type propwiseXor, type show } from "@ark/util";

readonly [arkKind] = "errors";
/**
* Inherited array methods (`map`, `filter`, `slice`, …) return a plain
* `Array`, not another `ArkErrors`, so callbacks that return primitives
* (e.g. `issues.map(i => i.message)`) cannot populate a new `ArkErrors` instance.
*/
static get [Symbol.species](): ArrayConstructor;
protected ctx: Traversal;

@@ -41,0 +47,0 @@ constructor(ctx: Traversal);

@@ -104,2 +104,10 @@ import { CastableBase, ReadonlyArray, ReadonlyPath, append, conflatenateAll, defineProperties, flatMorph, stringifyPath } from "@ark/util";

[arkKind] = "errors";
/**
* Inherited array methods (`map`, `filter`, `slice`, …) return a plain
* `Array`, not another `ArkErrors`, so callbacks that return primitives
* (e.g. `issues.map(i => i.message)`) cannot populate a new `ArkErrors` instance.
*/
static get [Symbol.species]() {
return Array;
}
ctx;

@@ -155,2 +163,3 @@ constructor(ctx) {

if (existing) {
// only add if it's not already in the errors collection
if (error === existing)

@@ -157,0 +166,0 @@ return;

@@ -187,6 +187,3 @@ import { ReadonlyPath, stringifyPath } from "@ark/util";

// if an ArkError was returned, ensure it has been added to errors
// (it may have already been added via ctx.error() within the morph)
// Only add if it's not already in the errors collection
if (!this.errors.includes(result))
this.errors.add(result);
this.errors.add(result);
// skip any remaining morphs at the current path

@@ -193,0 +190,0 @@ break;

@@ -704,3 +704,3 @@ import { append, conflatenate, flatMorph, printable, spliterate, throwInternalError, throwParseError } from "@ark/util";

if (node.sequence?.defaultables) {
js.for(`i < ${node.sequence.defaultables.length}`, js => js.set(`data[i]`, 5), `data.length - ${node.sequence.prefixLength}`);
js.for(`i < ${node.sequence.defaultables.length}`, js => js.line(`${node.sequence.defaultValueMorphsReference}[i]${args}`), `data.length - ${node.sequence.prefixLength}`);
}

@@ -707,0 +707,0 @@ if (node.undeclared === "delete") {

{
"name": "@ark/schema",
"version": "0.56.0",
"version": "0.56.1",
"license": "MIT",

@@ -40,3 +40,3 @@ "author": {

"dependencies": {
"@ark/util": "0.56.0"
"@ark/util": "0.56.1"
},

@@ -43,0 +43,0 @@ "publishConfig": {