@mxpicture/gcp-functions-common 0.2.62 → 0.2.64
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.
|
@@ -3,8 +3,8 @@ import { AnnotationsError, AnnotationsHeader, AnnotationsProperty } from "../typ
|
|
|
3
3
|
import { DocumentData } from "../types/types.document.js";
|
|
4
4
|
import { ValidationResultFields } from "../types/types.validation.js";
|
|
5
5
|
export declare const annoProperty: (propertyKey: string, headerOrProps: AnnotationsHeader | AnnotationsProperty[]) => AnnotationsProperty | null;
|
|
6
|
-
export declare const annoPropertyTitle: (
|
|
7
|
-
export declare const annoPropertyBase: <T>(
|
|
8
|
-
export declare const annoPropertyError: (propertyKey:
|
|
6
|
+
export declare const annoPropertyTitle: (prop: AnnotationsProperty, type?: MetaFacetItemType | "*") => string;
|
|
7
|
+
export declare const annoPropertyBase: <T>(annoKey: keyof AnnotationsProperty, prop: AnnotationsProperty, type: (MetaFacetItemType | "*") | undefined, fallback: T) => T;
|
|
8
|
+
export declare const annoPropertyError: (propertyKey: string, headerOrProps: AnnotationsHeader | AnnotationsProperty[], errorFields: ValidationResultFields, type?: MetaFacetItemType | "*") => AnnotationsError | undefined;
|
|
9
9
|
export declare const annoDocInitial: <T extends DocumentData>(properties: AnnotationsProperty[]) => Partial<T>;
|
|
10
10
|
//# sourceMappingURL=helper.annotation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.annotation.d.ts","sourceRoot":"","sources":["../../src/helper/helper.annotation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAEL,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,eAAO,MAAM,YAAY,GACvB,aAAa,MAAM,EACnB,eAAe,iBAAiB,GAAG,mBAAmB,EAAE,KACvD,mBAAmB,GAAG,IAMxB,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,
|
|
1
|
+
{"version":3,"file":"helper.annotation.d.ts","sourceRoot":"","sources":["../../src/helper/helper.annotation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAEL,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,eAAO,MAAM,YAAY,GACvB,aAAa,MAAM,EACnB,eAAe,iBAAiB,GAAG,mBAAmB,EAAE,KACvD,mBAAmB,GAAG,IAMxB,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,MAAM,mBAAmB,EACzB,OAAM,iBAAiB,GAAG,GAAS,KAClC,MAAiE,CAAC;AAErE,eAAO,MAAM,gBAAgB,GAAI,CAAC,EAChC,SAAS,MAAM,mBAAmB,EAClC,MAAM,mBAAmB,EACzB,OAAM,iBAAiB,GAAG,GAAG,aAAM,EACnC,UAAU,CAAC,KACV,CAgBF,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,aAAa,MAAM,EACnB,eAAe,iBAAiB,GAAG,mBAAmB,EAAE,EACxD,aAAa,sBAAsB,EACnC,OAAM,iBAAiB,GAAG,GAAS,KAClC,gBAAgB,GAAG,SASrB,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,YAAY,EACnD,YAAY,mBAAmB,EAAE,KAChC,OAAO,CAAC,CAAC,CAcX,CAAC"}
|
|
@@ -5,12 +5,9 @@ export const annoProperty = (propertyKey, headerOrProps) => {
|
|
|
5
5
|
: headerOrProps.properties;
|
|
6
6
|
return properties.find((prop) => prop.propertyKey == propertyKey) ?? null;
|
|
7
7
|
};
|
|
8
|
-
export const annoPropertyTitle = (
|
|
9
|
-
export const annoPropertyBase = (
|
|
10
|
-
const
|
|
11
|
-
if (!prop)
|
|
12
|
-
return fallback;
|
|
13
|
-
const res = prop[propertyKey];
|
|
8
|
+
export const annoPropertyTitle = (prop, type = "*") => annoPropertyBase("title", prop, type, prop.propertyKey);
|
|
9
|
+
export const annoPropertyBase = (annoKey, prop, type = "*", fallback) => {
|
|
10
|
+
const res = prop[annoKey];
|
|
14
11
|
if (res === null || res === undefined)
|
|
15
12
|
return fallback;
|
|
16
13
|
if (typeof res === "object") {
|
|
@@ -28,9 +25,10 @@ export const annoPropertyError = (propertyKey, headerOrProps, errorFields, type
|
|
|
28
25
|
const errors = errorFields[propertyKey];
|
|
29
26
|
if (!errors)
|
|
30
27
|
return undefined;
|
|
28
|
+
const prop = annoProperty(propertyKey, headerOrProps);
|
|
31
29
|
return {
|
|
32
30
|
propertyKey,
|
|
33
|
-
title: annoPropertyTitle(
|
|
31
|
+
title: prop ? annoPropertyTitle(prop, type) : propertyKey,
|
|
34
32
|
error: errors.join("\n"),
|
|
35
33
|
};
|
|
36
34
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.annotation.js","sourceRoot":"","sources":["../../src/helper/helper.annotation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAUzD,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,WAAmB,EACnB,aAAwD,EAC5B,EAAE;IAC9B,MAAM,UAAU,GAA0B,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC;QACpE,CAAC,CAAC,aAAa;QACf,CAAC,CAAC,aAAa,CAAC,UAAU,CAAC;IAE7B,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,IAAI,IAAI,CAAC;AAC5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