case-editor-tools 1.0.0 → 1.0.3

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/exporter/index.js CHANGED
@@ -111,7 +111,7 @@ const generateMessageConfigs = (study, outputPath, pretty) => {
111
111
  fs__default["default"].mkdirSync(messageConfigPath, { recursive: true });
112
112
  }
113
113
  study.messageConfigs.forEach(conf => {
114
- const fileName = `${messageConfigPath}/${conf.label.replace(' ', '_').toLocaleLowerCase()}.json`;
114
+ const fileName = `${messageConfigPath}/${conf.label.replace(/ /g, '_').toLocaleLowerCase()}.json`;
115
115
  const outputObject = types_messageConfig.buildMessageConfig(conf, study.studyKey);
116
116
  try {
117
117
  fs__default["default"].writeFileSync(fileName, JSON.stringify(outputObject, undefined, pretty ? 2 : undefined));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "case-editor-tools",
3
3
  "description": "Javascript tools to simplify survey and study coding for CASE.",
4
- "version": "1.0.0",
4
+ "version": "1.0.3",
5
5
  "main": "index.js",
6
6
  "license": "Apache-2.0",
7
7
  "repository": "github:case-framework/case-editor-tools",
@@ -337,7 +337,7 @@ const multipleChoiceSelectionCount = (itemKey) => {
337
337
  const getDatePickerResponseValue = (itemKey) => {
338
338
  return getResponseValueAsNum(itemKey, [constants_keyDefinitions.responseGroupKey, constants_keyDefinitions.datePickerKey].join('.'));
339
339
  };
340
- const singleChoiceOptionsSelected = (itemKey, ...optionKeys) => responseHasKeysAll(itemKey, [constants_keyDefinitions.responseGroupKey, constants_keyDefinitions.singleChoiceKey].join('.'), ...optionKeys);
340
+ const singleChoiceOptionsSelected = (itemKey, ...optionKeys) => responseHasKeysAny(itemKey, [constants_keyDefinitions.responseGroupKey, constants_keyDefinitions.singleChoiceKey].join('.'), ...optionKeys);
341
341
  const multipleChoiceOptionsSelected = (itemKey, ...optionKeys) => responseHasKeysAny(itemKey, [constants_keyDefinitions.responseGroupKey, constants_keyDefinitions.multipleChoiceKey].join('.'), ...optionKeys);
342
342
  const multipleChoiceAllOfTheseSelected = (itemKey, ...optionKeys) => responseHasKeysAll(itemKey, [constants_keyDefinitions.responseGroupKey, constants_keyDefinitions.multipleChoiceKey].join('.'), ...optionKeys);
343
343
  const multipleChoiceOnlyOtherKeysSelected = (itemKey, ...optionKeys) => responseHasOnlyKeysOtherThan(itemKey, [constants_keyDefinitions.responseGroupKey, constants_keyDefinitions.multipleChoiceKey].join('.'), ...optionKeys);
@@ -38,8 +38,8 @@ export declare const buildMessageConfig: (props: MessageConfig, studyKey: string
38
38
  };
39
39
  condition: {
40
40
  dtype: string;
41
- exp: Expression | undefined;
42
- };
41
+ exp: Expression;
42
+ } | undefined;
43
43
  period: number;
44
44
  defaultLanguage: string;
45
45
  translations: {
@@ -12,7 +12,7 @@ const buildMessageConfig = (props, studyKey) => {
12
12
  headerOverrides: props.headerOverrides,
13
13
  messageType: props.messageType,
14
14
  sendingTime: props.sendingTime,
15
- condition: { dtype: 'exp', exp: props.condition },
15
+ condition: props.condition ? { dtype: 'exp', exp: props.condition } : undefined,
16
16
  period: Math.floor(types_duration.durationObjectToSeconds(props.period)),
17
17
  defaultLanguage: props.defaultLanguage,
18
18
  translations: props.translations,