1 | ;
|
2 | // Copyright IBM Corp. and LoopBack contributors 2018,2020. All Rights Reserved.
|
3 | // Node module: @loopback/context
|
4 | // This file is licensed under the MIT License.
|
5 | // License text available at https://opensource.org/licenses/MIT
|
6 | Object.defineProperty(exports, "__esModule", { value: true });
|
7 | exports.UNIQUE_ID_PATTERN = exports.generateUniqueId = void 0;
|
8 | const tslib_1 = require("tslib");
|
9 | const hyperid_1 = tslib_1.__importDefault(require("hyperid"));
|
10 | /**
|
11 | * Generate a (globally) unique identifier in a very fast way.
|
12 | * Please note the ids ARE NOT formatted as UUID and have variable length.
|
13 | * The format of generated values may change in the future.
|
14 | *
|
15 | * @internal
|
16 | */
|
17 | exports.generateUniqueId = (0, hyperid_1.default)({
|
18 | fixedLength: false,
|
19 | urlSafe: true,
|
20 | });
|
21 | /**
|
22 | * A regular expression for testing values generated by generateUniqueId.
|
23 | * @internal
|
24 | */
|
25 | exports.UNIQUE_ID_PATTERN = /[A-Za-z0-9-_]+-\d+/;
|
26 | //# sourceMappingURL=unique-id.js.map |
\ | No newline at end of file |