@itwin/ecschema-rpcinterface-tests 5.15.0-dev.7 → 5.15.0-dev.9
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/lib/dist/bundled-tests.js +11 -4
- package/lib/dist/bundled-tests.js.map +1 -1
- package/package.json +15 -15
|
@@ -317216,11 +317216,18 @@ class Parser {
|
|
|
317216
317216
|
}
|
|
317217
317217
|
return undefined;
|
|
317218
317218
|
}
|
|
317219
|
+
/** Get the Unit Conversion for a known unit. Matches by unit name first because labels can differ between units providers
|
|
317220
|
+
* (e.g. an unlabeled schema unit may have an empty label in one provider and a name-derived label in another). Falls back to label lookup.
|
|
317221
|
+
*/
|
|
317222
|
+
static tryFindUnitConversionForUnit(unit, unitsConversions) {
|
|
317223
|
+
const byName = unitsConversions.find((conversion) => conversion.name === unit.name);
|
|
317224
|
+
return byName ? byName.conversion : Parser.tryFindUnitConversion(unit.label, unitsConversions, unit);
|
|
317225
|
+
}
|
|
317219
317226
|
/**
|
|
317220
317227
|
* Get what the unit conversion is for a unitless value.
|
|
317221
317228
|
*/
|
|
317222
317229
|
static getDefaultUnitConversion(tokens, unitsConversions, defaultUnit) {
|
|
317223
|
-
let unitConversion = defaultUnit ? Parser.
|
|
317230
|
+
let unitConversion = defaultUnit ? Parser.tryFindUnitConversionForUnit(defaultUnit, unitsConversions) : undefined;
|
|
317224
317231
|
if (!unitConversion) {
|
|
317225
317232
|
// No default unit conversion, take the first valid unit.
|
|
317226
317233
|
const uniqueUnitLabels = [...new Set(tokens.filter((token) => token.isString).map((token) => token.value))];
|
|
@@ -317340,7 +317347,7 @@ class Parser {
|
|
|
317340
317347
|
if (compositeUnitIndex > 0 && format.units && format.units.length > compositeUnitIndex) {
|
|
317341
317348
|
// if this is not the first token, and we have a composite spec, look up the unit from the current index
|
|
317342
317349
|
const presUnitAtIndex = format.units[compositeUnitIndex][0];
|
|
317343
|
-
conversion = Parser.
|
|
317350
|
+
conversion = Parser.tryFindUnitConversionForUnit(presUnitAtIndex, unitsConversions);
|
|
317344
317351
|
}
|
|
317345
317352
|
else if (defaultUnitConversion) {
|
|
317346
317353
|
conversion = defaultUnitConversion;
|
|
@@ -317633,7 +317640,7 @@ class Parser {
|
|
|
317633
317640
|
}
|
|
317634
317641
|
// Original flow for 1-unit composite - use Quantity.convertTo for proper unit conversion
|
|
317635
317642
|
const defaultUnit = spec.format.units && spec.format.units.length > 0 ? spec.format.units[0][0] : undefined;
|
|
317636
|
-
const unitConversion = defaultUnit ? Parser.
|
|
317643
|
+
const unitConversion = defaultUnit ? Parser.tryFindUnitConversionForUnit(defaultUnit, spec.unitConversions) : undefined;
|
|
317637
317644
|
if (!unitConversion) {
|
|
317638
317645
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_2__.QuantityError(_Exception__WEBPACK_IMPORTED_MODULE_2__.QuantityStatus.MissingRequiredProperty, `Missing input unit or unit conversion for interpreting ${spec.format.name}.`);
|
|
317639
317646
|
}
|
|
@@ -337598,7 +337605,7 @@ class WMS {
|
|
|
337598
337605
|
(module) {
|
|
337599
337606
|
|
|
337600
337607
|
"use strict";
|
|
337601
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.15.0-dev.
|
|
337608
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.15.0-dev.9","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s build:workers && npm run -s copy:draco","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2022 --outDir lib/esm","clean":"rimraf -g lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:draco":"cpx \\"./node_modules/@loaders.gl/draco/dist/libs/*\\" ./lib/public/scripts","docs":"betools docs --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts && npm run -s extract","extract":"betools extract --fileExt=ts --extractFrom=./src/test/example-code --recursive --out=../../generated-docs/extract","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-deprecation":"eslint --fix -f visualstudio --no-inline-config -c ../../common/config/eslint/eslint.config.deprecation-policy.js \\"./src/**/*.ts\\"","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run build:test-worker && vitest --run","cover":"npm run build:test-worker && vitest --run","build:test-worker":"vite build --config ./src/test/worker/vite.config.mts 1>&2","build:workers":"rimraf lib/workers/webpack && vite build --config ./src/workers/ImdlParser/vite.config.mts 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@bentley/aec-units-schema":"^1.0.3","@bentley/formats-schema":"^1.0.0","@bentley/units-schema":"^1.0.12","@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*","@itwin/object-storage-core":"^3.0.4","@itwin/eslint-plugin":"^6.0.0","@types/node":"~20.17.0","@types/sinon":"^17.0.2","@vitest/browser-playwright":"^4.1.10","@vitest/coverage-v8":"^4.1.10","cpx2":"^8.0.0","eslint":"^9.31.0","playwright":"~1.56.1","rimraf":"^6.0.1","sinon":"^17.0.2","typescript":"~5.6.2","vite":"^6.4.3","vitest":"^4.1.10"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^4.4.5","@loaders.gl/draco":"^4.4.5","fuse.js":"^3.3.0","wms-capabilities":"0.6.0"}}');
|
|
337602
337609
|
|
|
337603
337610
|
/***/ },
|
|
337604
337611
|
|