umt 1.3.4 → 1.3.6

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.
Files changed (62) hide show
  1. package/module/Consts/clock.d.ts +18 -2
  2. package/module/Consts/clock.js +18 -2
  3. package/module/Consts/clock.js.map +1 -1
  4. package/module/Simple/Tool/birthday.d.ts +1 -1
  5. package/module/Validate/core/index.d.ts +2 -0
  6. package/module/Validate/core/index.js +25 -0
  7. package/module/Validate/core/index.js.map +1 -0
  8. package/module/Validate/index.d.ts +2 -0
  9. package/module/Validate/index.js +4 -0
  10. package/module/Validate/index.js.map +1 -1
  11. package/module/Validate/number/core.d.ts +2 -0
  12. package/module/Validate/number/core.js +5 -0
  13. package/module/Validate/number/core.js.map +1 -0
  14. package/module/Validate/number/even.d.ts +2 -0
  15. package/module/Validate/number/even.js +8 -0
  16. package/module/Validate/number/even.js.map +1 -0
  17. package/module/Validate/number/index.d.ts +6 -0
  18. package/module/Validate/number/index.js +7 -0
  19. package/module/Validate/number/index.js.map +1 -0
  20. package/module/Validate/number/maxValue.d.ts +2 -0
  21. package/module/Validate/number/maxValue.js +8 -0
  22. package/module/Validate/number/maxValue.js.map +1 -0
  23. package/module/Validate/number/minValue.d.ts +2 -0
  24. package/module/Validate/number/minValue.js +8 -0
  25. package/module/Validate/number/minValue.js.map +1 -0
  26. package/module/Validate/number/odd.d.ts +2 -0
  27. package/module/Validate/number/odd.js +8 -0
  28. package/module/Validate/number/odd.js.map +1 -0
  29. package/module/Validate/number/prime.d.ts +2 -0
  30. package/module/Validate/number/prime.js +9 -0
  31. package/module/Validate/number/prime.js.map +1 -0
  32. package/module/Validate/string/core.d.ts +2 -0
  33. package/module/Validate/string/core.js +3 -0
  34. package/module/Validate/string/core.js.map +1 -0
  35. package/module/Validate/string/email.d.ts +2 -0
  36. package/module/Validate/string/email.js +10 -0
  37. package/module/Validate/string/email.js.map +1 -0
  38. package/module/Validate/string/index.d.ts +7 -0
  39. package/module/Validate/string/index.js +8 -0
  40. package/module/Validate/string/index.js.map +1 -0
  41. package/module/Validate/string/length.d.ts +2 -0
  42. package/module/Validate/string/length.js +6 -0
  43. package/module/Validate/string/length.js.map +1 -0
  44. package/module/Validate/string/maxLength.d.ts +2 -0
  45. package/module/Validate/string/maxLength.js +6 -0
  46. package/module/Validate/string/maxLength.js.map +1 -0
  47. package/module/Validate/string/minLength.d.ts +2 -0
  48. package/module/Validate/string/minLength.js +6 -0
  49. package/module/Validate/string/minLength.js.map +1 -0
  50. package/module/Validate/string/numberString.d.ts +2 -0
  51. package/module/Validate/string/numberString.js +9 -0
  52. package/module/Validate/string/numberString.js.map +1 -0
  53. package/module/Validate/string/uuid.d.ts +2 -0
  54. package/module/Validate/string/uuid.js +12 -0
  55. package/module/Validate/string/uuid.js.map +1 -0
  56. package/module/Validate/type.d.ts +14 -0
  57. package/module/Validate/type.js +2 -0
  58. package/module/Validate/type.js.map +1 -0
  59. package/module/index.d.ts +1 -0
  60. package/module/index.js +1 -0
  61. package/module/index.js.map +1 -1
  62. package/package.json +9 -9
@@ -19,10 +19,26 @@ export declare const OneDayMs: number;
19
19
  */
20
20
  export declare const OneWeekMs: number;
21
21
  /**
22
- * 1ヶ月のミリ秒数
22
+ * 1ヶ月のミリ秒数(28日)
23
+ */
24
+ export declare const OneMonthMs28: number;
25
+ /**
26
+ * 1ヶ月のミリ秒数(29日)
27
+ */
28
+ export declare const OneMonthMs29: number;
29
+ /**
30
+ * 1ヶ月のミリ秒数(30日)
23
31
  */
24
32
  export declare const OneMonthMs: number;
25
33
  /**
26
- * 1年のミリ秒数
34
+ * 1ヶ月のミリ秒数(31日)
35
+ */
36
+ export declare const OneMonthMs31: number;
37
+ /**
38
+ * 1年のミリ秒数(365日)
27
39
  */
28
40
  export declare const OneYearMs: number;
41
+ /**
42
+ * 1年のミリ秒数(366日)
43
+ */
44
+ export declare const OneYearMs366: number;
@@ -19,11 +19,27 @@ export const OneDayMs = OneHourMs * 24;
19
19
  */
20
20
  export const OneWeekMs = OneDayMs * 7;
21
21
  /**
22
- * 1ヶ月のミリ秒数
22
+ * 1ヶ月のミリ秒数(28日)
23
+ */
24
+ export const OneMonthMs28 = OneDayMs * 28;
25
+ /**
26
+ * 1ヶ月のミリ秒数(29日)
27
+ */
28
+ export const OneMonthMs29 = OneDayMs * 29;
29
+ /**
30
+ * 1ヶ月のミリ秒数(30日)
23
31
  */
24
32
  export const OneMonthMs = OneDayMs * 30;
25
33
  /**
26
- * 1年のミリ秒数
34
+ * 1ヶ月のミリ秒数(31日)
35
+ */
36
+ export const OneMonthMs31 = OneDayMs * 31;
37
+ /**
38
+ * 1年のミリ秒数(365日)
27
39
  */
28
40
  export const OneYearMs = OneDayMs * 365;
41
+ /**
42
+ * 1年のミリ秒数(366日)
43
+ */
44
+ export const OneYearMs366 = OneDayMs * 366;
29
45
  //# sourceMappingURL=clock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"clock.js","sourceRoot":"","sources":["../../src/Consts/clock.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC;AAEhC;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,WAAW,GAAG,EAAE,CAAC;AAE5C;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,GAAG,EAAE,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,SAAS,GAAG,EAAE,CAAC;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,GAAG,CAAC,CAAC;AAEtC;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,GAAG,EAAE,CAAC;AAExC;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,GAAG,GAAG,CAAC"}
1
+ {"version":3,"file":"clock.js","sourceRoot":"","sources":["../../src/Consts/clock.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC;AAEhC;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,WAAW,GAAG,EAAE,CAAC;AAE5C;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,GAAG,EAAE,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,SAAS,GAAG,EAAE,CAAC;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,GAAG,CAAC,CAAC;AAEtC;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,QAAQ,GAAG,EAAE,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,QAAQ,GAAG,EAAE,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,GAAG,EAAE,CAAC;AAExC;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,QAAQ,GAAG,EAAE,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,GAAG,GAAG,CAAC;AAExC;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,QAAQ,GAAG,GAAG,CAAC"}
@@ -5,7 +5,7 @@ export interface BIRTHDAYSIMPLE {
5
5
  year: number;
6
6
  mon: number;
7
7
  day: number;
8
- }, timeDifference: hoursTypeInt): number;
8
+ }, timeDifference?: hoursTypeInt): number;
9
9
  }
10
10
  /**
11
11
  * 年齢を取得する
@@ -0,0 +1,2 @@
1
+ import { Types, ValidateCoreReturnType, ValidateReturnType } from "../../Validate/type";
2
+ export declare const core: <T>(type: Types<T>) => <O extends ValidateReturnType<T>[]>(value: T, option: O, message?: string) => ValidateCoreReturnType<T>;
@@ -0,0 +1,25 @@
1
+ export const core = (type) => (value, option, message) => {
2
+ // biome-ignore lint/suspicious/useValidTypeof: <explanation>
3
+ if (typeof value !== type) {
4
+ return {
5
+ validate: false,
6
+ message: message || "",
7
+ type,
8
+ };
9
+ }
10
+ for (const validate of option) {
11
+ if (!validate.validate(value)) {
12
+ return {
13
+ validate: false,
14
+ message: validate.message || "",
15
+ type,
16
+ };
17
+ }
18
+ }
19
+ return {
20
+ validate: true,
21
+ message: "",
22
+ type,
23
+ };
24
+ };
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Validate/core/index.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,IAAI,GACf,CAAI,IAAc,EAAE,EAAE,CACtB,CACE,KAAQ,EACR,MAAS,EACT,OAAgB,EACW,EAAE;IAC7B,6DAA6D;IAC7D,IAAI,OAAO,KAAK,KAAK,IAAI,EAAE,CAAC;QAC1B,OAAO;YACL,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,OAAO,IAAI,EAAE;YACtB,IAAI;SACL,CAAC;IACJ,CAAC;IACD,KAAK,MAAM,QAAQ,IAAI,MAAM,EAAE,CAAC;QAC9B,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAC9B,OAAO;gBACL,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,QAAQ,CAAC,OAAO,IAAI,EAAE;gBAC/B,IAAI;aACL,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO;QACL,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,IAAI;KACL,CAAC;AACJ,CAAC,CAAC"}
@@ -1,3 +1,5 @@
1
+ export * from "./number";
2
+ export * from "./string";
1
3
  export * from "./isArray";
2
4
  export * from "./isBrowser";
3
5
  export * from "./isDouble";
@@ -1,3 +1,7 @@
1
+ // Validate Function
2
+ export * from "./number";
3
+ export * from "./string";
4
+ // Other Validate
1
5
  export * from "./isArray";
2
6
  export * from "./isBrowser";
3
7
  export * from "./isDouble";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Validate/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Validate/index.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AAEzB,iBAAiB;AACjB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { ValidateReturnType } from "../../Validate/type";
2
+ export declare const number: <T extends ValidateReturnType<number>[]>(option: T, message?: string) => (value: number) => import("../../Validate/type").ValidateCoreReturnType<number>;
@@ -0,0 +1,5 @@
1
+ import { core } from "../../Validate/core";
2
+ export const number = (option, message) => {
3
+ return (value) => core("number")(value, option, message);
4
+ };
5
+ //# sourceMappingURL=core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/Validate/number/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAGvC,MAAM,CAAC,MAAM,MAAM,GAAG,CACpB,MAAS,EACT,OAAgB,EAChB,EAAE;IACF,OAAO,CAAC,KAAa,EAAE,EAAE,CAAC,IAAI,CAAS,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAC3E,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { ValidateReturnType } from "../../Validate/type";
2
+ export declare const even: (message?: string) => ValidateReturnType<number>;
@@ -0,0 +1,8 @@
1
+ export const even = (message) => {
2
+ return {
3
+ type: "number",
4
+ message,
5
+ validate: (value) => value % 2 === 0,
6
+ };
7
+ };
8
+ //# sourceMappingURL=even.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"even.js","sourceRoot":"","sources":["../../../src/Validate/number/even.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,OAAgB,EAA8B,EAAE;IACnE,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,OAAO;QACP,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,KAAK,CAAC;KACrC,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from "./core";
2
+ export * from "./even";
3
+ export * from "./maxValue";
4
+ export * from "./minValue";
5
+ export * from "./odd";
6
+ export * from "./prime";
@@ -0,0 +1,7 @@
1
+ export * from "./core";
2
+ export * from "./even";
3
+ export * from "./maxValue";
4
+ export * from "./minValue";
5
+ export * from "./odd";
6
+ export * from "./prime";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Validate/number/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { ValidateReturnType } from "../../Validate/type";
2
+ export declare const maxValue: (maxValue: number, message?: string) => ValidateReturnType<number>;
@@ -0,0 +1,8 @@
1
+ export const maxValue = (maxValue, message) => {
2
+ return {
3
+ type: "number",
4
+ message,
5
+ validate: (value) => value <= maxValue,
6
+ };
7
+ };
8
+ //# sourceMappingURL=maxValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"maxValue.js","sourceRoot":"","sources":["../../../src/Validate/number/maxValue.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,QAAgB,EAChB,OAAgB,EACY,EAAE;IAC9B,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,OAAO;QACP,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,QAAQ;KACvC,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { ValidateReturnType } from "../../Validate/type";
2
+ export declare const minValue: (minValue: number, message?: string) => ValidateReturnType<number>;
@@ -0,0 +1,8 @@
1
+ export const minValue = (minValue, message) => {
2
+ return {
3
+ type: "number",
4
+ message,
5
+ validate: (value) => value >= minValue,
6
+ };
7
+ };
8
+ //# sourceMappingURL=minValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"minValue.js","sourceRoot":"","sources":["../../../src/Validate/number/minValue.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,QAAgB,EAChB,OAAgB,EACY,EAAE;IAC9B,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,OAAO;QACP,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,QAAQ;KACvC,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { ValidateReturnType } from "../../Validate/type";
2
+ export declare const odd: (message?: string) => ValidateReturnType<number>;
@@ -0,0 +1,8 @@
1
+ export const odd = (message) => {
2
+ return {
3
+ type: "number",
4
+ message,
5
+ validate: (value) => value % 2 !== 0,
6
+ };
7
+ };
8
+ //# sourceMappingURL=odd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"odd.js","sourceRoot":"","sources":["../../../src/Validate/number/odd.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,OAAgB,EAA8B,EAAE;IAClE,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,OAAO;QACP,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,KAAK,CAAC;KACrC,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { ValidateReturnType } from "../../Validate/type";
2
+ export declare const prime: (message?: string) => ValidateReturnType<number>;
@@ -0,0 +1,9 @@
1
+ import { isPrimeNumber } from "../isPrimeNumber";
2
+ export const prime = (message) => {
3
+ return {
4
+ type: "number",
5
+ message,
6
+ validate: (value) => isPrimeNumber(value),
7
+ };
8
+ };
9
+ //# sourceMappingURL=prime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prime.js","sourceRoot":"","sources":["../../../src/Validate/number/prime.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,OAAgB,EAA8B,EAAE;IACpE,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,OAAO;QACP,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC;KAC1C,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { ValidateReturnType } from "../../Validate/type";
2
+ export declare const string: <T extends ValidateReturnType<string>[]>(option: T, message?: string) => (value: string) => import("../../Validate/type").ValidateCoreReturnType<string>;
@@ -0,0 +1,3 @@
1
+ import { core } from "../../Validate/core";
2
+ export const string = (option, message) => (value) => core("string")(value, option, message);
3
+ //# sourceMappingURL=core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/Validate/string/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAGvC,MAAM,CAAC,MAAM,MAAM,GACjB,CAAyC,MAAS,EAAE,OAAgB,EAAE,EAAE,CACxE,CAAC,KAAa,EAAE,EAAE,CAChB,IAAI,CAAS,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { ValidateReturnType } from "../../Validate/type";
2
+ export declare const email: (message?: string) => ValidateReturnType<string>;
@@ -0,0 +1,10 @@
1
+ export const email = (message) => {
2
+ // メールアドレスの正規表現
3
+ const emailRegex = /^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;
4
+ return {
5
+ type: "string",
6
+ message,
7
+ validate: (value) => emailRegex.test(value),
8
+ };
9
+ };
10
+ //# sourceMappingURL=email.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email.js","sourceRoot":"","sources":["../../../src/Validate/string/email.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,OAAgB,EAA8B,EAAE;IACpE,eAAe;IACf,MAAM,UAAU,GACd,gEAAgE,CAAC;IACnE,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,OAAO;QACP,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC;KAC5C,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export * from "./core";
2
+ export * from "./email";
3
+ export * from "./length";
4
+ export * from "./minLength";
5
+ export * from "./maxLength";
6
+ export * from "./numberString";
7
+ export * from "./uuid";
@@ -0,0 +1,8 @@
1
+ export * from "./core";
2
+ export * from "./email";
3
+ export * from "./length";
4
+ export * from "./minLength";
5
+ export * from "./maxLength";
6
+ export * from "./numberString";
7
+ export * from "./uuid";
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Validate/string/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { ValidateReturnType } from "../../Validate/type";
2
+ export declare const length_: (length: number, message?: string) => ValidateReturnType<string>;
@@ -0,0 +1,6 @@
1
+ export const length_ = (length, message) => ({
2
+ type: "string",
3
+ message,
4
+ validate: (value) => value.length === length,
5
+ });
6
+ //# sourceMappingURL=length.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"length.js","sourceRoot":"","sources":["../../../src/Validate/string/length.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAG,CACrB,MAAc,EACd,OAAgB,EACY,EAAE,CAAC,CAAC;IAChC,IAAI,EAAE,QAAQ;IACd,OAAO;IACP,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,MAAM;CAC7C,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { ValidateReturnType } from "../../Validate/type";
2
+ export declare const maxLength: (maxLength: number, message?: string) => ValidateReturnType<string>;
@@ -0,0 +1,6 @@
1
+ export const maxLength = (maxLength, message) => ({
2
+ type: "string",
3
+ message,
4
+ validate: (value) => value.length <= maxLength,
5
+ });
6
+ //# sourceMappingURL=maxLength.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"maxLength.js","sourceRoot":"","sources":["../../../src/Validate/string/maxLength.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,SAAiB,EACjB,OAAgB,EACY,EAAE,CAAC,CAAC;IAChC,IAAI,EAAE,QAAQ;IACd,OAAO;IACP,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,IAAI,SAAS;CAC/C,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { ValidateReturnType } from "../../Validate/type";
2
+ export declare const minLength: (minLength: number, message?: string) => ValidateReturnType<string>;
@@ -0,0 +1,6 @@
1
+ export const minLength = (minLength, message) => ({
2
+ type: "string",
3
+ message,
4
+ validate: (value) => value.length >= minLength,
5
+ });
6
+ //# sourceMappingURL=minLength.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"minLength.js","sourceRoot":"","sources":["../../../src/Validate/string/minLength.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,SAAiB,EACjB,OAAgB,EACY,EAAE,CAAC,CAAC;IAChC,IAAI,EAAE,QAAQ;IACd,OAAO;IACP,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,IAAI,SAAS;CAC/C,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { ValidateReturnType } from "../../Validate/type";
2
+ export declare const numberString: (message?: string) => ValidateReturnType<string>;
@@ -0,0 +1,9 @@
1
+ import { isNumber } from "../isNumber";
2
+ export const numberString = (message) => {
3
+ return {
4
+ type: "string",
5
+ message,
6
+ validate: (value) => isNumber(value),
7
+ };
8
+ };
9
+ //# sourceMappingURL=numberString.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numberString.js","sourceRoot":"","sources":["../../../src/Validate/string/numberString.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAgB,EAA8B,EAAE;IAC3E,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,OAAO;QACP,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC;KACrC,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { ValidateReturnType } from "../../Validate/type";
2
+ export declare const uuid: (versions?: (1 | 2 | 3 | 4 | 5)[], message?: string) => ValidateReturnType<string>;
@@ -0,0 +1,12 @@
1
+ export const uuid = (versions = [4], message) => ({
2
+ type: "string",
3
+ message,
4
+ validate: (value) => {
5
+ return versions.some((version) => {
6
+ // バージョンごとの正規表現
7
+ const versionRegex = new RegExp(`^[\\da-f]{8}-?[\\da-f]{4}-?${version}[\\da-f]{3}-?[89ab][\\da-f]{3}-?[\\da-f]{12}$`, "i");
8
+ return versionRegex.test(value);
9
+ });
10
+ },
11
+ });
12
+ //# sourceMappingURL=uuid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uuid.js","sourceRoot":"","sources":["../../../src/Validate/string/uuid.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,IAAI,GAAG,CAClB,WAAkC,CAAC,CAAC,CAAC,EACrC,OAAgB,EACY,EAAE,CAAC,CAAC;IAChC,IAAI,EAAE,QAAQ;IACd,OAAO;IACP,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;QAClB,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;YAC/B,eAAe;YACf,MAAM,YAAY,GAAG,IAAI,MAAM,CAC7B,8BAA8B,OAAO,+CAA+C,EACpF,GAAG,CACJ,CAAC;YACF,OAAO,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ export type Types<T> = T extends string ? "string" : T extends number ? "number" : T extends boolean ? "boolean" : T extends Array<infer _> ? "array" : T extends object ? "object" : never;
2
+ export interface ValidateCoreReturnType<T> {
3
+ validate: boolean;
4
+ message: string;
5
+ type: Types<T>;
6
+ }
7
+ export interface ValidateReturnType<T> {
8
+ type: Types<T>;
9
+ validate: ValidateFunctionType<T>;
10
+ message?: string;
11
+ }
12
+ export interface ValidateFunctionType<T> {
13
+ (value: T): boolean;
14
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../src/Validate/type.ts"],"names":[],"mappings":""}
package/module/index.d.ts CHANGED
@@ -9,3 +9,4 @@ export * from "./Simple";
9
9
  export * from "./String";
10
10
  export * from "./Tool";
11
11
  export * from "./types";
12
+ export * from "./Validate";
package/module/index.js CHANGED
@@ -9,4 +9,5 @@ export * from "./Simple";
9
9
  export * from "./String";
10
10
  export * from "./Tool";
11
11
  export * from "./types";
12
+ export * from "./Validate";
12
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,MAAM,CAAC;AACrB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,MAAM,CAAC;AACrB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC"}
package/package.json CHANGED
@@ -5,14 +5,14 @@
5
5
  },
6
6
  "description": "個人的に作った便利関数集 個人用途なので破壊的変更がある可能性があります。 Main Packageに依存関係はありません。 JavaScriptからの呼び出しに対応しています。",
7
7
  "devDependencies": {
8
- "@biomejs/biome": "1.3.3",
8
+ "@biomejs/biome": "1.4.0",
9
9
  "@swc/core": "^1.3.99",
10
10
  "@swc/jest": "^0.2.29",
11
11
  "@types/jest": "^29.5.10",
12
- "@types/node": "^20.9.4",
13
- "@typescript-eslint/eslint-plugin": "^6.12.0",
14
- "@typescript-eslint/parser": "^6.12.0",
15
- "bun-types": "^1.0.13",
12
+ "@types/node": "^20.10.0",
13
+ "@typescript-eslint/eslint-plugin": "^6.13.1",
14
+ "@typescript-eslint/parser": "^6.13.1",
15
+ "bun-types": "^1.0.14",
16
16
  "eslint": "^8.54.0",
17
17
  "eslint-plugin-unicorn": "^49.0.0",
18
18
  "gh-pages": "^6.1.0",
@@ -20,9 +20,9 @@
20
20
  "ts-jest": "^29.1.1",
21
21
  "ts-node": "^10.9.1",
22
22
  "tsc-alias": "^1.8.8",
23
- "typedoc": "^0.25.3",
23
+ "typedoc": "^0.25.4",
24
24
  "typescript": "^5.3.2",
25
- "umt": "^1.3.2"
25
+ "umt": "^1.3.4"
26
26
  },
27
27
  "directories": {
28
28
  "doc": "doc",
@@ -54,5 +54,5 @@
54
54
  "format": "biome format . --write",
55
55
  "eslint": "eslint src"
56
56
  },
57
- "version": "1.3.4"
58
- }
57
+ "version": "1.3.6"
58
+ }