umt 1.0.14 → 1.1.0
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.
- package/module/Array/arraysJoin.js +1 -10
- package/module/Array/getArraysCommon.d.ts +1 -1
- package/module/Array/getArraysCommon.js +1 -14
- package/module/Array/getArraysDiff.d.ts +3 -3
- package/module/Array/getArraysDiff.js +2 -2
- package/module/Array/index.d.ts +7 -3
- package/module/Array/index.js +10 -28
- package/module/Array/quickSort.js +3 -1
- package/module/Date/index.d.ts +8 -3
- package/module/Date/index.js +14 -17
- package/module/Date/new.d.ts +4 -0
- package/module/Date/new.js +12 -0
- package/module/Date/now.d.ts +1 -1
- package/module/Date/now.js +9 -5
- package/module/Math/calculator/calculatorInitialization.js +2 -2
- package/module/Math/calculator/core.js +37 -40
- package/module/Math/calculator/exchange.js +8 -12
- package/module/Math/calculator/index.js +5 -4
- package/module/Math/calculator/literalExpression.js +4 -4
- package/module/Math/deviationValue.js +3 -1
- package/module/Math/division.js +13 -9
- package/module/Math/factorial.js +5 -4
- package/module/Math/factorize.js +4 -3
- package/module/Math/gcd.js +14 -10
- package/module/Math/getDecimalLength.js +1 -1
- package/module/Math/index.d.ts +79 -42
- package/module/Math/index.js +80 -131
- package/module/Math/isDouble.js +3 -2
- package/module/Math/isNumber.js +3 -2
- package/module/Math/isPrimeNumber.js +28 -6
- package/module/Math/lcm.js +5 -3
- package/module/Math/mathConverter.js +16 -17
- package/module/Math/multiples.js +1 -1
- package/module/Math/multiplication.js +5 -3
- package/module/Math/nCr.js +2 -1
- package/module/Math/nHr.js +2 -1
- package/module/Math/nPr.js +14 -11
- package/module/Math/primeFactorization.js +5 -4
- package/module/Math/random.d.ts +2 -2
- package/module/Math/random.js +2 -2
- package/module/Math/reduce.js +1 -1
- package/module/Math/repeatedTrial.js +4 -4
- package/module/Math/solveEquation.d.ts +18 -0
- package/module/Math/solveEquation.js +72 -0
- package/module/Math/subtract.js +0 -6
- package/module/Math/valueSwap.js +7 -5
- package/module/Object/index.d.ts +12 -0
- package/module/Object/index.js +15 -0
- package/module/Object/objectUnion.d.ts +5 -0
- package/module/Object/objectUnion.js +7 -0
- package/module/Simple/Date/index.d.ts +1 -1
- package/module/Simple/Date/index.js +2 -16
- package/module/Simple/Date/now.js +7 -7
- package/module/Simple/Tool/birthday.d.ts +1 -1
- package/module/Simple/Tool/birthday.js +6 -6
- package/module/Simple/Tool/dayOfWeekSimple.d.ts +6 -0
- package/module/Simple/{Math/dayOfWeek.js → Tool/dayOfWeekSimple.js} +9 -6
- package/module/Simple/{Math/deviationValue.js → Tool/deviationValueSimple.js} +4 -3
- package/module/Simple/Tool/index.d.ts +9 -1
- package/module/Simple/Tool/index.js +12 -16
- package/module/Simple/index.d.ts +7 -8
- package/module/Simple/index.js +8 -29
- package/module/String/index.d.ts +8 -0
- package/module/String/index.js +15 -0
- package/module/String/reverseString.d.ts +1 -0
- package/module/String/reverseString.js +7 -0
- package/module/Tool/birthday.js +1 -2
- package/module/Tool/dayOfWeek.d.ts +2 -2
- package/module/Tool/dayOfWeek.js +2 -2
- package/module/Tool/index.d.ts +8 -3
- package/module/Tool/index.js +12 -31
- package/module/Tool/isBrowser.js +1 -1
- package/module/index.d.ts +14 -6
- package/module/index.js +25 -33
- package/module/tsconfig.tsbuildinfo +1 -1
- package/module/types/clockType.d.ts +9 -0
- package/module/types/dateType.d.ts +11 -0
- package/module/types/dateType.js +2 -0
- package/module/types/int.d.ts +4 -4
- package/module/types/logicType.d.ts +9 -8
- package/package.json +25 -17
- package/.github/workflows/test.yml +0 -23
- package/.markdownlint.json +0 -6
- package/.nvmrc +0 -1
- package/jest.config.js +0 -13
- package/make_test.py +0 -24
- package/module/Compiler/core.d.ts +0 -5
- package/module/Compiler/core.js +0 -19
- package/module/Compiler/token.d.ts +0 -10
- package/module/Compiler/token.js +0 -120
- package/module/Math/roundOff.d.ts +0 -7
- package/module/Math/roundOff.js +0 -14
- package/module/Math/softmax.d.ts +0 -5
- package/module/Math/softmax.js +0 -40
- package/module/Simple/Math/dayOfWeek.d.ts +0 -6
- package/module/Simple/Math/index.d.ts +0 -10
- package/module/Simple/Math/index.js +0 -33
- package/module/types/monType.d.ts +0 -8
- /package/module/Simple/{Math/deviationValue.d.ts → Tool/deviationValueSimple.d.ts} +0 -0
- /package/module/types/{monType.js → clockType.js} +0 -0
package/module/types/int.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
1
|
+
export type int = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
2
|
+
export type doubleDigit = `${int}${int}`;
|
|
3
|
+
export type tripleDigit = `${int}${int}${int}`;
|
|
4
|
+
export type fourDigit = `${int}${int}${int}${int}`;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
1
|
+
export type isBoolean<X> = X extends number ? X extends 0 ? false : true : X extends string ? X extends "" ? false : true : X extends boolean ? X : X extends undefined ? false : X extends null ? false : X extends object ? X extends Array<any> ? X extends [] ? false : true : true : X extends Function ? false : true;
|
|
2
|
+
export type AND<X, Y> = isBoolean<X> extends true ? isBoolean<Y> extends true ? true : false : false;
|
|
3
|
+
export type OR<X, Y> = isBoolean<X> extends true ? true : isBoolean<Y> extends true ? true : false;
|
|
4
|
+
export type XOR<X, Y> = isBoolean<X> extends true ? isBoolean<Y> extends true ? false : true : isBoolean<Y> extends true ? true : false;
|
|
5
|
+
export type NOT<X> = isBoolean<X> extends true ? false : true;
|
|
6
|
+
export type NAND<X, Y> = NOT<AND<X, Y>>;
|
|
7
|
+
export type NOR<X, Y> = NOT<OR<X, Y>>;
|
|
8
|
+
export type XNOR<X, Y> = NOT<XOR<X, Y>>;
|
|
9
|
+
export type IMPLY<X, Y> = NOT<X> extends true ? true : isBoolean<Y>;
|
package/package.json
CHANGED
|
@@ -1,41 +1,49 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "",
|
|
3
|
+
"bugs": {
|
|
4
|
+
"url": "https://github.com/riya-amemiya/UMT/issues"
|
|
5
|
+
},
|
|
3
6
|
"description": "個人的に作った便利関数集 個人用途なので破壊的変更がある可能性があります。 Main Packageに依存関係はありません。 JavaScriptからの呼び出しに対応しています。",
|
|
4
7
|
"devDependencies": {
|
|
8
|
+
"@swc/core": "^1.3.44",
|
|
9
|
+
"@swc/jest": "^0.2.24",
|
|
5
10
|
"@types/jest": "^29.2.3",
|
|
6
11
|
"@types/node": "^18.11.9",
|
|
7
|
-
"gh-pages": "^
|
|
12
|
+
"gh-pages": "^5.0.0",
|
|
8
13
|
"jest": "^29.3.1",
|
|
9
|
-
"
|
|
14
|
+
"rome": "^12.0.0",
|
|
10
15
|
"ts-node": "^10.9.1",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
16
|
+
"tsc-alias": "^1.8.6",
|
|
17
|
+
"typedoc": "^0.24.4",
|
|
18
|
+
"typescript": "^5.0.4",
|
|
13
19
|
"umt": "^1.0.12"
|
|
14
20
|
},
|
|
21
|
+
"directories": {
|
|
22
|
+
"doc": "doc",
|
|
23
|
+
"lib": "lib",
|
|
24
|
+
"test": "tests"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://github.com/riya-amemiya/UMT#readme",
|
|
15
27
|
"keywords": [],
|
|
16
28
|
"license": "MIT",
|
|
17
29
|
"main": "module/index.js",
|
|
30
|
+
"types": "module/index.d.js",
|
|
31
|
+
"files": [
|
|
32
|
+
"module"
|
|
33
|
+
],
|
|
18
34
|
"name": "umt",
|
|
19
35
|
"repository": {
|
|
20
36
|
"type": "git",
|
|
21
37
|
"url": "git://github.com/riya-amemiya/UMT.git"
|
|
22
38
|
},
|
|
23
39
|
"scripts": {
|
|
24
|
-
"build": "tsc
|
|
40
|
+
"build": "tsc && tsc-alias -p tsconfig.json",
|
|
25
41
|
"deploy": "yarn typedoc && gh-pages -d doc",
|
|
26
42
|
"test": "jest",
|
|
27
43
|
"test-debug": "cd test && tsc",
|
|
28
|
-
"ts-node": "ts-node --project test/tsconfig.json test/src/index.ts"
|
|
44
|
+
"ts-node": "ts-node --project test/tsconfig.json test/src/index.ts",
|
|
45
|
+
"lint": "rome check .",
|
|
46
|
+
"format": "rome format ."
|
|
29
47
|
},
|
|
30
|
-
"
|
|
31
|
-
"version": "1.0.14",
|
|
32
|
-
"bugs": {
|
|
33
|
-
"url": "https://github.com/riya-amemiya/UMT/issues"
|
|
34
|
-
},
|
|
35
|
-
"homepage": "https://github.com/riya-amemiya/UMT#readme",
|
|
36
|
-
"directories": {
|
|
37
|
-
"doc": "doc",
|
|
38
|
-
"lib": "lib",
|
|
39
|
-
"test": "tests"
|
|
40
|
-
}
|
|
48
|
+
"version": "1.1.0"
|
|
41
49
|
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# アクション名
|
|
2
|
-
name: Test
|
|
3
|
-
|
|
4
|
-
# タイミングを指定
|
|
5
|
-
on:
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: [main]
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
build:
|
|
11
|
-
name: build
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
steps:
|
|
14
|
-
- uses: actions/checkout@v1
|
|
15
|
-
- name: yarn install
|
|
16
|
-
run: yarn install
|
|
17
|
-
- name: Run Test
|
|
18
|
-
run: yarn test
|
|
19
|
-
- name: Upload test coverage artifact
|
|
20
|
-
uses: actions/upload-artifact@v1
|
|
21
|
-
with:
|
|
22
|
-
name: coverage
|
|
23
|
-
path: coverage_dir
|
package/.markdownlint.json
DELETED
package/.nvmrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
v16.10.0
|
package/jest.config.js
DELETED
|
@@ -1,13 +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>/tests/**/*.ts',
|
|
9
|
-
'!**/node_modules/**',
|
|
10
|
-
],
|
|
11
|
-
coverageDirectory: 'coverage_dir',
|
|
12
|
-
coverageReporters: ['html'],
|
|
13
|
-
};
|
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
|
-
export declare const compilerCore: (code: string, tokenList: [string, RegExp, number | null][], UncategorizedTokenList: [string, RegExp, number | null][], process: (code: string, tokenList: [string, RegExp, number | null][], x: {
|
|
2
|
-
name: string;
|
|
3
|
-
value: string;
|
|
4
|
-
count: number;
|
|
5
|
-
}) => string) => string;
|
package/module/Compiler/core.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.compilerCore = void 0;
|
|
4
|
-
const token_1 = require("./token");
|
|
5
|
-
const compilerCore = (code, tokenList, UncategorizedTokenList, process) => {
|
|
6
|
-
const tokenCodes = (0, token_1.compilerToken)(code, tokenList, UncategorizedTokenList);
|
|
7
|
-
console.log('====================================');
|
|
8
|
-
console.log(tokenCodes[0].token);
|
|
9
|
-
console.log('====================================');
|
|
10
|
-
let outCode = '';
|
|
11
|
-
for (const tokenCode of tokenCodes) {
|
|
12
|
-
for (const n of tokenCode.token) {
|
|
13
|
-
outCode += process(code, tokenList, n);
|
|
14
|
-
}
|
|
15
|
-
outCode += '\n';
|
|
16
|
-
}
|
|
17
|
-
return outCode;
|
|
18
|
-
};
|
|
19
|
-
exports.compilerCore = compilerCore;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const compilerToken: (code: string, tokenList: [string, RegExp, number | null][], UncategorizedTokenList: [string, RegExp, number | null][]) => {
|
|
2
|
-
code: string;
|
|
3
|
-
token: {
|
|
4
|
-
name: string;
|
|
5
|
-
value: string;
|
|
6
|
-
count: number;
|
|
7
|
-
index: number;
|
|
8
|
-
}[];
|
|
9
|
-
outCode: string;
|
|
10
|
-
}[];
|
package/module/Compiler/token.js
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.compilerToken = void 0;
|
|
4
|
-
const compilerToken = (code, tokenList, UncategorizedTokenList) => {
|
|
5
|
-
const tokenListMax = Math.max(...tokenList.map((n) => { var _a; return (_a = n[2]) !== null && _a !== void 0 ? _a : 0; }));
|
|
6
|
-
let list = [];
|
|
7
|
-
const tokenListName = tokenList.map((n) => n[0]);
|
|
8
|
-
let outCode = [
|
|
9
|
-
code.split('\n'),
|
|
10
|
-
code.split('\n'),
|
|
11
|
-
];
|
|
12
|
-
console.log('====================================');
|
|
13
|
-
console.log(outCode);
|
|
14
|
-
console.log('====================================');
|
|
15
|
-
let count = {};
|
|
16
|
-
tokenList.forEach((token) => {
|
|
17
|
-
if (token[2] === null) {
|
|
18
|
-
return (token[2] = tokenListMax + 1);
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
return token;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
tokenList.sort((a, b) => {
|
|
25
|
-
if (a[2] === null) {
|
|
26
|
-
return 1;
|
|
27
|
-
}
|
|
28
|
-
else if (b[2] === null) {
|
|
29
|
-
return -1;
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
return a[2] - b[2];
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
for (const token of tokenList) {
|
|
36
|
-
code.split('\n')
|
|
37
|
-
.filter((n) => n !== '')
|
|
38
|
-
.forEach((_, index) => {
|
|
39
|
-
count = {};
|
|
40
|
-
outCode[1][index] = outCode[1][index].replace(new RegExp(token[1], 'g'), (match) => {
|
|
41
|
-
try {
|
|
42
|
-
count[token[0]].value += 1;
|
|
43
|
-
}
|
|
44
|
-
catch (_a) {
|
|
45
|
-
count[token[0]] = {
|
|
46
|
-
value: 0,
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
try {
|
|
50
|
-
list[index].push({
|
|
51
|
-
name: token[0],
|
|
52
|
-
value: match,
|
|
53
|
-
count: count[token[0]].value,
|
|
54
|
-
index: outCode[1][index].indexOf(match),
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
catch (_b) {
|
|
58
|
-
list[index] = [
|
|
59
|
-
{
|
|
60
|
-
name: token[0],
|
|
61
|
-
value: match,
|
|
62
|
-
count: 0,
|
|
63
|
-
index: outCode[1][index].indexOf(match),
|
|
64
|
-
},
|
|
65
|
-
];
|
|
66
|
-
}
|
|
67
|
-
outCode[1][index] = outCode[1][index].replace(match, ` ${token[0]} `);
|
|
68
|
-
return ` ${token[0]} `;
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
outCode[1].forEach((i, index) => {
|
|
73
|
-
for (const token of i
|
|
74
|
-
.split(' ')
|
|
75
|
-
.filter((n) => n !== '')
|
|
76
|
-
.filter((n) => tokenListName.indexOf(n) === -1)) {
|
|
77
|
-
UncategorizedTokenList.forEach((n) => {
|
|
78
|
-
token.replace(n[1], (match) => {
|
|
79
|
-
try {
|
|
80
|
-
count[n[0]].value += 1;
|
|
81
|
-
}
|
|
82
|
-
catch (_a) {
|
|
83
|
-
count[n[0]] = {
|
|
84
|
-
value: 0,
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
try {
|
|
88
|
-
list[index].push({
|
|
89
|
-
name: n[0],
|
|
90
|
-
value: match,
|
|
91
|
-
count: count[n[0]].value,
|
|
92
|
-
index: outCode[0][index].indexOf(match),
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
catch (_b) {
|
|
96
|
-
list[index] = [
|
|
97
|
-
{
|
|
98
|
-
name: n[0],
|
|
99
|
-
value: match,
|
|
100
|
-
count: 0,
|
|
101
|
-
index: outCode[0][index].indexOf(match),
|
|
102
|
-
},
|
|
103
|
-
];
|
|
104
|
-
}
|
|
105
|
-
outCode[0][index] = outCode[0][index].replace(match, ` ${n[0]} `);
|
|
106
|
-
outCode[1][index] = outCode[1][index].replace(token, ` ${n[0]} `);
|
|
107
|
-
return ` ${n[0]} `;
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
return code.split('\n').map((n, index) => {
|
|
113
|
-
return {
|
|
114
|
-
code: n,
|
|
115
|
-
token: list[index].sort((a, b) => a.index - b.index),
|
|
116
|
-
outCode: outCode[1][index],
|
|
117
|
-
};
|
|
118
|
-
});
|
|
119
|
-
};
|
|
120
|
-
exports.compilerToken = compilerToken;
|
package/module/Math/roundOff.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.roundOf = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* 四捨五入
|
|
6
|
-
* @param {number} num - 四捨五入する数値
|
|
7
|
-
* @param {number} precision - 四捨五入する桁数
|
|
8
|
-
* @returns number
|
|
9
|
-
*/
|
|
10
|
-
const roundOf = (num, precision) => {
|
|
11
|
-
return (Math.round(num * Math.pow(10, precision)) /
|
|
12
|
-
Math.pow(10, precision));
|
|
13
|
-
};
|
|
14
|
-
exports.roundOf = roundOf;
|
package/module/Math/softmax.d.ts
DELETED
package/module/Math/softmax.js
DELETED
|
@@ -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,6 +0,0 @@
|
|
|
1
|
-
import { dayType, MonthsWihout31Days, MonthsWith31Days } from '../../types/monType';
|
|
2
|
-
export declare const dayOfWeekSimple: <T extends MonthsWith31Days | MonthsWihout31Days>(props?: Date | {
|
|
3
|
-
yer?: number | undefined;
|
|
4
|
-
mon?: T | undefined;
|
|
5
|
-
day?: dayType<T> | undefined;
|
|
6
|
-
} | `${number}-${T}-${dayType<T>}` | `${number}:${T}:${dayType<T>}` | `${number}/${T}/${dayType<T>}` | undefined, timeDifference?: number) => number;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare class UMTSimpleMathClass {
|
|
2
|
-
#private;
|
|
3
|
-
constructor();
|
|
4
|
-
get dayOfWeek(): <T extends import("../../types/monType").MonthsWith31Days | import("../../types/monType").MonthsWihout31Days>(props?: Date | {
|
|
5
|
-
yer?: number | undefined;
|
|
6
|
-
mon?: T | undefined;
|
|
7
|
-
day?: import("../../types/monType").dayType<T> | undefined;
|
|
8
|
-
} | `${number}-${T}-${import("../../types/monType").dayType<T>}` | `${number}:${T}:${import("../../types/monType").dayType<T>}` | `${number}/${T}/${import("../../types/monType").dayType<T>}` | undefined, timeDifference?: number) => number;
|
|
9
|
-
get deviationValue(): import("./deviationValue").DeviationValueSimple;
|
|
10
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
-
};
|
|
8
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
-
};
|
|
13
|
-
var _UMTSimpleMathClass_Local_dayOfWeek, _UMTSimpleMathClass_Local_deviationValue;
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.UMTSimpleMathClass = void 0;
|
|
16
|
-
const dayOfWeek_1 = require("./dayOfWeek");
|
|
17
|
-
const deviationValue_1 = require("./deviationValue");
|
|
18
|
-
class UMTSimpleMathClass {
|
|
19
|
-
constructor() {
|
|
20
|
-
_UMTSimpleMathClass_Local_dayOfWeek.set(this, void 0);
|
|
21
|
-
_UMTSimpleMathClass_Local_deviationValue.set(this, void 0);
|
|
22
|
-
__classPrivateFieldSet(this, _UMTSimpleMathClass_Local_dayOfWeek, dayOfWeek_1.dayOfWeekSimple, "f");
|
|
23
|
-
__classPrivateFieldSet(this, _UMTSimpleMathClass_Local_deviationValue, deviationValue_1.deviationValueSimple, "f");
|
|
24
|
-
}
|
|
25
|
-
get dayOfWeek() {
|
|
26
|
-
return __classPrivateFieldGet(this, _UMTSimpleMathClass_Local_dayOfWeek, "f");
|
|
27
|
-
}
|
|
28
|
-
get deviationValue() {
|
|
29
|
-
return __classPrivateFieldGet(this, _UMTSimpleMathClass_Local_deviationValue, "f");
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.UMTSimpleMathClass = UMTSimpleMathClass;
|
|
33
|
-
_UMTSimpleMathClass_Local_dayOfWeek = new WeakMap(), _UMTSimpleMathClass_Local_deviationValue = new WeakMap();
|
|
@@ -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
|
|
File without changes
|