@nextgis/ngw-map 1.18.10 → 1.18.11
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/ngw-map.cjs.js +1 -1
- package/lib/ngw-map.esm-browser.js +43 -13
- package/lib/ngw-map.esm-browser.js.map +1 -1
- package/lib/ngw-map.esm-browser.prod.js +1 -1
- package/lib/ngw-map.esm-browser.prod.js.map +1 -1
- package/lib/ngw-map.esm-bundler.js +1 -1
- package/lib/ngw-map.global.js +43 -14
- package/lib/ngw-map.global.js.map +1 -1
- package/lib/ngw-map.global.prod.js +1 -1
- package/lib/ngw-map.global.prod.js.map +1 -1
- package/package.json +6 -6
package/lib/ngw-map.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Bundle of @nextgis/ngw-map; version: 1.18.
|
|
1
|
+
/** Bundle of @nextgis/ngw-map; version: 1.18.11; author: NextGIS */
|
|
2
2
|
var events = {exports: {}};
|
|
3
3
|
|
|
4
4
|
var R = typeof Reflect === 'object' ? Reflect : null;
|
|
@@ -1247,6 +1247,37 @@ const array = (args) => {
|
|
|
1247
1247
|
}
|
|
1248
1248
|
return value;
|
|
1249
1249
|
};
|
|
1250
|
+
function typeOfValue(value) {
|
|
1251
|
+
if (value === null)
|
|
1252
|
+
return 'null';
|
|
1253
|
+
switch (typeof value) {
|
|
1254
|
+
case 'string':
|
|
1255
|
+
return 'string';
|
|
1256
|
+
case 'number':
|
|
1257
|
+
return 'number';
|
|
1258
|
+
case 'boolean':
|
|
1259
|
+
return 'boolean';
|
|
1260
|
+
case 'object':
|
|
1261
|
+
if (Array.isArray(value)) {
|
|
1262
|
+
let arrayType = 'value';
|
|
1263
|
+
if (value.every((item) => typeof item === 'number')) {
|
|
1264
|
+
arrayType = 'number';
|
|
1265
|
+
}
|
|
1266
|
+
else if (value.every((item) => typeof item === 'string')) {
|
|
1267
|
+
arrayType = 'string';
|
|
1268
|
+
}
|
|
1269
|
+
else if (value.every((item) => typeof item === 'boolean')) {
|
|
1270
|
+
arrayType = 'boolean';
|
|
1271
|
+
}
|
|
1272
|
+
return `array<${arrayType}, ${value.length}>`;
|
|
1273
|
+
}
|
|
1274
|
+
else {
|
|
1275
|
+
return 'object';
|
|
1276
|
+
}
|
|
1277
|
+
default:
|
|
1278
|
+
return 'undefined';
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1250
1281
|
const typeExpressions = {
|
|
1251
1282
|
array: evaluateArgs(array),
|
|
1252
1283
|
boolean: evaluateArgs(fallback((arg) => (typeof arg === 'boolean' ? arg : undefined))),
|
|
@@ -1259,7 +1290,7 @@ const typeExpressions = {
|
|
|
1259
1290
|
'to-boolean': evaluateArgs(fallback(Boolean)),
|
|
1260
1291
|
'to-number': evaluateArgs(fallback(Number)),
|
|
1261
1292
|
'to-string': evaluateArgs(fallback(String)),
|
|
1262
|
-
typeof: evaluateArgs(([arg]) =>
|
|
1293
|
+
typeof: evaluateArgs(([arg]) => typeOfValue(arg)),
|
|
1263
1294
|
};
|
|
1264
1295
|
|
|
1265
1296
|
const mathExpressions = {
|
|
@@ -1357,35 +1388,33 @@ const stringExpressions = {
|
|
|
1357
1388
|
function not([expr]) {
|
|
1358
1389
|
return !expr;
|
|
1359
1390
|
}
|
|
1360
|
-
const checkCompareValues = ([a, b]) => {
|
|
1361
|
-
if (typeof a !== typeof b) {
|
|
1362
|
-
throw new Error('Values have different types.');
|
|
1363
|
-
}
|
|
1364
|
-
};
|
|
1365
1391
|
function notEqual([a, b]) {
|
|
1366
|
-
checkCompareValues([a, b]);
|
|
1367
1392
|
return a !== b;
|
|
1368
1393
|
}
|
|
1369
1394
|
function lessThan([left, right]) {
|
|
1370
|
-
checkCompareValues([left, right]);
|
|
1371
1395
|
return left < right;
|
|
1372
1396
|
}
|
|
1373
1397
|
function lessThanOrEqual([left, right]) {
|
|
1374
|
-
checkCompareValues([left, right]);
|
|
1375
1398
|
return left <= right;
|
|
1376
1399
|
}
|
|
1377
1400
|
function equal([left, right]) {
|
|
1378
|
-
checkCompareValues([left, right]);
|
|
1379
1401
|
return left === right;
|
|
1380
1402
|
}
|
|
1381
1403
|
function greaterThan([left, right]) {
|
|
1382
|
-
checkCompareValues([left, right]);
|
|
1383
1404
|
return left > right;
|
|
1384
1405
|
}
|
|
1385
1406
|
function greaterThanOrEqual([left, right]) {
|
|
1386
|
-
checkCompareValues([left, right]);
|
|
1387
1407
|
return left >= right;
|
|
1388
1408
|
}
|
|
1409
|
+
const coalesce = (args) => {
|
|
1410
|
+
for (let i = 0; i < args.length; i++) {
|
|
1411
|
+
const arg = args[i]();
|
|
1412
|
+
if (arg !== null && arg !== undefined) {
|
|
1413
|
+
return arg;
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
return null;
|
|
1417
|
+
};
|
|
1389
1418
|
const all = (args) => {
|
|
1390
1419
|
for (let i = 0; i < args.length; i++) {
|
|
1391
1420
|
const arg = args[i]();
|
|
@@ -1442,6 +1471,7 @@ const decisionExpressions = {
|
|
|
1442
1471
|
'==': evaluateArgs(equal),
|
|
1443
1472
|
'>': evaluateArgs(greaterThan),
|
|
1444
1473
|
'>=': evaluateArgs(greaterThanOrEqual),
|
|
1474
|
+
coalesce,
|
|
1445
1475
|
all,
|
|
1446
1476
|
any,
|
|
1447
1477
|
case: caseFunc,
|