@nxtedition/types 23.0.44 → 23.0.46
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.
- package/dist/nxtpression.d.ts +1 -1
- package/dist/records/domains/design.d.ts +1 -1
- package/dist/records/validate/assert-guard.js +5 -2
- package/dist/records/validate/assert.js +5 -2
- package/dist/records/validate/is.js +5 -2
- package/dist/records/validate/schemas.js +1 -1
- package/dist/records/validate/stringify.js +5 -2
- package/dist/records/validate/utils.d.ts +1 -1
- package/dist/records/validate/utils.js +1 -1
- package/dist/records/validate/validate-equals.js +8 -2
- package/dist/records/validate/validate.js +8 -2
- package/package.json +1 -1
package/dist/nxtpression.d.ts
CHANGED
|
@@ -421,7 +421,7 @@ declare interface DesignDomainRecord<Id = string, Key = string, Value = unknown>
|
|
|
421
421
|
}
|
|
422
422
|
|
|
423
423
|
declare interface DesignDomainRecords {
|
|
424
|
-
":design": DesignDomainRecord;
|
|
424
|
+
":design?": DesignDomainRecord;
|
|
425
425
|
}
|
|
426
426
|
|
|
427
427
|
declare interface DesignViewRow<Id = string, Key = string, Value = void> {
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import * as __typia_transform__assertGuard from "typia/lib/internal/_assertGuard.js";
|
|
2
2
|
import * as __typia_transform__accessExpressionAsString from "typia/lib/internal/_accessExpressionAsString.js";
|
|
3
3
|
import * as __typia_transform__isTypeUint64 from "typia/lib/internal/_isTypeUint64.js";
|
|
4
|
-
import { parseRecordName } from "./utils.js";
|
|
4
|
+
import { isEmptyRecord, parseRecordName } from "./utils.js";
|
|
5
5
|
import typia from 'typia';
|
|
6
6
|
export function assertGuardRecord(name, input) {
|
|
7
|
+
if (isEmptyRecord(input)) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
7
10
|
const parsed = parseRecordName(name);
|
|
8
11
|
if (parsed.type === "domain-rows") {
|
|
9
12
|
(() => { const _io0 = input => Array.isArray(input.rows) && input.rows.every(elem => "string" === typeof elem); const _ao0 = (input, _path, _exceptionable = true) => (Array.isArray(input.rows) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
@@ -4105,7 +4108,7 @@ function _assertGuardDomainRecord(domain, input) {
|
|
|
4105
4108
|
}
|
|
4106
4109
|
}; })()(input);
|
|
4107
4110
|
}
|
|
4108
|
-
case ":design": {
|
|
4111
|
+
case ":design?": {
|
|
4109
4112
|
return (() => { const _io0 = input => Array.isArray(input.rows) && input.rows.every(elem => "object" === typeof elem && null !== elem && _io1(elem)); const _io1 = input => "string" === typeof input.id && "string" === typeof input.key && true; const _ao0 = (input, _path, _exceptionable = true) => (Array.isArray(input.rows) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
4110
4113
|
method: "typia.assertGuard",
|
|
4111
4114
|
path: _path + ".rows",
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import * as __typia_transform__assertGuard from "typia/lib/internal/_assertGuard.js";
|
|
2
2
|
import * as __typia_transform__accessExpressionAsString from "typia/lib/internal/_accessExpressionAsString.js";
|
|
3
3
|
import * as __typia_transform__isTypeUint64 from "typia/lib/internal/_isTypeUint64.js";
|
|
4
|
-
import { parseRecordName } from "./utils.js";
|
|
4
|
+
import { isEmptyRecord, parseRecordName } from "./utils.js";
|
|
5
5
|
import typia from 'typia';
|
|
6
6
|
export function assertRecord(name, input) {
|
|
7
|
+
if (isEmptyRecord(input)) {
|
|
8
|
+
return input;
|
|
9
|
+
}
|
|
7
10
|
const parsed = parseRecordName(name);
|
|
8
11
|
if (parsed.type === "domain-rows") {
|
|
9
12
|
return (() => { const _io0 = input => Array.isArray(input.rows) && input.rows.every(elem => "string" === typeof elem); const _ao0 = (input, _path, _exceptionable = true) => (Array.isArray(input.rows) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
@@ -4162,7 +4165,7 @@ function _assertDomainRecord(domain, input) {
|
|
|
4162
4165
|
return input;
|
|
4163
4166
|
}; })()(input);
|
|
4164
4167
|
}
|
|
4165
|
-
case ":design": {
|
|
4168
|
+
case ":design?": {
|
|
4166
4169
|
return (() => { const _io0 = input => Array.isArray(input.rows) && input.rows.every(elem => "object" === typeof elem && null !== elem && _io1(elem)); const _io1 = input => "string" === typeof input.id && "string" === typeof input.key && true; const _ao0 = (input, _path, _exceptionable = true) => (Array.isArray(input.rows) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
4167
4170
|
method: "typia.assert",
|
|
4168
4171
|
path: _path + ".rows",
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import * as __typia_transform__isTypeUint64 from "typia/lib/internal/_isTypeUint64.js";
|
|
2
|
-
import { parseRecordName } from "./utils.js";
|
|
2
|
+
import { isEmptyRecord, parseRecordName } from "./utils.js";
|
|
3
3
|
import typia from 'typia';
|
|
4
4
|
export function isRecord(name, input) {
|
|
5
|
+
if (isEmptyRecord(input)) {
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
5
8
|
const parsed = parseRecordName(name);
|
|
6
9
|
if (parsed.type === "domain-rows") {
|
|
7
10
|
return (() => { const _io0 = input => Array.isArray(input.rows) && input.rows.every(elem => "string" === typeof elem); return input => "object" === typeof input && null !== input && _io0(input); })()(input);
|
|
@@ -316,7 +319,7 @@ function _isDomainRecord(domain, input) {
|
|
|
316
319
|
case ":deepstream.replicate": {
|
|
317
320
|
return (() => { const _io0 = input => (undefined === input.synced || "boolean" === typeof input.synced) && (null === input.since || undefined === input.since || 0 === input.since || "string" === typeof input.since) && (undefined === input.version || "number" === typeof input.version); return input => "object" === typeof input && null !== input && false === Array.isArray(input) && _io0(input); })()(input);
|
|
318
321
|
}
|
|
319
|
-
case ":design": {
|
|
322
|
+
case ":design?": {
|
|
320
323
|
return (() => { const _io0 = input => Array.isArray(input.rows) && input.rows.every(elem => "object" === typeof elem && null !== elem && _io1(elem)); const _io1 = input => "string" === typeof input.id && "string" === typeof input.key && true; return input => "object" === typeof input && null !== input && _io0(input); })()(input);
|
|
321
324
|
}
|
|
322
325
|
case ":edit": {
|
|
@@ -2,9 +2,12 @@ import * as __typia_transform__jsonStringifyString from "typia/lib/internal/_jso
|
|
|
2
2
|
import * as __typia_transform__throwTypeGuardError from "typia/lib/internal/_throwTypeGuardError.js";
|
|
3
3
|
import * as __typia_transform__jsonStringifyTail from "typia/lib/internal/_jsonStringifyTail.js";
|
|
4
4
|
import * as __typia_transform__isTypeUint64 from "typia/lib/internal/_isTypeUint64.js";
|
|
5
|
-
import { parseRecordName } from "./utils.js";
|
|
5
|
+
import { isEmptyRecord, parseRecordName } from "./utils.js";
|
|
6
6
|
import typia from 'typia';
|
|
7
7
|
export function stringifyRecord(name, input) {
|
|
8
|
+
if (isEmptyRecord(input)) {
|
|
9
|
+
return "{}";
|
|
10
|
+
}
|
|
8
11
|
const parsed = parseRecordName(name);
|
|
9
12
|
if (parsed.type === "domain-rows") {
|
|
10
13
|
return (() => { const _so0 = input => `{"rows":${`[${input.rows.map(elem => __typia_transform__jsonStringifyString._jsonStringifyString(elem)).join(",")}]`}}`; return input => _so0(input); })()(input);
|
|
@@ -668,7 +671,7 @@ function _stringifyDomainRecord(domain, input) {
|
|
|
668
671
|
});
|
|
669
672
|
})() : "null" : undefined},`}${undefined === input.version ? "" : `"version":${undefined !== input.version ? input.version : undefined}`}`)}}`; return input => _so0(input); })()(input);
|
|
670
673
|
}
|
|
671
|
-
case ":design": {
|
|
674
|
+
case ":design?": {
|
|
672
675
|
return (() => { const _so0 = input => `{"rows":${`[${input.rows.map(elem => _so1(elem)).join(",")}]`}}`; const _so1 = input => `{${undefined === input.value || "function" === typeof input.value ? "" : `"value":${undefined !== input.value ? JSON.stringify(input.value) : undefined},`}"id":${__typia_transform__jsonStringifyString._jsonStringifyString(input.id)},"key":${__typia_transform__jsonStringifyString._jsonStringifyString(input.key)}}`; const _io1 = input => "string" === typeof input.id && "string" === typeof input.key && true; return input => _so0(input); })()(input);
|
|
673
676
|
}
|
|
674
677
|
case ":edit": {
|
|
@@ -13,5 +13,5 @@ export interface DomainRecord {
|
|
|
13
13
|
export interface DomainRowsRecord {
|
|
14
14
|
type: "domain-rows";
|
|
15
15
|
}
|
|
16
|
-
export declare function isEmptyRecord<NonEmpty
|
|
16
|
+
export declare function isEmptyRecord<NonEmpty>(data: NonEmpty | EmptyObject): data is EmptyObject;
|
|
17
17
|
export declare function parseRecordName(name: string): ParsedRecordName;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const _exactRecordNames = new Set(["asset.assignees", "asset.clone", "asset.deadlines", "asset.duration", "asset.embedding", "asset.icon", "asset.locations", "asset.media", "asset.tags", "asset.title", "asset.types", "storage.locations?", "storage.zones?", "nxt.status?", "media.subtitles", "media.subtitles?", "media.transcribe?", "media.fonts?", "media.consolidate", "asset-daemon", "asset-daemon:user-notify.state", "deepstream-replicator.stats?"]);
|
|
2
2
|
export function isEmptyRecord(data) {
|
|
3
|
-
return Object.keys(data).length === 0;
|
|
3
|
+
return typeof data === "object" && data !== null && Object.keys(data).length === 0;
|
|
4
4
|
}
|
|
5
5
|
export function parseRecordName(name) {
|
|
6
6
|
if (_exactRecordNames.has(stripParams(name))) {
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import * as __typia_transform__accessExpressionAsString from "typia/lib/internal/_accessExpressionAsString.js";
|
|
2
2
|
import * as __typia_transform__validateReport from "typia/lib/internal/_validateReport.js";
|
|
3
3
|
import * as __typia_transform__isTypeUint64 from "typia/lib/internal/_isTypeUint64.js";
|
|
4
|
-
import { parseRecordName } from "./utils.js";
|
|
4
|
+
import { isEmptyRecord, parseRecordName } from "./utils.js";
|
|
5
5
|
import typia from 'typia';
|
|
6
6
|
export function validateEqualsRecord(name, input) {
|
|
7
|
+
if (isEmptyRecord(input)) {
|
|
8
|
+
return {
|
|
9
|
+
success: true,
|
|
10
|
+
data: input,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
7
13
|
const parsed = parseRecordName(name);
|
|
8
14
|
if (parsed.type === "domain-rows") {
|
|
9
15
|
return (() => { const _io0 = (input, _exceptionable = true) => Array.isArray(input.rows) && input.rows.every((elem, _index1) => "string" === typeof elem) && (1 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
@@ -6848,7 +6854,7 @@ function _validateEqualsDomainRecord(domain, input) {
|
|
|
6848
6854
|
};
|
|
6849
6855
|
}; })()(input);
|
|
6850
6856
|
}
|
|
6851
|
-
case ":design": {
|
|
6857
|
+
case ":design?": {
|
|
6852
6858
|
return (() => { const _io0 = (input, _exceptionable = true) => Array.isArray(input.rows) && input.rows.every((elem, _index1) => "object" === typeof elem && null !== elem && _io1(elem, true && _exceptionable)) && (1 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
6853
6859
|
if (["rows"].some(prop => key === prop))
|
|
6854
6860
|
return true;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import * as __typia_transform__validateReport from "typia/lib/internal/_validateReport.js";
|
|
2
2
|
import * as __typia_transform__accessExpressionAsString from "typia/lib/internal/_accessExpressionAsString.js";
|
|
3
3
|
import * as __typia_transform__isTypeUint64 from "typia/lib/internal/_isTypeUint64.js";
|
|
4
|
-
import { parseRecordName } from "./utils.js";
|
|
4
|
+
import { parseRecordName, isEmptyRecord } from "./utils.js";
|
|
5
5
|
import typia from 'typia';
|
|
6
6
|
export function validateRecord(name, input) {
|
|
7
|
+
if (isEmptyRecord(input)) {
|
|
8
|
+
return {
|
|
9
|
+
success: true,
|
|
10
|
+
data: input,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
7
13
|
const parsed = parseRecordName(name);
|
|
8
14
|
if (parsed.type === "domain-rows") {
|
|
9
15
|
return (() => { const _io0 = input => Array.isArray(input.rows) && input.rows.every(elem => "string" === typeof elem); const _vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.rows) || _report(_exceptionable, {
|
|
@@ -4230,7 +4236,7 @@ function _validateDomainRecord(domain, input) {
|
|
|
4230
4236
|
};
|
|
4231
4237
|
}; })()(input);
|
|
4232
4238
|
}
|
|
4233
|
-
case ":design": {
|
|
4239
|
+
case ":design?": {
|
|
4234
4240
|
return (() => { const _io0 = input => Array.isArray(input.rows) && input.rows.every(elem => "object" === typeof elem && null !== elem && _io1(elem)); const _io1 = input => "string" === typeof input.id && "string" === typeof input.key && true; const _vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.rows) || _report(_exceptionable, {
|
|
4235
4241
|
path: _path + ".rows",
|
|
4236
4242
|
expected: "Array<DesignViewRow<string, string, unknown>>",
|