prototype-helper 0.3.12 → 0.3.14

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 (55) hide show
  1. package/.vscode/settings.json +6 -6
  2. package/LICENSE +21 -21
  3. package/README.md +198 -198
  4. package/dist/extension/array.d.ts +1 -1
  5. package/dist/extension/array.js +103 -103
  6. package/dist/extension/index.d.ts +4 -4
  7. package/dist/extension/index.js +6 -6
  8. package/dist/extension/number.d.ts +1 -1
  9. package/dist/extension/number.js +71 -71
  10. package/dist/extension/number.test.d.ts +3 -3
  11. package/dist/extension/number.test.js +21 -21
  12. package/dist/extension/object.d.ts +1 -1
  13. package/dist/extension/object.js +12 -12
  14. package/dist/extension/string.d.ts +1 -22
  15. package/dist/extension/string.js +55 -50
  16. package/dist/extension/string.js.map +1 -1
  17. package/dist/extension/string.test.d.ts +2 -2
  18. package/dist/extension/string.test.js +17 -17
  19. package/dist/index.d.ts +3 -3
  20. package/dist/index.js +5 -5
  21. package/dist/interface/array.d.ts +19 -19
  22. package/dist/interface/array.js +1 -1
  23. package/dist/interface/index.d.ts +3 -3
  24. package/dist/interface/index.js +5 -5
  25. package/dist/interface/number.d.ts +23 -23
  26. package/dist/interface/number.js +1 -1
  27. package/dist/interface/object.js +5 -5
  28. package/dist/interface/string.d.ts +24 -0
  29. package/dist/interface/string.js +2 -0
  30. package/dist/interface/string.js.map +1 -0
  31. package/dist/override/console.d.ts +17 -17
  32. package/dist/override/console.js +70 -70
  33. package/dist/override/console.js.map +1 -1
  34. package/dist/override/index.d.ts +3 -3
  35. package/dist/override/index.js +5 -5
  36. package/dist/override/linq.d.ts +1 -1
  37. package/dist/override/linq.js +2 -2
  38. package/dist/override/math.d.ts +10 -10
  39. package/dist/override/math.js +23 -38
  40. package/dist/override/math.js.map +1 -1
  41. package/dist/test.d.ts +1 -1
  42. package/dist/test.js +115 -115
  43. package/dist/utils/deepCopy.d.ts +2 -0
  44. package/dist/utils/deepCopy.js +14 -0
  45. package/dist/utils/deepCopy.js.map +1 -0
  46. package/dist/utils/math.d.ts +1 -0
  47. package/dist/utils/math.js +21 -0
  48. package/dist/utils/math.js.map +1 -0
  49. package/dist/utils/valid.d.ts +1 -0
  50. package/dist/utils/valid.js +14 -0
  51. package/dist/utils/valid.js.map +1 -0
  52. package/package.json +1 -1
  53. package/tsconfig.json +48 -32
  54. package/types.d.ts +27 -0
  55. package/pnpm-lock.yaml +0 -4329
@@ -1,17 +1,17 @@
1
- interface ConsoleShowOption {
2
- log: boolean;
3
- info: boolean;
4
- warn: boolean;
5
- error: boolean;
6
- }
7
- interface ConsoleOption {
8
- development: ConsoleShowOption;
9
- production: ConsoleShowOption;
10
- }
11
- declare global {
12
- interface Console {
13
- show(message?: any, ...optionalParams: any[]): void;
14
- useTheme(consoleOption?: ConsoleOption): void;
15
- }
16
- }
17
- export {};
1
+ interface ConsoleShowOption {
2
+ log: boolean;
3
+ info: boolean;
4
+ warn: boolean;
5
+ error: boolean;
6
+ }
7
+ interface ConsoleOption {
8
+ development: ConsoleShowOption;
9
+ production: ConsoleShowOption;
10
+ }
11
+ declare global {
12
+ interface Console {
13
+ show(message?: any, ...optionalParams: any[]): void;
14
+ useTheme(consoleOption?: ConsoleOption): void;
15
+ }
16
+ }
17
+ export {};
@@ -1,71 +1,71 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const TH = this;
4
- const temp = {
5
- log: console.log.bind(TH),
6
- info: console.log.bind(TH),
7
- warn: console.log.bind(TH),
8
- error: console.log.bind(TH),
9
- };
10
- // let leftLogList: any[] = [];
11
- // let rightLogList: any[] = [];
12
- function getTime() {
13
- const nowDate = new Date();
14
- return `${nowDate.getHours()}:${nowDate.getMinutes()}:${nowDate.getSeconds()}:${`${nowDate.getMilliseconds()}`.padStart(3, "0")}`;
15
- }
16
- function showMessage(type, message, ...optionalParams) {
17
- let color = ["\x1b[2m"];
18
- if (type == "info")
19
- color[0] = "\x1b[34m";
20
- else if (type == "warn")
21
- color[0] = "\x1b[33m";
22
- else if (type == "error")
23
- color[0] = "\x1b[31m";
24
- // if (type == "info")
25
- // leftLogList.push([message, ...optionalParams]);
26
- // else if (type == "warn" || type == "error")
27
- // rightLogList.push([message, ...optionalParams]);
28
- temp[type](`${color[0]}[${getTime()}]\x1b[0m\x1b[37m`, message, ...optionalParams);
29
- }
30
- console.useTheme = useTheme;
31
- function useTheme(consoleOption = {
32
- development: {
33
- log: true,
34
- info: true,
35
- warn: true,
36
- error: true,
37
- },
38
- production: {
39
- log: false,
40
- info: false,
41
- warn: true,
42
- error: true,
43
- },
44
- }) {
45
- console.log = function (message, ...optionalParams) {
46
- if ((process.env.NODE_ENV === "development" && consoleOption.development.log) ||
47
- (process.env.NODE_ENV === "production" && consoleOption.production.log) ||
48
- !process.env.NODE_ENV)
49
- showMessage("log", message, ...optionalParams);
50
- };
51
- console.info = function (message, ...optionalParams) {
52
- if ((process.env.NODE_ENV === "development" && consoleOption.development.info) ||
53
- (process.env.NODE_ENV === "production" && consoleOption.production.info) ||
54
- !process.env.NODE_ENV)
55
- showMessage("info", message, ...optionalParams);
56
- };
57
- console.warn = function (message, ...optionalParams) {
58
- if ((process.env.NODE_ENV === "development" && consoleOption.development.warn) ||
59
- (process.env.NODE_ENV === "production" && consoleOption.production.warn) ||
60
- !process.env.NODE_ENV)
61
- showMessage("warn", message, ...optionalParams);
62
- };
63
- console.error = function (message, ...optionalParams) {
64
- if ((process.env.NODE_ENV === "development" && consoleOption.development.error) ||
65
- (process.env.NODE_ENV === "production" && consoleOption.production.error) ||
66
- !process.env.NODE_ENV)
67
- showMessage("error", message, ...optionalParams);
68
- };
69
- globalThis.console = console;
70
- }
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const TH = this;
4
+ const temp = {
5
+ log: console.log.bind(TH),
6
+ info: console.log.bind(TH),
7
+ warn: console.log.bind(TH),
8
+ error: console.log.bind(TH),
9
+ };
10
+ // let leftLogList: any[] = [];
11
+ // let rightLogList: any[] = [];
12
+ function getTime() {
13
+ const nowDate = new Date();
14
+ return `${nowDate.getHours().fixNumber(2)}:${nowDate.getMinutes().fixNumber(2)}:${nowDate.getSeconds().fixNumber(2)}:${`${nowDate.getMilliseconds()}`.fixNumber(3)}`;
15
+ }
16
+ function showMessage(type, message, ...optionalParams) {
17
+ let color = ["\x1b[2m"];
18
+ if (type == "info")
19
+ color[0] = "\x1b[34m";
20
+ else if (type == "warn")
21
+ color[0] = "\x1b[33m";
22
+ else if (type == "error")
23
+ color[0] = "\x1b[31m";
24
+ // if (type == "info")
25
+ // leftLogList.push([message, ...optionalParams]);
26
+ // else if (type == "warn" || type == "error")
27
+ // rightLogList.push([message, ...optionalParams]);
28
+ temp[type](`${color[0]}[${getTime()}]\x1b[0m\x1b[37m`, message, ...optionalParams);
29
+ }
30
+ console.useTheme = useTheme;
31
+ function useTheme(consoleOption = {
32
+ development: {
33
+ log: true,
34
+ info: true,
35
+ warn: true,
36
+ error: true,
37
+ },
38
+ production: {
39
+ log: false,
40
+ info: false,
41
+ warn: true,
42
+ error: true,
43
+ },
44
+ }) {
45
+ console.log = function (message, ...optionalParams) {
46
+ if ((process.env.NODE_ENV === "development" && consoleOption.development.log) ||
47
+ (process.env.NODE_ENV === "production" && consoleOption.production.log) ||
48
+ !process.env.NODE_ENV)
49
+ showMessage("log", message, ...optionalParams);
50
+ };
51
+ console.info = function (message, ...optionalParams) {
52
+ if ((process.env.NODE_ENV === "development" && consoleOption.development.info) ||
53
+ (process.env.NODE_ENV === "production" && consoleOption.production.info) ||
54
+ !process.env.NODE_ENV)
55
+ showMessage("info", message, ...optionalParams);
56
+ };
57
+ console.warn = function (message, ...optionalParams) {
58
+ if ((process.env.NODE_ENV === "development" && consoleOption.development.warn) ||
59
+ (process.env.NODE_ENV === "production" && consoleOption.production.warn) ||
60
+ !process.env.NODE_ENV)
61
+ showMessage("warn", message, ...optionalParams);
62
+ };
63
+ console.error = function (message, ...optionalParams) {
64
+ if ((process.env.NODE_ENV === "development" && consoleOption.development.error) ||
65
+ (process.env.NODE_ENV === "production" && consoleOption.production.error) ||
66
+ !process.env.NODE_ENV)
67
+ showMessage("error", message, ...optionalParams);
68
+ };
69
+ globalThis.console = console;
70
+ }
71
71
  //# sourceMappingURL=console.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"console.js","sourceRoot":"","sources":["../../src/override/console.ts"],"names":[],"mappings":";;AAqBA,MAAM,EAAE,GAAG,IAAI,CAAC;AAChB,MAAM,IAAI,GAAG;IACX,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;IACzB,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;IAC1B,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;IAC1B,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;CAC5B,CAAC;AAEF,+BAA+B;AAC/B,gCAAgC;AAEhC,SAAS,OAAO;IACd,MAAM,OAAO,GAAG,IAAI,IAAI,EAAE,CAAC;IAC3B,OAAO,GAAG,OAAO,CAAC,QAAQ,EAAE,IAAI,OAAO,CAAC,UAAU,EAAE,IAAI,OAAO,CAAC,UAAU,EAAE,IAAI,GAAG,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;AACpI,CAAC;AAED,SAAS,WAAW,CAAC,IAAuC,EAAE,OAAa,EAAE,GAAG,cAAqB;IACnG,IAAI,KAAK,GAAG,CAAC,SAAS,CAAC,CAAC;IACxB,IAAI,IAAI,IAAI,MAAM;QAAE,KAAK,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC;SACrC,IAAI,IAAI,IAAI,MAAM;QAAE,KAAK,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC;SAC1C,IAAI,IAAI,IAAI,OAAO;QAAE,KAAK,CAAC,CAAC,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MAAM,EAAE,OAAO,EAAE,GAAG,cAAc,CAAC,CAAC;IACpD,CAAC,CAAC;IACF,OAAO,CAAC,KAAK,GAAG,UAAU,OAAa,EAAE,GAAG,cAAqB;QAC/D,IACE,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,IAAI,aAAa,CAAC,WAAW,CAAC,KAAK,CAAC;YAC3E,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,IAAI,aAAa,CAAC,UAAU,CAAC,KAAK,CAAC;YACzE,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ;YAErB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,cAAc,CAAC,CAAC;IACrD,CAAC,CAAC;IAEF,UAAU,CAAC,OAAO,GAAG,OAAO,CAAC;AAC/B,CAAC"}
@@ -1,3 +1,3 @@
1
- import "../extension";
2
- import "./console";
3
- import "./math";
1
+ import "../extension";
2
+ import "./console";
3
+ import "./math";
@@ -1,6 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- require("../extension");
4
- require("./console");
5
- require("./math");
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ require("../extension");
4
+ require("./console");
5
+ require("./math");
6
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=linq.js.map
@@ -1,10 +1,10 @@
1
- export {};
2
- declare global {
3
- interface Math {
4
- round10(x: number, point?: number): number;
5
- floor10(x: number, point?: number): number;
6
- ceil10(x: number, point?: number): number;
7
- randomRange(a: number, b: number, point?: number): number;
8
- clamp(input: number, min: number, max: number): number;
9
- }
10
- }
1
+ export {};
2
+ declare global {
3
+ interface Math {
4
+ round10(x: number, point?: number): number;
5
+ floor10(x: number, point?: number): number;
6
+ ceil10(x: number, point?: number): number;
7
+ randomRange(a: number, b: number, point?: number): number;
8
+ clamp(input: number, min: number, max: number): number;
9
+ }
10
+ }
@@ -1,39 +1,24 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- if (!Math.round10) {
4
- Math.round10 = decimalAdjust("round");
5
- }
6
- if (!Math.floor10) {
7
- Math.floor10 = decimalAdjust("floor");
8
- }
9
- if (!Math.ceil10) {
10
- Math.ceil10 = decimalAdjust("ceil");
11
- }
12
- if (!Math.randomRange) {
13
- Math.randomRange = function (a, b, point = 0) {
14
- return Math.floor10(Math.random() * (b - a + 1) + a, point);
15
- };
16
- }
17
- if (!Math.clamp) {
18
- Math.clamp = function (input, min, max) {
19
- return Math.min(Math.max(input, min), max);
20
- };
21
- }
22
- function decimalAdjust(type) {
23
- const func = Math[type];
24
- return (number, precision = 0) => {
25
- precision =
26
- precision == null ? 0 : precision >= 0 ? Math.min(precision, 292) : Math.max(precision, -292);
27
- if (precision) {
28
- // Shift with exponential notation to avoid floating-point issues.
29
- // See [MDN](https://mdn.io/round#Examples) for more details.
30
- let pair = `${number}e`.split("e");
31
- const value = func(`${pair[0]}e${+pair[1] + precision}`.toNumber());
32
- pair = `${value}e`.split("e");
33
- return +`${pair[0]}e${+pair[1] - precision}`;
34
- }
35
- return func(number);
36
- };
37
- }
38
- globalThis.Math = Math;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const math_1 = require("../utils/math");
4
+ if (!Math.round10) {
5
+ Math.round10 = (0, math_1.decimalAdjust)("round");
6
+ }
7
+ if (!Math.floor10) {
8
+ Math.floor10 = (0, math_1.decimalAdjust)("floor");
9
+ }
10
+ if (!Math.ceil10) {
11
+ Math.ceil10 = (0, math_1.decimalAdjust)("ceil");
12
+ }
13
+ if (!Math.randomRange) {
14
+ Math.randomRange = function (a, b, point = 0) {
15
+ return Math.floor10(Math.random() * (b - a + 1) + a, point);
16
+ };
17
+ }
18
+ if (!Math.clamp) {
19
+ Math.clamp = function (input, min, max) {
20
+ return Math.min(Math.max(input, min), max);
21
+ };
22
+ }
23
+ globalThis.Math = Math;
39
24
  //# sourceMappingURL=math.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"math.js","sourceRoot":"","sources":["../../src/override/math.ts"],"names":[],"mappings":";;AAYA,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;IACjB,IAAI,CAAC,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;CACvC;AACD,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;IACjB,IAAI,CAAC,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;CACvC;AACD,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;IAChB,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;CACrC;AAED,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;IACrB,IAAI,CAAC,WAAW,GAAG,UAAU,CAAS,EAAE,CAAS,EAAE,QAAgB,CAAC;QAClE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;IAC9D,CAAC,CAAC;CACH;AAED,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;IACf,IAAI,CAAC,KAAK,GAAG,UAAU,KAAa,EAAE,GAAW,EAAE,GAAW;QAC5D,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;IAC7C,CAAC,CAAC;CACH;AAED,SAAS,aAAa,CAAC,IAAgC;IACrD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;IACxB,OAAO,CAAC,MAAc,EAAE,YAAoB,CAAC,EAAE,EAAE;QAC/C,SAAS;YACP,SAAS,IAAI,IAAI,CA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IAAI,CAAC,WAAW,EAAE;IACrB,IAAI,CAAC,WAAW,GAAG,UAAU,CAAS,EAAE,CAAS,EAAE,QAAgB,CAAC;QAClE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;IAC9D,CAAC,CAAC;CACH;AAED,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;IACf,IAAI,CAAC,KAAK,GAAG,UAAU,KAAa,EAAE,GAAW,EAAE,GAAW;QAC5D,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;IAC7C,CAAC,CAAC;CACH;AAED,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC"}
package/dist/test.d.ts CHANGED
@@ -1 +1 @@
1
- import "./index";
1
+ import "./index";
package/dist/test.js CHANGED
@@ -1,116 +1,116 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- require("./index");
4
- console.useTheme();
5
- // import "../dist";
6
- // console.log("hello");
7
- // console.warn("warn log");
8
- // console.error("error log");
9
- console.log("300".fixPoint(10));
10
- // console.log("300".toComma(10));
11
- // console.log("24816246784".toComma());
12
- // console.log("24816246784".toNumber());
13
- // console.log((24816246784).toComma());
14
- // console.log(35 % 0.8);
15
- //0.5999999999999981
16
- // console.log((35).ampersand(0.8));
17
- //0.6
18
- // console.log(0.1 * 0.2);
19
- // console.log((0.1).safeMultiply(0.2));
20
- // console.log(0.2 / 0.2);
21
- // console.log((0.1).safeAdd(0.2)); // 0.6
22
- // console.log((0.3).safeAdd(-0.2));
23
- // console.log((0.1).safeSubtract(0.3)); // 0.6
24
- console.log((35).mod(0.8)); // 0.6
25
- console.log((39225.3).mod(0.1), 0); // 0
26
- console.log((39225.3).mod(0.01), 0); // 0
27
- // console.log((0.2).safeDivision(0.6)); // 0.8333333333333334
28
- // console.log((0.1).safeMultiply(0.2)); // 0.02
29
- //////////////////////////////////////////////////////////////////////////
30
- // console.log(Math.round10(112.5345, 3));
31
- // console.log(Math.floor10(112.5345, 3));
32
- // console.log(Math.ceil10(112.5345, 3));
33
- // // console.log(Math.round(112.5));
34
- // console.log(Math.randomRange(112.5, 200, 1));
35
- // console.log(Math.randomRange(112.5, 200, 0));
36
- // for (var i = 0; i < 10; i++) {
37
- // console.log(Math.randomRange(4, 5));
38
- // }
39
- ////////////////////////////////////////////////////////////////////////////
40
- console.log("123".toComma());
41
- // console.log((1).fixNumber(5));
42
- // console.log((3022).fixNumber(1));
43
- // console.log((30222.12).fixNumber(8));
44
- // console.log((30222.12).fixNumber(8).toComma());
45
- // console.log("30222.50380000".fixPoint(8).fixNumber(8));
46
- console.log("30222.50380000".fixPoint(5));
47
- console.log("30222.50380000".fixPoint(5).toComma());
48
- // console.log((30222).fixPoint(3));
49
- // console.log((30222.12).fixPoint(5).toComma());
50
- // console.log((30222.12).toComma().pointPad(5));
51
- // console.log("30222.12".pointPad(5));
52
- // console.log(Math.clamp(10, 3, 5));
53
- // console.log(Math.clamp(1, 3, 5));
54
- // console.log(Math.clamp(4, 3, 5));
55
- const hello = [1, 2, 3, 4, 5, 6, 7, 8, 9];
56
- console.log(hello.singleOrDefault((e) => e == 99));
57
- console.log(hello.skip(3).take(5));
58
- console.log(hello.skip(1).skip(1));
59
- const test = hello.take(9).select((now, index) => {
60
- return {
61
- id: now,
62
- index,
63
- name: "test",
64
- };
65
- });
66
- console.log(test);
67
- console.log(hello.skip(1).count());
68
- console.log(test.max((now) => now.id));
69
- console.log(test.min((now) => now.id));
70
- console.log(test.sum((now) => now.id));
71
- console.log(test.first((now) => now.id % 3 == 0));
72
- console.log(test.firstOrDefault((now) => now.id % 99 == 0, 991));
73
- console.log(test.last((now) => now.id % 3 == 0));
74
- console.log(test.lastOrDefault((now) => now.id % 3 == 4, 991));
75
- // console.log(hello.single((now) => now == 3));
76
- console.log((134.5).addSymbol());
77
- console.log((0).addSymbol());
78
- console.log((-1.345).addSymbol());
79
- console.log((134.5).addSymbol(" "));
80
- console.log((134.5).addSymbol(" "));
81
- console.log((134.5).fromPer(50));
82
- console.log((134.5).fromPer(33));
83
- console.log((134.5).fromPer(72));
84
- console.log((100).fromPer(50));
85
- console.log((100).fromPer(1250));
86
- console.log((300).fromPer(10));
87
- console.log((300).toPer(10));
88
- console.log((2 ** 256 + 0.213445).toComma().fixPoint(10));
89
- console.info("test1");
90
- console.warn("test2");
91
- console.error("test3");
92
- const aaa = [1, 2, 3, 4, 5];
93
- console.log(aaa._toJson());
94
- const bbb = aaa._deepCopy();
95
- const ccc = `[1,2,3,4,5]`;
96
- console.log(aaa, bbb, aaa === bbb);
97
- console.log(ccc.fromJson());
98
- // console.log({ a: 1, b: 3 }._toJson());
99
- console.log((1234.1234).round(2));
100
- console.log((1234.1234).floor(2));
101
- console.log((1234.1234).ceil(2));
102
- console.log("3022.50380000".fixNumber(5)); // 03022.50380000
103
- console.log((3022).fixNumber(7)); // 30222
104
- console.log((3222.12).fixNumber(5).toComma()); // 03,222.12
105
- console.log("hello world".issetWord("ell"));
106
- console.log("hello world".issetWord("xx"));
107
- console.log("hello world".issetWord(""));
108
- console.log("helloworld".issetWord(" "));
109
- console.log("hello world".getChar(0));
110
- console.log("hello world".getChar(1));
111
- console.log("hello world".getChar(2));
112
- console.log("hello world".getChar(3));
113
- console.log("hello world".getChar(4));
114
- console.log("hello world".getChar(5));
115
- // hello.findIndex;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ require("./index");
4
+ console.useTheme();
5
+ // import "../dist";
6
+ // console.log("hello");
7
+ // console.warn("warn log");
8
+ // console.error("error log");
9
+ console.log("300".fixPoint(10));
10
+ // console.log("300".toComma(10));
11
+ // console.log("24816246784".toComma());
12
+ // console.log("24816246784".toNumber());
13
+ // console.log((24816246784).toComma());
14
+ // console.log(35 % 0.8);
15
+ //0.5999999999999981
16
+ // console.log((35).ampersand(0.8));
17
+ //0.6
18
+ // console.log(0.1 * 0.2);
19
+ // console.log((0.1).safeMultiply(0.2));
20
+ // console.log(0.2 / 0.2);
21
+ // console.log((0.1).safeAdd(0.2)); // 0.6
22
+ // console.log((0.3).safeAdd(-0.2));
23
+ // console.log((0.1).safeSubtract(0.3)); // 0.6
24
+ console.log((35).mod(0.8)); // 0.6
25
+ console.log((39225.3).mod(0.1), 0); // 0
26
+ console.log((39225.3).mod(0.01), 0); // 0
27
+ // console.log((0.2).safeDivision(0.6)); // 0.8333333333333334
28
+ // console.log((0.1).safeMultiply(0.2)); // 0.02
29
+ //////////////////////////////////////////////////////////////////////////
30
+ // console.log(Math.round10(112.5345, 3));
31
+ // console.log(Math.floor10(112.5345, 3));
32
+ // console.log(Math.ceil10(112.5345, 3));
33
+ // // console.log(Math.round(112.5));
34
+ // console.log(Math.randomRange(112.5, 200, 1));
35
+ // console.log(Math.randomRange(112.5, 200, 0));
36
+ // for (var i = 0; i < 10; i++) {
37
+ // console.log(Math.randomRange(4, 5));
38
+ // }
39
+ ////////////////////////////////////////////////////////////////////////////
40
+ console.log("123".toComma());
41
+ // console.log((1).fixNumber(5));
42
+ // console.log((3022).fixNumber(1));
43
+ // console.log((30222.12).fixNumber(8));
44
+ // console.log((30222.12).fixNumber(8).toComma());
45
+ // console.log("30222.50380000".fixPoint(8).fixNumber(8));
46
+ console.log("30222.50380000".fixPoint(5));
47
+ console.log("30222.50380000".fixPoint(5).toComma());
48
+ // console.log((30222).fixPoint(3));
49
+ // console.log((30222.12).fixPoint(5).toComma());
50
+ // console.log((30222.12).toComma().pointPad(5));
51
+ // console.log("30222.12".pointPad(5));
52
+ // console.log(Math.clamp(10, 3, 5));
53
+ // console.log(Math.clamp(1, 3, 5));
54
+ // console.log(Math.clamp(4, 3, 5));
55
+ const hello = [1, 2, 3, 4, 5, 6, 7, 8, 9];
56
+ console.log(hello.singleOrDefault((e) => e == 99));
57
+ console.log(hello.skip(3).take(5));
58
+ console.log(hello.skip(1).skip(1));
59
+ const test = hello.take(9).select((now, index) => {
60
+ return {
61
+ id: now,
62
+ index,
63
+ name: "test",
64
+ };
65
+ });
66
+ console.log(test);
67
+ console.log(hello.skip(1).count());
68
+ console.log(test.max((now) => now.id));
69
+ console.log(test.min((now) => now.id));
70
+ console.log(test.sum((now) => now.id));
71
+ console.log(test.first((now) => now.id % 3 == 0));
72
+ console.log(test.firstOrDefault((now) => now.id % 99 == 0, 991));
73
+ console.log(test.last((now) => now.id % 3 == 0));
74
+ console.log(test.lastOrDefault((now) => now.id % 3 == 4, 991));
75
+ // console.log(hello.single((now) => now == 3));
76
+ console.log((134.5).addSymbol());
77
+ console.log((0).addSymbol());
78
+ console.log((-1.345).addSymbol());
79
+ console.log((134.5).addSymbol(" "));
80
+ console.log((134.5).addSymbol(" "));
81
+ console.log((134.5).fromPer(50));
82
+ console.log((134.5).fromPer(33));
83
+ console.log((134.5).fromPer(72));
84
+ console.log((100).fromPer(50));
85
+ console.log((100).fromPer(1250));
86
+ console.log((300).fromPer(10));
87
+ console.log((300).toPer(10));
88
+ console.log((2 ** 256 + 0.213445).toComma().fixPoint(10));
89
+ console.info("test1");
90
+ console.warn("test2");
91
+ console.error("test3");
92
+ const aaa = [1, 2, 3, 4, 5];
93
+ console.log(aaa._toJson());
94
+ const bbb = aaa._deepCopy();
95
+ const ccc = `[1,2,3,4,5]`;
96
+ console.log(aaa, bbb, aaa === bbb);
97
+ console.log(ccc.fromJson());
98
+ // console.log({ a: 1, b: 3 }._toJson());
99
+ console.log((1234.1234).round(2));
100
+ console.log((1234.1234).floor(2));
101
+ console.log((1234.1234).ceil(2));
102
+ console.log("3022.50380000".fixNumber(5)); // 03022.50380000
103
+ console.log((3022).fixNumber(7)); // 30222
104
+ console.log((3222.12).fixNumber(5).toComma()); // 03,222.12
105
+ console.log("hello world".issetWord("ell"));
106
+ console.log("hello world".issetWord("xx"));
107
+ console.log("hello world".issetWord(""));
108
+ console.log("helloworld".issetWord(" "));
109
+ console.log("hello world".getChar(0));
110
+ console.log("hello world".getChar(1));
111
+ console.log("hello world".getChar(2));
112
+ console.log("hello world".getChar(3));
113
+ console.log("hello world".getChar(4));
114
+ console.log("hello world".getChar(5));
115
+ // hello.findIndex;
116
116
  //# sourceMappingURL=test.js.map
@@ -0,0 +1,2 @@
1
+ declare function deepClone(obj: any): any;
2
+ export default deepClone;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ function deepClone(obj) {
4
+ if (obj === null || typeof obj !== "object") {
5
+ return obj;
6
+ }
7
+ const result = Array.isArray(obj) ? [] : {};
8
+ for (let key of Object.keys(obj)) {
9
+ result[key] = deepClone(obj[key]);
10
+ }
11
+ return result;
12
+ }
13
+ exports.default = deepClone;
14
+ //# sourceMappingURL=deepCopy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepCopy.js","sourceRoot":"","sources":["../../src/utils/deepCopy.ts"],"names":[],"mappings":";;AAAA,SAAS,SAAS,CAAC,GAAQ;IACzB,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC3C,OAAO,GAAG,CAAC;KACZ;IAED,MAAM,MAAM,GAAQ,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAEjD,KAAK,IAAI,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QAChC,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;KACnC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,kBAAe,SAAS,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function decimalAdjust(type: "round" | "floor" | "ceil"): (number: number, precision?: number) => number;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.decimalAdjust = void 0;
4
+ function decimalAdjust(type) {
5
+ const func = Math[type];
6
+ return (number, precision = 0) => {
7
+ precision =
8
+ precision == null ? 0 : precision >= 0 ? Math.min(precision, 292) : Math.max(precision, -292);
9
+ if (precision) {
10
+ // Shift with exponential notation to avoid floating-point issues.
11
+ // See [MDN](https://mdn.io/round#Examples) for more details.
12
+ let pair = `${number}e`.split("e");
13
+ const value = func(`${pair[0]}e${+pair[1] + precision}`.toNumber());
14
+ pair = `${value}e`.split("e");
15
+ return +`${pair[0]}e${+pair[1] - precision}`;
16
+ }
17
+ return func(number);
18
+ };
19
+ }
20
+ exports.decimalAdjust = decimalAdjust;
21
+ //# sourceMappingURL=math.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"math.js","sourceRoot":"","sources":["../../src/utils/math.ts"],"names":[],"mappings":";;;AACA,SAAgB,aAAa,CAAC,IAAgC;IAC5D,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;IACxB,OAAO,CAAC,MAAc,EAAE,YAAoB,CAAC,EAAE,EAAE;QAC/C,SAAS;YACP,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC;QAChG,IAAI,SAAS,EAAE;YACb,kEAAkE;YAClE,6DAA6D;YAC7D,IAAI,IAAI,GAAG,GAAG,MAAM,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACnC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,SAAS,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;YAEpE,IAAI,GAAG,GAAG,KAAK,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC9B,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,SAAS,EAAE,CAAC;SAC9C;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;IACtB,CAAC,CAAC;AACJ,CAAC;AAhBD,sCAgBC"}
@@ -0,0 +1 @@
1
+ export declare const isNumber: (num: any) => boolean;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isNumber = void 0;
4
+ const isNumber = (num) => {
5
+ if (typeof num === "number") {
6
+ return num - num === 0;
7
+ }
8
+ if (typeof num === "string" && num.trim() !== "") {
9
+ return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
10
+ }
11
+ return false;
12
+ };
13
+ exports.isNumber = isNumber;
14
+ //# sourceMappingURL=valid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"valid.js","sourceRoot":"","sources":["../../src/utils/valid.ts"],"names":[],"mappings":";;;AAAO,MAAM,QAAQ,GAAG,CAAC,GAAQ,EAAE,EAAE;IACnC,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC3B,OAAO,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC;KACxB;IACD,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QAChD,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC;KACjE;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AARW,QAAA,QAAQ,YAQnB"}