umt 1.6.1 → 1.7.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.
Files changed (111) hide show
  1. package/README.md +3 -0
  2. package/module/Array/quickSort.d.ts +2 -0
  3. package/module/Array/quickSort.js +2 -0
  4. package/module/Array/quickSort.js.map +1 -1
  5. package/module/Array/shuffle.js +6 -4
  6. package/module/Array/shuffle.js.map +1 -1
  7. package/module/Color/cmykToRgba.d.ts +12 -0
  8. package/module/Color/cmykToRgba.js +41 -0
  9. package/module/Color/cmykToRgba.js.map +1 -0
  10. package/module/Color/hexaToRgba.d.ts +12 -0
  11. package/module/Color/hexaToRgba.js +20 -0
  12. package/module/Color/hexaToRgba.js.map +1 -0
  13. package/module/Color/hslaToRgba.d.ts +15 -0
  14. package/module/Color/hslaToRgba.js +76 -0
  15. package/module/Color/hslaToRgba.js.map +1 -0
  16. package/module/Color/index.d.ts +6 -0
  17. package/module/Color/index.js +7 -0
  18. package/module/Color/index.js.map +1 -0
  19. package/module/Color/rgbaToCmyk.d.ts +18 -0
  20. package/module/Color/rgbaToCmyk.js +26 -0
  21. package/module/Color/rgbaToCmyk.js.map +1 -0
  22. package/module/Color/rgbaToHexA.d.ts +12 -0
  23. package/module/Color/rgbaToHexA.js +25 -0
  24. package/module/Color/rgbaToHexA.js.map +1 -0
  25. package/module/Color/rgbaToHsla.d.ts +17 -0
  26. package/module/Color/rgbaToHsla.js +48 -0
  27. package/module/Color/rgbaToHsla.js.map +1 -0
  28. package/module/Date/birthday.d.ts +11 -0
  29. package/module/Date/birthday.js +21 -0
  30. package/module/Date/birthday.js.map +1 -0
  31. package/module/Date/dayOfWeek.d.ts +14 -0
  32. package/module/Date/dayOfWeek.js +17 -0
  33. package/module/Date/dayOfWeek.js.map +1 -0
  34. package/module/Date/index.d.ts +2 -0
  35. package/module/Date/index.js +2 -0
  36. package/module/Date/index.js.map +1 -1
  37. package/module/Math/addition.d.ts +2 -3
  38. package/module/Math/addition.js +4 -5
  39. package/module/Math/addition.js.map +1 -1
  40. package/module/Math/degToRad.js +3 -1
  41. package/module/Math/degToRad.js.map +1 -1
  42. package/module/Math/lcm.js +3 -4
  43. package/module/Math/lcm.js.map +1 -1
  44. package/module/Math/mathConverter.js +17 -28
  45. package/module/Math/mathConverter.js.map +1 -1
  46. package/module/Math/mathSeparator.js +14 -13
  47. package/module/Math/mathSeparator.js.map +1 -1
  48. package/module/Math/multiplication.d.ts +4 -5
  49. package/module/Math/multiplication.js +10 -9
  50. package/module/Math/multiplication.js.map +1 -1
  51. package/module/Math/radToDeg.js +2 -1
  52. package/module/Math/radToDeg.js.map +1 -1
  53. package/module/Math/roundOf.d.ts +1 -1
  54. package/module/Math/roundOf.js +1 -1
  55. package/module/Math/roundOf.js.map +1 -1
  56. package/module/Math/subtract.d.ts +4 -5
  57. package/module/Math/subtract.js +13 -9
  58. package/module/Math/subtract.js.map +1 -1
  59. package/module/Math/toBinary.d.ts +8 -0
  60. package/module/Math/toBinary.js +11 -0
  61. package/module/Math/toBinary.js.map +1 -0
  62. package/module/Simple/Date/birthdaySimple.d.ts +19 -0
  63. package/module/Simple/Date/birthdaySimple.js +31 -0
  64. package/module/Simple/Date/birthdaySimple.js.map +1 -0
  65. package/module/Simple/Date/dayOfWeekSimple.d.ts +20 -0
  66. package/module/Simple/Date/dayOfWeekSimple.js +34 -0
  67. package/module/Simple/Date/dayOfWeekSimple.js.map +1 -0
  68. package/module/Simple/Date/index.d.ts +2 -0
  69. package/module/Simple/Date/index.js +2 -0
  70. package/module/Simple/Date/index.js.map +1 -1
  71. package/module/Simple/Math/deviationValueSimple.d.ts +13 -0
  72. package/module/Simple/Math/deviationValueSimple.js +19 -0
  73. package/module/Simple/Math/deviationValueSimple.js.map +1 -0
  74. package/module/Simple/Math/index.d.ts +1 -0
  75. package/module/Simple/Math/index.js +2 -0
  76. package/module/Simple/Math/index.js.map +1 -0
  77. package/module/Simple/Tool/birthdaySimple.js +1 -1
  78. package/module/Simple/Tool/dayOfWeekSimple.js +1 -1
  79. package/module/Simple/index.d.ts +1 -1
  80. package/module/Simple/index.js +1 -1
  81. package/module/String/deleteSpace.d.ts +7 -0
  82. package/module/String/deleteSpace.js +10 -0
  83. package/module/String/deleteSpace.js.map +1 -0
  84. package/module/String/deleteSpaces.d.ts +7 -0
  85. package/module/String/deleteSpaces.js +10 -0
  86. package/module/String/deleteSpaces.js.map +1 -0
  87. package/module/String/index.d.ts +2 -0
  88. package/module/String/index.js +2 -0
  89. package/module/String/index.js.map +1 -1
  90. package/module/String/randomString.d.ts +1 -1
  91. package/module/String/randomString.js +1 -1
  92. package/module/String/randomString.js.map +1 -1
  93. package/module/String/randomStringInitialization.js +1 -1
  94. package/module/Tool/cmykToRgba.d.ts +12 -0
  95. package/module/Tool/cmykToRgba.js +41 -0
  96. package/module/Tool/cmykToRgba.js.map +1 -0
  97. package/module/Tool/hexToRgba.d.ts +12 -0
  98. package/module/Tool/hexToRgba.js +20 -0
  99. package/module/Tool/hexToRgba.js.map +1 -0
  100. package/module/Tool/hslaToRgba.d.ts +15 -0
  101. package/module/Tool/hslaToRgba.js +76 -0
  102. package/module/Tool/hslaToRgba.js.map +1 -0
  103. package/module/Tool/index.d.ts +0 -7
  104. package/module/Tool/index.js +0 -7
  105. package/module/Tool/index.js.map +1 -1
  106. package/module/Validate/isNode.js +8 -1
  107. package/module/Validate/isNode.js.map +1 -1
  108. package/module/index.d.ts +1 -0
  109. package/module/index.js +1 -0
  110. package/module/index.js.map +1 -1
  111. package/package.json +13 -13
@@ -1,4 +1,6 @@
1
+ import { division } from "./division";
1
2
  import { gcd } from "./gcd";
3
+ import { multiplication } from "./multiplication";
2
4
  import { valueSwap } from "./valueSwap";
3
5
  /**
4
6
  * 最小公倍数
@@ -8,13 +10,10 @@ import { valueSwap } from "./valueSwap";
8
10
  * @example lcm(2, 3); // 6
9
11
  */
10
12
  export const lcm = (x, y) => {
11
- // If either input is 0, the least common multiple is 0
12
13
  if (x === 0 || y === 0) {
13
14
  return 0;
14
15
  }
15
- // Swap the values of x and y if x is greater than y
16
16
  [x, y] = valueSwap(x, y);
17
- // The least common multiple is x times y divided by their greatest common divisor
18
- return (x / gcd(x, y)) * y;
17
+ return multiplication(division(x, gcd(x, y)), y);
19
18
  };
20
19
  //# sourceMappingURL=lcm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lcm.js","sourceRoot":"","sources":["../../src/Math/lcm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE;IAC1C,uDAAuD;IACvD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,CAAC,CAAC;IACX,CAAC;IACD,oDAAoD;IACpD,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACzB,kFAAkF;IAClF,OAAO,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAC7B,CAAC,CAAC"}
1
+ {"version":3,"file":"lcm.js","sourceRoot":"","sources":["../../src/Math/lcm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE;IAC1C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,CAAC,CAAC;IACX,CAAC;IACD,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACzB,OAAO,cAAc,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACnD,CAAC,CAAC"}
@@ -8,36 +8,25 @@ import { mathSeparator } from "./mathSeparator";
8
8
  export const mathConverter = (equation) => {
9
9
  let convertedEquation = equation;
10
10
  while (true) {
11
- if (convertedEquation.includes("^") || convertedEquation.includes("*")) {
12
- // 乗算と累乗の処理
13
- const extractedData = [
14
- convertedEquation.match(/\d+\.?(\d+)?(\*|\^)\d+\.?(\d+)?/),
15
- [""],
16
- ];
17
- if (extractedData[0]) {
18
- extractedData[1] = extractedData[0][0]
19
- .split(/(\d+\.\d+)|(\d+)/g)
20
- .filter((number_) => {
21
- return number_ !== undefined && number_ !== "";
22
- });
23
- if (extractedData[1][0] === extractedData[1][2] ||
24
- (extractedData[1][2] && extractedData[1][1] === "^")) {
25
- const [primary, remainder] = mathSeparator(extractedData[1][0]);
26
- if (primary) {
27
- convertedEquation = `${Number(extractedData[1][0]) + remainder}*${primary}+`;
28
- if (remainder <= 100) {
29
- convertedEquation += `${remainder}*${remainder}`;
30
- }
31
- else {
32
- convertedEquation += mathConverter(`${remainder}*${remainder}`);
33
- return convertedEquation;
34
- }
35
- return convertedEquation;
36
- }
37
- }
11
+ const multiplicationOrExponentiation = convertedEquation.match(/\d+\.?(\d+)?(\*|\^)\d+\.?(\d+)?/);
12
+ if (!multiplicationOrExponentiation) {
13
+ return convertedEquation;
14
+ }
15
+ const [operand1, operator, operand2] = multiplicationOrExponentiation[0].split(/(\*|\^)/);
16
+ if (operand1 === operand2 || (operand2 && operator === "^")) {
17
+ const [primary, remainder] = mathSeparator(operand1);
18
+ if (!primary) {
19
+ return convertedEquation;
38
20
  }
21
+ convertedEquation = `${Number(operand1) + remainder}*${primary}+`;
22
+ convertedEquation +=
23
+ remainder <= 100
24
+ ? `${remainder}*${remainder}`
25
+ : mathConverter(`${remainder}*${remainder}`);
26
+ }
27
+ else {
28
+ return convertedEquation;
39
29
  }
40
- return convertedEquation;
41
30
  }
42
31
  };
43
32
  //# sourceMappingURL=mathConverter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mathConverter.js","sourceRoot":"","sources":["../../src/Math/mathConverter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAgB,EAAU,EAAE;IACxD,IAAI,iBAAiB,GAAG,QAAQ,CAAC;IAEjC,OAAO,IAAI,EAAE,CAAC;QACZ,IAAI,iBAAiB,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,iBAAiB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACvE,WAAW;YACX,MAAM,aAAa,GAAwC;gBACzD,iBAAiB,CAAC,KAAK,CAAC,iCAAiC,CAAC;gBAC1D,CAAC,EAAE,CAAC;aACL,CAAC;YAEF,IAAI,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;gBACrB,aAAa,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;qBACnC,KAAK,CAAC,mBAAmB,CAAC;qBAC1B,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE;oBAClB,OAAO,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,EAAE,CAAC;gBACjD,CAAC,CAAC,CAAC;gBAEL,IACE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC3C,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC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CAAC;QAErD,IAAI,QAAQ,KAAK,QAAQ,IAAI,CAAC,QAAQ,IAAI,QAAQ,KAAK,GAAG,CAAC,EAAE,CAAC;YAC5D,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;YAErD,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,OAAO,iBAAiB,CAAC;YAC3B,CAAC;YAED,iBAAiB,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS,IAAI,OAAO,GAAG,CAAC;YAElE,iBAAiB;gBACf,SAAS,IAAI,GAAG;oBACd,CAAC,CAAC,GAAG,SAAS,IAAI,SAAS,EAAE;oBAC7B,CAAC,CAAC,aAAa,CAAC,GAAG,SAAS,IAAI,SAAS,EAAE,CAAC,CAAC;QACnD,CAAC;aAAM,CAAC;YACN,OAAO,iBAAiB,CAAC;QAC3B,CAAC;IACH,CAAC;AACH,CAAC,CAAC"}
@@ -8,21 +8,22 @@ import { isNumber } from "../Validate/isNumber";
8
8
  */
9
9
  export const mathSeparator = (number) => {
10
10
  let decimalPart = 0;
11
+ if (!isNumber(number)) {
12
+ return [0, 0];
13
+ }
11
14
  if (isDouble(number)) {
12
- const splitNumber = String(number).split(".");
13
- // 小数点部分を取得
14
- decimalPart = Number(`0.${splitNumber[1]}`);
15
- number = splitNumber[0];
15
+ const [integerPart, fractionalPart] = String(number).split(".");
16
+ decimalPart = Number(`0.${fractionalPart}`);
17
+ number = integerPart;
16
18
  }
17
- if (isNumber(number)) {
18
- const [n, x] = typeof number === "string"
19
- ? [number.length - 1, Number(number)]
20
- : [String(number).length - 1, number];
21
- if (n) {
22
- return [Math.pow(10, n), x - Math.pow(10, n) + decimalPart];
23
- }
24
- return [Number(number), 0];
19
+ const numberString = String(number);
20
+ const numberOfDigits = numberString.length - 1;
21
+ const numericalValue = Number(numberString);
22
+ if (numberOfDigits === 0) {
23
+ return [numericalValue, 0];
25
24
  }
26
- return [0, 0];
25
+ const primary = Math.pow(10, numberOfDigits);
26
+ const remainder = numericalValue - primary + decimalPart;
27
+ return [primary, remainder];
27
28
  };
28
29
  //# sourceMappingURL=mathSeparator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mathSeparator.js","sourceRoot":"","sources":["../../src/Math/mathSeparator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAuB,EAAoB,EAAE;IACzE,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACrB,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9C,WAAW;QACX,WAAW,GAAG,MAAM,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAC5C,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IAC1B,CAAC;IACD,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACrB,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GACV,OAAO,MAAM,KAAK,QAAQ;YACxB,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;YACrC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,EAAE,CAAC;YACN,OAAO,CAAC,SAAA,EAAE,EAAI,CAAC,CAAA,EAAE,CAAC,GAAG,SAAA,EAAE,EAAI,CAAC,CAAA,GAAG,WAAW,CAAC,CAAC;QAC9C,CAAC;QACD,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAA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
@@ -1,8 +1,7 @@
1
1
  /**
2
- * 誤差のない掛け算
3
- * @param {number} x
4
- * @param {number} y
2
+ * 誤差のない掛け算を任意長の引数で行う
3
+ * @param {...number[]} numbers
5
4
  * @returns number
6
- * @example multiplication(0.1, 0.2); // 0.02
5
+ * @example multiplication(0.1, 0.2, 0.3); // 0.006
7
6
  */
8
- export declare const multiplication: (x: number, y: number) => number;
7
+ export declare const multiplication: (...numbers: number[]) => number;
@@ -1,15 +1,16 @@
1
1
  import { getDecimalLength } from "./getDecimalLength";
2
2
  /**
3
- * 誤差のない掛け算
4
- * @param {number} x
5
- * @param {number} y
3
+ * 誤差のない掛け算を任意長の引数で行う
4
+ * @param {...number[]} numbers
6
5
  * @returns number
7
- * @example multiplication(0.1, 0.2); // 0.02
6
+ * @example multiplication(0.1, 0.2, 0.3); // 0.006
8
7
  */
9
- export const multiplication = (x, y) => {
10
- const n = Math.pow(10, (getDecimalLength(x) + getDecimalLength(y)));
11
- x = +`${x}`.replace(".", "");
12
- y = +`${y}`.replace(".", "");
13
- return (x * y) / n;
8
+ export const multiplication = (...numbers) => {
9
+ return numbers.reduce((accumulator, number) => {
10
+ const n = Math.pow(10, (getDecimalLength(accumulator) + getDecimalLength(number)));
11
+ const accumulatorWithoutDot = +`${accumulator}`.replace(".", "");
12
+ const numberWithoutDot = +`${number}`.replace(".", "");
13
+ return (accumulatorWithoutDot * numberWithoutDot) / n;
14
+ }, 1);
14
15
  };
15
16
  //# sourceMappingURL=multiplication.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"multiplication.js","sourceRoot":"","sources":["../../src/Math/multiplication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE;IACrD,MAAM,CAAC,GAAG,SAAA,EAAE,EAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAA,CAAC;IAC5D,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC7B,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC7B,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AACrB,CAAC,CAAC"}
1
+ {"version":3,"file":"multiplication.js","sourceRoot":"","sources":["../../src/Math/multiplication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAG,OAAiB,EAAE,EAAE;IACrD,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE;QAC5C,MAAM,CAAC,GAAG,SAAA,EAAE,EAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAA,CAAC;QAC3E,MAAM,qBAAqB,GAAG,CAAC,GAAG,WAAW,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QACjE,MAAM,gBAAgB,GAAG,CAAC,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QACvD,OAAO,CAAC,qBAAqB,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACxD,CAAC,EAAE,CAAC,CAAC,CAAC;AACR,CAAC,CAAC"}
@@ -1,8 +1,9 @@
1
+ import { division } from "./division";
1
2
  /**
2
3
  * ラジアンを角度に変換
3
4
  * @param {number} x
4
5
  * @returns number
5
6
  * @example radToDeg(Math.PI); // 180
6
7
  */
7
- export const radToDeg = (x) => x / (Math.PI / 180);
8
+ export const radToDeg = (x) => division(x, division(Math.PI, 180));
8
9
  //# sourceMappingURL=radToDeg.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"radToDeg.js","sourceRoot":"","sources":["../../src/Math/radToDeg.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC"}
1
+ {"version":3,"file":"radToDeg.js","sourceRoot":"","sources":["../../src/Math/radToDeg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC"}
@@ -5,4 +5,4 @@
5
5
  * @returns number
6
6
  * @example roundOf(1.234, 2); // 1.23
7
7
  */
8
- export declare const roundOf: (number_: number, precision: number) => number;
8
+ export declare const roundOf: (number_: number, precision?: number) => number;
@@ -5,7 +5,7 @@
5
5
  * @returns number
6
6
  * @example roundOf(1.234, 2); // 1.23
7
7
  */
8
- export const roundOf = (number_, precision) => {
8
+ export const roundOf = (number_, precision = 0) => {
9
9
  return Math.round(number_ * Math.pow(10, precision)) / Math.pow(10, precision);
10
10
  };
11
11
  //# sourceMappingURL=roundOf.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"roundOf.js","sourceRoot":"","sources":["../../src/Math/roundOf.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,OAAe,EAAE,SAAiB,EAAE,EAAE;IAC5D,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,SAAA,EAAE,EAAI,SAAS,CAAA,CAAC,GAAG,SAAA,EAAE,EAAI,SAAS,CAAA,CAAC;AACjE,CAAC,CAAC"}
1
+ {"version":3,"file":"roundOf.js","sourceRoot":"","sources":["../../src/Math/roundOf.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,OAAe,EAAE,SAAS,GAAG,CAAC,EAAE,EAAE;IACxD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,SAAA,EAAE,EAAI,SAAS,CAAA,CAAC,GAAG,SAAA,EAAE,EAAI,SAAS,CAAA,CAAC;AACjE,CAAC,CAAC"}
@@ -1,8 +1,7 @@
1
1
  /**
2
- * 誤差のない引き算
3
- * @param {number} x
4
- * @param {number} y
2
+ * 誤差のない引き算を任意長の引数で行う
3
+ * @param {number[]} numbers 引き算を行う数値の配列
5
4
  * @returns number
6
- * @example subtract(0.1, 0.2); // -0.1
5
+ * @example subtract([0.1, 0.2, 0.3]); // -0.4
7
6
  */
8
- export declare const subtract: (x: number, y: number) => number;
7
+ export declare const subtract: (...numbers: number[]) => number;
@@ -2,16 +2,20 @@ import { getDecimalLength } from "./getDecimalLength";
2
2
  import { max } from "./max";
3
3
  import { multiplication } from "./multiplication";
4
4
  /**
5
- * 誤差のない引き算
6
- * @param {number} x
7
- * @param {number} y
5
+ * 誤差のない引き算を任意長の引数で行う
6
+ * @param {number[]} numbers 引き算を行う数値の配列
8
7
  * @returns number
9
- * @example subtract(0.1, 0.2); // -0.1
8
+ * @example subtract([0.1, 0.2, 0.3]); // -0.4
10
9
  */
11
- export const subtract = (x, y) => {
12
- // 10の何乗かを取得
13
- const z = Math.pow(10, max(getDecimalLength(x), getDecimalLength(y)));
14
- // 小数点を揃えてから引き算
15
- return (multiplication(x, z) - multiplication(y, z)) / z;
10
+ export const subtract = (...numbers) => {
11
+ return numbers.reduce((accumulator, current, index) => {
12
+ if (index === 0) {
13
+ return current;
14
+ }
15
+ // 10の何乗かを取得
16
+ const z = Math.pow(10, max(getDecimalLength(accumulator), getDecimalLength(current)));
17
+ // 小数点を揃えてから引き算
18
+ return (multiplication(accumulator, z) - multiplication(current, z)) / z;
19
+ }, 0);
16
20
  };
17
21
  //# sourceMappingURL=subtract.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"subtract.js","sourceRoot":"","sources":["../../src/Math/subtract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;;;GAMG;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAE,CAAS,EAAU,EAAE;IACvD,YAAY;IACZ,MAAM,CAAC,GAAG,SAAA,EAAE,EAAI,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAA,CAAC;IAC9D,eAAe;IACf,OAAO,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAC3D,CAAC,CAAC"}
1
+ {"version":3,"file":"subtract.js","sourceRoot":"","sources":["../../src/Math/subtract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAG,OAAiB,EAAU,EAAE;IACvD,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;QACpD,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;YAChB,OAAO,OAAO,CAAC;QACjB,CAAC;QACD,YAAY;QACZ,MAAM,CAAC,GACL,SAAA,EAAE,EAAI,GAAG,CAAC,gBAAgB,CAAC,WAAW,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAA,CAAC;QACtE,eAAe;QACf,OAAO,CAAC,cAAc,CAAC,WAAW,EAAE,CAAC,CAAC,GAAG,cAAc,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAC3E,CAAC,EAAE,CAAC,CAAC,CAAC;AACR,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * n進数に変換
3
+ * @param {number} x
4
+ * @param {number} [radix=2] n進数
5
+ * @returns string
6
+ * @example toBinary(10); // "1010"
7
+ */
8
+ export declare const toBinary: (x: number, radix?: number) => string;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * n進数に変換
3
+ * @param {number} x
4
+ * @param {number} [radix=2] n進数
5
+ * @returns string
6
+ * @example toBinary(10); // "1010"
7
+ */
8
+ export const toBinary = (x, radix = 2) => {
9
+ return x.toString(radix);
10
+ };
11
+ //# sourceMappingURL=toBinary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toBinary.js","sourceRoot":"","sources":["../../src/Math/toBinary.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAE,KAAK,GAAG,CAAC,EAAE,EAAE;IAC/C,OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { hoursTypeInt } from "../../types/clockType";
2
+ import type { dayType, monType } from "../../types/dateType";
3
+ export type BIRTHDAYSIMPLE = <T extends monType>(birthdays: Date | `${number}-${T}-${dayType<T>}` | `${number}:${T}:${dayType<T>}` | `${number}/${T}/${dayType<T>}` | {
4
+ year: number;
5
+ mon: number;
6
+ day: number;
7
+ }, timeDifference?: hoursTypeInt) => number;
8
+ /**
9
+ * 年齢を取得する
10
+ * @param birthdays - 誕生日
11
+ * @param timeDifference - 時差 (default: 9)
12
+ * @returns number
13
+ * @example birthdaySimple("2000-01-01");
14
+ * birthdaySimple("2000:01:01");
15
+ * birthdaySimple("2000/01/01");
16
+ * birthdaySimple({ year: 2000, mon: 1, day: 1 });
17
+ * birthdaySimple(new Date(2000, 0, 1));
18
+ */
19
+ export declare const birthdaySimple: BIRTHDAYSIMPLE;
@@ -0,0 +1,31 @@
1
+ import { birthday } from "../../Date/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=birthdaySimple.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"birthdaySimple.js","sourceRoot":"","sources":["../../../src/Simple/Date/birthdaySimple.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAU3C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,c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AAC"}
@@ -0,0 +1,20 @@
1
+ import type { hoursTypeInt } from "../../types/clockType";
2
+ import type { MonthsWith31Days, MonthsWith31DaysInt, MonthsWithout31Days, MonthsWithout31DaysInt, convertMonTypeZero, dayType, dayTypeInt } from "../../types/dateType";
3
+ /**
4
+ * 曜日を取得する
5
+ * @param properties - 年月日
6
+ * @param timeDifference - 時差 (default: 9)
7
+ * @returns number
8
+ * @example dayOfWeekSimple("2000-01-01");
9
+ * dayOfWeekSimple("2000:01:01");
10
+ * dayOfWeekSimple("2000/01/01");
11
+ * dayOfWeekSimple({ year: 2000, mon: 1, day: 1 });
12
+ * dayOfWeekSimple(new Date(2000, 0, 1));
13
+ */
14
+ declare function dayOfWeekSimple<T extends MonthsWith31DaysInt | MonthsWithout31DaysInt>(properties?: {
15
+ year?: number;
16
+ mon?: T;
17
+ day?: dayTypeInt<T>;
18
+ }, timeDifference?: hoursTypeInt): number;
19
+ declare function dayOfWeekSimple<T extends MonthsWith31Days | MonthsWithout31Days>(properties?: `${number}-${convertMonTypeZero<T>}-${dayType<T>}` | `${number}:${convertMonTypeZero<T>}:${dayType<T>}` | `${number}/${convertMonTypeZero<T>}/${dayType<T>}` | Date, timeDifference?: hoursTypeInt): number;
20
+ export { dayOfWeekSimple };
@@ -0,0 +1,34 @@
1
+ import { dayOfWeek } from "../../Date/dayOfWeek";
2
+ function dayOfWeekSimple(properties, timeDifference = 9) {
3
+ if (typeof properties === "string") {
4
+ if (properties.includes(":")) {
5
+ const [year, mon, day] = properties
6
+ .split(":")
7
+ // biome-ignore lint/suspicious/noExplicitAny: <explanation>
8
+ .map(Number);
9
+ return dayOfWeek({ year, mon, day }, timeDifference);
10
+ }
11
+ if (properties.includes("/")) {
12
+ const [year, mon, day] = properties
13
+ .split("/")
14
+ // biome-ignore lint/suspicious/noExplicitAny: <explanation>
15
+ .map(Number);
16
+ return dayOfWeek({ year, mon, day }, timeDifference);
17
+ }
18
+ const [year, mon, day] = properties
19
+ .split("-")
20
+ // biome-ignore lint/suspicious/noExplicitAny: <explanation>
21
+ .map(Number);
22
+ return dayOfWeek({ year, mon, day }, timeDifference);
23
+ }
24
+ if (properties instanceof Date) {
25
+ return dayOfWeek({
26
+ year: properties.getFullYear(),
27
+ mon: (properties.getMonth() + 1),
28
+ day: properties.getDate(),
29
+ }, timeDifference);
30
+ }
31
+ return dayOfWeek(properties, timeDifference);
32
+ }
33
+ export { dayOfWeekSimple };
34
+ //# sourceMappingURL=dayOfWeekSimple.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dayOfWeekSimple.js","sourceRoot":"","sources":["../../../src/Simple/Date/dayOfWeekSimple.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AA8B7C,SAAS,eAAe,CAOtB,UAyBQ,EACR,iBAA+B,CAAC;IAEhC,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;QACnC,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC7B,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,UAAU;iBAChC,KAAK,CAAC,GAAG,CAAC;gBACX,4DAA4D;iBAC3D,GAAG,CAAC,MAAM,CAAQ,CAAC;YACtB,OAAO,SAAS,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,cAAc,CAAC,CAAC;QACvD,CAAC;QACD,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC7B,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,UAAU;iBAChC,KAAK,CAAC,GAAG,CAAC;gBACX,4DAA4D;iBAC3D,GAAG,CAAC,MAAM,CAAQ,CAAC;YACtB,OAAO,SAAS,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,cAAc,CAAC,CAAC;QACvD,CAAC;QACD,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,UAAU;aAChC,KAAK,CAAC,GAAG,CAAC;YACX,4DAA4D;aAC3D,GAAG,CAAC,MAAM,CAAQ,CAAC;QACtB,OAAO,SAAS,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,cAAc,CAAC,CAAC;IACvD,CAAC;IACD,IAAI,UAAU,YAAY,IAAI,EAAE,CAAC;QAC/B,OAAO,SAAS,CACd;YACE,IAAI,EAAE,UAAU,CAAC,WAAW,EAAE;YAC9B,GAAG,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,GAAG,CAAC,CAER;YACvB,GAAG,EAAE,UAAU,CAAC,OAAO,EAEtB;SACF,EACD,cAAc,CACf,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CACd,UAIC,EACD,cAAc,CACf,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -1 +1,3 @@
1
+ export * from "./birthdaySimple";
2
+ export * from "./dayOfWeekSimple";
1
3
  export * from "./nowSimple";
@@ -1,2 +1,4 @@
1
+ export * from "./birthdaySimple";
2
+ export * from "./dayOfWeekSimple";
1
3
  export * from "./nowSimple";
2
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Simple/Date/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Simple/Date/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC"}
@@ -0,0 +1,13 @@
1
+ export interface DeviationValueSimple {
2
+ (value: number, averageValue: number, standardDeviationValue: number): number;
3
+ (value: number, averageValue: number[]): number;
4
+ }
5
+ /**
6
+ * 偏差値を返す
7
+ * @param {number} value 値
8
+ * @param {number|number[]} averageValue 平均値
9
+ * @param {number} standardDeviationValue 標準偏差
10
+ * @returns number
11
+ * @example deviationValueSimple(60, 50, 10); // 110
12
+ */
13
+ export declare const deviationValueSimple: DeviationValueSimple;
@@ -0,0 +1,19 @@
1
+ import { average } from "../../Math/average";
2
+ import { deviationValue } from "../../Math/deviationValue";
3
+ import { standardDeviation } from "../../Math/standardDeviation";
4
+ /**
5
+ * 偏差値を返す
6
+ * @param {number} value 値
7
+ * @param {number|number[]} averageValue 平均値
8
+ * @param {number} standardDeviationValue 標準偏差
9
+ * @returns number
10
+ * @example deviationValueSimple(60, 50, 10); // 110
11
+ */
12
+ export const deviationValueSimple = ((value, averageValue, standardDeviationValue) => {
13
+ if (Array.isArray(averageValue)) {
14
+ const x = average(averageValue);
15
+ return deviationValue(value, x, standardDeviation(averageValue));
16
+ }
17
+ return deviationValue(value, averageValue, standardDeviationValue);
18
+ });
19
+ //# sourceMappingURL=deviationValueSimple.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deviationValueSimple.js","sourceRoot":"","sources":["../../../src/Simple/Math/deviationValueSimple.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAM7D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CACnC,KAAa,EACb,YAA+B,EAC/B,sBAA8B,EAC9B,EAAE;IACF,IAAI,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;QAChC,MAAM,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;QAChC,OAAO,cAAc,CAAC,KAAK,EAAE,CAAC,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,cAAc,CAAC,KAAK,EAAE,YAAY,EAAE,sBAAsB,CAAC,CAAC;AACrE,CAAC,CAAyB,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "./deviationValueSimple";
@@ -0,0 +1,2 @@
1
+ export * from "./deviationValueSimple";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Simple/Math/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { birthday } from "../../Tool/birthday";
1
+ import { birthday } from "../../Date/birthday";
2
2
  /**
3
3
  * 年齢を取得する
4
4
  * @param birthdays - 誕生日
@@ -1,4 +1,4 @@
1
- import { dayOfWeek } from "../../Tool/dayOfWeek";
1
+ import { dayOfWeek } from "../../Date/dayOfWeek";
2
2
  function dayOfWeekSimple(properties, timeDifference = 9) {
3
3
  if (typeof properties === "string") {
4
4
  if (properties.includes(":")) {
@@ -1,3 +1,3 @@
1
1
  export * from "./Array";
2
2
  export * from "./Date";
3
- export * from "./Tool";
3
+ export * from "./Math";
@@ -1,4 +1,4 @@
1
1
  export * from "./Array";
2
2
  export * from "./Date";
3
- export * from "./Tool";
3
+ export * from "./Math";
4
4
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 文字列からスペースを削除する
3
+ * @param char
4
+ * @returns string
5
+ * @example deleteSpace("Hello World"); // "HelloWorld"
6
+ */
7
+ export declare const deleteSpace: (char: string) => string;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * 文字列からスペースを削除する
3
+ * @param char
4
+ * @returns string
5
+ * @example deleteSpace("Hello World"); // "HelloWorld"
6
+ */
7
+ export const deleteSpace = (char) => {
8
+ return char.replaceAll(/\s/g, "");
9
+ };
10
+ //# sourceMappingURL=deleteSpace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deleteSpace.js","sourceRoot":"","sources":["../../src/String/deleteSpace.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAY,EAAE,EAAE;IAC1C,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACpC,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 文字列からスペースを削除する
3
+ * @param char
4
+ * @returns string
5
+ * @example deleteSpace("Hello World"); // "HelloWorld"
6
+ */
7
+ export declare const deleteSpaces: (string_: string) => string;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * 文字列からスペースを削除する
3
+ * @param char
4
+ * @returns string
5
+ * @example deleteSpace("Hello World"); // "HelloWorld"
6
+ */
7
+ export const deleteSpaces = (string_) => {
8
+ return string_.replaceAll(/\s/g, "");
9
+ };
10
+ //# sourceMappingURL=deleteSpaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deleteSpaces.js","sourceRoot":"","sources":["../../src/String/deleteSpaces.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAe,EAAE,EAAE;IAC9C,OAAO,OAAO,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACvC,CAAC,CAAC"}
@@ -1,3 +1,4 @@
1
+ export * from "./deleteSpaces";
1
2
  export * from "./formatString";
2
3
  export * from "./fromBase64";
3
4
  export * from "./padEnd";
@@ -6,6 +7,7 @@ export * from "./randomString";
6
7
  export * from "./randomStringInitialization";
7
8
  export * from "./reverseString";
8
9
  export * from "./toBase64";
10
+ export * from "./toHalfWidth";
9
11
  export * from "./trimCharacters";
10
12
  export * from "./trimEndCharacters";
11
13
  export * from "./trimStartCharacters";
@@ -1,3 +1,4 @@
1
+ export * from "./deleteSpaces";
1
2
  export * from "./formatString";
2
3
  export * from "./fromBase64";
3
4
  export * from "./padEnd";
@@ -6,6 +7,7 @@ export * from "./randomString";
6
7
  export * from "./randomStringInitialization";
7
8
  export * from "./reverseString";
8
9
  export * from "./toBase64";
10
+ export * from "./toHalfWidth";
9
11
  export * from "./trimCharacters";
10
12
  export * from "./trimEndCharacters";
11
13
  export * from "./trimStartCharacters";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/String/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/String/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC"}
@@ -4,4 +4,4 @@
4
4
  * @param size ランダムな文字列の長さ
5
5
  * @returns ランダムな文字列
6
6
  */
7
- export declare const randomString: (char?: string, size?: number) => string;
7
+ export declare const randomString: (size?: number, char?: string) => string;