@itwin/ecschema-rpcinterface-tests 5.0.0-dev.39 → 5.0.0-dev.40
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 -16
- package/lib/dist/bundled-tests.js.map +1 -1
- package/package.json +16 -16
|
@@ -289571,6 +289571,10 @@ class ParseToken {
|
|
|
289571
289571
|
}
|
|
289572
289572
|
get isString() { return !this.isOperator && typeof this.value === "string"; }
|
|
289573
289573
|
get isNumber() { return typeof this.value === "number"; }
|
|
289574
|
+
get isSpecialCharacter() {
|
|
289575
|
+
const format = /^[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]+$/;
|
|
289576
|
+
return this.isString && this.value.toString().match(format) !== null;
|
|
289577
|
+
}
|
|
289574
289578
|
}
|
|
289575
289579
|
/** A ScientificToken holds an index and string representing the exponent.
|
|
289576
289580
|
* @beta
|
|
@@ -289810,7 +289814,12 @@ class Parser {
|
|
|
289810
289814
|
if (signToken.length > 0) {
|
|
289811
289815
|
wipToken = signToken + wipToken;
|
|
289812
289816
|
}
|
|
289813
|
-
|
|
289817
|
+
if (isNaN(Number(wipToken))) {
|
|
289818
|
+
tokens.push(new ParseToken(NaN));
|
|
289819
|
+
}
|
|
289820
|
+
else {
|
|
289821
|
+
tokens.push(new ParseToken(parseFloat(wipToken)));
|
|
289822
|
+
}
|
|
289814
289823
|
}
|
|
289815
289824
|
else {
|
|
289816
289825
|
tokens.push(new ParseToken(wipToken));
|
|
@@ -289908,8 +289917,6 @@ class Parser {
|
|
|
289908
289917
|
*/
|
|
289909
289918
|
static async parseIntoQuantity(inString, format, unitsProvider, altUnitLabelsProvider) {
|
|
289910
289919
|
const tokens = Parser.parseQuantitySpecification(inString, format);
|
|
289911
|
-
if (tokens.length === 0 || (!format.allowMathematicOperations && Parser.isMathematicOperation(tokens)))
|
|
289912
|
-
return new _Quantity__WEBPACK_IMPORTED_MODULE_3__.Quantity();
|
|
289913
289920
|
return Parser.createQuantityFromParseTokens(tokens, format, unitsProvider, altUnitLabelsProvider);
|
|
289914
289921
|
}
|
|
289915
289922
|
/** method to get the Unit Conversion given a unit label */
|
|
@@ -290002,6 +290009,14 @@ class Parser {
|
|
|
290002
290009
|
* Accumulate the given list of tokens into a single quantity value. Formatting the tokens along the way.
|
|
290003
290010
|
*/
|
|
290004
290011
|
static getQuantityValueFromParseTokens(tokens, format, unitsConversions, defaultUnitConversion) {
|
|
290012
|
+
if (tokens.length === 0)
|
|
290013
|
+
return { ok: false, error: ParseError.UnableToGenerateParseTokens };
|
|
290014
|
+
if (!format.allowMathematicOperations && Parser.isMathematicOperation(tokens))
|
|
290015
|
+
return { ok: false, error: ParseError.MathematicOperationFoundButIsNotAllowed };
|
|
290016
|
+
if (tokens.some((token) => token.isNumber && isNaN(token.value)) ||
|
|
290017
|
+
tokens.every((token) => token.isSpecialCharacter)) {
|
|
290018
|
+
return { ok: false, error: ParseError.UnableToConvertParseTokensToQuantity };
|
|
290019
|
+
}
|
|
290005
290020
|
const defaultUnit = format.units && format.units.length > 0 ? format.units[0][0] : undefined;
|
|
290006
290021
|
defaultUnitConversion = defaultUnitConversion ? defaultUnitConversion : Parser.getDefaultUnitConversion(tokens, unitsConversions, defaultUnit);
|
|
290007
290022
|
let tokenPair;
|
|
@@ -290119,6 +290134,16 @@ class Parser {
|
|
|
290119
290134
|
return this.parseAndProcessTokens(inString, format, unitsConversions);
|
|
290120
290135
|
}
|
|
290121
290136
|
static parseBearingFormat(inString, spec) {
|
|
290137
|
+
const specialDirections = {
|
|
290138
|
+
n: 0,
|
|
290139
|
+
ne: 45,
|
|
290140
|
+
e: 90,
|
|
290141
|
+
se: 135,
|
|
290142
|
+
s: 180,
|
|
290143
|
+
sw: 225,
|
|
290144
|
+
w: 270,
|
|
290145
|
+
nw: 315,
|
|
290146
|
+
};
|
|
290122
290147
|
// TODO: at some point we will want to open this for localization, in the first release it's going to be hard coded
|
|
290123
290148
|
let DirectionLabel;
|
|
290124
290149
|
(function (DirectionLabel) {
|
|
@@ -290130,28 +290155,36 @@ class Parser {
|
|
|
290130
290155
|
let matchedPrefix = null;
|
|
290131
290156
|
let matchedSuffix = null;
|
|
290132
290157
|
// check if input string begins with northLabel or southLabel and strip it off
|
|
290133
|
-
if (inString.startsWith(DirectionLabel.North)) {
|
|
290158
|
+
if (inString.toUpperCase().startsWith(DirectionLabel.North)) {
|
|
290134
290159
|
inString = inString.substring(DirectionLabel.North.length);
|
|
290135
290160
|
matchedPrefix = DirectionLabel.North;
|
|
290136
290161
|
}
|
|
290137
|
-
else if (inString.startsWith(DirectionLabel.South)) {
|
|
290162
|
+
else if (inString.toUpperCase().startsWith(DirectionLabel.South)) {
|
|
290138
290163
|
inString = inString.substring(DirectionLabel.South.length);
|
|
290139
290164
|
matchedPrefix = DirectionLabel.South;
|
|
290140
290165
|
}
|
|
290141
|
-
// check if input string ends with eastLabel or westLabel and strip it off
|
|
290142
|
-
if (inString.endsWith(DirectionLabel.East)) {
|
|
290166
|
+
// check if input string ends with eastLabel or westLabel (case-insensitive) and strip it off
|
|
290167
|
+
if (inString.toUpperCase().endsWith(DirectionLabel.East)) {
|
|
290143
290168
|
inString = inString.substring(0, inString.length - DirectionLabel.East.length);
|
|
290144
290169
|
matchedSuffix = DirectionLabel.East;
|
|
290145
290170
|
}
|
|
290146
|
-
else if (inString.endsWith(DirectionLabel.West)) {
|
|
290171
|
+
else if (inString.toUpperCase().endsWith(DirectionLabel.West)) {
|
|
290147
290172
|
inString = inString.substring(0, inString.length - DirectionLabel.West.length);
|
|
290148
290173
|
matchedSuffix = DirectionLabel.West;
|
|
290149
290174
|
}
|
|
290175
|
+
// check if the remaining string is a special direction
|
|
290176
|
+
if (inString.trim() === "") {
|
|
290177
|
+
const prefix = matchedPrefix?.toLowerCase() || "";
|
|
290178
|
+
const suffix = matchedSuffix?.toLowerCase() || "";
|
|
290179
|
+
const specialDirection = specialDirections[`${prefix}${suffix}`];
|
|
290180
|
+
if (specialDirection !== undefined)
|
|
290181
|
+
return { ok: true, value: specialDirection };
|
|
290182
|
+
}
|
|
290150
290183
|
if (matchedPrefix === null || matchedSuffix === null) {
|
|
290151
290184
|
return { ok: false, error: ParseError.BearingPrefixOrSuffixMissing };
|
|
290152
290185
|
}
|
|
290153
290186
|
const parsedResult = this.parseAndProcessTokens(inString, spec.format, spec.unitConversions);
|
|
290154
|
-
if (this.isParseError(parsedResult)
|
|
290187
|
+
if (this.isParseError(parsedResult)) {
|
|
290155
290188
|
return parsedResult;
|
|
290156
290189
|
}
|
|
290157
290190
|
let magnitude = parsedResult.value;
|
|
@@ -290176,7 +290209,7 @@ class Parser {
|
|
|
290176
290209
|
}
|
|
290177
290210
|
static parseAzimuthFormat(inString, spec) {
|
|
290178
290211
|
const parsedResult = this.parseAndProcessTokens(inString, spec.format, spec.unitConversions);
|
|
290179
|
-
if (this.isParseError(parsedResult)
|
|
290212
|
+
if (this.isParseError(parsedResult)) {
|
|
290180
290213
|
return parsedResult;
|
|
290181
290214
|
}
|
|
290182
290215
|
let magnitude = parsedResult.value;
|
|
@@ -290275,11 +290308,6 @@ class Parser {
|
|
|
290275
290308
|
}
|
|
290276
290309
|
static parseAndProcessTokens(inString, format, unitsConversions) {
|
|
290277
290310
|
const tokens = Parser.parseQuantitySpecification(inString, format);
|
|
290278
|
-
if (tokens.length === 0)
|
|
290279
|
-
return { ok: false, error: ParseError.UnableToGenerateParseTokens };
|
|
290280
|
-
if (!format.allowMathematicOperations && Parser.isMathematicOperation(tokens)) {
|
|
290281
|
-
return { ok: false, error: ParseError.MathematicOperationFoundButIsNotAllowed };
|
|
290282
|
-
}
|
|
290283
290311
|
if (Parser._log) {
|
|
290284
290312
|
// eslint-disable-next-line no-console
|
|
290285
290313
|
console.log(`Parse tokens`);
|
|
@@ -305649,7 +305677,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
305649
305677
|
/***/ ((module) => {
|
|
305650
305678
|
|
|
305651
305679
|
"use strict";
|
|
305652
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.0.0-dev.
|
|
305680
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.0.0-dev.40","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 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 --coverage","test:debug":"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:*"},"//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/eslint-plugin":"5.0.0-dev.1","@types/chai-as-promised":"^7","@vitest/browser":"^2.1.0","@vitest/coverage-v8":"^2.1.0","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","cpx2":"^3.0.0","eslint":"^9.13.0","glob":"^10.3.12","playwright":"~1.47.1","rimraf":"^3.0.2","source-map-loader":"^4.0.0","typescript":"~5.6.2","typemoq":"^2.1.0","vitest":"^2.1.0","vite-multiple-assets":"^1.3.1","vite-plugin-static-copy":"1.0.6","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.2.5","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"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"}}');
|
|
305653
305681
|
|
|
305654
305682
|
/***/ })
|
|
305655
305683
|
|