umt 1.4.0 → 1.4.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.
- package/module/Array/compareFunctionDefault.d.ts +1 -0
- package/module/Array/compareFunctionDefault.js +2 -0
- package/module/Array/compareFunctionDefault.js.map +1 -0
- package/module/Array/index.d.ts +1 -0
- package/module/Array/index.js +1 -0
- package/module/Array/index.js.map +1 -1
- package/module/Array/mergeSort.d.ts +1 -0
- package/module/Array/mergeSort.js +28 -0
- package/module/Array/mergeSort.js.map +1 -0
- package/module/Array/quickSort.d.ts +1 -2
- package/module/Array/quickSort.js +32 -14
- package/module/Array/quickSort.js.map +1 -1
- package/module/Simple/Array/quickSortSimple.js +2 -1
- package/module/Simple/Array/quickSortSimple.js.map +1 -1
- package/module/Validate/array/core.d.ts +2 -0
- package/module/Validate/array/core.js +31 -0
- package/module/Validate/array/core.js.map +1 -0
- package/module/Validate/array/index.d.ts +1 -0
- package/module/Validate/array/index.js +2 -0
- package/module/Validate/array/index.js.map +1 -0
- package/module/Validate/core/index.d.ts +1 -1
- package/module/Validate/core/index.js +1 -1
- package/module/Validate/core/index.js.map +1 -1
- package/module/Validate/index.d.ts +1 -0
- package/module/Validate/index.js +1 -0
- package/module/Validate/index.js.map +1 -1
- package/module/Validate/number/core.d.ts +1 -1
- package/module/Validate/number/core.js.map +1 -1
- package/module/Validate/object/core.d.ts +2 -2
- package/module/Validate/object/core.js +1 -1
- package/module/Validate/object/core.js.map +1 -1
- package/module/Validate/string/core.d.ts +1 -1
- package/module/Validate/string/core.js.map +1 -1
- package/module/Validate/string/index.d.ts +1 -0
- package/module/Validate/string/index.js +1 -0
- package/module/Validate/string/index.js.map +1 -1
- package/module/Validate/string/regexMatch.d.ts +2 -0
- package/module/Validate/string/regexMatch.js +8 -0
- package/module/Validate/string/regexMatch.js.map +1 -0
- package/module/Validate/type.d.ts +2 -2
- package/package.json +3 -2
- package/module/Array/ArrayWrapper.d.ts +0 -7
- package/module/Array/ArrayWrapper.js +0 -21
- package/module/Array/ArrayWrapper.js.map +0 -1
- package/module/Array/arrayMap.d.ts +0 -1
- package/module/Array/arrayMap.js +0 -8
- package/module/Array/arrayMap.js.map +0 -1
- package/module/Async/Array/quickSortAsync.d.ts +0 -10
- package/module/Async/Array/quickSortAsync.js +0 -25
- package/module/Async/Array/quickSortAsync.js.map +0 -1
- package/module/Async/Math/isPrimeNumberAsync.d.ts +0 -7
- package/module/Async/Math/isPrimeNumberAsync.js +0 -22
- package/module/Async/Math/isPrimeNumberAsync.js.map +0 -1
- package/module/Math/calculator/exchange.d.ts +0 -1
- package/module/Math/calculator/exchange.js +0 -33
- package/module/Math/calculator/exchange.js.map +0 -1
- package/module/Math/isDouble.d.ts +0 -12
- package/module/Math/isDouble.js +0 -22
- package/module/Math/isDouble.js.map +0 -1
- package/module/Math/isNumber.d.ts +0 -11
- package/module/Math/isNumber.js +0 -17
- package/module/Math/isNumber.js.map +0 -1
- package/module/Math/isPrimeNumber.d.ts +0 -7
- package/module/Math/isPrimeNumber.js +0 -18
- package/module/Math/isPrimeNumber.js.map +0 -1
- package/module/Simple/Date/now.d.ts +0 -8
- package/module/Simple/Date/now.js +0 -18
- package/module/Simple/Date/now.js.map +0 -1
- package/module/Simple/Tool/birthday.d.ts +0 -21
- package/module/Simple/Tool/birthday.js +0 -31
- package/module/Simple/Tool/birthday.js.map +0 -1
- package/module/Tool/isArr.d.ts +0 -1
- package/module/Tool/isArr.js +0 -4
- package/module/Tool/isArr.js.map +0 -1
- package/module/Tool/isArray.d.ts +0 -8
- package/module/Tool/isArray.js +0 -11
- package/module/Tool/isArray.js.map +0 -1
- package/module/Tool/isBrowser.d.ts +0 -4
- package/module/Tool/isBrowser.js +0 -5
- package/module/Tool/isBrowser.js.map +0 -1
- package/module/Tool/isNode.d.ts +0 -4
- package/module/Tool/isNode.js +0 -5
- package/module/Tool/isNode.js.map +0 -1
- package/module/Tool/isNodeWebkit.d.ts +0 -4
- package/module/Tool/isNodeWebkit.js +0 -7
- package/module/Tool/isNodeWebkit.js.map +0 -1
- package/module/Tool/isNotEmpty.d.ts +0 -8
- package/module/Tool/isNotEmpty.js +0 -12
- package/module/Tool/isNotEmpty.js.map +0 -1
- package/module/Tool/isObj.d.ts +0 -3
- package/module/Tool/isObj.js +0 -4
- package/module/Tool/isObj.js.map +0 -1
- package/module/Tool/isObject.d.ts +0 -10
- package/module/Tool/isObject.js +0 -11
- package/module/Tool/isObject.js.map +0 -1
- package/module/Tool/pipeFunction.d.ts +0 -5
- package/module/Tool/pipeFunction.js +0 -6
- package/module/Tool/pipeFunction.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const compareFunctionDefault: <T>(a: T, b: T) => number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compareFunctionDefault.js","sourceRoot":"","sources":["../../src/Array/compareFunctionDefault.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAI,CAAI,EAAE,CAAI,EAAU,EAAE,CAC9D,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
package/module/Array/index.d.ts
CHANGED
package/module/Array/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Array/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,OAAO,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Array/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const mergeSort: <T>(array: T[], compareFunction?: (a: T, b: T) => number, start?: number, end?: number) => T[];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { compareFunctionDefault } from "./compareFunctionDefault";
|
|
2
|
+
export const mergeSort = (array, compareFunction = (compareFunctionDefault), start = 0, end = array.length) => {
|
|
3
|
+
const length = end - start;
|
|
4
|
+
if (length <= 1) {
|
|
5
|
+
return array.slice(start, end);
|
|
6
|
+
}
|
|
7
|
+
const middle = start + Math.floor(length / 2);
|
|
8
|
+
const left = mergeSort(array, compareFunction, start, middle);
|
|
9
|
+
const right = mergeSort(array, compareFunction, middle, end);
|
|
10
|
+
return merge(left, right, compareFunction);
|
|
11
|
+
};
|
|
12
|
+
function merge(left, right, compareFunction) {
|
|
13
|
+
const result = [];
|
|
14
|
+
let leftIndex = 0;
|
|
15
|
+
let rightIndex = 0;
|
|
16
|
+
while (leftIndex < left.length && rightIndex < right.length) {
|
|
17
|
+
if (compareFunction(left[leftIndex], right[rightIndex]) <= 0) {
|
|
18
|
+
result.push(left[leftIndex]);
|
|
19
|
+
leftIndex++;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
result.push(right[rightIndex]);
|
|
23
|
+
rightIndex++;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return result.concat(left.slice(leftIndex)).concat(right.slice(rightIndex));
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=mergeSort.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeSort.js","sourceRoot":"","sources":["../../src/Array/mergeSort.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,KAAU,EACV,kBAA0C,CAAA,sBAAyB,CAAA,EACnE,KAAK,GAAG,CAAC,EACT,MAAc,KAAK,CAAC,MAAM,EACrB,EAAE;IACP,MAAM,MAAM,GAAG,GAAG,GAAG,KAAK,CAAC;IAC3B,IAAI,MAAM,IAAI,CAAC,EAAE,CAAC;QAChB,OAAO,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACjC,CAAC;IAED,MAAM,MAAM,GAAG,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC9C,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IAC9D,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;IAE7D,OAAO,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC;AAC7C,CAAC,CAAC;AAEF,SAAS,KAAK,CACZ,IAAS,EACT,KAAU,EACV,eAAuC;IAEvC,MAAM,MAAM,GAAQ,EAAE,CAAC;IACvB,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,IAAI,UAAU,GAAG,CAAC,CAAC;IAEnB,OAAO,SAAS,GAAG,IAAI,CAAC,MAAM,IAAI,UAAU,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;QAC5D,IAAI,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7D,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;YAC7B,SAAS,EAAE,CAAC;QACd,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;YAC/B,UAAU,EAAE,CAAC;QACf,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;AAC9E,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export declare const compareFunctionDefault: <T>(a: T, b: T) => number;
|
|
2
1
|
/**
|
|
3
2
|
* 配列を高速にソート
|
|
4
3
|
* @param {T[]} array 配列
|
|
@@ -8,4 +7,4 @@ export declare const compareFunctionDefault: <T>(a: T, b: T) => number;
|
|
|
8
7
|
* @returns T[]
|
|
9
8
|
* @example quickSort([1, 3, 2, 4, 5], (a, b) => a - b); // [1, 2, 3, 4, 5]
|
|
10
9
|
*/
|
|
11
|
-
export declare const quickSort: <T>(array: T[], compareFunction?: (a: T, b: T) => number, startID?: number, endID?: number) => T[];
|
|
10
|
+
export declare const quickSort: <T>(array: T[], compareFunction?: (a: T, b: T) => number, startID?: number, endID?: number, insertionSortThreshold?: number) => T[];
|
|
@@ -1,4 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
import { compareFunctionDefault } from "./compareFunctionDefault";
|
|
2
|
+
const medianOfThree = (array, a, b, c, compareFunction) => {
|
|
3
|
+
const ab = compareFunction(array[a], array[b]);
|
|
4
|
+
const ac = compareFunction(array[a], array[c]);
|
|
5
|
+
const bc = compareFunction(array[b], array[c]);
|
|
6
|
+
if (ab < 0) {
|
|
7
|
+
if (bc < 0) {
|
|
8
|
+
return array[b];
|
|
9
|
+
}
|
|
10
|
+
return ac < 0 ? array[c] : array[a];
|
|
11
|
+
}
|
|
12
|
+
if (ac < 0) {
|
|
13
|
+
return array[a];
|
|
14
|
+
}
|
|
15
|
+
return bc < 0 ? array[c] : array[b];
|
|
16
|
+
};
|
|
2
17
|
/**
|
|
3
18
|
* 配列を高速にソート
|
|
4
19
|
* @param {T[]} array 配列
|
|
@@ -8,20 +23,23 @@ export const compareFunctionDefault = (a, b) => a > b ? 1 : a < b ? -1 : 0;
|
|
|
8
23
|
* @returns T[]
|
|
9
24
|
* @example quickSort([1, 3, 2, 4, 5], (a, b) => a - b); // [1, 2, 3, 4, 5]
|
|
10
25
|
*/
|
|
11
|
-
export const quickSort = (array, compareFunction = (compareFunctionDefault), startID = 0, endID = array.length - 1) => {
|
|
26
|
+
export const quickSort = (array, compareFunction = (compareFunctionDefault), startID = 0, endID = array.length - 1, insertionSortThreshold = 10) => {
|
|
12
27
|
const partition = (low, high) => {
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (compareFunction(array[index_], pivot) < 0) {
|
|
19
|
-
[array[index], array[index_]] = [array[index_], array[index]];
|
|
28
|
+
const pivot = medianOfThree(array, low, Math.floor((low + high) / 2), high, compareFunction);
|
|
29
|
+
let index = low - 1;
|
|
30
|
+
let index_ = high + 1;
|
|
31
|
+
while (true) {
|
|
32
|
+
do {
|
|
20
33
|
index++;
|
|
34
|
+
} while (compareFunction(array[index], pivot) < 0);
|
|
35
|
+
do {
|
|
36
|
+
index_--;
|
|
37
|
+
} while (compareFunction(array[index_], pivot) > 0);
|
|
38
|
+
if (index >= index_) {
|
|
39
|
+
return index_;
|
|
21
40
|
}
|
|
41
|
+
[array[index], array[index_]] = [array[index_], array[index]];
|
|
22
42
|
}
|
|
23
|
-
[array[index], array[high]] = [array[high], array[index]];
|
|
24
|
-
return index;
|
|
25
43
|
};
|
|
26
44
|
const insertionSort = (low, high) => {
|
|
27
45
|
for (let index = low + 1; index <= high; index++) {
|
|
@@ -36,18 +54,18 @@ export const quickSort = (array, compareFunction = (compareFunctionDefault), sta
|
|
|
36
54
|
};
|
|
37
55
|
const sort = (low, high) => {
|
|
38
56
|
while (low < high) {
|
|
39
|
-
if (high - low <
|
|
57
|
+
if (high - low < insertionSortThreshold) {
|
|
40
58
|
insertionSort(low, high);
|
|
41
59
|
break;
|
|
42
60
|
}
|
|
43
61
|
const pi = partition(low, high);
|
|
44
62
|
if (pi - low < high - pi) {
|
|
45
|
-
sort(low, pi
|
|
63
|
+
sort(low, pi);
|
|
46
64
|
low = pi + 1;
|
|
47
65
|
}
|
|
48
66
|
else {
|
|
49
67
|
sort(pi + 1, high);
|
|
50
|
-
high = pi
|
|
68
|
+
high = pi;
|
|
51
69
|
}
|
|
52
70
|
}
|
|
53
71
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quickSort.js","sourceRoot":"","sources":["../../src/Array/quickSort.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"quickSort.js","sourceRoot":"","sources":["../../src/Array/quickSort.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quickSortSimple.js","sourceRoot":"","sources":["../../../src/Simple/Array/quickSortSimple.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"quickSortSimple.js","sourceRoot":"","sources":["../../../src/Simple/Array/quickSortSimple.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,KAAU,EACV,kBAA0C,CAAA,sBAAyB,CAAA,EACnE,OAAO,GAAG,CAAC,EACX,QAAgB,KAAK,CAAC,MAAM,GAAG,CAAC,EAC3B,EAAE;IACP,IAAI,OAAO,GAAG,CAAC,IAAI,OAAO,IAAI,KAAK,CAAC,MAAM,IAAI,OAAO,GAAG,KAAK,EAAE,CAAC;QAC9D,OAAO,GAAG,CAAC,CAAC;IACd,CAAC;IACD,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QACvC,KAAK,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;IAC3B,CAAC;IACD,OAAO,SAAS,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAC3D,CAAC,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Types, ValidateCoreReturnType, ValidateType } from "../../Validate/type";
|
|
2
|
+
export declare const array: <A extends string | number | boolean, O extends { [P in Types<A>]: (value: ValidateType<P>) => ValidateCoreReturnType<ValidateType<P>>; } = { [P_1 in Types<A>]: (value: ValidateType<P_1>) => ValidateCoreReturnType<ValidateType<P_1>>; }>(option?: O, message?: string) => (values: A[]) => ValidateCoreReturnType<A[]>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { isArray } from "../../Validate/isArray";
|
|
2
|
+
import { isNotEmpty } from "../../Validate/isNotEmpty";
|
|
3
|
+
export const array = (option = {}, message) => {
|
|
4
|
+
return (values) => {
|
|
5
|
+
if (!isArray(values)) {
|
|
6
|
+
return {
|
|
7
|
+
validate: false,
|
|
8
|
+
message: message || "",
|
|
9
|
+
type: values,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
if (isNotEmpty(option)) {
|
|
13
|
+
for (const value of values) {
|
|
14
|
+
const validater = option[typeof value];
|
|
15
|
+
if (!(validater === null || validater === void 0 ? void 0 : validater(value).validate)) {
|
|
16
|
+
return {
|
|
17
|
+
validate: false,
|
|
18
|
+
message: (validater === null || validater === void 0 ? void 0 : validater(value).message) || "",
|
|
19
|
+
type: values,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
validate: true,
|
|
26
|
+
message: "",
|
|
27
|
+
type: values,
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=core.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/Validate/array/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD,MAAM,CAAC,MAAM,KAAK,GAAG,CAYnB,SAAY,EAAO,EACnB,OAAgB,EAChB,EAAE;IACF,OAAO,CAAC,MAAW,EAA+B,EAAE;QAClD,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YACrB,OAAO;gBACL,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,OAAO,IAAI,EAAE;gBACtB,IAAI,EAAE,MAAM;aACb,CAAC;QACJ,CAAC;QACD,IAAI,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YACvB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;gBAC3B,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,KAAiB,CAAC,CAAC;gBACnD,IAAI,CAAC,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAG,KAAc,EAAE,QAAQ,CAAA,EAAE,CAAC;oBAC1C,OAAO;wBACL,QAAQ,EAAE,KAAK;wBACf,OAAO,EAAE,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAG,KAAc,EAAE,OAAO,KAAI,EAAE;wBAClD,IAAI,EAAE,MAAM;qBACb,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO;YACL,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE;YACX,IAAI,EAAE,MAAM;SACb,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./core";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Validate/array/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Types, ValidateCoreReturnType, ValidateReturnType } from "../../Validate/type";
|
|
2
|
-
export declare const core: <T>(type: Types<T>) => <O extends ValidateReturnType<T>[]>(value: T, option
|
|
2
|
+
export declare const core: <T>(type: Types<T>) => <O extends ValidateReturnType<T>[]>(value: T, option?: O, message?: string) => ValidateCoreReturnType<T>;
|
|
@@ -1 +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,
|
|
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,SAAY,EAAkB,EAC9B,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"}
|
package/module/Validate/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Validate/index.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,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"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Validate/index.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ValidateReturnType } from "../../Validate/type";
|
|
2
|
-
export declare const number: <T extends ValidateReturnType<number>[]>(option
|
|
2
|
+
export declare const number: <T extends ValidateReturnType<number>[]>(option?: T | undefined, message?: string) => (value: number) => import("../../Validate/type").ValidateCoreReturnType<number>;
|
|
@@ -1 +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,
|
|
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,MAAU,EACV,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"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ValidateCoreReturnType, ValidateType } from "../../Validate/type";
|
|
2
2
|
export declare const object: <T extends {
|
|
3
3
|
[key: string]: (value: any) => ValidateCoreReturnType<any>;
|
|
4
|
-
}>(option
|
|
4
|
+
}>(option?: T, message?: string) => (value: { [key in keyof T]: ValidateType<ReturnType<T[key]>["type"]>; }) => {
|
|
5
5
|
validate: boolean;
|
|
6
6
|
message: string;
|
|
7
|
-
type: { [
|
|
7
|
+
type: { [key_1 in keyof T]: ValidateType<ReturnType<T[key_1]>["type"]>; };
|
|
8
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/Validate/object/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAG/C,MAAM,CAAC,MAAM,MAAM,GAAG,CAMpB,
|
|
1
|
+
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/Validate/object/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAG/C,MAAM,CAAC,MAAM,MAAM,GAAG,CAMpB,SAAY,EAAO,EACnB,OAAgB,EAChB,EAAE;IACF,OAAO,CACL,KAEC,EAKD,EAAE;QACF,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YACrB,OAAO;gBACL,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,OAAO,IAAI,EAAE;gBACtB,IAAI,EAAE,KAAK;aACZ,CAAC;QACJ,CAAC;QACD,KAAK,MAAM,QAAQ,IAAI,MAAM,EAAE,CAAC;YAC9B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;gBAChD,OAAO;oBACL,QAAQ,EAAE,KAAK;oBACf,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO;oBACxC,IAAI,EAAE,KAAK;iBACZ,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO;YACL,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE;YACX,IAAI,EAAE,KAAK;SACZ,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ValidateReturnType } from "../../Validate/type";
|
|
2
|
-
export declare const string: <T extends ValidateReturnType<string>[]>(option
|
|
2
|
+
export declare const string: <T extends ValidateReturnType<string>[]>(option?: T | undefined, message?: string) => (value: string) => import("../../Validate/type").ValidateCoreReturnType<string>;
|
|
@@ -1 +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,
|
|
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,MAAU,EAAE,OAAgB,EAAE,EAAE,CACzE,CAAC,KAAa,EAAE,EAAE,CAChB,IAAI,CAAS,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC"}
|
|
@@ -1 +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"}
|
|
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,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regexMatch.js","sourceRoot":"","sources":["../../../src/Validate/string/regexMatch.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,OAAe,EACf,OAAgB,EACY,EAAE;IAC9B,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,OAAO;QACP,QAAQ,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;KACjD,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type Types<T> = T extends string ? "string" : T extends number ? "number" : T extends boolean ? "boolean" : T
|
|
1
|
+
export type Types<T> = T extends string ? "string" : T extends number ? "number" : T extends boolean ? "boolean" : T;
|
|
2
2
|
export interface ValidateCoreReturnType<T> {
|
|
3
3
|
validate: boolean;
|
|
4
4
|
message: string;
|
|
@@ -12,4 +12,4 @@ export interface ValidateReturnType<T> {
|
|
|
12
12
|
export interface ValidateFunctionType<T> {
|
|
13
13
|
(value: T): boolean;
|
|
14
14
|
}
|
|
15
|
-
export type ValidateType<T> = T extends "string" ? string : T extends "number" ? number : T extends "boolean" ? boolean : T
|
|
15
|
+
export type ValidateType<T> = T extends "string" ? string : T extends "number" ? number : T extends "boolean" ? boolean : T;
|
package/package.json
CHANGED
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "tsc && tsc-alias -p tsconfig.json",
|
|
49
|
+
"clean-build": "rm -rf module && yarn build",
|
|
49
50
|
"deploy": "yarn typedoc && gh-pages -d doc",
|
|
50
51
|
"test": "jest",
|
|
51
52
|
"test-debug": "cd test && tsc",
|
|
@@ -54,5 +55,5 @@
|
|
|
54
55
|
"format": "biome format . --write",
|
|
55
56
|
"eslint": "eslint src"
|
|
56
57
|
},
|
|
57
|
-
"version": "1.4.
|
|
58
|
-
}
|
|
58
|
+
"version": "1.4.1"
|
|
59
|
+
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ArrayWrapper = void 0;
|
|
4
|
-
const arrayMap_1 = require("./arrayMap");
|
|
5
|
-
class ArrayWrapper {
|
|
6
|
-
constructor() {
|
|
7
|
-
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
8
|
-
this.localData = [];
|
|
9
|
-
this.localArrayMap = arrayMap_1.arrayMap;
|
|
10
|
-
this.localData = [];
|
|
11
|
-
}
|
|
12
|
-
map(array, callbackfn) {
|
|
13
|
-
this.localData = this.localArrayMap(array, callbackfn);
|
|
14
|
-
return this;
|
|
15
|
-
}
|
|
16
|
-
getData() {
|
|
17
|
-
return this.localData;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.ArrayWrapper = ArrayWrapper;
|
|
21
|
-
//# sourceMappingURL=ArrayWrapper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArrayWrapper.js","sourceRoot":"","sources":["../../src/Array/ArrayWrapper.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AAEtC,MAAa,YAAY;IAIvB;QAFA,4DAA4D;QACpD,cAAS,GAAU,EAAE,CAAC;QAE5B,IAAI,CAAC,aAAa,GAAG,mBAAQ,CAAC;QAC9B,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;IACtB,CAAC;IAED,GAAG,CACD,KAAU,EACV,UAAkE;QAElE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;QACvD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;CACF;AApBD,oCAoBC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const arrayMap: <T, U>(array: T[], callbackfn: (value: T, index: number, rowArray: T[]) => U) => U[];
|
package/module/Array/arrayMap.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"arrayMap.js","sourceRoot":"","sources":["../../src/Array/arrayMap.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,KAAU,EACV,UAAkE,EAC7D,EAAE;IACP,MAAM,MAAM,GAAQ,EAAE,CAAC;IACvB,KAAK,MAAM,KAAK,IAAI,KAAK,EAAE;QACzB,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;KAC7D;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 配列を非同期に高速にソート
|
|
3
|
-
* @param {unknown[]} array 配列
|
|
4
|
-
* @param {(a: T, b: T) => number} compareFn 比較関数
|
|
5
|
-
* @param {number} startID 開始インデックス
|
|
6
|
-
* @param {number} endID 終了インデックス
|
|
7
|
-
* @returns Promise<unknown[]>
|
|
8
|
-
* @example quickSortAsync([1, 3, 2, 4, 5]); // Promise<[1, 2, 3, 4, 5]>
|
|
9
|
-
*/
|
|
10
|
-
export declare const quickSortAsync: <T>(array: T[], compareFunction?: (a: T, b: T) => number, startID?: number, endID?: number) => Promise<T[]>;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { compareFunctionDefault, quickSort } from "../../Array/quickSort";
|
|
11
|
-
/**
|
|
12
|
-
* 配列を非同期に高速にソート
|
|
13
|
-
* @param {unknown[]} array 配列
|
|
14
|
-
* @param {(a: T, b: T) => number} compareFn 比較関数
|
|
15
|
-
* @param {number} startID 開始インデックス
|
|
16
|
-
* @param {number} endID 終了インデックス
|
|
17
|
-
* @returns Promise<unknown[]>
|
|
18
|
-
* @example quickSortAsync([1, 3, 2, 4, 5]); // Promise<[1, 2, 3, 4, 5]>
|
|
19
|
-
*/
|
|
20
|
-
export const quickSortAsync = (array, compareFunction = (compareFunctionDefault), startID = 0, endID = array.length - 1) => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
|
-
return new Promise((resolve) => {
|
|
22
|
-
resolve(quickSort(array, compareFunction, startID, endID));
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
//# sourceMappingURL=quickSortAsync.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"quickSortAsync.js","sourceRoot":"","sources":["../../../src/Async/Array/quickSortAsync.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEtE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,KAAU,EACV,kBAA0C,CAAA,sBAAyB,CAAA,EACnE,OAAO,GAAG,CAAC,EACX,QAAgB,KAAK,CAAC,MAAM,GAAG,CAAC,EAClB,EAAE;IAChB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,OAAO,CAAC,SAAS,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;AACL,CAAC,CAAA,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { isPrimeNumber } from "../../Math/isPrimeNumber";
|
|
11
|
-
/**
|
|
12
|
-
* 非同期で素数判定を行う
|
|
13
|
-
* @param {number} n - 判定する数
|
|
14
|
-
* @returns {Promise<boolean>} 素数の場合はtrue、そうでない場合はfalse
|
|
15
|
-
* @example isPrimeNumberAsync(2); // Promise<true>
|
|
16
|
-
*/
|
|
17
|
-
export const isPrimeNumberAsync = (n) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
-
return new Promise((resolve) => {
|
|
19
|
-
resolve(isPrimeNumber(n));
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
//# sourceMappingURL=isPrimeNumberAsync.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isPrimeNumberAsync.js","sourceRoot":"","sources":["../../../src/Async/Math/isPrimeNumberAsync.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAO,CAAS,EAAoB,EAAE;IACtE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;AACL,CAAC,CAAA,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const exchange: <T extends object>(n: string, props?: T | undefined) => string;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.exchange = void 0;
|
|
4
|
-
const isNumber_1 = require("../isNumber");
|
|
5
|
-
const multiplication_1 = require("../multiplication");
|
|
6
|
-
// The function accepts two parameters, the first is n, a string, and the second is props, an object.
|
|
7
|
-
// props is an optional parameter.
|
|
8
|
-
const exchange = (n, props) => {
|
|
9
|
-
if (props) {
|
|
10
|
-
for (const i in props) {
|
|
11
|
-
if (n.indexOf(i) !== -1) {
|
|
12
|
-
if ((0, isNumber_1.isNumber)(props[i])) {
|
|
13
|
-
const x = (0, multiplication_1.multiplication)(Number(n.slice(i.length)), Number(props[i]));
|
|
14
|
-
if (Number.isNaN(x)) {
|
|
15
|
-
return n;
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
return String((0, multiplication_1.multiplication)(Number(n.slice(i.length)), Number(props[i])));
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
return n;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return n;
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
return n;
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
exports.exchange = exchange;
|
|
33
|
-
//# sourceMappingURL=exchange.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exchange.js","sourceRoot":"","sources":["../../../src/Math/calculator/exchange.ts"],"names":[],"mappings":";;;AAAA,0CAAuC;AACvC,sDAAmD;AACnD,qGAAqG;AACrG,kCAAkC;AAC3B,MAAM,QAAQ,GAAG,CAAmB,CAAS,EAAE,KAAS,EAAE,EAAE;IACjE,IAAI,KAAK,EAAE;QACT,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE;YACrB,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE;gBACvB,IAAI,IAAA,mBAAQ,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE;oBACtB,MAAM,CAAC,GAAG,IAAA,+BAAc,EAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBACtE,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;wBACnB,OAAO,CAAC,CAAC;qBACV;yBAAM;wBACL,OAAO,MAAM,CACX,IAAA,+BAAc,EAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAC5D,CAAC;qBACH;iBACF;aACF;iBAAM;gBACL,OAAO,CAAC,CAAC;aACV;SACF;QACD,OAAO,CAAC,CAAC;KACV;SAAM;QACL,OAAO,CAAC,CAAC;KACV;AACH,CAAC,CAAC;AAtBW,QAAA,QAAQ,YAsBnB"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 小数かどうかを判定する
|
|
3
|
-
* @param {unknown} x
|
|
4
|
-
* @param {boolean} [loose=true] - 文字列も対象にするかどうか
|
|
5
|
-
* @returns boolean
|
|
6
|
-
* @example isDouble(0.1); // true
|
|
7
|
-
* isDouble("0.1"); // true
|
|
8
|
-
* isDouble("0.1", false); // false
|
|
9
|
-
*/
|
|
10
|
-
declare function isDouble(x: unknown): x is number | string;
|
|
11
|
-
declare function isDouble(x: unknown, loose: false): x is number;
|
|
12
|
-
export { isDouble };
|
package/module/Math/isDouble.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 小数かどうかを判定する
|
|
3
|
-
* @param {unknown} x
|
|
4
|
-
* @param {boolean} [loose=true] - 文字列も対象にするかどうか
|
|
5
|
-
* @returns boolean
|
|
6
|
-
* @example isDouble(0.1); // true
|
|
7
|
-
* isDouble("0.1"); // true
|
|
8
|
-
* isDouble("0.1", false); // false
|
|
9
|
-
*/
|
|
10
|
-
function isDouble(x, loose = true) {
|
|
11
|
-
if (loose) {
|
|
12
|
-
return (
|
|
13
|
-
// biome-ignore lint/suspicious/noGlobalIsFinite: <explanation>
|
|
14
|
-
isFinite(x) &&
|
|
15
|
-
!Number.isNaN(x) &&
|
|
16
|
-
Number.isFinite(Number(x)) &&
|
|
17
|
-
!Number.isInteger(Number(x)));
|
|
18
|
-
}
|
|
19
|
-
return Number.isFinite(x) && !Number.isInteger(x);
|
|
20
|
-
}
|
|
21
|
-
export { isDouble };
|
|
22
|
-
//# sourceMappingURL=isDouble.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isDouble.js","sourceRoot":"","sources":["../../src/Math/isDouble.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,SAAS,QAAQ,CAAC,CAAU,EAAE,KAAK,GAAG,IAAI;IACxC,IAAI,KAAK,EAAE,CAAC;QACV,OAAO;QACL,+DAA+D;QAC/D,QAAQ,CAAC,CAAW,CAAC;YACrB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YAChB,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAC1B,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAC7B,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 数字かどうか
|
|
3
|
-
* @param {unknown} x
|
|
4
|
-
* @param {boolean} loose 文字列も対象にするかどうか (default: true)
|
|
5
|
-
* @returns boolean
|
|
6
|
-
* @example isNumber(0.1); // true
|
|
7
|
-
* isNumber("0.1"); // true
|
|
8
|
-
* isNumber("0.1", false); // false
|
|
9
|
-
*/
|
|
10
|
-
declare function isNumber<T extends boolean>(number: unknown, loose?: T): number is T extends true ? number | string : number;
|
|
11
|
-
export { isNumber };
|
package/module/Math/isNumber.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 数字かどうか
|
|
3
|
-
* @param {unknown} x
|
|
4
|
-
* @param {boolean} loose 文字列も対象にするかどうか (default: true)
|
|
5
|
-
* @returns boolean
|
|
6
|
-
* @example isNumber(0.1); // true
|
|
7
|
-
* isNumber("0.1"); // true
|
|
8
|
-
* isNumber("0.1", false); // false
|
|
9
|
-
*/
|
|
10
|
-
function isNumber(number, loose = true) {
|
|
11
|
-
return number !== null && typeof number !== "boolean" && loose
|
|
12
|
-
? // biome-ignore lint/suspicious/noGlobalIsFinite: <explanation>
|
|
13
|
-
isFinite(number)
|
|
14
|
-
: Number.isFinite(number);
|
|
15
|
-
}
|
|
16
|
-
export { isNumber };
|
|
17
|
-
//# sourceMappingURL=isNumber.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isNumber.js","sourceRoot":"","sources":["../../src/Math/isNumber.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,SAAS,QAAQ,CACf,MAAe,EACf,QAAW,IAAS;IAEpB,OAAO,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,SAAS,IAAI,KAAK;QAC5D,CAAC,CAAC,+DAA+D;YAC/D,QAAQ,CAAC,MAAgB,CAAC;QAC5B,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAgB,CAAC,CAAC;AACxC,CAAC;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 素数判定
|
|
3
|
-
* @param {number} n
|
|
4
|
-
* @returns boolean
|
|
5
|
-
* @example isPrimeNumber(2); // true
|
|
6
|
-
*/
|
|
7
|
-
export const isPrimeNumber = (n) => {
|
|
8
|
-
if (n <= 1) {
|
|
9
|
-
return false;
|
|
10
|
-
}
|
|
11
|
-
for (let index = 2; index <= Math.sqrt(n); index++) {
|
|
12
|
-
if (n % index === 0) {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return true;
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=isPrimeNumber.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isPrimeNumber.js","sourceRoot":"","sources":["../../src/Math/isPrimeNumber.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAS,EAAW,EAAE;IAClD,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACX,OAAO,KAAK,CAAC;IACf,CAAC;IAED,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;QACnD,IAAI,CAAC,GAAG,KAAK,KAAK,CAAC,EAAE,CAAC;YACpB,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { hoursType, hoursTypeInt } from "../../types/clockType";
|
|
2
|
-
/**
|
|
3
|
-
* 現在時刻を取得する
|
|
4
|
-
* @param timeDifference - 時差 (default: 9)
|
|
5
|
-
* @returns Date
|
|
6
|
-
* @example nowSimple(); // 2021-01-01T00:00:00.000Z
|
|
7
|
-
*/
|
|
8
|
-
export declare const nowSimple: (timeDifference?: hoursTypeInt | hoursType) => Date;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { now } from "../../Date/now";
|
|
2
|
-
import { isNumber } from "../../Validate/isNumber";
|
|
3
|
-
/**
|
|
4
|
-
* 現在時刻を取得する
|
|
5
|
-
* @param timeDifference - 時差 (default: 9)
|
|
6
|
-
* @returns Date
|
|
7
|
-
* @example nowSimple(); // 2021-01-01T00:00:00.000Z
|
|
8
|
-
*/
|
|
9
|
-
export const nowSimple = (timeDifference = 9) => {
|
|
10
|
-
if (typeof timeDifference === "number") {
|
|
11
|
-
return now(timeDifference);
|
|
12
|
-
}
|
|
13
|
-
if (isNumber(timeDifference)) {
|
|
14
|
-
return now(Number(timeDifference));
|
|
15
|
-
}
|
|
16
|
-
return now();
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=now.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"now.js","sourceRoot":"","sources":["../../../src/Simple/Date/now.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,iBAA2C,CAAC,EAAE,EAAE;IACxE,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE,CAAC;QACvC,OAAO,GAAG,CAAC,cAAc,CAAC,CAAC;IAC7B,CAAC;IACD,IAAI,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;QAC7B,OAAO,GAAG,CAAC,MAAM,CAAC,cAAc,CAAiB,CAAC,CAAC;IACrD,CAAC;IACD,OAAO,GAAG,EAAE,CAAC;AACf,CAAC,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { dayType, monType } from "../../types/dateType";
|
|
2
|
-
import { hoursTypeInt } from "../../types/clockType";
|
|
3
|
-
export interface BIRTHDAYSIMPLE {
|
|
4
|
-
<T extends monType>(birthdays: Date | `${number}-${T}-${dayType<T>}` | `${number}:${T}:${dayType<T>}` | `${number}/${T}/${dayType<T>}` | {
|
|
5
|
-
year: number;
|
|
6
|
-
mon: number;
|
|
7
|
-
day: number;
|
|
8
|
-
}, timeDifference?: hoursTypeInt): number;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* 年齢を取得する
|
|
12
|
-
* @param birthdays - 誕生日
|
|
13
|
-
* @param timeDifference - 時差 (default: 9)
|
|
14
|
-
* @returns number
|
|
15
|
-
* @example birthdaySimple("2000-01-01");
|
|
16
|
-
* birthdaySimple("2000:01:01");
|
|
17
|
-
* birthdaySimple("2000/01/01");
|
|
18
|
-
* birthdaySimple({ year: 2000, mon: 1, day: 1 });
|
|
19
|
-
* birthdaySimple(new Date(2000, 0, 1));
|
|
20
|
-
*/
|
|
21
|
-
export declare const birthdaySimple: BIRTHDAYSIMPLE;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { birthday } from "../../Tool/birthday";
|
|
2
|
-
/**
|
|
3
|
-
* 年齢を取得する
|
|
4
|
-
* @param birthdays - 誕生日
|
|
5
|
-
* @param timeDifference - 時差 (default: 9)
|
|
6
|
-
* @returns number
|
|
7
|
-
* @example birthdaySimple("2000-01-01");
|
|
8
|
-
* birthdaySimple("2000:01:01");
|
|
9
|
-
* birthdaySimple("2000/01/01");
|
|
10
|
-
* birthdaySimple({ year: 2000, mon: 1, day: 1 });
|
|
11
|
-
* birthdaySimple(new Date(2000, 0, 1));
|
|
12
|
-
*/
|
|
13
|
-
export const birthdaySimple = ((birthdays, timeDifference = 9) => {
|
|
14
|
-
if (typeof birthdays === "string") {
|
|
15
|
-
if (birthdays.includes(":")) {
|
|
16
|
-
const [year, mon, day] = birthdays.split(":").map(Number);
|
|
17
|
-
return birthday(year, mon, day, timeDifference);
|
|
18
|
-
}
|
|
19
|
-
if (birthdays.includes("/")) {
|
|
20
|
-
const [year, mon, day] = birthdays.split("/").map(Number);
|
|
21
|
-
return birthday(year, mon, day, timeDifference);
|
|
22
|
-
}
|
|
23
|
-
const [year, mon, day] = birthdays.split("-").map(Number);
|
|
24
|
-
return birthday(year, mon, day, timeDifference);
|
|
25
|
-
}
|
|
26
|
-
if (birthdays instanceof Date) {
|
|
27
|
-
return birthday(birthdays.getFullYear(), birthdays.getMonth(), birthdays.getDate(), timeDifference);
|
|
28
|
-
}
|
|
29
|
-
return birthday(birthdays.year, birthdays.mon, birthdays.day, timeDifference);
|
|
30
|
-
});
|
|
31
|
-
//# sourceMappingURL=birthday.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"birthday.js","sourceRoot":"","sources":["../../../src/Simple/Tool/birthday.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAa3C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAC7B,SAK8C,EAC9C,iBAA+B,CAAC,EAChC,EAAE;IACF,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;QAClC,IAAI,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC5B,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAIvD,CAAC;YACF,OAAO,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,cAAc,CAAC,CAAC;QAClD,CAAC;QACD,IAAI,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC5B,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAIvD,CAAC;YACF,OAAO,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,cAAc,CAAC,CAAC;QAClD,CAAC;QACD,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAIvD,CAAC;QACF,OAAO,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,cAAc,CAAC,CAAC;IAClD,CAAC;IACD,IAAI,SAAS,YAAY,IAAI,EAAE,CAAC;QAC9B,OAAO,QAAQ,CACb,SAAS,CAAC,WAAW,EAAE,EACvB,SAAS,CAAC,QAAQ,EAAgB,EAClC,SAAS,CAAC,OAAO,EAA4B,EAC7C,cAAc,CACf,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,CACb,SAAS,CAAC,IAAI,EACd,SAAS,CAAC,GAAiB,EAC3B,SAAS,CAAC,GAA6B,EACvC,cAAc,CACf,CAAC;AACJ,CAAC,CAAmB,CAAC"}
|
package/module/Tool/isArr.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const isArr: <T>(arr: unknown) => arr is T[];
|
package/module/Tool/isArr.js
DELETED
package/module/Tool/isArr.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isArr.js","sourceRoot":"","sources":["../../src/Tool/isArr.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG,CAAI,GAAY,EAAc,EAAE;IACnD,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC,CAAC"}
|
package/module/Tool/isArray.d.ts
DELETED
package/module/Tool/isArray.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isArray.js","sourceRoot":"","sources":["../../src/Tool/isArray.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAI,KAAc,EAAgB,EAAE;IACzD,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC,CAAC"}
|
package/module/Tool/isBrowser.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isBrowser.js","sourceRoot":"","sources":["../../src/Tool/isBrowser.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC"}
|
package/module/Tool/isNode.d.ts
DELETED
package/module/Tool/isNode.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isNode.js","sourceRoot":"","sources":["../../src/Tool/isNode.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GACjB,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,OAAO,KAAK,WAAW,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isNodeWebkit.js","sourceRoot":"","sources":["../../src/Tool/isNodeWebkit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,IAAI,MAAM,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* objectが空かどうかを確認する
|
|
3
|
-
* @param obj
|
|
4
|
-
* @returns {boolean} true: 空でない, false: 空
|
|
5
|
-
* @example isNotEmpty({}); // false
|
|
6
|
-
* isNotEmpty({ a: 1 }); // true
|
|
7
|
-
*/
|
|
8
|
-
export const isNotEmpty = (object) => {
|
|
9
|
-
// objectが空かどうかを確認する
|
|
10
|
-
return Object.keys(object).length > 0;
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=isNotEmpty.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isNotEmpty.js","sourceRoot":"","sources":["../../src/Tool/isNotEmpty.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAAc,EAAW,EAAE;IACpD,oBAAoB;IACpB,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AACxC,CAAC,CAAC"}
|
package/module/Tool/isObj.d.ts
DELETED
package/module/Tool/isObj.js
DELETED
package/module/Tool/isObj.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isObj.js","sourceRoot":"","sources":["../../src/Tool/isObj.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG,CACnB,GAAY,EACF,EAAE;IACZ,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AACxE,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* オブジェクトかどうかを判定する
|
|
3
|
-
* @param object
|
|
4
|
-
* @returns {boolean} true: オブジェクト, false: オブジェクトでない
|
|
5
|
-
* @example isObject({}); // true
|
|
6
|
-
* isObject([]); // false
|
|
7
|
-
*/
|
|
8
|
-
export declare const isObject: <T extends {
|
|
9
|
-
[key: string]: unknown;
|
|
10
|
-
}>(object: unknown) => object is T;
|
package/module/Tool/isObject.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* オブジェクトかどうかを判定する
|
|
3
|
-
* @param object
|
|
4
|
-
* @returns {boolean} true: オブジェクト, false: オブジェクトでない
|
|
5
|
-
* @example isObject({}); // true
|
|
6
|
-
* isObject([]); // false
|
|
7
|
-
*/
|
|
8
|
-
export const isObject = (object) => {
|
|
9
|
-
return (typeof object === "object" && object !== null && !Array.isArray(object));
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=isObject.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isObject.js","sourceRoot":"","sources":["../../src/Tool/isObject.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,MAAe,EACF,EAAE;IACf,OAAO,CACL,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CACxE,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pipeFunction = void 0;
|
|
4
|
-
const pipeFunction = (x) => ((f) => (f ? (0, exports.pipeFunction)(f(x)) : x));
|
|
5
|
-
exports.pipeFunction = pipeFunction;
|
|
6
|
-
//# sourceMappingURL=pipeFunction.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pipeFunction.js","sourceRoot":"","sources":["../../src/Tool/pipeFunction.ts"],"names":[],"mappings":";;;AAIO,MAAM,YAAY,GAAyB,CAAI,CAAI,EAAE,EAAE,CAC5D,CAAC,CAAI,CAAe,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,oBAAY,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAY,CAAC;AADvD,QAAA,YAAY,gBAC2C"}
|