Skip to content

Commit 4d2be9d

Browse files
authored
Upgrade JS generation for QUDT3 (#115)
* Remove special handling for currency units * Upgrade all dependencies * Added concat-files as a submodule * Add index.d.ts files and adapt to QUDT API changes * Adapt unit tests * Update CHANGELOG.md * Switch to qudtlib-js main branch
1 parent 5340ac9 commit 4d2be9d

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

qudtlib-common-codegen/src/main/java/io/github/qudtlib/common/CodeGen.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ public static Constant makeConstant(
5858
typeName.substring(0, 1).toLowerCase()
5959
+ typeName.substring(1)
6060
+ "FromLocalnameRequired";
61-
if (typeName.equals("Unit") && codeConstantName.endsWith("_Currency")) {
62-
valueFactory = "currencyFromLocalnameRequired";
63-
}
6461
return new Constant(
6562
codeConstantName, iriLocalName, label, iri, typeName, symbol, valueFactory);
6663
}

qudtlib-js

qudtlib-main/src/main/java/io/github/qudtlib/Qudt.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ public static Unit scale(String prefixLabel, String baseUnitLabel) {
335335
// to handle specifically.
336336
if (prefixLabel.toLowerCase(Locale.ROOT).equals("kilo")
337337
&& baseUnitLabel.toLowerCase(Locale.ROOT).equals("gram")) {
338-
return unitFromLabel("kilogram");
338+
return unitFromLocalname("KiloGM");
339339
}
340340
return Optional.empty();
341341
})

0 commit comments

Comments
 (0)