@glyphteck/veyl 0.59.0 → 0.60.0

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/auth.js CHANGED
@@ -166,7 +166,8 @@ var allowedPasskeyOrigins = Object.freeze([
166
166
  ])
167
167
  ]);
168
168
  var storageCorsOrigins = Object.freeze([
169
- origins.veyl
169
+ origins.veyl,
170
+ origins.veylDevWeb
170
171
  ]);
171
172
  var devStorageCorsOrigins = Object.freeze([
172
173
  origins.veylDev,
@@ -246,7 +247,6 @@ var adjectives = [
246
247
  "Grim",
247
248
  "Holy",
248
249
  "Infernal",
249
- "Ivory",
250
250
  "Jade",
251
251
  "Light",
252
252
  "Midnight",
@@ -390,10 +390,18 @@ var nouns = [
390
390
  "Wizard",
391
391
  "Wyvern"
392
392
  ];
393
+ var TWO_WORD_LABEL_COUNT = adjectives.length * nouns.length;
394
+ function twoWordLabelAt(index) {
395
+ if (!Number.isSafeInteger(index) || index < 0) {
396
+ throw new Error("two-word label index must be a non-negative integer");
397
+ }
398
+ const normalized = index % TWO_WORD_LABEL_COUNT;
399
+ const adjective = adjectives[normalized % adjectives.length];
400
+ const noun = nouns[Math.floor(normalized / adjectives.length)];
401
+ return `${adjective} ${noun}`;
402
+ }
393
403
  function randomPasskeyLabel() {
394
- const adj = adjectives[Math.floor(Math.random() * adjectives.length)];
395
- const noun = nouns[Math.floor(Math.random() * nouns.length)];
396
- return `${adj} ${noun}`;
404
+ return twoWordLabelAt(Math.floor(Math.random() * TWO_WORD_LABEL_COUNT));
397
405
  }
398
406
 
399
407
  // src/auth.js