@micromag/data 0.3.485 → 0.3.486

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/lib/index.js +6 -5
  2. package/package.json +3 -3
package/lib/index.js CHANGED
@@ -22,13 +22,14 @@ var contexts = require('@micromag/core/contexts');
22
22
  basePath: PropTypes.string
23
23
  });
24
24
  var compilers = {};
25
- function generatePath(path, data) {
25
+ function generatePath(fullPath, data) {
26
26
  var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
27
- if (typeof compilers[path] === 'undefined') {
28
- compilers[path] = pathToRegexp.compile(path, opts);
27
+ var fullUrlMatches = fullPath.match(/^(https?:\/\/[^/]+)\//);
28
+ if (typeof compilers[fullPath] === 'undefined') {
29
+ compilers[fullPath] = pathToRegexp.compile(fullPath.replace(/^(https?:\/\/[^/]+)\//, '/'), opts);
29
30
  }
30
- var compiler = compilers[path];
31
- return compiler(data);
31
+ var compiler = compilers[fullPath];
32
+ return fullUrlMatches !== null ? "".concat(fullUrlMatches[1].substr(0, -1)).concat(compiler(data)) : compiler(data);
32
33
  }
33
34
 
34
35
  var Base = /*#__PURE__*/function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/data",
3
- "version": "0.3.485",
3
+ "version": "0.3.486",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [
@@ -60,7 +60,7 @@
60
60
  "@babel/runtime": "^7.13.10",
61
61
  "@folklore/fetch": "^0.1.17",
62
62
  "@folklore/routes": "^0.2.27",
63
- "@micromag/core": "^0.3.485",
63
+ "@micromag/core": "^0.3.486",
64
64
  "lodash": "^4.17.21",
65
65
  "prop-types": "^15.7.2",
66
66
  "query-string": "^6.13.7"
@@ -69,5 +69,5 @@
69
69
  "access": "public",
70
70
  "registry": "https://registry.npmjs.org/"
71
71
  },
72
- "gitHead": "7af4c126bdc155c5ea821e894957023b201c2b79"
72
+ "gitHead": "dc11ac41ea80f5d5c5d7c247bfa146fda3cc9905"
73
73
  }