@itwin/ecschema-rpcinterface-tests 5.0.0 → 5.0.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/lib/dist/bundled-tests.js +44 -2
- package/lib/dist/bundled-tests.js.map +1 -1
- package/package.json +15 -15
|
@@ -298604,6 +298604,8 @@ var Operator;
|
|
|
298604
298604
|
(function (Operator) {
|
|
298605
298605
|
Operator["addition"] = "+";
|
|
298606
298606
|
Operator["subtraction"] = "-";
|
|
298607
|
+
Operator["multiplication"] = "*";
|
|
298608
|
+
Operator["division"] = "/"; // unsupported but we recognize it during parsing
|
|
298607
298609
|
})(Operator || (Operator = {}));
|
|
298608
298610
|
function isOperator(char) {
|
|
298609
298611
|
if (typeof char === "number") {
|
|
@@ -298804,6 +298806,15 @@ class Parser {
|
|
|
298804
298806
|
processingNumber = false;
|
|
298805
298807
|
wipToken = "";
|
|
298806
298808
|
}
|
|
298809
|
+
else if (format.type === _Formatter_FormatEnums__WEBPACK_IMPORTED_MODULE_2__.FormatType.Bearing && wipToken.length > 0) {
|
|
298810
|
+
if (signToken.length > 0) {
|
|
298811
|
+
wipToken = signToken + wipToken;
|
|
298812
|
+
signToken = "";
|
|
298813
|
+
}
|
|
298814
|
+
tokens.push(new ParseToken(parseFloat(wipToken))); // Create token for the current number
|
|
298815
|
+
processingNumber = false;
|
|
298816
|
+
wipToken = "";
|
|
298817
|
+
}
|
|
298807
298818
|
continue;
|
|
298808
298819
|
}
|
|
298809
298820
|
else {
|
|
@@ -299088,6 +299099,26 @@ class Parser {
|
|
|
299088
299099
|
}
|
|
299089
299100
|
const defaultUnit = format.units && format.units.length > 0 ? format.units[0][0] : undefined;
|
|
299090
299101
|
defaultUnitConversion = defaultUnitConversion ? defaultUnitConversion : Parser.getDefaultUnitConversion(tokens, unitsConversions, defaultUnit);
|
|
299102
|
+
if (format.type === _Formatter_FormatEnums__WEBPACK_IMPORTED_MODULE_2__.FormatType.Bearing && format.units !== undefined && format.units.length > 0) {
|
|
299103
|
+
const units = format.units;
|
|
299104
|
+
const desiredNumberOfTokens = units.length;
|
|
299105
|
+
if (tokens.length < desiredNumberOfTokens && tokens[0].isNumber && desiredNumberOfTokens <= 3) {
|
|
299106
|
+
// handle the special XX.YYZZ format which is common for bearings. It uses no separators, so we need to split based on numeric indexes. We support up to 3 units
|
|
299107
|
+
const value = tokens[0].value;
|
|
299108
|
+
const firstToken = Math.floor(value);
|
|
299109
|
+
tokens.pop();
|
|
299110
|
+
tokens.push(new ParseToken(firstToken)); // Add the first token back to the list.
|
|
299111
|
+
if (desiredNumberOfTokens >= 2) {
|
|
299112
|
+
const remaining = (value - firstToken) * 100;
|
|
299113
|
+
const secondToken = Math.floor(remaining);
|
|
299114
|
+
tokens.push(new ParseToken(secondToken));
|
|
299115
|
+
if (desiredNumberOfTokens === 3) {
|
|
299116
|
+
const thirdToken = (remaining - secondToken) * 100;
|
|
299117
|
+
tokens.push(new ParseToken(thirdToken));
|
|
299118
|
+
}
|
|
299119
|
+
}
|
|
299120
|
+
}
|
|
299121
|
+
}
|
|
299091
299122
|
let tokenPair;
|
|
299092
299123
|
let increment = 1;
|
|
299093
299124
|
let mag = 0.0;
|
|
@@ -299199,6 +299230,17 @@ class Parser {
|
|
|
299199
299230
|
}
|
|
299200
299231
|
return this.parseAndProcessTokens(inString, format, unitsConversions);
|
|
299201
299232
|
}
|
|
299233
|
+
/** The value of special direction is always in degrees, try to find the unit conversion for that. */
|
|
299234
|
+
static processSpecialBearingDirection(mag, spec) {
|
|
299235
|
+
const specialDirUnit = spec.unitConversions.find((unitConversion) => unitConversion.name === "Units.ARC_DEG");
|
|
299236
|
+
if (!specialDirUnit)
|
|
299237
|
+
return { ok: false, error: ParseError.UnknownUnit };
|
|
299238
|
+
const preferredUnit = spec.outUnit;
|
|
299239
|
+
const conversion = this.tryFindUnitConversion(specialDirUnit.label, spec.unitConversions, preferredUnit);
|
|
299240
|
+
if (!conversion)
|
|
299241
|
+
return { ok: true, value: mag };
|
|
299242
|
+
return { ok: true, value: (0,_Quantity__WEBPACK_IMPORTED_MODULE_3__.applyConversion)(mag, conversion) };
|
|
299243
|
+
}
|
|
299202
299244
|
static parseBearingFormat(inString, spec) {
|
|
299203
299245
|
const specialDirections = {
|
|
299204
299246
|
n: 0,
|
|
@@ -299244,7 +299286,7 @@ class Parser {
|
|
|
299244
299286
|
const suffix = matchedSuffix?.toLowerCase() || "";
|
|
299245
299287
|
const specialDirection = specialDirections[`${prefix}${suffix}`];
|
|
299246
299288
|
if (specialDirection !== undefined)
|
|
299247
|
-
return
|
|
299289
|
+
return this.processSpecialBearingDirection(specialDirection, spec);
|
|
299248
299290
|
}
|
|
299249
299291
|
if (matchedPrefix === null || matchedSuffix === null) {
|
|
299250
299292
|
return { ok: false, error: ParseError.BearingPrefixOrSuffixMissing };
|
|
@@ -313247,7 +313289,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
313247
313289
|
/***/ ((module) => {
|
|
313248
313290
|
|
|
313249
313291
|
"use strict";
|
|
313250
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.0.
|
|
313292
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.0.1","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 webpackWorkers && npm run -s copy:workers","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:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./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","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","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run webpackTestWorker && vitest --run","cover":"npm run webpackTestWorker && vitest --run","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 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":{"@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/eslint-plugin":"5.0.0-dev.1","@types/chai-as-promised":"^7","@vitest/browser":"^3.0.6","@vitest/coverage-v8":"^3.0.6","cpx2":"^8.0.0","eslint":"^9.13.0","glob":"^10.3.12","playwright":"~1.47.1","rimraf":"^6.0.1","source-map-loader":"^5.0.0","typescript":"~5.6.2","typemoq":"^2.1.0","vitest":"^3.0.6","vite-multiple-assets":"^1.3.1","vite-plugin-static-copy":"2.2.0","webpack":"^5.97.1"},"//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/cloud-agnostic-core":"^2.2.4","@itwin/object-storage-core":"^2.3.0","@itwin/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"}}');
|
|
313251
313293
|
|
|
313252
313294
|
/***/ })
|
|
313253
313295
|
|