umt 1.0.10 → 1.0.11

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 (159) hide show
  1. package/.markdownlint.json +4 -1
  2. package/README.md +11 -4
  3. package/lib/.clang-format +200 -0
  4. package/lib/1.s +259 -0
  5. package/lib/Makefile +5 -0
  6. package/lib/index.cpp +10 -0
  7. package/lib/index.s +238 -0
  8. package/module/Array/arraysJoin.d.ts +1 -2
  9. package/module/Array/arraysJoin.js +2 -1
  10. package/module/Array/getArraysCommon.d.ts +6 -0
  11. package/module/Array/getArraysCommon.js +25 -0
  12. package/module/Array/getArraysDiff.d.ts +1 -2
  13. package/module/Array/getArraysDiff.js +15 -7
  14. package/module/Array/index.d.ts +16 -5
  15. package/module/Array/index.js +54 -11
  16. package/module/Array/quickSort.d.ts +1 -2
  17. package/module/Array/quickSort.js +4 -3
  18. package/module/Array/sum.d.ts +1 -0
  19. package/module/Array/sum.js +8 -0
  20. package/module/Compiler/core.d.ts +5 -0
  21. package/module/Compiler/core.js +19 -0
  22. package/module/Compiler/token.d.ts +10 -0
  23. package/module/Compiler/token.js +120 -0
  24. package/module/Date/index.d.ts +7 -1
  25. package/module/Date/index.js +26 -5
  26. package/module/Date/now.d.ts +5 -2
  27. package/module/Date/now.js +10 -3
  28. package/module/Math/addition.d.ts +2 -2
  29. package/module/Math/addition.js +8 -9
  30. package/module/Math/average.d.ts +2 -2
  31. package/module/Math/average.js +3 -1
  32. package/module/Math/calculator/core.d.ts +1 -5
  33. package/module/Math/calculator/core.js +76 -55
  34. package/module/Math/calculator/exchange.d.ts +1 -5
  35. package/module/Math/calculator/exchange.js +16 -12
  36. package/module/Math/calculator/index.d.ts +2 -5
  37. package/module/Math/calculator/index.js +13 -8
  38. package/module/Math/calculator/literalExpression.d.ts +2 -2
  39. package/module/Math/calculator/literalExpression.js +20 -13
  40. package/module/Math/degToRad.d.ts +2 -2
  41. package/module/Math/degToRad.js +3 -1
  42. package/module/Math/deviationValue.d.ts +8 -0
  43. package/module/Math/deviationValue.js +14 -0
  44. package/module/Math/division.d.ts +7 -2
  45. package/module/Math/division.js +20 -9
  46. package/module/Math/factorial.d.ts +2 -2
  47. package/module/Math/factorial.js +10 -4
  48. package/module/Math/factorize.d.ts +2 -2
  49. package/module/Math/factorize.js +3 -1
  50. package/module/Math/gcd.d.ts +2 -2
  51. package/module/Math/gcd.js +6 -7
  52. package/module/Math/getDecimalLength.d.ts +2 -2
  53. package/module/Math/getDecimalLength.js +3 -1
  54. package/module/Math/index.d.ts +94 -33
  55. package/module/Math/index.js +278 -67
  56. package/module/Math/isDouble.d.ts +3 -2
  57. package/module/Math/isDouble.js +4 -1
  58. package/module/Math/isNumber.d.ts +3 -3
  59. package/module/Math/isNumber.js +4 -2
  60. package/module/Math/isPrimeNumber.d.ts +2 -2
  61. package/module/Math/isPrimeNumber.js +5 -6
  62. package/module/Math/lcm.d.ts +2 -2
  63. package/module/Math/lcm.js +7 -8
  64. package/module/Math/mathConverter.d.ts +5 -0
  65. package/module/Math/mathConverter.js +48 -0
  66. package/module/Math/mathSeparator.d.ts +5 -0
  67. package/module/Math/mathSeparator.js +21 -0
  68. package/module/Math/max.d.ts +1 -2
  69. package/module/Math/max.js +3 -2
  70. package/module/Math/min.d.ts +1 -2
  71. package/module/Math/min.js +3 -2
  72. package/module/Math/multiples.d.ts +1 -2
  73. package/module/Math/multiples.js +2 -1
  74. package/module/Math/multiplication.d.ts +1 -2
  75. package/module/Math/multiplication.js +4 -6
  76. package/module/Math/nCr.d.ts +1 -2
  77. package/module/Math/nCr.js +4 -6
  78. package/module/Math/nHr.d.ts +1 -2
  79. package/module/Math/nHr.js +4 -6
  80. package/module/Math/nPr.d.ts +1 -2
  81. package/module/Math/nPr.js +2 -1
  82. package/module/Math/primeFactorization.d.ts +1 -2
  83. package/module/Math/primeFactorization.js +2 -1
  84. package/module/Math/quotient.d.ts +1 -2
  85. package/module/Math/quotient.js +2 -1
  86. package/module/Math/radToDeg.d.ts +1 -2
  87. package/module/Math/radToDeg.js +2 -1
  88. package/module/Math/random.d.ts +3 -2
  89. package/module/Math/random.js +5 -2
  90. package/module/Math/reduce.d.ts +1 -2
  91. package/module/Math/reduce.js +5 -7
  92. package/module/Math/repeatedTrial.d.ts +2 -2
  93. package/module/Math/repeatedTrial.js +7 -8
  94. package/module/Math/roundOff.d.ts +7 -0
  95. package/module/Math/roundOff.js +14 -0
  96. package/module/Math/softmax.d.ts +5 -0
  97. package/module/Math/softmax.js +40 -0
  98. package/module/Math/standardDeviation.d.ts +1 -2
  99. package/module/Math/standardDeviation.js +5 -7
  100. package/module/Math/subtract.d.ts +1 -2
  101. package/module/Math/subtract.js +9 -9
  102. package/module/Math/toBinary.d.ts +5 -2
  103. package/module/Math/toBinary.js +4 -4
  104. package/module/Math/toCelsius.d.ts +1 -2
  105. package/module/Math/toCelsius.js +4 -6
  106. package/module/Math/toKelvin.d.ts +1 -2
  107. package/module/Math/toKelvin.js +4 -6
  108. package/module/Math/valueSwap.d.ts +2 -2
  109. package/module/Math/valueSwap.js +3 -1
  110. package/module/Simple/Date/index.d.ts +5 -0
  111. package/module/Simple/Date/index.js +27 -0
  112. package/module/Simple/Date/now.d.ts +1 -0
  113. package/module/Simple/Date/now.js +17 -0
  114. package/module/Simple/Math/dayOfWeek.d.ts +6 -0
  115. package/module/Simple/Math/dayOfWeek.js +31 -0
  116. package/module/Simple/Math/deviationValue.d.ts +5 -0
  117. package/module/Simple/Math/deviationValue.js +14 -0
  118. package/module/Simple/Math/index.d.ts +10 -0
  119. package/module/Simple/Math/index.js +33 -0
  120. package/module/Simple/Tool/birthday.d.ts +9 -0
  121. package/module/Simple/Tool/birthday.js +26 -0
  122. package/module/Simple/Tool/index.d.ts +5 -0
  123. package/module/Simple/Tool/index.js +27 -0
  124. package/module/Simple/index.d.ts +11 -0
  125. package/module/Simple/index.js +40 -0
  126. package/module/Tool/birthday.d.ts +8 -2
  127. package/module/Tool/birthday.js +15 -10
  128. package/module/Tool/dayOfWeek.d.ts +5 -6
  129. package/module/Tool/dayOfWeek.js +12 -2
  130. package/module/Tool/index.d.ts +18 -3
  131. package/module/Tool/index.js +58 -9
  132. package/module/Tool/isBrowser.d.ts +1 -0
  133. package/module/Tool/isBrowser.js +4 -0
  134. package/module/Tool/isNode.d.ts +1 -0
  135. package/module/Tool/isNode.js +4 -0
  136. package/module/Tool/isNodeWebkit.d.ts +1 -0
  137. package/module/Tool/isNodeWebkit.js +6 -0
  138. package/module/Tool/pipeFunction.d.ts +1 -2
  139. package/module/Tool/pipeFunction.js +3 -2
  140. package/module/index.d.ts +10 -11
  141. package/module/index.js +49 -33
  142. package/module/tsconfig.tsbuildinfo +1 -1
  143. package/module/types/int.d.ts +4 -0
  144. package/module/{Math/value.js → types/int.js} +0 -2
  145. package/module/types/logicType.d.ts +8 -0
  146. package/module/types/logicType.js +2 -0
  147. package/module/types/monType.d.ts +4 -0
  148. package/module/types/monType.js +2 -0
  149. package/package.json +18 -18
  150. package/.env +0 -1
  151. package/.github/dependabot.yml +0 -11
  152. package/.github/workflows/node.js.yml +0 -30
  153. package/module/Array/getArraysIntersect.d.ts +0 -7
  154. package/module/Array/getArraysIntersect.js +0 -15
  155. package/module/Math/euclideanAlgorithm.d.ts +0 -8
  156. package/module/Math/euclideanAlgorithm.js +0 -31
  157. package/module/Math/value.d.ts +0 -2
  158. package/sider.yml +0 -60
  159. package/test.js +0 -5
package/lib/index.s ADDED
@@ -0,0 +1,238 @@
1
+ .section __TEXT,__text,regular,pure_instructions
2
+ .build_version macos, 12, 0 sdk_version 12, 3
3
+ .globl _main ## -- Begin function main
4
+ .p2align 4, 0x90
5
+ _main: ## @main
6
+ Lfunc_begin0:
7
+ .file 1 "/Users/yuta/programming/Typescript/UMT/package/main/lib" "index.cpp"
8
+ .loc 1 1 0 ## index.cpp:1:0
9
+ .cfi_startproc
10
+ ## %bb.0:
11
+ pushq %rbp
12
+ .cfi_def_cfa_offset 16
13
+ .cfi_offset %rbp, -16
14
+ movq %rsp, %rbp
15
+ .cfi_def_cfa_register %rbp
16
+ Ltmp0:
17
+ ##DEBUG_VALUE: main:x <- [DW_OP_plus_uconst 1, DW_OP_stack_value] undef
18
+ .loc 1 9 5 prologue_end ## index.cpp:9:5
19
+ xorl %eax, %eax
20
+ popq %rbp
21
+ retq
22
+ Ltmp1:
23
+ Lfunc_end0:
24
+ .cfi_endproc
25
+ ## -- End function
26
+ .section __DWARF,__debug_abbrev,regular,debug
27
+ Lsection_abbrev:
28
+ .byte 1 ## Abbreviation Code
29
+ .byte 17 ## DW_TAG_compile_unit
30
+ .byte 1 ## DW_CHILDREN_yes
31
+ .byte 37 ## DW_AT_producer
32
+ .byte 14 ## DW_FORM_strp
33
+ .byte 19 ## DW_AT_language
34
+ .byte 5 ## DW_FORM_data2
35
+ .byte 3 ## DW_AT_name
36
+ .byte 14 ## DW_FORM_strp
37
+ .ascii "\202|" ## DW_AT_LLVM_sysroot
38
+ .byte 14 ## DW_FORM_strp
39
+ .ascii "\357\177" ## DW_AT_APPLE_sdk
40
+ .byte 14 ## DW_FORM_strp
41
+ .byte 16 ## DW_AT_stmt_list
42
+ .byte 23 ## DW_FORM_sec_offset
43
+ .byte 27 ## DW_AT_comp_dir
44
+ .byte 14 ## DW_FORM_strp
45
+ .ascii "\341\177" ## DW_AT_APPLE_optimized
46
+ .byte 25 ## DW_FORM_flag_present
47
+ .byte 17 ## DW_AT_low_pc
48
+ .byte 1 ## DW_FORM_addr
49
+ .byte 18 ## DW_AT_high_pc
50
+ .byte 6 ## DW_FORM_data4
51
+ .byte 0 ## EOM(1)
52
+ .byte 0 ## EOM(2)
53
+ .byte 2 ## Abbreviation Code
54
+ .byte 46 ## DW_TAG_subprogram
55
+ .byte 1 ## DW_CHILDREN_yes
56
+ .byte 17 ## DW_AT_low_pc
57
+ .byte 1 ## DW_FORM_addr
58
+ .byte 18 ## DW_AT_high_pc
59
+ .byte 6 ## DW_FORM_data4
60
+ .byte 64 ## DW_AT_frame_base
61
+ .byte 24 ## DW_FORM_exprloc
62
+ .byte 122 ## DW_AT_call_all_calls
63
+ .byte 25 ## DW_FORM_flag_present
64
+ .byte 3 ## DW_AT_name
65
+ .byte 14 ## DW_FORM_strp
66
+ .byte 58 ## DW_AT_decl_file
67
+ .byte 11 ## DW_FORM_data1
68
+ .byte 59 ## DW_AT_decl_line
69
+ .byte 11 ## DW_FORM_data1
70
+ .byte 73 ## DW_AT_type
71
+ .byte 19 ## DW_FORM_ref4
72
+ .byte 63 ## DW_AT_external
73
+ .byte 25 ## DW_FORM_flag_present
74
+ .ascii "\341\177" ## DW_AT_APPLE_optimized
75
+ .byte 25 ## DW_FORM_flag_present
76
+ .byte 0 ## EOM(1)
77
+ .byte 0 ## EOM(2)
78
+ .byte 3 ## Abbreviation Code
79
+ .byte 52 ## DW_TAG_variable
80
+ .byte 0 ## DW_CHILDREN_no
81
+ .byte 3 ## DW_AT_name
82
+ .byte 14 ## DW_FORM_strp
83
+ .byte 58 ## DW_AT_decl_file
84
+ .byte 11 ## DW_FORM_data1
85
+ .byte 59 ## DW_AT_decl_line
86
+ .byte 11 ## DW_FORM_data1
87
+ .byte 73 ## DW_AT_type
88
+ .byte 19 ## DW_FORM_ref4
89
+ .byte 0 ## EOM(1)
90
+ .byte 0 ## EOM(2)
91
+ .byte 4 ## Abbreviation Code
92
+ .byte 36 ## DW_TAG_base_type
93
+ .byte 0 ## DW_CHILDREN_no
94
+ .byte 3 ## DW_AT_name
95
+ .byte 14 ## DW_FORM_strp
96
+ .byte 62 ## DW_AT_encoding
97
+ .byte 11 ## DW_FORM_data1
98
+ .byte 11 ## DW_AT_byte_size
99
+ .byte 11 ## DW_FORM_data1
100
+ .byte 0 ## EOM(1)
101
+ .byte 0 ## EOM(2)
102
+ .byte 0 ## EOM(3)
103
+ .section __DWARF,__debug_info,regular,debug
104
+ Lsection_info:
105
+ Lcu_begin0:
106
+ .set Lset0, Ldebug_info_end0-Ldebug_info_start0 ## Length of Unit
107
+ .long Lset0
108
+ Ldebug_info_start0:
109
+ .short 4 ## DWARF version number
110
+ .set Lset1, Lsection_abbrev-Lsection_abbrev ## Offset Into Abbrev. Section
111
+ .long Lset1
112
+ .byte 8 ## Address Size (in bytes)
113
+ .byte 1 ## Abbrev [1] 0xb:0x54 DW_TAG_compile_unit
114
+ .long 0 ## DW_AT_producer
115
+ .short 4 ## DW_AT_language
116
+ .long 49 ## DW_AT_name
117
+ .long 59 ## DW_AT_LLVM_sysroot
118
+ .long 154 ## DW_AT_APPLE_sdk
119
+ .set Lset2, Lline_table_start0-Lsection_line ## DW_AT_stmt_list
120
+ .long Lset2
121
+ .long 165 ## DW_AT_comp_dir
122
+ ## DW_AT_APPLE_optimized
123
+ .quad Lfunc_begin0 ## DW_AT_low_pc
124
+ .set Lset3, Lfunc_end0-Lfunc_begin0 ## DW_AT_high_pc
125
+ .long Lset3
126
+ .byte 2 ## Abbrev [2] 0x32:0x25 DW_TAG_subprogram
127
+ .quad Lfunc_begin0 ## DW_AT_low_pc
128
+ .set Lset4, Lfunc_end0-Lfunc_begin0 ## DW_AT_high_pc
129
+ .long Lset4
130
+ .byte 1 ## DW_AT_frame_base
131
+ .byte 86
132
+ ## DW_AT_call_all_calls
133
+ .long 221 ## DW_AT_name
134
+ .byte 1 ## DW_AT_decl_file
135
+ .byte 1 ## DW_AT_decl_line
136
+ .long 87 ## DW_AT_type
137
+ ## DW_AT_external
138
+ ## DW_AT_APPLE_optimized
139
+ .byte 3 ## Abbrev [3] 0x4b:0xb DW_TAG_variable
140
+ .long 230 ## DW_AT_name
141
+ .byte 1 ## DW_AT_decl_file
142
+ .byte 2 ## DW_AT_decl_line
143
+ .long 87 ## DW_AT_type
144
+ .byte 0 ## End Of Children Mark
145
+ .byte 4 ## Abbrev [4] 0x57:0x7 DW_TAG_base_type
146
+ .long 226 ## DW_AT_name
147
+ .byte 5 ## DW_AT_encoding
148
+ .byte 4 ## DW_AT_byte_size
149
+ .byte 0 ## End Of Children Mark
150
+ Ldebug_info_end0:
151
+ .section __DWARF,__debug_str,regular,debug
152
+ Linfo_string:
153
+ .asciz "Apple clang version 14.0.0 (clang-1400.0.29.102)" ## string offset=0
154
+ .asciz "index.cpp" ## string offset=49
155
+ .asciz "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" ## string offset=59
156
+ .asciz "MacOSX.sdk" ## string offset=154
157
+ .asciz "/Users/yuta/programming/Typescript/UMT/package/main/lib" ## string offset=165
158
+ .asciz "main" ## string offset=221
159
+ .asciz "int" ## string offset=226
160
+ .asciz "x" ## string offset=230
161
+ .section __DWARF,__apple_names,regular,debug
162
+ Lnames_begin:
163
+ .long 1212240712 ## Header Magic
164
+ .short 1 ## Header Version
165
+ .short 0 ## Header Hash Function
166
+ .long 1 ## Header Bucket Count
167
+ .long 1 ## Header Hash Count
168
+ .long 12 ## Header Data Length
169
+ .long 0 ## HeaderData Die Offset Base
170
+ .long 1 ## HeaderData Atom Count
171
+ .short 1 ## DW_ATOM_die_offset
172
+ .short 6 ## DW_FORM_data4
173
+ .long 0 ## Bucket 0
174
+ .long 2090499946 ## Hash in Bucket 0
175
+ .set Lset5, LNames0-Lnames_begin ## Offset in Bucket 0
176
+ .long Lset5
177
+ LNames0:
178
+ .long 221 ## main
179
+ .long 1 ## Num DIEs
180
+ .long 50
181
+ .long 0
182
+ .section __DWARF,__apple_objc,regular,debug
183
+ Lobjc_begin:
184
+ .long 1212240712 ## Header Magic
185
+ .short 1 ## Header Version
186
+ .short 0 ## Header Hash Function
187
+ .long 1 ## Header Bucket Count
188
+ .long 0 ## Header Hash Count
189
+ .long 12 ## Header Data Length
190
+ .long 0 ## HeaderData Die Offset Base
191
+ .long 1 ## HeaderData Atom Count
192
+ .short 1 ## DW_ATOM_die_offset
193
+ .short 6 ## DW_FORM_data4
194
+ .long -1 ## Bucket 0
195
+ .section __DWARF,__apple_namespac,regular,debug
196
+ Lnamespac_begin:
197
+ .long 1212240712 ## Header Magic
198
+ .short 1 ## Header Version
199
+ .short 0 ## Header Hash Function
200
+ .long 1 ## Header Bucket Count
201
+ .long 0 ## Header Hash Count
202
+ .long 12 ## Header Data Length
203
+ .long 0 ## HeaderData Die Offset Base
204
+ .long 1 ## HeaderData Atom Count
205
+ .short 1 ## DW_ATOM_die_offset
206
+ .short 6 ## DW_FORM_data4
207
+ .long -1 ## Bucket 0
208
+ .section __DWARF,__apple_types,regular,debug
209
+ Ltypes_begin:
210
+ .long 1212240712 ## Header Magic
211
+ .short 1 ## Header Version
212
+ .short 0 ## Header Hash Function
213
+ .long 1 ## Header Bucket Count
214
+ .long 1 ## Header Hash Count
215
+ .long 20 ## Header Data Length
216
+ .long 0 ## HeaderData Die Offset Base
217
+ .long 3 ## HeaderData Atom Count
218
+ .short 1 ## DW_ATOM_die_offset
219
+ .short 6 ## DW_FORM_data4
220
+ .short 3 ## DW_ATOM_die_tag
221
+ .short 5 ## DW_FORM_data2
222
+ .short 4 ## DW_ATOM_type_flags
223
+ .short 11 ## DW_FORM_data1
224
+ .long 0 ## Bucket 0
225
+ .long 193495088 ## Hash in Bucket 0
226
+ .set Lset6, Ltypes0-Ltypes_begin ## Offset in Bucket 0
227
+ .long Lset6
228
+ Ltypes0:
229
+ .long 226 ## int
230
+ .long 1 ## Num DIEs
231
+ .long 87
232
+ .short 36
233
+ .byte 0
234
+ .long 0
235
+ .subsections_via_symbols
236
+ .section __DWARF,__debug_line,regular,debug
237
+ Lsection_line:
238
+ Lline_table_start0:
@@ -3,5 +3,4 @@
3
3
  * @param {any[]} array
4
4
  * @param {any[]} ...arrays
5
5
  */
6
- declare const arraysJoin: <A extends any[], B extends any[], C extends A | B>(array: A, ...arrays: B[]) => C;
7
- export default arraysJoin;
6
+ export declare const arraysJoin: <A extends any[], B extends any[], C extends A & B>(array: A, ...arrays: B[]) => C;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.arraysJoin = void 0;
3
4
  /**
4
5
  * 重複をしないで結合
5
6
  * @param {any[]} array
@@ -11,4 +12,4 @@ const arraysJoin = (array, ...arrays) => {
11
12
  }
12
13
  return [...new Set(array)];
13
14
  };
14
- exports.default = arraysJoin;
15
+ exports.arraysJoin = arraysJoin;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 共通の要素をとりだす
3
+ * @param {any[]} array
4
+ * @param {any[]} ...arrays
5
+ */
6
+ export declare const getArraysCommon: (array: any[], ...arrays: any[]) => any[];
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getArraysCommon = void 0;
4
+ /**
5
+ * 共通の要素をとりだす
6
+ * @param {any[]} array
7
+ * @param {any[]} ...arrays
8
+ */
9
+ const getArraysCommon = (array, ...arrays) => {
10
+ const result = [];
11
+ for (const i of array) {
12
+ let flag = true;
13
+ for (const j of arrays) {
14
+ if (!j.includes(i)) {
15
+ flag = false;
16
+ break;
17
+ }
18
+ }
19
+ if (flag) {
20
+ result.push(i);
21
+ }
22
+ }
23
+ return result;
24
+ };
25
+ exports.getArraysCommon = getArraysCommon;
@@ -3,5 +3,4 @@
3
3
  * @param {any[]} array
4
4
  * @param {any[]} ...arrays
5
5
  */
6
- declare const getArraysDiff: <A extends any[], B extends any[], C extends A | B>(array: A, ...arrays: B[]) => C;
7
- export default getArraysDiff;
6
+ export declare const getArraysDiff: (array: any[], ...arrays: any[]) => any[];
@@ -1,17 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getArraysDiff = void 0;
3
4
  /**
4
5
  * 共通しない要素をとりだす
5
6
  * @param {any[]} array
6
7
  * @param {any[]} ...arrays
7
8
  */
8
9
  const getArraysDiff = (array, ...arrays) => {
9
- let hasArr = [];
10
- for (const i of arrays) {
11
- hasArr.push(...i);
10
+ const result = [];
11
+ for (const i of array) {
12
+ let flag = true;
13
+ for (const j of arrays) {
14
+ if (j.includes(i)) {
15
+ flag = false;
16
+ break;
17
+ }
18
+ }
19
+ if (flag) {
20
+ result.push(i);
21
+ }
12
22
  }
13
- const arr01 = [...new Set(array)];
14
- const arr02 = [...new Set(hasArr)];
15
- return [...arr01, ...arr02].filter((value) => !arr01.includes(value) || !arr02.includes(value));
23
+ return result;
16
24
  };
17
- exports.default = getArraysDiff;
25
+ exports.getArraysDiff = getArraysDiff;
@@ -1,5 +1,16 @@
1
- import arraysJoin from './arraysJoin';
2
- import getArraysDiff from './getArraysDiff';
3
- import getArraysIntersect from './getArraysIntersect';
4
- import quickSort from './quickSort';
5
- export { arraysJoin, getArraysDiff, getArraysIntersect, quickSort };
1
+ import { arraysJoin } from './arraysJoin';
2
+ import { getArraysCommon } from './getArraysCommon';
3
+ import { getArraysDiff } from './getArraysDiff';
4
+ import { quickSort } from './quickSort';
5
+ import { sum } from './sum';
6
+ export { arraysJoin, getArraysCommon, getArraysDiff, quickSort, sum };
7
+ export declare class UMTArrayClass {
8
+ #private;
9
+ constructor();
10
+ get arraysJoin(): <A extends any[], B extends any[], C extends A & B>(array: A, ...arrays: B[]) => C;
11
+ get getArraysCommon(): (array: any[], ...arrays: any[]) => any[];
12
+ get getArraysDiff(): (array: any[], ...arrays: any[]) => any[];
13
+ get quickSort(): <A extends any[]>(array: A, startID?: number, endID?: number) => A;
14
+ get sum(): (x: number[]) => number;
15
+ }
16
+ export declare const UMT_Array: UMTArrayClass;
@@ -1,14 +1,57 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
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;
4
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 _UMTArrayClass_LocalarraysJoin, _UMTArrayClass_LocalgetArraysCommon, _UMTArrayClass_LocalgetArraysDiff, _UMTArrayClass_LocalquickSort, _UMTArrayClass_Localsum;
5
14
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.quickSort = exports.getArraysIntersect = exports.getArraysDiff = exports.arraysJoin = void 0;
7
- const arraysJoin_1 = __importDefault(require("./arraysJoin"));
8
- exports.arraysJoin = arraysJoin_1.default;
9
- const getArraysDiff_1 = __importDefault(require("./getArraysDiff"));
10
- exports.getArraysDiff = getArraysDiff_1.default;
11
- const getArraysIntersect_1 = __importDefault(require("./getArraysIntersect"));
12
- exports.getArraysIntersect = getArraysIntersect_1.default;
13
- const quickSort_1 = __importDefault(require("./quickSort"));
14
- exports.quickSort = quickSort_1.default;
15
+ exports.UMT_Array = exports.UMTArrayClass = exports.sum = exports.quickSort = exports.getArraysDiff = exports.getArraysCommon = exports.arraysJoin = void 0;
16
+ const arraysJoin_1 = require("./arraysJoin");
17
+ Object.defineProperty(exports, "arraysJoin", { enumerable: true, get: function () { return arraysJoin_1.arraysJoin; } });
18
+ const getArraysCommon_1 = require("./getArraysCommon");
19
+ Object.defineProperty(exports, "getArraysCommon", { enumerable: true, get: function () { return getArraysCommon_1.getArraysCommon; } });
20
+ const getArraysDiff_1 = require("./getArraysDiff");
21
+ Object.defineProperty(exports, "getArraysDiff", { enumerable: true, get: function () { return getArraysDiff_1.getArraysDiff; } });
22
+ const quickSort_1 = require("./quickSort");
23
+ Object.defineProperty(exports, "quickSort", { enumerable: true, get: function () { return quickSort_1.quickSort; } });
24
+ const sum_1 = require("./sum");
25
+ Object.defineProperty(exports, "sum", { enumerable: true, get: function () { return sum_1.sum; } });
26
+ class UMTArrayClass {
27
+ constructor() {
28
+ _UMTArrayClass_LocalarraysJoin.set(this, void 0);
29
+ _UMTArrayClass_LocalgetArraysCommon.set(this, void 0);
30
+ _UMTArrayClass_LocalgetArraysDiff.set(this, void 0);
31
+ _UMTArrayClass_LocalquickSort.set(this, void 0);
32
+ _UMTArrayClass_Localsum.set(this, void 0);
33
+ __classPrivateFieldSet(this, _UMTArrayClass_LocalarraysJoin, arraysJoin_1.arraysJoin, "f");
34
+ __classPrivateFieldSet(this, _UMTArrayClass_LocalgetArraysCommon, getArraysCommon_1.getArraysCommon, "f");
35
+ __classPrivateFieldSet(this, _UMTArrayClass_LocalgetArraysDiff, getArraysDiff_1.getArraysDiff, "f");
36
+ __classPrivateFieldSet(this, _UMTArrayClass_LocalquickSort, quickSort_1.quickSort, "f");
37
+ __classPrivateFieldSet(this, _UMTArrayClass_Localsum, sum_1.sum, "f");
38
+ }
39
+ get arraysJoin() {
40
+ return __classPrivateFieldGet(this, _UMTArrayClass_LocalarraysJoin, "f");
41
+ }
42
+ get getArraysCommon() {
43
+ return __classPrivateFieldGet(this, _UMTArrayClass_LocalgetArraysCommon, "f");
44
+ }
45
+ get getArraysDiff() {
46
+ return __classPrivateFieldGet(this, _UMTArrayClass_LocalgetArraysDiff, "f");
47
+ }
48
+ get quickSort() {
49
+ return __classPrivateFieldGet(this, _UMTArrayClass_LocalquickSort, "f");
50
+ }
51
+ get sum() {
52
+ return __classPrivateFieldGet(this, _UMTArrayClass_Localsum, "f");
53
+ }
54
+ }
55
+ exports.UMTArrayClass = UMTArrayClass;
56
+ _UMTArrayClass_LocalarraysJoin = new WeakMap(), _UMTArrayClass_LocalgetArraysCommon = new WeakMap(), _UMTArrayClass_LocalgetArraysDiff = new WeakMap(), _UMTArrayClass_LocalquickSort = new WeakMap(), _UMTArrayClass_Localsum = new WeakMap();
57
+ exports.UMT_Array = new UMTArrayClass();
@@ -4,5 +4,4 @@
4
4
  * @param {number} startID
5
5
  * @param {number} endID
6
6
  */
7
- declare const quickSort: <A extends any[]>(array: A, startID?: number, endID?: number) => A;
8
- export default quickSort;
7
+ export declare const quickSort: <A extends any[]>(array: A, startID?: number, endID?: number) => A;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.quickSort = void 0;
3
4
  /**
4
5
  * 配列を高速にソート
5
6
  * @param {any[]} array
@@ -27,11 +28,11 @@ const quickSort = (array, startID = 0, endID = array.length - 1) => {
27
28
  right--;
28
29
  }
29
30
  if (startID < left - 1) {
30
- quickSort(array, startID, left - 1);
31
+ (0, exports.quickSort)(array, startID, left - 1);
31
32
  }
32
33
  if (right + 1 < endID) {
33
- quickSort(array, right + 1, endID);
34
+ (0, exports.quickSort)(array, right + 1, endID);
34
35
  }
35
36
  return array;
36
37
  };
37
- exports.default = quickSort;
38
+ exports.quickSort = quickSort;
@@ -0,0 +1 @@
1
+ export declare const sum: (x: number[]) => number;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sum = void 0;
4
+ const addition_1 = require("../Math/addition");
5
+ const sum = (x) => {
6
+ return x.reduce((a, b) => (0, addition_1.addition)(a, b));
7
+ };
8
+ exports.sum = sum;
@@ -0,0 +1,5 @@
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;
@@ -0,0 +1,19 @@
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;
@@ -0,0 +1,10 @@
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
+ }[];
@@ -0,0 +1,120 @@
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;
@@ -1,2 +1,8 @@
1
- import now from './now';
1
+ import { now } from './now';
2
2
  export { now };
3
+ export declare class UMTDateClass {
4
+ #private;
5
+ constructor();
6
+ get now(): (timeDifference?: number) => Date;
7
+ }
8
+ export declare const UMT_Date: UMTDateClass;