@nxtedition/types 23.0.44 → 23.0.45
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/records/validate/assert-guard.js +4 -1
- package/dist/records/validate/assert.js +4 -1
- package/dist/records/validate/is.js +4 -1
- package/dist/records/validate/stringify.js +4 -1
- package/dist/records/validate/utils.d.ts +1 -1
- package/dist/records/validate/utils.js +1 -1
- package/dist/records/validate/validate-equals.js +7 -1
- package/dist/records/validate/validate.js +7 -1
- package/package.json +1 -1
|
@@ -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, {
|
|
@@ -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, {
|
|
@@ -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);
|
|
@@ -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);
|
|
@@ -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 => {
|
|
@@ -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, {
|