UNPKG

409 BJavaScriptView Raw
1"use strict";
2
3require("core-js/modules/es.regexp.exec.js");
4
5require("core-js/modules/es.string.match.js");
6
7Object.defineProperty(exports, "__esModule", {
8 value: true
9});
10exports.default = pathToId;
11
12function pathToId(path) {
13 var match = (path || '').match(/^\/story\/(.+)/);
14
15 if (!match) {
16 throw new Error("Invalid path '".concat(path, "', must start with '/story/'"));
17 }
18
19 return match[1];
20}
\No newline at end of file