@markuplint/ml-config 4.0.0-alpha.2 → 4.0.0-dev.28

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.
@@ -48,10 +48,10 @@ export function mergeRule(a, b) {
48
48
  deleteUndefProp(res);
49
49
  return res;
50
50
  }
51
- const severity = oB.severity ?? (!isRuleConfigValue(oA) ? oA.severity : undefined);
51
+ const severity = oB.severity ?? (isRuleConfigValue(oA) ? undefined : oA.severity);
52
52
  const value = oB.value ?? (isRuleConfigValue(oA) ? oA : oA.value);
53
- const options = mergeObject(!isRuleConfigValue(oA) ? oA.options : undefined, oB.options);
54
- const reason = oB.reason ?? (!isRuleConfigValue(oA) ? oA.reason : undefined);
53
+ const options = mergeObject(isRuleConfigValue(oA) ? undefined : oA.options, oB.options);
54
+ const reason = oB.reason ?? (isRuleConfigValue(oA) ? undefined : oA.reason);
55
55
  const res = {
56
56
  severity,
57
57
  value,
@@ -107,7 +107,9 @@ function concatArray(a, b, uniquely = false, comparePropName) {
107
107
  }
108
108
  newArray.splice(existedIndex, 1, merged);
109
109
  }
110
+ // eslint-disable-next-line unicorn/no-array-for-each
110
111
  a?.forEach(concat);
112
+ // eslint-disable-next-line unicorn/no-array-for-each
111
113
  b?.forEach(concat);
112
114
  return newArray.length === 0 ? undefined : newArray;
113
115
  }
package/lib/utils.js CHANGED
@@ -49,7 +49,7 @@ export function exchangeValueOnRule(rule, data) {
49
49
  const exchangedValue = exchangeValue(result.reason, data);
50
50
  result = {
51
51
  ...result,
52
- reason: exchangedValue != null ? `${exchangedValue}` : undefined,
52
+ reason: exchangedValue == null ? undefined : `${exchangedValue}`,
53
53
  };
54
54
  }
55
55
  deleteUndefProp(result);
@@ -141,9 +141,9 @@ function exchangeOption(optionValue, data) {
141
141
  return optionValue.map(v => exchangeOption(v, data));
142
142
  }
143
143
  const result = {};
144
- Object.keys(optionValue).forEach(key => {
144
+ for (const key of Object.keys(optionValue)) {
145
145
  result[key] = exchangeOption(optionValue[key], data);
146
- });
146
+ }
147
147
  return result;
148
148
  }
149
149
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/ml-config",
3
- "version": "4.0.0-alpha.2",
3
+ "version": "4.0.0-dev.28+0131de5e",
4
4
  "description": "JSON Schema and TypeScript types of markuplint configure JSON",
5
5
  "repository": "git@github.com:markuplint/markuplint.git",
6
6
  "author": "Yusuke Hirao <yusukehirao@me.com>",
@@ -24,14 +24,14 @@
24
24
  "clean": "tsc --build --clean"
25
25
  },
26
26
  "dependencies": {
27
- "@markuplint/ml-ast": "4.0.0-alpha.2",
28
- "@markuplint/selector": "4.0.0-alpha.2",
29
- "@markuplint/shared": "4.0.0-alpha.2",
30
- "@types/mustache": "^4.2.3",
27
+ "@markuplint/ml-ast": "4.0.0-dev.28+0131de5e",
28
+ "@markuplint/selector": "4.0.0-dev.28+0131de5e",
29
+ "@markuplint/shared": "4.0.0-dev.28+0131de5e",
30
+ "@types/mustache": "^4.2.4",
31
31
  "deepmerge": "^4.3.1",
32
32
  "is-plain-object": "^5.0.0",
33
33
  "mustache": "^4.2.0",
34
- "type-fest": "^4.4.0"
34
+ "type-fest": "^4.5.0"
35
35
  },
36
- "gitHead": "51ad52c760435641f9bff8685707d8178b0787eb"
36
+ "gitHead": "0131de5ea9dd6d3fd5472d7b414b66644c758881"
37
37
  }