@thatcompany/ts-tool
Version:
基于TypeScript编写的工具库
42 lines • 1.04 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.UUID = void 0;
const uuid_1 = require("uuid");
/**
* UUID 工具类
*
* generate 默认生成 v7 UUID
*
* From https://github.com/uuidjs/uuid
*/
class UUID {
static generate(options) {
return (0, uuid_1.v7)(options);
}
static generate7(options) {
return (0, uuid_1.v7)(options);
}
static generate6(options) {
return (0, uuid_1.v6)(options);
}
static generate5(name, namespace) {
return (0, uuid_1.v5)(name, namespace);
}
static generate4(options) {
return (0, uuid_1.v4)(options);
}
static validate(uuid) {
return (0, uuid_1.validate)(uuid);
}
static version(uuid) {
return (0, uuid_1.version)(uuid);
}
static parse(uuid) {
return (0, uuid_1.parse)(uuid);
}
static stringify(uuidBuffer, offset) {
return (0, uuid_1.stringify)(uuidBuffer, offset);
}
}
exports.UUID = UUID;
//# sourceMappingURL=index.js.map