@mgamadeus/ddd-web 0.19.0 → 0.19.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.19.1
4
+
5
+ ### Fixed
6
+ - `enums: 'const'`: an integer enum keeps its numbers (`{ "1": 1, "101": 101 }`); the members were strings (`"1"`), so
7
+ the property type did not fit the numbers the backend sends.
8
+
3
9
  ## 0.19.0
4
10
 
5
11
  ### Added
@@ -1326,7 +1326,8 @@ function applyEnumConsts(body, modelName, model, options = {}) {
1326
1326
  if (!values || values.length === 0) continue;
1327
1327
  const constName = `${modelName}${propertyName2.charAt(0).toUpperCase()}${propertyName2.slice(1)}`;
1328
1328
  if (!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(constName)) continue;
1329
- const members = [...new Set(values.map(String))].map((value) => ` ${enumKeyOf(value)}: ${JSON.stringify(value)},`).join("\n");
1329
+ const unique = [...new Map(values.map((value) => [String(value), value])).values()];
1330
+ const members = unique.map((value) => ` ${enumKeyOf(String(value))}: ${JSON.stringify(value)},`).join("\n");
1330
1331
  consts.set(constName, `export const ${constName} = {
1331
1332
  ${members}
1332
1333
  };
@@ -3383,4 +3384,4 @@ export {
3383
3384
  runSkillLinks,
3384
3385
  linkSkills
3385
3386
  };
3386
- //# sourceMappingURL=chunk-HZ4VYIHY.js.map
3387
+ //# sourceMappingURL=chunk-HSPGT4KA.js.map