@pi-r/chrome 0.9.2 → 0.9.4

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.
Files changed (2) hide show
  1. package/index.js +6 -2
  2. package/package.json +5 -5
package/index.js CHANGED
@@ -386,8 +386,12 @@ function getSrcURL(instance, parent, file) {
386
386
  if (parentDir === assetDir) {
387
387
  return [file.filename, true];
388
388
  }
389
- const prefix = parentDir.split('/');
390
- const suffix = assetDir.split('/');
389
+ if (!parentDir) {
390
+ return [relativeUrl, false];
391
+ }
392
+ const splitPath = (value) => value.split(/\//).filter(seg => seg.trim());
393
+ const prefix = splitPath(parentDir);
394
+ const suffix = splitPath(assetDir);
391
395
  let found = false;
392
396
  while (prefix.length > 0 && suffix.length > 0 && prefix[0] === suffix[0]) {
393
397
  prefix.shift();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/chrome",
3
- "version": "0.9.2",
3
+ "version": "0.9.4",
4
4
  "description": "Chrome document constructor for E-mc.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -20,9 +20,9 @@
20
20
  "license": "MIT",
21
21
  "homepage": "https://github.com/anpham6/pi-r#readme",
22
22
  "dependencies": {
23
- "@e-mc/cloud": "^0.11.2",
24
- "@e-mc/core": "^0.11.2",
25
- "@e-mc/document": "^0.11.2",
26
- "@e-mc/types": "^0.11.2"
23
+ "@e-mc/cloud": "^0.11.5",
24
+ "@e-mc/core": "^0.11.5",
25
+ "@e-mc/document": "^0.11.5",
26
+ "@e-mc/types": "^0.11.5"
27
27
  }
28
28
  }