Socket
Socket
Sign inDemoInstall

@xyo-network/payload-model

Package Overview
Dependencies
Maintainers
5
Versions
709
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xyo-network/payload-model - npm Package Compare versions

Comparing version 2.110.10 to 2.110.11

50

dist/browser/index.js

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

var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
// src/isPayload.ts
import { AsObjectFactory, isObject } from "@xylabs/object";
var isAnyPayload = /* @__PURE__ */ __name((value) => {
var isAnyPayload = (value) => {
if (isObject(value)) {

@@ -11,5 +8,5 @@ return typeof value.schema === "string";

return false;
}, "isAnyPayload");
};
var asAnyPayload = AsObjectFactory.create(isAnyPayload);
var isPayload = /* @__PURE__ */ __name((schema) => (value) => {
var isPayload = (schema) => (value) => {
if (isAnyPayload(value)) {

@@ -19,18 +16,18 @@ return schema.includes(value.schema);

return false;
}, "isPayload");
var asPayload = /* @__PURE__ */ __name((schema) => AsObjectFactory.create((value) => isPayload(schema)(value)), "asPayload");
};
var asPayload = (schema) => AsObjectFactory.create((value) => isPayload(schema)(value));
// src/isPayloadOfSchemaType.ts
var isPayloadOfSchemaType = /* @__PURE__ */ __name((schema) => {
var isPayloadOfSchemaType = (schema) => {
return (x) => isAnyPayload(x) && x?.schema === schema;
}, "isPayloadOfSchemaType");
var isPayloadOfSchemaTypeWithMeta = /* @__PURE__ */ __name((schema) => {
};
var isPayloadOfSchemaTypeWithMeta = (schema) => {
return (x) => isPayloadOfSchemaType(schema)(x) && x.$hash !== void 0;
}, "isPayloadOfSchemaTypeWithMeta");
var isPayloadOfSchemaTypeWithSources = /* @__PURE__ */ __name((schema) => {
};
var isPayloadOfSchemaTypeWithSources = (schema) => {
return (x) => isPayloadOfSchemaType(schema)(x) && x.sources !== void 0 && Array.isArray(x.sources);
}, "isPayloadOfSchemaTypeWithSources");
var notPayloadOfSchemaType = /* @__PURE__ */ __name((schema) => {
};
var notPayloadOfSchemaType = (schema) => {
return (x) => !isAnyPayload(x) || x?.schema !== schema;
}, "notPayloadOfSchemaType");
};

@@ -42,11 +39,11 @@ // src/Error.ts

// src/isPayloadWithHash.ts
var isWithHash = /* @__PURE__ */ __name((value) => {
var isWithHash = (value) => {
return typeof value?.$hash === "string";
}, "isWithHash");
var isPayloadWithHash = /* @__PURE__ */ __name((value) => {
};
var isPayloadWithHash = (value) => {
return isAnyPayload(value) && isWithHash(value);
}, "isPayloadWithHash");
};
// src/Meta.ts
var unMeta = /* @__PURE__ */ __name((payload) => {
var unMeta = (payload) => {
if (payload) {

@@ -56,3 +53,3 @@ const { $meta, $hash, ...result } = payload;

}
}, "unMeta");
};

@@ -65,8 +62,5 @@ // src/PayloadSet/PayloadSetSchema.ts

var PayloadSchema = "network.xyo.payload";
var isSchema = /* @__PURE__ */ __name((value) => {
if (typeof value === "string") {
return true;
}
return false;
}, "isSchema");
var isSchema = (value) => {
return typeof value === "string";
};
var asSchema = AsTypeFactory.create(isSchema);

@@ -73,0 +67,0 @@ export {

@@ -6,6 +6,6 @@ import { Payload } from './Payload.js';

schema: string;
} & import("./Payload.js").PayloadFields>(value: import("@xylabs/promise").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
} & import("./Payload.js").PayloadFields>(value: import(".store/@xylabs-promise-npm-3.6.5-91213d5428/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends {
schema: string;
} & import("./Payload.js").PayloadFields>(value: import("@xylabs/promise").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<{
} & import("./Payload.js").PayloadFields>(value: import(".store/@xylabs-promise-npm-3.6.5-91213d5428/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<{
schema: string;

@@ -16,5 +16,5 @@ } & import("./Payload.js").PayloadFields>, config?: import("@xylabs/object").TypeCheckConfig): TType;

export declare const asPayload: <T extends Payload>(schema: string[]) => {
<TType extends T>(value: import("@xylabs/promise").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends T>(value: import("@xylabs/promise").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<T>, config?: import("@xylabs/object").TypeCheckConfig): TType;
<TType extends T>(value: import(".store/@xylabs-promise-npm-3.6.5-91213d5428/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends T>(value: import(".store/@xylabs-promise-npm-3.6.5-91213d5428/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<T>, config?: import("@xylabs/object").TypeCheckConfig): TType;
};
//# sourceMappingURL=isPayload.d.ts.map

@@ -7,4 +7,4 @@ import { EmptyObject } from '@xylabs/object';

export declare const asSchema: {
<TType extends string>(value: import("@xylabs/promise").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends string>(value: import("@xylabs/promise").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<string>, config?: import("@xylabs/object").TypeCheckConfig): TType;
<TType extends string>(value: import(".store/@xylabs-promise-npm-3.6.5-91213d5428/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends string>(value: import(".store/@xylabs-promise-npm-3.6.5-91213d5428/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<string>, config?: import("@xylabs/object").TypeCheckConfig): TType;
};

@@ -11,0 +11,0 @@ export interface SchemaFields extends EmptyObject {

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

var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
// src/isPayload.ts
import { AsObjectFactory, isObject } from "@xylabs/object";
var isAnyPayload = /* @__PURE__ */ __name((value) => {
var isAnyPayload = (value) => {
if (isObject(value)) {

@@ -11,5 +8,5 @@ return typeof value.schema === "string";

return false;
}, "isAnyPayload");
};
var asAnyPayload = AsObjectFactory.create(isAnyPayload);
var isPayload = /* @__PURE__ */ __name((schema) => (value) => {
var isPayload = (schema) => (value) => {
if (isAnyPayload(value)) {

@@ -19,18 +16,18 @@ return schema.includes(value.schema);

return false;
}, "isPayload");
var asPayload = /* @__PURE__ */ __name((schema) => AsObjectFactory.create((value) => isPayload(schema)(value)), "asPayload");
};
var asPayload = (schema) => AsObjectFactory.create((value) => isPayload(schema)(value));
// src/isPayloadOfSchemaType.ts
var isPayloadOfSchemaType = /* @__PURE__ */ __name((schema) => {
var isPayloadOfSchemaType = (schema) => {
return (x) => isAnyPayload(x) && x?.schema === schema;
}, "isPayloadOfSchemaType");
var isPayloadOfSchemaTypeWithMeta = /* @__PURE__ */ __name((schema) => {
};
var isPayloadOfSchemaTypeWithMeta = (schema) => {
return (x) => isPayloadOfSchemaType(schema)(x) && x.$hash !== void 0;
}, "isPayloadOfSchemaTypeWithMeta");
var isPayloadOfSchemaTypeWithSources = /* @__PURE__ */ __name((schema) => {
};
var isPayloadOfSchemaTypeWithSources = (schema) => {
return (x) => isPayloadOfSchemaType(schema)(x) && x.sources !== void 0 && Array.isArray(x.sources);
}, "isPayloadOfSchemaTypeWithSources");
var notPayloadOfSchemaType = /* @__PURE__ */ __name((schema) => {
};
var notPayloadOfSchemaType = (schema) => {
return (x) => !isAnyPayload(x) || x?.schema !== schema;
}, "notPayloadOfSchemaType");
};

@@ -42,11 +39,11 @@ // src/Error.ts

// src/isPayloadWithHash.ts
var isWithHash = /* @__PURE__ */ __name((value) => {
var isWithHash = (value) => {
return typeof value?.$hash === "string";
}, "isWithHash");
var isPayloadWithHash = /* @__PURE__ */ __name((value) => {
};
var isPayloadWithHash = (value) => {
return isAnyPayload(value) && isWithHash(value);
}, "isPayloadWithHash");
};
// src/Meta.ts
var unMeta = /* @__PURE__ */ __name((payload) => {
var unMeta = (payload) => {
if (payload) {

@@ -56,3 +53,3 @@ const { $meta, $hash, ...result } = payload;

}
}, "unMeta");
};

@@ -65,8 +62,5 @@ // src/PayloadSet/PayloadSetSchema.ts

var PayloadSchema = "network.xyo.payload";
var isSchema = /* @__PURE__ */ __name((value) => {
if (typeof value === "string") {
return true;
}
return false;
}, "isSchema");
var isSchema = (value) => {
return typeof value === "string";
};
var asSchema = AsTypeFactory.create(isSchema);

@@ -73,0 +67,0 @@ export {

@@ -6,6 +6,6 @@ import { Payload } from './Payload.js';

schema: string;
} & import("./Payload.js").PayloadFields>(value: import("@xylabs/promise").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
} & import("./Payload.js").PayloadFields>(value: import(".store/@xylabs-promise-npm-3.6.5-91213d5428/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends {
schema: string;
} & import("./Payload.js").PayloadFields>(value: import("@xylabs/promise").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<{
} & import("./Payload.js").PayloadFields>(value: import(".store/@xylabs-promise-npm-3.6.5-91213d5428/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<{
schema: string;

@@ -16,5 +16,5 @@ } & import("./Payload.js").PayloadFields>, config?: import("@xylabs/object").TypeCheckConfig): TType;

export declare const asPayload: <T extends Payload>(schema: string[]) => {
<TType extends T>(value: import("@xylabs/promise").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends T>(value: import("@xylabs/promise").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<T>, config?: import("@xylabs/object").TypeCheckConfig): TType;
<TType extends T>(value: import(".store/@xylabs-promise-npm-3.6.5-91213d5428/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends T>(value: import(".store/@xylabs-promise-npm-3.6.5-91213d5428/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<T>, config?: import("@xylabs/object").TypeCheckConfig): TType;
};
//# sourceMappingURL=isPayload.d.ts.map

@@ -7,4 +7,4 @@ import { EmptyObject } from '@xylabs/object';

export declare const asSchema: {
<TType extends string>(value: import("@xylabs/promise").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends string>(value: import("@xylabs/promise").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<string>, config?: import("@xylabs/object").TypeCheckConfig): TType;
<TType extends string>(value: import(".store/@xylabs-promise-npm-3.6.5-91213d5428/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends string>(value: import(".store/@xylabs-promise-npm-3.6.5-91213d5428/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<string>, config?: import("@xylabs/object").TypeCheckConfig): TType;
};

@@ -11,0 +11,0 @@ export interface SchemaFields extends EmptyObject {

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

var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
// src/isPayload.ts
import { AsObjectFactory, isObject } from "@xylabs/object";
var isAnyPayload = /* @__PURE__ */ __name((value) => {
var isAnyPayload = (value) => {
if (isObject(value)) {

@@ -11,5 +8,5 @@ return typeof value.schema === "string";

return false;
}, "isAnyPayload");
};
var asAnyPayload = AsObjectFactory.create(isAnyPayload);
var isPayload = /* @__PURE__ */ __name((schema) => (value) => {
var isPayload = (schema) => (value) => {
if (isAnyPayload(value)) {

@@ -19,18 +16,18 @@ return schema.includes(value.schema);

return false;
}, "isPayload");
var asPayload = /* @__PURE__ */ __name((schema) => AsObjectFactory.create((value) => isPayload(schema)(value)), "asPayload");
};
var asPayload = (schema) => AsObjectFactory.create((value) => isPayload(schema)(value));
// src/isPayloadOfSchemaType.ts
var isPayloadOfSchemaType = /* @__PURE__ */ __name((schema) => {
var isPayloadOfSchemaType = (schema) => {
return (x) => isAnyPayload(x) && (x == null ? void 0 : x.schema) === schema;
}, "isPayloadOfSchemaType");
var isPayloadOfSchemaTypeWithMeta = /* @__PURE__ */ __name((schema) => {
};
var isPayloadOfSchemaTypeWithMeta = (schema) => {
return (x) => isPayloadOfSchemaType(schema)(x) && x.$hash !== void 0;
}, "isPayloadOfSchemaTypeWithMeta");
var isPayloadOfSchemaTypeWithSources = /* @__PURE__ */ __name((schema) => {
};
var isPayloadOfSchemaTypeWithSources = (schema) => {
return (x) => isPayloadOfSchemaType(schema)(x) && x.sources !== void 0 && Array.isArray(x.sources);
}, "isPayloadOfSchemaTypeWithSources");
var notPayloadOfSchemaType = /* @__PURE__ */ __name((schema) => {
};
var notPayloadOfSchemaType = (schema) => {
return (x) => !isAnyPayload(x) || (x == null ? void 0 : x.schema) !== schema;
}, "notPayloadOfSchemaType");
};

@@ -42,11 +39,11 @@ // src/Error.ts

// src/isPayloadWithHash.ts
var isWithHash = /* @__PURE__ */ __name((value) => {
var isWithHash = (value) => {
return typeof (value == null ? void 0 : value.$hash) === "string";
}, "isWithHash");
var isPayloadWithHash = /* @__PURE__ */ __name((value) => {
};
var isPayloadWithHash = (value) => {
return isAnyPayload(value) && isWithHash(value);
}, "isPayloadWithHash");
};
// src/Meta.ts
var unMeta = /* @__PURE__ */ __name((payload) => {
var unMeta = (payload) => {
if (payload) {

@@ -56,3 +53,3 @@ const { $meta, $hash, ...result } = payload;

}
}, "unMeta");
};

@@ -65,8 +62,5 @@ // src/PayloadSet/PayloadSetSchema.ts

var PayloadSchema = "network.xyo.payload";
var isSchema = /* @__PURE__ */ __name((value) => {
if (typeof value === "string") {
return true;
}
return false;
}, "isSchema");
var isSchema = (value) => {
return typeof value === "string";
};
var asSchema = AsTypeFactory.create(isSchema);

@@ -73,0 +67,0 @@ export {

@@ -6,6 +6,6 @@ import { Payload } from './Payload.js';

schema: string;
} & import("./Payload.js").PayloadFields>(value: import("@xylabs/promise").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
} & import("./Payload.js").PayloadFields>(value: import(".store/@xylabs-promise-npm-3.6.5-91213d5428/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends {
schema: string;
} & import("./Payload.js").PayloadFields>(value: import("@xylabs/promise").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<{
} & import("./Payload.js").PayloadFields>(value: import(".store/@xylabs-promise-npm-3.6.5-91213d5428/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<{
schema: string;

@@ -16,5 +16,5 @@ } & import("./Payload.js").PayloadFields>, config?: import("@xylabs/object").TypeCheckConfig): TType;

export declare const asPayload: <T extends Payload>(schema: string[]) => {
<TType extends T>(value: import("@xylabs/promise").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends T>(value: import("@xylabs/promise").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<T>, config?: import("@xylabs/object").TypeCheckConfig): TType;
<TType extends T>(value: import(".store/@xylabs-promise-npm-3.6.5-91213d5428/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends T>(value: import(".store/@xylabs-promise-npm-3.6.5-91213d5428/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<T>, config?: import("@xylabs/object").TypeCheckConfig): TType;
};
//# sourceMappingURL=isPayload.d.ts.map

@@ -7,4 +7,4 @@ import { EmptyObject } from '@xylabs/object';

export declare const asSchema: {
<TType extends string>(value: import("@xylabs/promise").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends string>(value: import("@xylabs/promise").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<string>, config?: import("@xylabs/object").TypeCheckConfig): TType;
<TType extends string>(value: import(".store/@xylabs-promise-npm-3.6.5-91213d5428/package").AnyNonPromise, config?: import("@xylabs/object").TypeCheckConfig): TType | undefined;
<TType extends string>(value: import(".store/@xylabs-promise-npm-3.6.5-91213d5428/package").AnyNonPromise, assert: import("@xylabs/object").StringOrAlertFunction<string>, config?: import("@xylabs/object").TypeCheckConfig): TType;
};

@@ -11,0 +11,0 @@ export interface SchemaFields extends EmptyObject {

@@ -13,8 +13,8 @@ {

"dependencies": {
"@xylabs/hex": "^3.6.4",
"@xylabs/object": "^3.6.4"
"@xylabs/hex": "^3.6.5",
"@xylabs/object": "^3.6.5"
},
"devDependencies": {
"@xylabs/ts-scripts-yarn3": "^3.12.4",
"@xylabs/tsconfig": "^3.12.4",
"@xylabs/ts-scripts-yarn3": "^3.13.3",
"@xylabs/tsconfig": "^3.13.3",
"typescript": "^5.5.4"

@@ -61,4 +61,4 @@ },

"sideEffects": false,
"version": "2.110.10",
"version": "2.110.11",
"type": "module"
}

@@ -10,6 +10,3 @@ import { AsTypeFactory, EmptyObject } from '@xylabs/object'

export const isSchema = (value: unknown): value is Schema => {
if (typeof value === 'string') {
return true
}
return false
return typeof value === 'string'
}

@@ -16,0 +13,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

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

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc