@cloudparker/moldex.js 0.0.81 → 0.0.82

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.
@@ -255,3 +255,4 @@ export declare function inchToPixel(inches: number): number;
255
255
  * console.log(inches); // Output: 1
256
256
  */
257
257
  export declare function pixelToInch(pixels: number): number;
258
+ export declare function alphabetNanoid(length?: number, lowercase?: boolean): string;
@@ -1,4 +1,5 @@
1
1
  import { toDate } from '../date/date-service';
2
+ import { customAlphabet } from 'nanoid';
2
3
  /**
3
4
  * Generates a random number between the specified minimum and maximum values (inclusive of the minimum and exclusive of the maximum).
4
5
  *
@@ -394,3 +395,11 @@ export function pixelToInch(pixels) {
394
395
  const DPI = 96; // Default DPI for screen resolution
395
396
  return pixels / DPI;
396
397
  }
398
+ export function alphabetNanoid(length = 10, lowercase = false) {
399
+ let alphabet = Array.from({ length: 26 }, (_, i) => String.fromCharCode(65 + i)).join('');
400
+ if (lowercase) {
401
+ alphabet = alphabet.toLowerCase();
402
+ }
403
+ const nanoid = customAlphabet(alphabet, length);
404
+ return nanoid();
405
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudparker/moldex.js",
3
- "version": "0.0.81",
3
+ "version": "0.0.82",
4
4
  "author": "cloudparker.com",
5
5
  "license": "MIT",
6
6
  "keywords": [