@imbricate/core 3.0.4 → 3.1.0
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/document/property.d.ts +7 -1
- package/document/validate.js +1 -1
- package/package.json +1 -1
package/document/property.d.ts
CHANGED
|
@@ -15,11 +15,17 @@ export declare enum IMBRICATE_PROPERTY_TYPE {
|
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Document properties
|
|
18
|
+
*
|
|
19
|
+
* Key - Property key, which should match schema properties unique identifier
|
|
20
|
+
* Value - Property value, which should match schema properties type
|
|
18
21
|
*/
|
|
19
22
|
export type DocumentProperties = Record<DocumentPropertyKey, DocumentPropertyValue<IMBRICATE_PROPERTY_TYPE>>;
|
|
23
|
+
/**
|
|
24
|
+
* Document property key, which should match schema properties unique identifier
|
|
25
|
+
*/
|
|
20
26
|
export type DocumentPropertyKey = string;
|
|
21
27
|
export type DocumentPropertyValue<T extends IMBRICATE_PROPERTY_TYPE> = {
|
|
22
|
-
readonly type:
|
|
28
|
+
readonly type: T;
|
|
23
29
|
readonly value: DocumentPropertyValueObject<T>;
|
|
24
30
|
};
|
|
25
31
|
export type DocumentPropertyValueObject<T extends IMBRICATE_PROPERTY_TYPE> = T extends IMBRICATE_PROPERTY_TYPE.STRING ? string : T extends IMBRICATE_PROPERTY_TYPE.MARKDOWN ? string : never;
|
package/document/validate.js
CHANGED
|
@@ -23,7 +23,7 @@ const validateImbricateProperties = (properties, schema) => {
|
|
|
23
23
|
const keys = Object.keys(properties);
|
|
24
24
|
for (const key of keys) {
|
|
25
25
|
const property = schema.properties.find((each) => {
|
|
26
|
-
return each.
|
|
26
|
+
return each.propertyIdentifier === key;
|
|
27
27
|
});
|
|
28
28
|
if (!property) {
|
|
29
29
|
return `Property ${key} not found in schema`;
|