umt 1.0.15 → 1.1.1

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 (89) hide show
  1. package/module/Array/arraysJoin.js +1 -10
  2. package/module/Array/getArraysCommon.d.ts +1 -1
  3. package/module/Array/getArraysCommon.js +1 -14
  4. package/module/Array/getArraysDiff.d.ts +3 -3
  5. package/module/Array/getArraysDiff.js +2 -2
  6. package/module/Array/index.d.ts +7 -3
  7. package/module/Array/index.js +10 -28
  8. package/module/Array/quickSort.js +3 -1
  9. package/module/Date/DateWrapper.d.ts +4 -0
  10. package/module/Date/DateWrapper.js +11 -0
  11. package/module/Date/index.d.ts +8 -3
  12. package/module/Date/index.js +14 -17
  13. package/module/Date/new.d.ts +4 -0
  14. package/module/Date/new.js +12 -0
  15. package/module/Date/now.d.ts +1 -1
  16. package/module/Date/now.js +13 -5
  17. package/module/Math/calculator/core.js +37 -40
  18. package/module/Math/calculator/exchange.js +2 -2
  19. package/module/Math/calculator/index.js +5 -4
  20. package/module/Math/calculator/literalExpression.js +4 -4
  21. package/module/Math/division.js +13 -9
  22. package/module/Math/factorial.js +5 -4
  23. package/module/Math/factorize.js +4 -3
  24. package/module/Math/gcd.js +14 -10
  25. package/module/Math/getDecimalLength.js +1 -1
  26. package/module/Math/index.d.ts +79 -40
  27. package/module/Math/index.js +81 -125
  28. package/module/Math/isDouble.js +3 -2
  29. package/module/Math/isNumber.js +3 -2
  30. package/module/Math/isPrimeNumber.js +28 -6
  31. package/module/Math/lcm.js +5 -3
  32. package/module/Math/mathConverter.js +16 -17
  33. package/module/Math/multiples.js +1 -1
  34. package/module/Math/multiplication.js +5 -3
  35. package/module/Math/nCr.js +2 -1
  36. package/module/Math/nHr.js +2 -1
  37. package/module/Math/nPr.js +14 -11
  38. package/module/Math/primeFactorization.js +5 -4
  39. package/module/Math/random.d.ts +2 -2
  40. package/module/Math/random.js +2 -2
  41. package/module/Math/reduce.js +1 -1
  42. package/module/Math/repeatedTrial.js +4 -4
  43. package/module/Math/solveEquation.d.ts +18 -0
  44. package/module/Math/solveEquation.js +72 -0
  45. package/module/Math/subtract.js +0 -6
  46. package/module/Math/valueSwap.js +7 -5
  47. package/module/Object/index.d.ts +12 -0
  48. package/module/Object/index.js +15 -0
  49. package/module/Object/objectUnion.d.ts +5 -0
  50. package/module/Object/objectUnion.js +7 -0
  51. package/module/Simple/Date/index.d.ts +1 -1
  52. package/module/Simple/Date/index.js +2 -16
  53. package/module/Simple/Date/now.js +7 -7
  54. package/module/Simple/Tool/birthday.d.ts +1 -1
  55. package/module/Simple/Tool/birthday.js +6 -6
  56. package/module/Simple/Tool/dayOfWeekSimple.d.ts +2 -2
  57. package/module/Simple/Tool/dayOfWeekSimple.js +9 -6
  58. package/module/Simple/Tool/deviationValueSimple.js +4 -3
  59. package/module/Simple/Tool/index.d.ts +6 -4
  60. package/module/Simple/Tool/index.js +6 -22
  61. package/module/Simple/index.d.ts +4 -3
  62. package/module/Simple/index.js +6 -21
  63. package/module/String/index.d.ts +8 -0
  64. package/module/String/index.js +15 -0
  65. package/module/String/reverseString.d.ts +1 -0
  66. package/module/String/reverseString.js +7 -0
  67. package/module/Tool/birthday.js +1 -2
  68. package/module/Tool/dayOfWeek.d.ts +1 -1
  69. package/module/Tool/dayOfWeek.js +2 -2
  70. package/module/Tool/index.d.ts +8 -3
  71. package/module/Tool/index.js +12 -31
  72. package/module/Tool/isBrowser.js +1 -1
  73. package/module/index.d.ts +14 -6
  74. package/module/index.js +25 -33
  75. package/module/tsconfig.tsbuildinfo +1 -1
  76. package/module/types/clockType.d.ts +9 -0
  77. package/module/types/dateType.d.ts +11 -0
  78. package/module/types/dateType.js +2 -0
  79. package/module/types/int.d.ts +4 -4
  80. package/module/types/logicType.d.ts +9 -8
  81. package/package.json +16 -8
  82. package/.markdownlint.json +0 -6
  83. package/.nvmrc +0 -1
  84. package/jest.config.js +0 -16
  85. package/make_test.py +0 -24
  86. package/module/Math/softmax.d.ts +0 -5
  87. package/module/Math/softmax.js +0 -40
  88. package/module/types/monType.d.ts +0 -8
  89. /package/module/types/{monType.js → clockType.js} +0 -0
package/jest.config.js DELETED
@@ -1,16 +0,0 @@
1
- /** @type {import('ts-jest').JestConfigWithTsJest} */
2
- module.exports = {
3
- preset: 'ts-jest',
4
- testEnvironment: 'node',
5
- roots: ['<rootDir>/tests'],
6
- collectCoverage: true,
7
- collectCoverageFrom: [
8
- '<rootDir>/module/**/*.{js,ts}',
9
- '<rootDir>/src/**/*.{js,ts}',
10
- '!**/node_modules/**',
11
- '!**/{index,random}.{js,ts}',
12
- '!**/Date/**',
13
- ],
14
- coverageDirectory: 'coverage_dir',
15
- coverageReporters: ['text'],
16
- };
package/make_test.py DELETED
@@ -1,24 +0,0 @@
1
- import os
2
- import pathlib
3
- paths = ["Array", "Math", "Simple"]
4
- for path in paths:
5
- path = f"src/{path}"
6
- files = os.listdir(path)
7
- files_file = [f for f in files if os.path.isfile(os.path.join(path, f))]
8
- for file in files_file:
9
- if(file == "index.ts" or file == ".DS_Store" or file in "random"):
10
- continue
11
- path = pathlib.Path(path)
12
- p_dir = path.name
13
- p_dir = f"tests/{p_dir}/"
14
- file = pathlib.Path(file).stem
15
- if not os.path.exists(p_dir):
16
- os.makedirs(p_dir)
17
- if os.path.isfile(p_dir + file + ".test.ts"):
18
- continue
19
- pathlib.Path(p_dir + file + ".test.ts").touch()
20
- with open(p_dir + file + ".test.ts", "w") as f:
21
- f.write(
22
- """import { %s } from "../../module/%s/%s";
23
- test('{%s}', () => {});
24
- """ % (file, path.name, file, file))
@@ -1,5 +0,0 @@
1
- /**
2
- * @param {number[]} x
3
- * @return {number[]}
4
- */
5
- export declare const softmax: (x: number[]) => number[];
@@ -1,40 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.softmax = void 0;
27
- const ArraySum = __importStar(require("../Array/sum"));
28
- const division_1 = require("./division");
29
- const roundOf_1 = require("./roundOf");
30
- /**
31
- * @param {number[]} x
32
- * @return {number[]}
33
- */
34
- const softmax = (x) => {
35
- const max = Math.max(...x);
36
- const exp = x.map((i) => Math.exp(i - max));
37
- const sum = ArraySum.sum(exp);
38
- return exp.map((i) => (0, roundOf_1.roundOf)((0, division_1.division)(i, sum), 3));
39
- };
40
- exports.softmax = softmax;
@@ -1,8 +0,0 @@
1
- export declare type monType = `${0}${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}` | `${1}${0 | 1 | 2}`;
2
- export declare type monTypeInt = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
3
- export declare type MonthsWith31Days = `${0}${1 | 3 | 5 | 7 | 8}` | `${1}${0 | 2}`;
4
- export declare type MonthsWith31DaysInt = 1 | 3 | 5 | 7 | 8 | 10 | 12;
5
- export declare type MonthsWihout31Days = `${0}${2 | 4 | 6 | 9}` | `${1}${1}`;
6
- export declare type MonthsWihout31DaysInt = 2 | 4 | 6 | 9 | 11;
7
- export declare type dayType<T extends string> = T extends '02' ? `${0}${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}` | `${1}${0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}` | `${2}${0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}` : `${0}${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}` | `${1}${0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}` | `${2}${0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}` | `${3}${T extends MonthsWihout31Days ? 0 : 0 | 1}`;
8
- export declare type dayTypeInt<T extends number> = T extends 2 ? 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 : T extends MonthsWihout31DaysInt ? 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 : 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31;
File without changes