@edgenets/utils 0.3.7 → 0.3.8

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.
@@ -1,4 +1,4 @@
1
- export declare class NanoidUtil {
1
+ export declare class NanoIdUtil {
2
2
  private static readonly DEFAULT_CHARS;
3
3
  static generate(length: number, chars?: string): string;
4
4
  static generateDefault(length: number): string;
@@ -1,7 +1,7 @@
1
1
  import crypto from "crypto";
2
- export class NanoidUtil {
2
+ export class NanoIdUtil {
3
3
  static DEFAULT_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
4
- static generate(length, chars = NanoidUtil.DEFAULT_CHARS) {
4
+ static generate(length, chars = NanoIdUtil.DEFAULT_CHARS) {
5
5
  if (length <= 0) {
6
6
  throw new Error("Length must be greater than 0");
7
7
  }
@@ -13,10 +13,10 @@ export class NanoidUtil {
13
13
  return result.join("");
14
14
  }
15
15
  static generateDefault(length) {
16
- return NanoidUtil.generate(length);
16
+ return NanoIdUtil.generate(length);
17
17
  }
18
18
  static generateCustom(length, customChars) {
19
- return NanoidUtil.generate(length, customChars);
19
+ return NanoIdUtil.generate(length, customChars);
20
20
  }
21
21
  static generateNumberId(length = 8) {
22
22
  const now = new Date();
@@ -25,7 +25,7 @@ export class NanoidUtil {
25
25
  const dayPart = dayCount.toString().slice(-4).padStart(4, "0");
26
26
  const minutesOfDay = now.getHours() * 60 + now.getMinutes();
27
27
  const minutePart = minutesOfDay.toString().padStart(4, "0");
28
- const randomPart = NanoidUtil.generate(length, "0123456789");
28
+ const randomPart = NanoIdUtil.generate(length, "0123456789");
29
29
  return Number(`${dayPart}${minutePart}${randomPart}`);
30
30
  }
31
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgenets/utils",
3
- "version": "0.3.7",
3
+ "version": "0.3.8",
4
4
  "description": "Edgenets utilities package containing common types and utilities.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",