Socket
Socket
Sign inDemoInstall

@algolia/json-stream-analyzer

Package Overview
Dependencies
0
Maintainers
64
Versions
29
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.11 to 0.2.13

2

convert.d.ts

@@ -1,3 +0,3 @@

import { SchemaType } from './interfaces';
import type { SchemaType } from './interfaces';
declare const convertToSchema: (content: any, tag?: any) => SchemaType;
export default convertToSchema;

@@ -45,3 +45,3 @@ "use strict";

}
return __assign({}, partial, update);
return __assign(__assign({}, partial), update);
}, {});

@@ -54,3 +54,3 @@ }

var key = _a[0], subContent = _a[1];
return __assign({}, schemas, (_b = {}, _b[key] = convertToSchema(subContent, tag), _b));
return __assign(__assign({}, schemas), (_b = {}, _b[key] = convertToSchema(subContent, tag), _b));
}, {});

@@ -57,0 +57,0 @@ return new types_1.ObjectType({ counter: 1, tag: tag }, schema);

import convertToSchema from './convert';
import * as _models from './models';
import * as _types from './types';
import * as _models from './models';
export declare const types: typeof _types;
export declare const models: typeof _models;
export default convertToSchema;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.models = exports.types = void 0;
var convert_1 = require("./convert");
var _models = require("./models");
var _types = require("./types");
var _models = require("./models");
exports.types = _types;

@@ -7,0 +8,0 @@ exports.models = _models;

@@ -14,3 +14,3 @@ export declare type TagCombiner = (thisTag: any, otherTag?: any) => any;

* Unique type ID that can be used to discriminate between different Schema
* Types like NumberType, StringType, ObjectType
* Types like NumberType, StringType, ObjectType.
*/

@@ -28,3 +28,3 @@ type: SchemaTypeID;

* Note: In the model, we will only ever keep only one tag on every node of the
* tree representation of the schema type
* tree representation of the schema type.
*/

@@ -41,6 +41,6 @@ tag?: any;

* type, and that can be overriden when a more advanced logic is needed
* (e.g. for Object, Arrays, etc.).
* (e.g. For Object, Arrays, etc.).
*
* If the 2 models are of the same type, we can safely merge them together,
* otherwise we combine them into a UnionType
* otherwise we combine them into a UnionType.
*

@@ -51,7 +51,7 @@ * Important: If you override this method to have a more specific combination

*
* @param {SchemaType} other - the schema to combine it with
* @param {number} counter - the number of times the other schema was seen
* @param {TagCombiner} combineTag - a method used
* @param {SchemaType} other - The schema to combine it with.
* @param {number} counter - The number of times the other schema was seen.
* @param {TagCombiner} combineTag - A method used
* to combine tags together. If unset, it uses a keep-first strategy.
* @returns {SchemaType} a SchemaType that is the combination of both models
* @returns {SchemaType} A SchemaType that is the combination of both models.
*/

@@ -64,3 +64,4 @@ combine: (other: SchemaType, options?: CombineOptions) => SchemaType;

* For immutability purposes.
* @returns {SchemaType} the copy
*
* @returns {SchemaType} The copy.
*/

@@ -67,0 +68,0 @@ copy: () => SchemaType;

@@ -1,7 +0,7 @@

import { SchemaType, Diagnostic, Model } from '../interfaces';
import type { SchemaType, Diagnostic, Model } from '../interfaces';
export declare class ArrayTagModel implements Model {
tag: (record: any) => any;
schema?: SchemaType;
private size;
schema?: SchemaType;
constructor({ tag, size, }: {
constructor({ tag, size }: {
tag: (record: any) => any;

@@ -8,0 +8,0 @@ size: number;

"use strict";
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ArrayTagModel = void 0;
var convert_1 = require("../convert");

@@ -17,9 +23,9 @@ var ArrayTagModel = /** @class */ (function () {

if (Array.isArray(thisTag) && Array.isArray(otherTag)) {
return thisTag.concat(otherTag).slice(0, _this.size);
return __spreadArray(__spreadArray([], thisTag), otherTag).slice(0, _this.size);
}
if (Array.isArray(thisTag)) {
return thisTag.concat([otherTag]);
return __spreadArray(__spreadArray([], thisTag), [otherTag]);
}
if (Array.isArray(otherTag)) {
return [thisTag].concat(otherTag).slice(0, _this.size);
return __spreadArray([thisTag], otherTag).slice(0, _this.size);
}

@@ -26,0 +32,0 @@ return [thisTag, otherTag];

"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./SimpleTag"));
__export(require("./ArrayTag"));
__exportStar(require("./SimpleTag"), exports);
__exportStar(require("./ArrayTag"), exports);
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

import { SchemaType, Diagnostic, Model } from '../interfaces';
import type { SchemaType, Diagnostic, Model } from '../interfaces';
export declare class SimpleTagModel implements Model {

@@ -3,0 +3,0 @@ tag: (record: any) => any;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SimpleTagModel = void 0;
var convert_1 = require("../convert");

@@ -4,0 +5,0 @@ var SimpleTagModel = /** @class */ (function () {

{
"name": "@algolia/json-stream-analyzer",
"version": "0.2.11",
"version": "0.2.13",
"main": "index.js",

@@ -8,18 +8,21 @@ "repository": "git@github.com:algolia/json-stream-analyzer.git",

"devDependencies": {
"@types/jest": "^24.0.12",
"@typescript-eslint/eslint-plugin": "^1.7.0",
"@typescript-eslint/parser": "^1.7.0",
"babel-eslint": "^10.0.1",
"eslint": "^5.16.0",
"eslint-config-algolia": "^13.3.0",
"eslint-config-prettier": "^4.2.0",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-prettier": "^3.0.1",
"jest": "^24.7.1",
"prettier": "^1.17.0",
"ts-jest": "^24.0.2",
"typescript": "^3.4.5"
"@types/jest": "26.0.23",
"@typescript-eslint/eslint-plugin": "4.28.0",
"@typescript-eslint/parser": "4.28.0",
"babel-eslint": "10.1.0",
"eslint": "7.28.0",
"eslint-config-algolia": "18.0.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-eslint-comments": "3.2.0",
"eslint-plugin-import": "2.23.4",
"eslint-plugin-jest": "24.3.6",
"eslint-plugin-jsdoc": "35.4.0",
"eslint-plugin-prettier": "3.4.0",
"jest": "26.6.3",
"prettier": "2.3.1",
"ts-jest": "26.5.6",
"typescript": "4.3.2"
},
"scripts": {
"test": "yarn lint && jest",
"test": "jest",
"build": "yarn clean && tsc",

@@ -29,10 +32,10 @@ "lint": "eslint --ext .ts src/",

"clean": "rm -rf dist/",
"pre-release": "yarn test && yarn build && cp package.json dist/ && npm publish --dry-run --access public dist",
"pre-release": "yarn test && yarn build && cp package.json dist/ && npm publish dist/ --dry-run --access public ",
"re-link": "cd dist && (yarn unlink || echo 'no package to unlink') && yarn link && cd .. && yarn link @algolia/json-stream-analyzer",
"pre-release-test": "yarn pre-release && yarn re-link && jest --config jest.pre-release.config.js",
"release": "(npm whoami || (echo 'this command must be run from npm and not yarn' && exit 1)) && yarn pre-release-test && yarn version && cp package.json dist/ && cp README.md dist/ && cp LICENSE dist/ && npm publish --access public dist && git push origin master"
"release": "(npm whoami || (echo 'this command must be run from npm and not yarn' && exit 1)) && yarn pre-release-test && yarn version && cp package.json dist/ && cp README.md dist/ && cp LICENSE dist/ && npm publish dist/ --access public && git push origin master"
},
"engines": {
"node": ">=10.0.0"
"node": ">=14.0.0"
}
}

@@ -1,3 +0,3 @@

import { TagCombiner } from '../interfaces';
import type { TagCombiner } from '../interfaces';
export declare const keepFirst: TagCombiner;
export declare const keepN: (limit: number) => TagCombiner;
"use strict";
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.keepFirst = function (thisTag) { return thisTag; };
exports.keepN = function (limit) { return function (thisTag, otherTag) {
exports.keepN = exports.keepFirst = void 0;
var keepFirst = function (thisTag) { return thisTag; };
exports.keepFirst = keepFirst;
var keepN = function (limit) { return function (thisTag, otherTag) {
if (Array.isArray(thisTag) && thisTag.length >= limit) {

@@ -9,12 +16,13 @@ return thisTag;

if (Array.isArray(thisTag) && Array.isArray(otherTag)) {
return thisTag.concat(otherTag).slice(0, limit);
return __spreadArray(__spreadArray([], thisTag), otherTag).slice(0, limit);
}
if (Array.isArray(thisTag)) {
return thisTag.concat([otherTag]);
return __spreadArray(__spreadArray([], thisTag), [otherTag]);
}
if (Array.isArray(otherTag)) {
return [thisTag].concat(otherTag).slice(0, limit);
return __spreadArray([thisTag], otherTag).slice(0, limit);
}
return [thisTag, otherTag];
}; };
exports.keepN = keepN;
//# sourceMappingURL=combiners.js.map

@@ -1,2 +0,2 @@

import { SchemaTypeParams, Diagnostic, CombineOptions, SchemaType, SchemaTypeID, SchemaObject } from '../interfaces';
import type { SchemaTypeParams, Diagnostic, CombineOptions, SchemaType, SchemaTypeID, SchemaObject } from '../interfaces';
import { UnionType } from './UnionType';

@@ -6,3 +6,3 @@ export declare class ArrayType implements SchemaType {

* Unique type ID that can be used to discriminate between different Schema
* Types like NumberType, StringType, ObjectType
* Types like NumberType, StringType, ObjectType.
*/

@@ -20,3 +20,3 @@ type: SchemaTypeID;

* Note: In the model, we will only ever keep only one tag on every node of the
* tree representation of the schema type
* tree representation of the schema type.
*/

@@ -35,3 +35,3 @@ tag?: any;

* means that we don't keep track of ordering of the elements in the array
* but only of the types present within. e.g. [1,2,3] and [1] will have the
* but only of the types present within. E.g. [1,2,3] and [1] will have the
* same ArrayType. ['abc', 123] and [123, 'abc'] will also have the same

@@ -43,14 +43,15 @@ * ArrayType.

/**
* A typeguard to ensure that another SchemaType is of the same type
* @param {SchemaType} other the schema to test
* @returns {boolean} whether the schema to test is an ArrayType
* A typeguard to ensure that another SchemaType is of the same type.
*
* @param other - The schema to test.
* @returns Whether the schema to test is an ArrayType.
*/
isSameType(other: SchemaType): other is ArrayType;
/**
* creates an immutable copy of the current ArrayType with identical `.types`
* @returns {ArrayType} the copy
* Creates an immutable copy of the current ArrayType with identical `.types`.
*
* @returns The copy.
*/
copy: () => ArrayType;
combine: (other: SchemaType, { counter, combineTag }?: CombineOptions) => UnionType | ArrayType;
private diagnoseChildren;
diagnose: (path?: string[]) => Diagnostic[];

@@ -61,2 +62,3 @@ traverse: (path?: string[]) => {

};
private diagnoseChildren;
}

@@ -13,3 +13,9 @@ "use strict";

};
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ArrayType = void 0;
var combiners_1 = require("../tags/combiners");

@@ -28,4 +34,5 @@ var UnionType_1 = require("./UnionType");

/**
* creates an immutable copy of the current ArrayType with identical `.types`
* @returns {ArrayType} the copy
* Creates an immutable copy of the current ArrayType with identical `.types`.
*
* @returns The copy.
*/

@@ -40,3 +47,3 @@ this.copy = function () {

var key = _a[0], schema = _a[1];
return __assign({}, partial, (_b = {}, _b[key] = schema.copy(), _b));
return __assign(__assign({}, partial), (_b = {}, _b[key] = schema.copy(), _b));
}, {});

@@ -65,3 +72,3 @@ return result;

var type = _a[0], schema = _a[1];
return __assign({}, partial, (_b = {}, _b[type] = schema.copy(), _b));
return __assign(__assign({}, partial), (_b = {}, _b[type] = schema.copy(), _b));
}, {});

@@ -80,6 +87,6 @@ combinedTypes = Object.entries(other.types).reduce(function (partial, _a) {

}
return __assign({}, partial, update);
return __assign(__assign({}, partial), update);
}, combinedTypes);
var combinedCounter = counter || _this.counter + other.counter;
// @ts-ignore ts(2351)
// @ts-expect-error ts(2351)
return new _this.constructor({

@@ -90,8 +97,2 @@ counter: combinedCounter,

};
this.diagnoseChildren = function (path) {
return Object.entries(_this.types).reduce(function (currentDiagnostics, _a) {
var type = _a[0], schema = _a[1];
return currentDiagnostics.concat(schema.diagnose(path.concat(["[" + type + "]"])));
}, []);
};
this.diagnose = function (path) {

@@ -140,3 +141,3 @@ if (path === void 0) { path = []; }

}
return diagnostics.concat(_this.diagnoseChildren(path));
return __spreadArray(__spreadArray([], diagnostics), _this.diagnoseChildren(path));
};

@@ -159,3 +160,3 @@ this.traverse = function (path) {

var _a = subSchema.traverse(path.slice(1)), subPath = _a.path, traversedSchema = _a.schema;
return { path: [segment].concat(subPath), schema: traversedSchema };
return { path: __spreadArray([segment], subPath), schema: traversedSchema };
}

@@ -165,2 +166,8 @@ }

};
this.diagnoseChildren = function (path) {
return Object.entries(_this.types).reduce(function (currentDiagnostics, _a) {
var type = _a[0], schema = _a[1];
return __spreadArray(__spreadArray([], currentDiagnostics), schema.diagnose(__spreadArray(__spreadArray([], path), ["[" + type + "]"])));
}, []);
};
this.counter = counter;

@@ -172,5 +179,6 @@ this.tag = tag;

/**
* A typeguard to ensure that another SchemaType is of the same type
* @param {SchemaType} other the schema to test
* @returns {boolean} whether the schema to test is an ArrayType
* A typeguard to ensure that another SchemaType is of the same type.
*
* @param other - The schema to test.
* @returns Whether the schema to test is an ArrayType.
*/

@@ -177,0 +185,0 @@ ArrayType.prototype.isSameType = function (other) {

@@ -1,6 +0,6 @@

import { SchemaTypeParams, SchemaType, SchemaTypeID, CombineOptions, Diagnostic } from '../interfaces';
import type { SchemaTypeParams, SchemaType, SchemaTypeID, CombineOptions, Diagnostic } from '../interfaces';
export declare class BooleanType implements SchemaType {
/**
* Unique type ID that can be used to discriminate between different Schema
* Types like NumberType, StringType, ObjectType
* Types like NumberType, StringType, ObjectType.
*/

@@ -18,3 +18,3 @@ type: SchemaTypeID;

* Note: In the model, we will only ever keep only one tag on every node of the
* tree representation of the schema type
* tree representation of the schema type.
*/

@@ -32,6 +32,6 @@ tag?: any;

* type, and that can be overriden when a more advanced logic is needed
* (e.g. for Object, Arrays, etc.).
* (e.g. For Object, Arrays, etc.).
*
* If the 2 models are of the same type, we can safely merge them together,
* otherwise we combine them into a UnionType
* otherwise we combine them into a UnionType.
*

@@ -42,7 +42,8 @@ * Important: If you override this method to have a more specific combination

*
* @param {SchemaType} other - the schema to combine it with
* @param {number} counter - the number of times the other schema was seen
* @param {TagCombiner} combineTag - a method used
* @param other - The schema to combine it with.
* @param counter - The counter.
* @param counter.counter - The number of times the other schema was seen.
* @param counter.combineTag - A method used
* to combine tags together. If unset, it uses a keep-first strategy.
* @returns {SchemaType} a SchemaType that is the combination of both models
* @returns A SchemaType that is the combination of both models.
*/

@@ -55,3 +56,4 @@ combine: (other: SchemaType, { counter, combineTag }?: CombineOptions) => SchemaType;

* For immutability purposes.
* @returns {SchemaType} the copy
*
* @returns The copy.
*/

@@ -58,0 +60,0 @@ copy: () => any;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BooleanType = void 0;
var combiners_1 = require("../tags/combiners");

@@ -12,6 +13,6 @@ var UnionType_1 = require("./UnionType");

* type, and that can be overriden when a more advanced logic is needed
* (e.g. for Object, Arrays, etc.).
* (e.g. For Object, Arrays, etc.).
*
* If the 2 models are of the same type, we can safely merge them together,
* otherwise we combine them into a UnionType
* otherwise we combine them into a UnionType.
*

@@ -22,7 +23,8 @@ * Important: If you override this method to have a more specific combination

*
* @param {SchemaType} other - the schema to combine it with
* @param {number} counter - the number of times the other schema was seen
* @param {TagCombiner} combineTag - a method used
* @param other - The schema to combine it with.
* @param counter - The counter.
* @param counter.counter - The number of times the other schema was seen.
* @param counter.combineTag - A method used
* to combine tags together. If unset, it uses a keep-first strategy.
* @returns {SchemaType} a SchemaType that is the combination of both models
* @returns A SchemaType that is the combination of both models.
*/

@@ -34,3 +36,3 @@ this.combine = function (other, _a) {

if (other.type === _this.type) {
// @ts-ignore ts(2351)
// @ts-expect-error ts(2351)
var result = new other.constructor({

@@ -52,6 +54,7 @@ counter: counter || _this.counter + other.counter,

* For immutability purposes.
* @returns {SchemaType} the copy
*
* @returns The copy.
*/
this.copy = function () {
// @ts-ignore ts(2351)
// @ts-expect-error ts(2351)
return new _this.constructor({ counter: _this.counter, tag: _this.tag });

@@ -58,0 +61,0 @@ };

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UnknownType = exports.UnionType = exports.StringType = exports.ObjectType = exports.NumberType = exports.NullType = exports.MissingType = exports.BooleanType = exports.ArrayType = void 0;
var ArrayType_1 = require("./ArrayType");
exports.ArrayType = ArrayType_1.ArrayType;
Object.defineProperty(exports, "ArrayType", { enumerable: true, get: function () { return ArrayType_1.ArrayType; } });
var BooleanType_1 = require("./BooleanType");
exports.BooleanType = BooleanType_1.BooleanType;
Object.defineProperty(exports, "BooleanType", { enumerable: true, get: function () { return BooleanType_1.BooleanType; } });
var MissingType_1 = require("./MissingType");
exports.MissingType = MissingType_1.MissingType;
Object.defineProperty(exports, "MissingType", { enumerable: true, get: function () { return MissingType_1.MissingType; } });
var NullType_1 = require("./NullType");
exports.NullType = NullType_1.NullType;
Object.defineProperty(exports, "NullType", { enumerable: true, get: function () { return NullType_1.NullType; } });
var NumberType_1 = require("./NumberType");
exports.NumberType = NumberType_1.NumberType;
Object.defineProperty(exports, "NumberType", { enumerable: true, get: function () { return NumberType_1.NumberType; } });
var ObjectType_1 = require("./ObjectType");
exports.ObjectType = ObjectType_1.ObjectType;
Object.defineProperty(exports, "ObjectType", { enumerable: true, get: function () { return ObjectType_1.ObjectType; } });
var StringType_1 = require("./StringType");
exports.StringType = StringType_1.StringType;
Object.defineProperty(exports, "StringType", { enumerable: true, get: function () { return StringType_1.StringType; } });
var UnionType_1 = require("./UnionType");
exports.UnionType = UnionType_1.UnionType;
Object.defineProperty(exports, "UnionType", { enumerable: true, get: function () { return UnionType_1.UnionType; } });
var UnknownType_1 = require("./UnknownType");
exports.UnknownType = UnknownType_1.UnknownType;
Object.defineProperty(exports, "UnknownType", { enumerable: true, get: function () { return UnknownType_1.UnknownType; } });
//# sourceMappingURL=index.js.map

@@ -1,6 +0,6 @@

import { SchemaTypeParams, SchemaType, SchemaTypeID, CombineOptions, Diagnostic } from '../interfaces';
import type { SchemaTypeParams, SchemaType, SchemaTypeID, CombineOptions, Diagnostic } from '../interfaces';
export declare class MissingType implements SchemaType {
/**
* Unique type ID that can be used to discriminate between different Schema
* Types like NumberType, StringType, ObjectType
* Types like NumberType, StringType, ObjectType.
*/

@@ -18,3 +18,3 @@ type: SchemaTypeID;

* Note: In the model, we will only ever keep only one tag on every node of the
* tree representation of the schema type
* tree representation of the schema type.
*/

@@ -32,6 +32,6 @@ tag?: any;

* type, and that can be overriden when a more advanced logic is needed
* (e.g. for Object, Arrays, etc.).
* (e.g. For Object, Arrays, etc.).
*
* If the 2 models are of the same type, we can safely merge them together,
* otherwise we combine them into a UnionType
* otherwise we combine them into a UnionType.
*

@@ -42,7 +42,8 @@ * Important: If you override this method to have a more specific combination

*
* @param {SchemaType} other - the schema to combine it with
* @param {number} counter - the number of times the other schema was seen
* @param {TagCombiner} combineTag - a method used
* @param other - The schema to combine it with.
* @param counter - The counter.
* @param counter.counter - The number of times the other schema was seen.
* @param counter.combineTag - A method used
* to combine tags together. If unset, it uses a keep-first strategy.
* @returns {SchemaType} a SchemaType that is the combination of both models
* @returns A SchemaType that is the combination of both models.
*/

@@ -55,3 +56,4 @@ combine: (other: SchemaType, { counter, combineTag }?: CombineOptions) => SchemaType;

* For immutability purposes.
* @returns {SchemaType} the copy
*
* @returns The copy.
*/

@@ -58,0 +60,0 @@ copy: () => any;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MissingType = void 0;
var combiners_1 = require("../tags/combiners");

@@ -12,6 +13,6 @@ var UnionType_1 = require("./UnionType");

* type, and that can be overriden when a more advanced logic is needed
* (e.g. for Object, Arrays, etc.).
* (e.g. For Object, Arrays, etc.).
*
* If the 2 models are of the same type, we can safely merge them together,
* otherwise we combine them into a UnionType
* otherwise we combine them into a UnionType.
*

@@ -22,7 +23,8 @@ * Important: If you override this method to have a more specific combination

*
* @param {SchemaType} other - the schema to combine it with
* @param {number} counter - the number of times the other schema was seen
* @param {TagCombiner} combineTag - a method used
* @param other - The schema to combine it with.
* @param counter - The counter.
* @param counter.counter - The number of times the other schema was seen.
* @param counter.combineTag - A method used
* to combine tags together. If unset, it uses a keep-first strategy.
* @returns {SchemaType} a SchemaType that is the combination of both models
* @returns A SchemaType that is the combination of both models.
*/

@@ -34,3 +36,3 @@ this.combine = function (other, _a) {

if (other.type === _this.type) {
// @ts-ignore ts(2351)
// @ts-expect-error ts(2351)
var result = new other.constructor({

@@ -52,6 +54,7 @@ counter: counter || _this.counter + other.counter,

* For immutability purposes.
* @returns {SchemaType} the copy
*
* @returns The copy.
*/
this.copy = function () {
// @ts-ignore ts(2351)
// @ts-expect-error ts(2351)
return new _this.constructor({ counter: _this.counter, tag: _this.tag });

@@ -58,0 +61,0 @@ };

@@ -1,6 +0,6 @@

import { SchemaTypeParams, SchemaType, SchemaTypeID, CombineOptions, Diagnostic } from '../interfaces';
import type { SchemaTypeParams, SchemaType, SchemaTypeID, CombineOptions, Diagnostic } from '../interfaces';
export declare class NullType implements SchemaType {
/**
* Unique type ID that can be used to discriminate between different Schema
* Types like NumberType, StringType, ObjectType
* Types like NumberType, StringType, ObjectType.
*/

@@ -18,3 +18,3 @@ type: SchemaTypeID;

* Note: In the model, we will only ever keep only one tag on every node of the
* tree representation of the schema type
* tree representation of the schema type.
*/

@@ -32,6 +32,6 @@ tag?: any;

* type, and that can be overriden when a more advanced logic is needed
* (e.g. for Object, Arrays, etc.).
* (e.g. For Object, Arrays, etc.).
*
* If the 2 models are of the same type, we can safely merge them together,
* otherwise we combine them into a UnionType
* otherwise we combine them into a UnionType.
*

@@ -42,7 +42,8 @@ * Important: If you override this method to have a more specific combination

*
* @param {SchemaType} other - the schema to combine it with
* @param {number} counter - the number of times the other schema was seen
* @param {TagCombiner} combineTag - a method used
* @param other - The schema to combine it with.
* @param counter - The counter.
* @param counter.counter - The number of times the other schema was seen.
* @param counter.combineTag - A method used
* to combine tags together. If unset, it uses a keep-first strategy.
* @returns {SchemaType} a SchemaType that is the combination of both models
* @returns A SchemaType that is the combination of both models.
*/

@@ -55,3 +56,4 @@ combine: (other: SchemaType, { counter, combineTag }?: CombineOptions) => SchemaType;

* For immutability purposes.
* @returns {SchemaType} the copy
*
* @returns The copy.
*/

@@ -58,0 +60,0 @@ copy: () => any;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NullType = void 0;
var combiners_1 = require("../tags/combiners");

@@ -12,6 +13,6 @@ var UnionType_1 = require("./UnionType");

* type, and that can be overriden when a more advanced logic is needed
* (e.g. for Object, Arrays, etc.).
* (e.g. For Object, Arrays, etc.).
*
* If the 2 models are of the same type, we can safely merge them together,
* otherwise we combine them into a UnionType
* otherwise we combine them into a UnionType.
*

@@ -22,7 +23,8 @@ * Important: If you override this method to have a more specific combination

*
* @param {SchemaType} other - the schema to combine it with
* @param {number} counter - the number of times the other schema was seen
* @param {TagCombiner} combineTag - a method used
* @param other - The schema to combine it with.
* @param counter - The counter.
* @param counter.counter - The number of times the other schema was seen.
* @param counter.combineTag - A method used
* to combine tags together. If unset, it uses a keep-first strategy.
* @returns {SchemaType} a SchemaType that is the combination of both models
* @returns A SchemaType that is the combination of both models.
*/

@@ -34,3 +36,3 @@ this.combine = function (other, _a) {

if (other.type === _this.type) {
// @ts-ignore ts(2351)
// @ts-expect-error ts(2351)
var result = new other.constructor({

@@ -52,6 +54,7 @@ counter: counter || _this.counter + other.counter,

* For immutability purposes.
* @returns {SchemaType} the copy
*
* @returns The copy.
*/
this.copy = function () {
// @ts-ignore ts(2351)
// @ts-expect-error ts(2351)
return new _this.constructor({ counter: _this.counter, tag: _this.tag });

@@ -58,0 +61,0 @@ };

@@ -1,6 +0,6 @@

import { SchemaTypeParams, SchemaType, SchemaTypeID, CombineOptions, Diagnostic } from '../interfaces';
import type { SchemaTypeParams, SchemaType, SchemaTypeID, CombineOptions, Diagnostic } from '../interfaces';
export declare class NumberType implements SchemaType {
/**
* Unique type ID that can be used to discriminate between different Schema
* Types like NumberType, StringType, ObjectType
* Types like NumberType, StringType, ObjectType.
*/

@@ -18,3 +18,3 @@ type: SchemaTypeID;

* Note: In the model, we will only ever keep only one tag on every node of the
* tree representation of the schema type
* tree representation of the schema type.
*/

@@ -32,6 +32,6 @@ tag?: any;

* type, and that can be overriden when a more advanced logic is needed
* (e.g. for Object, Arrays, etc.).
* (e.g. For Object, Arrays, etc.).
*
* If the 2 models are of the same type, we can safely merge them together,
* otherwise we combine them into a UnionType
* otherwise we combine them into a UnionType.
*

@@ -42,7 +42,8 @@ * Important: If you override this method to have a more specific combination

*
* @param {SchemaType} other - the schema to combine it with
* @param {number} counter - the number of times the other schema was seen
* @param {TagCombiner} combineTag - a method used
* @param other - The schema to combine it with.
* @param counter - The counter.
* @param counter.counter - The number of times the other schema was seen.
* @param counter.combineTag - A method used
* to combine tags together. If unset, it uses a keep-first strategy.
* @returns {SchemaType} a SchemaType that is the combination of both models
* @returns A SchemaType that is the combination of both models.
*/

@@ -55,3 +56,4 @@ combine: (other: SchemaType, { counter, combineTag }?: CombineOptions) => SchemaType;

* For immutability purposes.
* @returns {SchemaType} the copy
*
* @returns The copy.
*/

@@ -58,0 +60,0 @@ copy: () => any;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NumberType = void 0;
var combiners_1 = require("../tags/combiners");

@@ -12,6 +13,6 @@ var UnionType_1 = require("./UnionType");

* type, and that can be overriden when a more advanced logic is needed
* (e.g. for Object, Arrays, etc.).
* (e.g. For Object, Arrays, etc.).
*
* If the 2 models are of the same type, we can safely merge them together,
* otherwise we combine them into a UnionType
* otherwise we combine them into a UnionType.
*

@@ -22,7 +23,8 @@ * Important: If you override this method to have a more specific combination

*
* @param {SchemaType} other - the schema to combine it with
* @param {number} counter - the number of times the other schema was seen
* @param {TagCombiner} combineTag - a method used
* @param other - The schema to combine it with.
* @param counter - The counter.
* @param counter.counter - The number of times the other schema was seen.
* @param counter.combineTag - A method used
* to combine tags together. If unset, it uses a keep-first strategy.
* @returns {SchemaType} a SchemaType that is the combination of both models
* @returns A SchemaType that is the combination of both models.
*/

@@ -34,3 +36,3 @@ this.combine = function (other, _a) {

if (other.type === _this.type) {
// @ts-ignore ts(2351)
// @ts-expect-error ts(2351)
var result = new other.constructor({

@@ -52,6 +54,7 @@ counter: counter || _this.counter + other.counter,

* For immutability purposes.
* @returns {SchemaType} the copy
*
* @returns The copy.
*/
this.copy = function () {
// @ts-ignore ts(2351)
// @ts-expect-error ts(2351)
return new _this.constructor({ counter: _this.counter, tag: _this.tag });

@@ -58,0 +61,0 @@ };

@@ -1,2 +0,2 @@

import { SchemaTypeParams, Diagnostic, CombineOptions, SchemaType, SchemaTypeID, SchemaObject } from '../interfaces';
import type { SchemaTypeParams, Diagnostic, CombineOptions, SchemaType, SchemaTypeID, SchemaObject } from '../interfaces';
import { UnionType } from './UnionType';

@@ -6,3 +6,3 @@ export declare class ObjectType implements SchemaType {

* Unique type ID that can be used to discriminate between different Schema
* Types like NumberType, StringType, ObjectType
* Types like NumberType, StringType, ObjectType.
*/

@@ -20,3 +20,3 @@ type: SchemaTypeID;

* Note: In the model, we will only ever keep only one tag on every node of the
* tree representation of the schema type
* tree representation of the schema type.
*/

@@ -36,3 +36,3 @@ tag?: any;

* b: <BooleanType>
* }
* }.
*/

@@ -42,10 +42,12 @@ schema: SchemaObject;

/**
* A typeguard to ensure that another SchemaType is of the same type
* @param {SchemaType} other the schema to test
* @returns {boolean} whether the schema to test is an ObjectType
* A typeguard to ensure that another SchemaType is of the same type.
*
* @param other - The schema to test.
* @returns Whether the schema to test is an ObjectType.
*/
isSameType(other: SchemaType): other is ObjectType;
/**
* creates an immutable copy of the current ObjectType with identical `.schema`
* @returns {ObjectType} the copy
* Creates an immutable copy of the current ObjectType with identical `.schema`.
*
* @returns The copy.
*/

@@ -52,0 +54,0 @@ copy: () => ObjectType;

@@ -13,6 +13,12 @@ "use strict";

};
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ObjectType = void 0;
var combiners_1 = require("../tags/combiners");
var MissingType_1 = require("./MissingType");
var UnionType_1 = require("./UnionType");
var MissingType_1 = require("./MissingType");
var ObjectType = /** @class */ (function () {

@@ -24,4 +30,5 @@ function ObjectType(_a, schema) {

/**
* creates an immutable copy of the current ObjectType with identical `.schema`
* @returns {ObjectType} the copy
* Creates an immutable copy of the current ObjectType with identical `.schema`.
*
* @returns The copy.
*/

@@ -36,3 +43,3 @@ this.copy = function () {

var key = _a[0], schema = _a[1];
return __assign({}, partial, (_b = {}, _b[key] = schema.copy(), _b));
return __assign(__assign({}, partial), (_b = {}, _b[key] = schema.copy(), _b));
}, {});

@@ -57,3 +64,3 @@ return result;

* model we found with a MissingType model of the correct size (counter) and
* identifier (tag)
* identifier (tag).
*/

@@ -78,3 +85,3 @@ var combinedSchema = Object.entries(other.schema).reduce(function (partial, _a) {

}
return __assign({}, partial, update);
return __assign(__assign({}, partial), update);
}, {});

@@ -93,6 +100,6 @@ combinedSchema = Object.entries(_this.schema).reduce(function (partial, _a) {

}
return __assign({}, partial, update);
return __assign(__assign({}, partial), update);
}, combinedSchema);
var combinedCounter = counter || _this.counter + other.counter;
// @ts-ignore ts(2351)
// @ts-expect-error ts(2351)
return new _this.constructor({

@@ -111,3 +118,2 @@ counter: combinedCounter,

})
// eslint-disable-next-line @typescript-eslint/no-unused-vars
.map(function (_a) {

@@ -136,3 +142,3 @@ var _ = _a[0], value = _a[1];

var key = _a[0], schema = _a[1];
return currentDiagnostics.concat(schema.diagnose(path.concat([key])));
return __spreadArray(__spreadArray([], currentDiagnostics), schema.diagnose(__spreadArray(__spreadArray([], path), [key])));
}, diagnostics);

@@ -153,3 +159,3 @@ };

var _a = subSchema.traverse(path.slice(1)), subPath = _a.path, traversedSchema = _a.schema;
return { path: [segment].concat(subPath), schema: traversedSchema };
return { path: __spreadArray([segment], subPath), schema: traversedSchema };
}

@@ -164,5 +170,6 @@ return invalidPathSchema;

/**
* A typeguard to ensure that another SchemaType is of the same type
* @param {SchemaType} other the schema to test
* @returns {boolean} whether the schema to test is an ObjectType
* A typeguard to ensure that another SchemaType is of the same type.
*
* @param other - The schema to test.
* @returns Whether the schema to test is an ObjectType.
*/

@@ -169,0 +176,0 @@ ObjectType.prototype.isSameType = function (other) {

@@ -1,6 +0,6 @@

import { SchemaTypeParams, SchemaType, SchemaTypeID, CombineOptions, Diagnostic } from '../interfaces';
import type { SchemaTypeParams, SchemaType, SchemaTypeID, CombineOptions, Diagnostic } from '../interfaces';
export declare class StringType implements SchemaType {
/**
* Unique type ID that can be used to discriminate between different Schema
* Types like NumberType, StringType, ObjectType
* Types like NumberType, StringType, ObjectType.
*/

@@ -18,3 +18,3 @@ type: SchemaTypeID;

* Note: In the model, we will only ever keep only one tag on every node of the
* tree representation of the schema type
* tree representation of the schema type.
*/

@@ -32,6 +32,6 @@ tag?: any;

* type, and that can be overriden when a more advanced logic is needed
* (e.g. for Object, Arrays, etc.).
* (e.g. For Object, Arrays, etc.).
*
* If the 2 models are of the same type, we can safely merge them together,
* otherwise we combine them into a UnionType
* otherwise we combine them into a UnionType.
*

@@ -42,7 +42,8 @@ * Important: If you override this method to have a more specific combination

*
* @param {SchemaType} other - the schema to combine it with
* @param {number} counter - the number of times the other schema was seen
* @param {TagCombiner} combineTag - a method used
* @param other - The schema to combine it with.
* @param counter - The counter.
* @param counter.counter - The number of times the other schema was seen.
* @param counter.combineTag - A method used
* to combine tags together. If unset, it uses a keep-first strategy.
* @returns {SchemaType} a SchemaType that is the combination of both models
* @returns A SchemaType that is the combination of both models.
*/

@@ -55,3 +56,4 @@ combine: (other: SchemaType, { counter, combineTag }?: CombineOptions) => SchemaType;

* For immutability purposes.
* @returns {SchemaType} the copy
*
* @returns The copy.
*/

@@ -58,0 +60,0 @@ copy: () => any;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StringType = void 0;
var combiners_1 = require("../tags/combiners");

@@ -12,6 +13,6 @@ var UnionType_1 = require("./UnionType");

* type, and that can be overriden when a more advanced logic is needed
* (e.g. for Object, Arrays, etc.).
* (e.g. For Object, Arrays, etc.).
*
* If the 2 models are of the same type, we can safely merge them together,
* otherwise we combine them into a UnionType
* otherwise we combine them into a UnionType.
*

@@ -22,7 +23,8 @@ * Important: If you override this method to have a more specific combination

*
* @param {SchemaType} other - the schema to combine it with
* @param {number} counter - the number of times the other schema was seen
* @param {TagCombiner} combineTag - a method used
* @param other - The schema to combine it with.
* @param counter - The counter.
* @param counter.counter - The number of times the other schema was seen.
* @param counter.combineTag - A method used
* to combine tags together. If unset, it uses a keep-first strategy.
* @returns {SchemaType} a SchemaType that is the combination of both models
* @returns A SchemaType that is the combination of both models.
*/

@@ -34,3 +36,3 @@ this.combine = function (other, _a) {

if (other.type === _this.type) {
// @ts-ignore ts(2351)
// @ts-expect-error ts(2351)
var result = new other.constructor({

@@ -52,6 +54,7 @@ counter: counter || _this.counter + other.counter,

* For immutability purposes.
* @returns {SchemaType} the copy
*
* @returns The copy.
*/
this.copy = function () {
// @ts-ignore ts(2351)
// @ts-expect-error ts(2351)
return new _this.constructor({ counter: _this.counter, tag: _this.tag });

@@ -58,0 +61,0 @@ };

@@ -1,6 +0,6 @@

import { Diagnostic, CombineOptions, SchemaTypeID, SchemaTypeParams, SchemaType, SchemaObject } from '../interfaces';
import type { Diagnostic, CombineOptions, SchemaTypeID, SchemaTypeParams, SchemaType, SchemaObject } from '../interfaces';
export declare class UnionType implements SchemaType {
/**
* Unique type ID that can be used to discriminate between different Schema
* Types like NumberType, StringType, ObjectType
* Types like NumberType, StringType, ObjectType.
*/

@@ -18,3 +18,3 @@ type: SchemaTypeID;

* Note: In the model, we will only ever keep only one tag on every node of the
* tree representation of the schema type
* tree representation of the schema type.
*/

@@ -35,3 +35,3 @@ tag?: any;

* Null: <NullType>
* }
* }.
*/

@@ -41,14 +41,15 @@ types: SchemaObject;

/**
* A typeguard to ensure that another SchemaType is of the same type
* @param {SchemaType} other the schema to test
* @returns {boolean} whether the schema to test is a UnionType
* A typeguard to ensure that another SchemaType is of the same type.
*
* @param other - The schema to test.
* @returns Whether the schema to test is a UnionType.
*/
isSameType(other: SchemaType): other is UnionType;
/**
* creates an immutable copy of the current UnionType with identical `.types`
* @returns {UnionType} the copy
* Creates an immutable copy of the current UnionType with identical `.types`.
*
* @returns The copy.
*/
copy: () => UnionType;
combine: (other: SchemaType, { counter, combineTag }?: CombineOptions) => UnionType;
private diagnoseChildren;
diagnose: (path?: string[]) => Diagnostic[];

@@ -59,2 +60,3 @@ traverse: (path?: string[]) => {

};
private diagnoseChildren;
}

@@ -13,3 +13,9 @@ "use strict";

};
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.UnionType = void 0;
var combiners_1 = require("../tags/combiners");

@@ -24,7 +30,8 @@ var isMultiType = function (types) {

var _this = this;
var _b = (_a === void 0 ? { counter: 0 } : _a).counter, counter = _b === void 0 ? 0 : _b;
var _b = _a === void 0 ? { counter: 0 } : _a, _c = _b.counter, counter = _c === void 0 ? 0 : _c;
if (types === void 0) { types = {}; }
/**
* creates an immutable copy of the current UnionType with identical `.types`
* @returns {UnionType} the copy
* Creates an immutable copy of the current UnionType with identical `.types`.
*
* @returns The copy.
*/

@@ -37,3 +44,3 @@ this.copy = function () {

var key = _a[0], schema = _a[1];
return __assign({}, partial, (_b = {}, _b[key] = schema.copy(), _b));
return __assign(__assign({}, partial), (_b = {}, _b[key] = schema.copy(), _b));
}, {});

@@ -49,3 +56,3 @@ return result;

var type = _a[0], schema = _a[1];
return __assign({}, copy, (_b = {}, _b[type] = schema.copy(), _b));
return __assign(__assign({}, copy), (_b = {}, _b[type] = schema.copy(), _b));
}, {});

@@ -72,3 +79,3 @@ /**

}
return __assign({}, types, update);
return __assign(__assign({}, types), update);
}, combinedTypes);

@@ -86,11 +93,5 @@ }

var combinedCounter = counter || _this.counter + other.counter;
// @ts-ignore ts(2351)
// @ts-expect-error ts(2351)
return new _this.constructor({ counter: combinedCounter }, combinedTypes);
};
this.diagnoseChildren = function (path) {
return Object.entries(_this.types).reduce(function (currentDiagnostics, _a) {
var type = _a[0], schema = _a[1];
return currentDiagnostics.concat(schema.diagnose(path.concat(["(" + type + ")"])));
}, []);
};
this.diagnose = function (path) {

@@ -140,3 +141,3 @@ if (path === void 0) { path = []; }

});
diagnostics = diagnostics.concat(multiTypeDiagnostics);
diagnostics = __spreadArray(__spreadArray([], diagnostics), multiTypeDiagnostics);
}

@@ -152,3 +153,3 @@ var healthyDiagnostic = {

diagnostics.push(healthyDiagnostic);
return diagnostics.concat(_this.diagnoseChildren(path));
return __spreadArray(__spreadArray([], diagnostics), _this.diagnoseChildren(path));
};

@@ -171,3 +172,3 @@ this.traverse = function (path) {

var _a = subSchema.traverse(path.slice(1)), subPath = _a.path, traversedSchema = _a.schema;
return { path: [segment].concat(subPath), schema: traversedSchema };
return { path: __spreadArray([segment], subPath), schema: traversedSchema };
}

@@ -177,2 +178,8 @@ }

};
this.diagnoseChildren = function (path) {
return Object.entries(_this.types).reduce(function (currentDiagnostics, _a) {
var type = _a[0], schema = _a[1];
return __spreadArray(__spreadArray([], currentDiagnostics), schema.diagnose(__spreadArray(__spreadArray([], path), ["(" + type + ")"])));
}, []);
};
this.counter = counter;

@@ -183,5 +190,6 @@ this.type = 'Union';

/**
* A typeguard to ensure that another SchemaType is of the same type
* @param {SchemaType} other the schema to test
* @returns {boolean} whether the schema to test is a UnionType
* A typeguard to ensure that another SchemaType is of the same type.
*
* @param other - The schema to test.
* @returns Whether the schema to test is a UnionType.
*/

@@ -188,0 +196,0 @@ UnionType.prototype.isSameType = function (other) {

@@ -1,6 +0,6 @@

import { Diagnostic, CombineOptions, SchemaTypeID, SchemaTypeParams, SchemaType } from '../interfaces';
import type { Diagnostic, CombineOptions, SchemaTypeID, SchemaTypeParams, SchemaType } from '../interfaces';
export declare class UnknownType implements SchemaType {
/**
* Unique type ID that can be used to discriminate between different Schema
* Types like NumberType, StringType, ObjectType
* Types like NumberType, StringType, ObjectType.
*/

@@ -18,3 +18,3 @@ type: SchemaTypeID;

* Note: In the model, we will only ever keep only one tag on every node of the
* tree representation of the schema type
* tree representation of the schema type.
*/

@@ -32,6 +32,6 @@ tag?: any;

* type, and that can be overriden when a more advanced logic is needed
* (e.g. for Object, Arrays, etc.).
* (e.g. For Object, Arrays, etc.).
*
* If the 2 models are of the same type, we can safely merge them together,
* otherwise we combine them into a UnionType
* otherwise we combine them into a UnionType.
*

@@ -42,7 +42,8 @@ * Important: If you override this method to have a more specific combination

*
* @param {SchemaType} other - the schema to combine it with
* @param {number} counter - the number of times the other schema was seen
* @param {TagCombiner} combineTag - a method used
* @param other - The schema to combine it with.
* @param counter - The counter.
* @param counter.counter - The number of times the other schema was seen.
* @param counter.combineTag - A method used
* to combine tags together. If unset, it uses a keep-first strategy.
* @returns {SchemaType} a SchemaType that is the combination of both models
* @returns A SchemaType that is the combination of both models.
*/

@@ -55,3 +56,4 @@ combine: (other: SchemaType, { counter, combineTag }?: CombineOptions) => SchemaType;

* For immutability purposes.
* @returns {SchemaType} the copy
*
* @returns The copy.
*/

@@ -58,0 +60,0 @@ copy: () => any;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UnknownType = void 0;
var combiners_1 = require("../tags/combiners");

@@ -12,6 +13,6 @@ var UnionType_1 = require("./UnionType");

* type, and that can be overriden when a more advanced logic is needed
* (e.g. for Object, Arrays, etc.).
* (e.g. For Object, Arrays, etc.).
*
* If the 2 models are of the same type, we can safely merge them together,
* otherwise we combine them into a UnionType
* otherwise we combine them into a UnionType.
*

@@ -22,7 +23,8 @@ * Important: If you override this method to have a more specific combination

*
* @param {SchemaType} other - the schema to combine it with
* @param {number} counter - the number of times the other schema was seen
* @param {TagCombiner} combineTag - a method used
* @param other - The schema to combine it with.
* @param counter - The counter.
* @param counter.counter - The number of times the other schema was seen.
* @param counter.combineTag - A method used
* to combine tags together. If unset, it uses a keep-first strategy.
* @returns {SchemaType} a SchemaType that is the combination of both models
* @returns A SchemaType that is the combination of both models.
*/

@@ -34,3 +36,3 @@ this.combine = function (other, _a) {

if (other.type === _this.type) {
// @ts-ignore ts(2351)
// @ts-expect-error ts(2351)
var result = new other.constructor({

@@ -52,6 +54,7 @@ counter: counter || _this.counter + other.counter,

* For immutability purposes.
* @returns {SchemaType} the copy
*
* @returns The copy.
*/
this.copy = function () {
// @ts-ignore ts(2351)
// @ts-expect-error ts(2351)
return new _this.constructor({ counter: _this.counter, tag: _this.tag });

@@ -58,0 +61,0 @@ };

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc