@takeshape/util 11.9.2 → 11.10.0

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/dist/common.d.ts CHANGED
@@ -26,4 +26,5 @@ export * from './sort-object';
26
26
  export * from './path-to-string';
27
27
  export * from './persisted-queries';
28
28
  export * from './assert';
29
+ export * from './urls';
29
30
  //# sourceMappingURL=common.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/common.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/common.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
package/dist/common.js CHANGED
@@ -310,4 +310,15 @@ Object.keys(_assert).forEach(function (key) {
310
310
  return _assert[key];
311
311
  }
312
312
  });
313
+ });
314
+ var _urls = require("./urls");
315
+ Object.keys(_urls).forEach(function (key) {
316
+ if (key === "default" || key === "__esModule") return;
317
+ if (key in exports && exports[key] === _urls[key]) return;
318
+ Object.defineProperty(exports, key, {
319
+ enumerable: true,
320
+ get: function () {
321
+ return _urls[key];
322
+ }
323
+ });
313
324
  });
package/dist/urls.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export declare function getFileName(urlOrPath: string): string;
2
+ //# sourceMappingURL=urls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"urls.d.ts","sourceRoot":"","sources":["../../src/urls.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAIrD"}
package/dist/urls.js ADDED
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getFileName = getFileName;
7
+ function getFileName(urlOrPath) {
8
+ const path = urlOrPath.includes('://') ? new URL(urlOrPath).pathname : urlOrPath;
9
+ const index = path.lastIndexOf('/');
10
+ return index === -1 ? path : path.substring(index + 1);
11
+ }
package/es/common.js CHANGED
@@ -25,4 +25,5 @@ export * from './validation';
25
25
  export * from './sort-object';
26
26
  export * from './path-to-string';
27
27
  export * from './persisted-queries';
28
- export * from './assert';
28
+ export * from './assert';
29
+ export * from './urls';
package/es/urls.js ADDED
@@ -0,0 +1,5 @@
1
+ export function getFileName(urlOrPath) {
2
+ const path = urlOrPath.includes('://') ? new URL(urlOrPath).pathname : urlOrPath;
3
+ const index = path.lastIndexOf('/');
4
+ return index === -1 ? path : path.substring(index + 1);
5
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takeshape/util",
3
- "version": "11.9.2",
3
+ "version": "11.10.0",
4
4
  "description": "Shared utilities",
5
5
  "homepage": "https://www.takeshape.io",
6
6
  "repository": {
@@ -32,7 +32,7 @@
32
32
  "shortid": "^2.2.16",
33
33
  "tiny-invariant": "^1.2.0",
34
34
  "url-parse": "^1.5.3",
35
- "@takeshape/routing": "11.9.2"
35
+ "@takeshape/routing": "11.10.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/classnames": "^2.2.9",