1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.safeId = exports.unprefixId = exports.prefixId = exports.isDraftId = void 0;
|
4 | function isDraftId(id) {
|
5 | return id.startsWith('drafts.');
|
6 | }
|
7 | exports.isDraftId = isDraftId;
|
8 | exports.prefixId = function (id) { return (id.startsWith('drafts.') ? id : "drafts." + id); };
|
9 | exports.unprefixId = function (id) { return id.replace(/^drafts\./, ''); };
|
10 | exports.safeId = function (id, makeSafe) {
|
11 | return /^(image|file)-[a-z0-9]{32,}-/.test(id)
|
12 | ?
|
13 | id
|
14 | :
|
15 |
|
16 | "-" + makeSafe(id);
|
17 | };
|
18 |
|
\ | No newline at end of file |