@xyo-network/payload-model 2.67.0-rc.1 → 2.67.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isPayload = exports.isObject = void 0;
4
+ const isObject = (x) => {
5
+ return typeof x === 'object' && !Array.isArray(x);
6
+ };
7
+ exports.isObject = isObject;
8
+ const isPayload = (x) => {
9
+ if ((0, exports.isObject)(x)) {
10
+ return !!x && typeof x['schema'] === 'string';
11
+ }
12
+ return false;
13
+ };
14
+ exports.isPayload = isPayload;
15
+ //# sourceMappingURL=identity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/identity.ts"],"names":[],"mappings":";;;AAGO,MAAM,QAAQ,GAAG,CAAC,CAAM,EAA8C,EAAE;IAC7E,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;AACnD,CAAC,CAAA;AAFY,QAAA,QAAQ,YAEpB;AAEM,MAAM,SAAS,GAAG,CAAC,CAAM,EAAgB,EAAE;IAChD,IAAI,IAAA,gBAAQ,EAAC,CAAC,CAAC,EAAE;QACf,OAAO,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK,QAAQ,CAAA;KAC9C;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AALY,QAAA,SAAS,aAKrB"}
package/dist/cjs/index.js CHANGED
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./EmptyPayload"), exports);
5
5
  tslib_1.__exportStar(require("./Error"), exports);
6
+ tslib_1.__exportStar(require("./identity"), exports);
6
7
  tslib_1.__exportStar(require("./isPayloadOfSchemaType"), exports);
7
8
  tslib_1.__exportStar(require("./Payload"), exports);
8
9
  tslib_1.__exportStar(require("./PayloadFindFilter"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,yDAA8B;AAC9B,kDAAuB;AACvB,kEAAuC;AACvC,oDAAyB;AACzB,8DAAmC;AACnC,uDAA4B;AAC5B,kDAAuB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,yDAA8B;AAC9B,kDAAuB;AACvB,qDAA0B;AAC1B,kEAAuC;AACvC,oDAAyB;AACzB,8DAAmC;AACnC,uDAA4B;AAC5B,kDAAuB"}
@@ -0,0 +1,10 @@
1
+ export const isObject = (x) => {
2
+ return typeof x === 'object' && !Array.isArray(x);
3
+ };
4
+ export const isPayload = (x) => {
5
+ if (isObject(x)) {
6
+ return !!x && typeof x['schema'] === 'string';
7
+ }
8
+ return false;
9
+ };
10
+ //# sourceMappingURL=identity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/identity.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAM,EAA8C,EAAE;IAC7E,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;AACnD,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAM,EAAgB,EAAE;IAChD,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE;QACf,OAAO,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK,QAAQ,CAAA;KAC9C;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA"}
package/dist/esm/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './EmptyPayload';
2
2
  export * from './Error';
3
+ export * from './identity';
3
4
  export * from './isPayloadOfSchemaType';
4
5
  export * from './Payload';
5
6
  export * from './PayloadFindFilter';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,yBAAyB,CAAA;AACvC,cAAc,WAAW,CAAA;AACzB,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,yBAAyB,CAAA;AACvC,cAAc,WAAW,CAAA;AACzB,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA"}
@@ -0,0 +1,5 @@
1
+ export declare const isObject: (x: any) => x is Record<string | number | symbol, any>;
2
+ export declare const isPayload: (x: any) => x is import("./Payload").SchemaFields & import("./Payload").PayloadFields & {
3
+ schema: string;
4
+ };
5
+ //# sourceMappingURL=identity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/identity.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ,MAAO,GAAG,+CAE9B,CAAA;AAED,eAAO,MAAM,SAAS,MAAO,GAAG;;CAK/B,CAAA"}
@@ -1,5 +1,6 @@
1
1
  export * from './EmptyPayload';
2
2
  export * from './Error';
3
+ export * from './identity';
3
4
  export * from './isPayloadOfSchemaType';
4
5
  export * from './Payload';
5
6
  export * from './PayloadFindFilter';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,yBAAyB,CAAA;AACvC,cAAc,WAAW,CAAA;AACzB,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,yBAAyB,CAAA;AACvC,cAAc,WAAW,CAAA;AACzB,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA"}
package/package.json CHANGED
@@ -47,6 +47,6 @@
47
47
  },
48
48
  "sideEffects": false,
49
49
  "types": "dist/types/index.d.ts",
50
- "version": "2.67.0-rc.1",
50
+ "version": "2.67.0-rc.2",
51
51
  "stableVersion": "2.66.9"
52
52
  }
@@ -0,0 +1,13 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import { Payload } from './Payload'
3
+
4
+ export const isObject = (x: any): x is Record<string | symbol | number, any> => {
5
+ return typeof x === 'object' && !Array.isArray(x)
6
+ }
7
+
8
+ export const isPayload = (x: any): x is Payload => {
9
+ if (isObject(x)) {
10
+ return !!x && typeof x['schema'] === 'string'
11
+ }
12
+ return false
13
+ }
package/src/index.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './EmptyPayload'
2
2
  export * from './Error'
3
+ export * from './identity'
3
4
  export * from './isPayloadOfSchemaType'
4
5
  export * from './Payload'
5
6
  export * from './PayloadFindFilter'