@openframe-org/criteria-set-protocol 2.6.3 → 2.6.5
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/v1/utils.d.ts +1 -1
- package/dist/v1/utils.js +6 -3
- package/package.json +1 -1
package/dist/v1/utils.d.ts
CHANGED
|
@@ -59,5 +59,5 @@ export declare const getCertificationsByValue: (certificationDefinitions: Certif
|
|
|
59
59
|
* - If it is a different type, throw an error
|
|
60
60
|
* In all cases, the data should contain 'text' and 'readOnly' properties
|
|
61
61
|
*/
|
|
62
|
-
export declare const
|
|
62
|
+
export declare const validateData: (dataOrTreeElement: CriteriaTreeElement | TaskItemData | ElementData | TreeResult) => void;
|
|
63
63
|
export {};
|
package/dist/v1/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.validateData = exports.getCertificationsByValue = exports.isNil = exports.applyReportTitleTextFormatFormattingPlaceholders = exports.applyCriteriaTreeElementTextFormatFormattingPlaceholders = exports.applyDocumentTreeFolderTextFormattingPlaceholders = exports.applyBreadcrumbTextFormattingPlaceholders = exports.findInTree = exports.toColorHexString = exports.isTaskItem = exports.isTask = exports.isTaskGroup = exports.isCriterion = exports.isTheme = void 0;
|
|
4
4
|
const isTheme = (element) => element.type === "theme";
|
|
5
5
|
exports.isTheme = isTheme;
|
|
6
6
|
const isCriterion = (element) => element.type === "criterion";
|
|
@@ -100,7 +100,10 @@ exports.getCertificationsByValue = getCertificationsByValue;
|
|
|
100
100
|
* - If it is a different type, throw an error
|
|
101
101
|
* In all cases, the data should contain 'text' and 'readOnly' properties
|
|
102
102
|
*/
|
|
103
|
-
const
|
|
103
|
+
const validateData = (dataOrTreeElement) => {
|
|
104
|
+
if ("type" in dataOrTreeElement && dataOrTreeElement.type === "task-group") {
|
|
105
|
+
throw new Error("Task groups cannot have data");
|
|
106
|
+
}
|
|
104
107
|
if (("type" in dataOrTreeElement) && dataOrTreeElement.type === "task-item" && !("readOnly" in dataOrTreeElement)) {
|
|
105
108
|
throw new Error("Data is missing 'readOnly' property");
|
|
106
109
|
}
|
|
@@ -140,4 +143,4 @@ const validateElementData = (dataOrTreeElement) => {
|
|
|
140
143
|
throw new Error(`Data has an invalid 'type' property: ${data.type}`);
|
|
141
144
|
}
|
|
142
145
|
};
|
|
143
|
-
exports.
|
|
146
|
+
exports.validateData = validateData;
|
package/package.json
CHANGED