@supernova-studio/model 1.0.0-alpha.1 → 1.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -936,6 +936,21 @@ function removeDiacritics(str) {
936
936
  return str;
937
937
  }
938
938
 
939
+ // src/utils/short-persistent-id.ts
940
+ var shortPersistentIdLength = 8;
941
+ var alphanumeric = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
942
+ function generateShortPersistentId() {
943
+ return generateAlphanumericId(shortPersistentIdLength);
944
+ }
945
+ function generateAlphanumericId(length) {
946
+ let randomString = "";
947
+ for (let i = 0; i < length; i++) {
948
+ const randomIndex = Math.floor(Math.random() * alphanumeric.length);
949
+ randomString += alphanumeric.charAt(randomIndex);
950
+ }
951
+ return randomString;
952
+ }
953
+
939
954
  // src/utils/slugify.ts
940
955
  import slugifyImplementation from "@sindresorhus/slugify";
941
956
  function slugify(str, options) {
@@ -6091,6 +6106,7 @@ export {
6091
6106
  figmaFileStructureToMap,
6092
6107
  filterNonNullish,
6093
6108
  forceUnwrapNullish,
6109
+ generateShortPersistentId,
6094
6110
  getCodenameFromText,
6095
6111
  getFigmaRenderFormatFileExtension,
6096
6112
  groupBy,