UNPKG

@strapi/utils

Version:

Shared utilities for the Strapi packages

1 lines 635 B
{"version":3,"file":"dates.mjs","sources":["../../src/primitives/dates.ts"],"sourcesContent":["// Using timestamp (milliseconds) to be sure it is unique\n// + converting timestamp to base 36 for better readibility\nconst timestampCode = (date?: Date) => {\n const referDate = date ?? new Date();\n\n return referDate.getTime().toString(36);\n};\n\nexport { timestampCode };\n"],"names":["timestampCode","date","referDate","Date","getTime","toString"],"mappings":"AAAA;AACA;AACA,MAAMA,gBAAgB,CAACC,IAAAA,GAAAA;IACrB,MAAMC,SAAAA,GAAYD,QAAQ,IAAIE,IAAAA,EAAAA;AAE9B,IAAA,OAAOD,SAAUE,CAAAA,OAAO,EAAGC,CAAAA,QAAQ,CAAC,EAAA,CAAA;AACtC;;;;"}