@openframe-org/criteria-set-protocol 1.3.4 → 1.3.6

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.
@@ -55,9 +55,7 @@ type BaseElement<Type extends CriteriaTreeElementType> = {
55
55
  data?: Record<string, any>;
56
56
  sortOrder?: number;
57
57
  };
58
- export type Quality = Pick<BaseElement<'quality'>, 'type' | 'tags' | 'documentation' | 'data' | 'sortOrder'> & {
59
- code: string;
60
- title?: string;
58
+ export type Quality = BaseElement<'quality'> & {
61
59
  style?: QualityStyle;
62
60
  items: Criterion[];
63
61
  };
@@ -12,3 +12,6 @@ export declare const getQualifiedName: (element: Quality | Criterion | TaskGroup
12
12
  code: string;
13
13
  title: string;
14
14
  }) => string;
15
+ export declare const resolveCode: (element: Quality | Criterion | TaskGroup | Task | {
16
+ code: string;
17
+ } | string) => string;
package/dist/v1/utils.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getQualifiedName = exports.shouldHideCode = exports.toColorHexString = exports.isTaskItem = exports.isTask = exports.isTaskGroup = exports.isCriterion = exports.isQuality = void 0;
3
+ exports.resolveCode = exports.getQualifiedName = exports.shouldHideCode = exports.toColorHexString = exports.isTaskItem = exports.isTask = exports.isTaskGroup = exports.isCriterion = exports.isQuality = void 0;
4
4
  const isQuality = (element) => element.type === 'quality';
5
5
  exports.isQuality = isQuality;
6
6
  const isCriterion = (element) => element.type === 'criterion';
@@ -30,3 +30,8 @@ const getQualifiedName = (element) => {
30
30
  return `${code} ${element.title}`;
31
31
  };
32
32
  exports.getQualifiedName = getQualifiedName;
33
+ const resolveCode = (element) => {
34
+ const resolvedCode = typeof element === 'string' ? element : element.code;
35
+ return resolvedCode.startsWith('_') ? resolvedCode.substring(1) : resolvedCode;
36
+ };
37
+ exports.resolveCode = resolveCode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openframe-org/criteria-set-protocol",
3
- "version": "1.3.4",
3
+ "version": "1.3.6",
4
4
  "description": "A protocol and tools for defining and working with criteria sets",
5
5
  "private": false,
6
6
  "author": "Andrés Angulo <aa@openframe.org>",