@expofp/offline 3.11.10 → 3.11.12

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.
@@ -51,11 +51,12 @@ export async function* generateOfflineDataLegacy(manifest, options) {
51
51
  function stripPathPrefix(node, prefix) {
52
52
  if (Array.isArray(node)) {
53
53
  for (let i = 0; i < node.length; i++) {
54
- if (typeof node[i] === 'string' && node[i].startsWith(prefix)) {
55
- node[i] = node[i].slice(prefix.length);
54
+ const el = node[i];
55
+ if (typeof el === 'string' && el.startsWith(prefix)) {
56
+ node[i] = el.slice(prefix.length);
56
57
  }
57
- else if (node[i] && typeof node[i] === 'object') {
58
- stripPathPrefix(node[i], prefix);
58
+ else if (el && typeof el === 'object') {
59
+ stripPathPrefix(el, prefix);
59
60
  }
60
61
  }
61
62
  return;
@@ -198,7 +198,7 @@ function deriveExplicitArea(ctx, fpSvg) {
198
198
  return null;
199
199
  }
200
200
  function getSvgViewBox(svg) {
201
- const match = svg.match(/\bviewBox\s*=\s*["']([^"']+)["']/i);
201
+ const match = /\bviewBox\s*=\s*["']([^"']+)["']/i.exec(svg);
202
202
  if (!match)
203
203
  return null;
204
204
  const [x, y, w, h] = match[1]
@@ -210,7 +210,7 @@ function getSvgViewBox(svg) {
210
210
  return new Box(x, y, w, h);
211
211
  }
212
212
  function getSvgRectById(svg, id) {
213
- const rectMatch = svg.match(new RegExp(`<rect\\b(?=[^>]*\\bid=["']${id}["'])[^>]*/?>`, 'i'));
213
+ const rectMatch = new RegExp(`<rect\\b(?=[^>]*\\bid=["']${id}["'])[^>]*/?>`, 'i').exec(svg);
214
214
  if (!rectMatch)
215
215
  return null;
216
216
  const rect = rectMatch[0];
@@ -223,7 +223,7 @@ function getSvgRectById(svg, id) {
223
223
  return new Box(x, y, w, h);
224
224
  }
225
225
  function getSvgAttribute(element, name) {
226
- return element.match(new RegExp(`\\b${name}\\s*=\\s*["']([^"']+)["']`, 'i'))?.[1];
226
+ return new RegExp(`\\b${name}\\s*=\\s*["']([^"']+)["']`, 'i').exec(element)?.[1];
227
227
  }
228
228
  async function assertPmtilesCliAvailable(signal) {
229
229
  try {
@@ -300,6 +300,7 @@ async function runPmtiles(args, signal) {
300
300
  if (stderr)
301
301
  log(stderr.trim());
302
302
  if (error) {
303
+ // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
303
304
  reject(error);
304
305
  return;
305
306
  }
@@ -66,7 +66,7 @@ export async function offlinizeAssetsInPlace(data, opts) {
66
66
  // Fetch and recursively process the referenced document
67
67
  const response = await fetchWithRetry(urlKey, { signal: opts.signal });
68
68
  if (response.ok) {
69
- const referencedData = await response.json();
69
+ const referencedData = (await response.json());
70
70
  processedRefs.set(urlKey, referencedData);
71
71
  log(`Processing referenced document: ${urlKey}`);
72
72
  // Recursively offlinize assets in the referenced document
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expofp/offline",
3
- "version": "3.11.10",
3
+ "version": "3.11.12",
4
4
  "type": "module",
5
5
  "description": "CLI tool for creating offline copies of ExpoFP floor plans",
6
6
  "homepage": "https://developer.expofp.com/",
@@ -31,10 +31,10 @@
31
31
  "dependencies": {
32
32
  "debug": "^4.4.3",
33
33
  "tslib": "^2.3.0",
34
- "@expofp/data": "3.11.10",
35
- "@expofp/floorplan": "3.11.10",
36
- "@expofp/geometry": "3.11.10",
37
- "@expofp/utils": "3.11.10",
38
- "@expofp/resolve": "3.11.10"
34
+ "@expofp/data": "3.11.12",
35
+ "@expofp/floorplan": "3.11.12",
36
+ "@expofp/resolve": "3.11.12",
37
+ "@expofp/geometry": "3.11.12",
38
+ "@expofp/utils": "3.11.12"
39
39
  }
40
40
  }