UNPKG

docxml

Version:

TypeScript (component) library for building and parsing a DOCX file

14 lines (13 loc) 396 B
/** * Create a unique not-so-random identifier. * * @todo maybe make it really random some time. */ import * as dntShim from "../../_dnt.shims.js"; export function createRandomId(prefix = 'id') { return `${prefix}-${dntShim.dntGlobalThis.crypto.randomUUID()}`; } let uniqueNumericIdentifiers = 0; export function createUniqueNumericIdentifier() { return ++uniqueNumericIdentifiers; }