locutus 2.0.32 → 2.0.35

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 (886) hide show
  1. package/README.md +18 -0
  2. package/_data/rosetta.yml +325 -0
  3. package/awk/builtin/index.js +5 -0
  4. package/awk/builtin/int.js +13 -0
  5. package/awk/builtin/length.js +16 -0
  6. package/awk/builtin/substr.js +23 -0
  7. package/awk/builtin/tolower.js +11 -0
  8. package/awk/builtin/toupper.js +11 -0
  9. package/c/ctype/index.js +8 -0
  10. package/c/ctype/isalnum.js +15 -0
  11. package/c/ctype/isalpha.js +17 -0
  12. package/c/ctype/isdigit.js +15 -0
  13. package/c/ctype/islower.js +15 -0
  14. package/c/ctype/isspace.js +15 -0
  15. package/c/ctype/isupper.js +15 -0
  16. package/c/ctype/tolower.js +15 -0
  17. package/c/ctype/toupper.js +15 -0
  18. package/c/index.js +2 -5
  19. package/c/math/abs.js +14 -18
  20. package/c/math/frexp.js +19 -20
  21. package/c/math/index.js +2 -5
  22. package/c/stdio/index.js +1 -4
  23. package/c/stdio/sprintf.js +71 -81
  24. package/c/stdlib/atof.js +15 -0
  25. package/c/stdlib/atoi.js +17 -0
  26. package/c/stdlib/index.js +2 -0
  27. package/c/string/index.js +5 -0
  28. package/c/string/strcat.js +12 -0
  29. package/c/string/strchr.js +15 -0
  30. package/c/string/strcmp.js +21 -0
  31. package/c/string/strlen.js +12 -0
  32. package/c/string/strstr.js +15 -0
  33. package/clojure/Math/abs.js +13 -0
  34. package/clojure/Math/ceil.js +15 -0
  35. package/clojure/Math/floor.js +14 -0
  36. package/clojure/Math/index.js +3 -0
  37. package/elixir/Float/ceil.js +16 -0
  38. package/elixir/Float/floor.js +14 -0
  39. package/elixir/Float/index.js +2 -0
  40. package/elixir/Kernel/abs.js +13 -0
  41. package/elixir/Kernel/index.js +1 -0
  42. package/golang/index.js +1 -4
  43. package/golang/strconv/Atoi.js +26 -0
  44. package/golang/strconv/FormatBool.js +12 -0
  45. package/golang/strconv/FormatInt.js +21 -0
  46. package/golang/strconv/Itoa.js +14 -0
  47. package/golang/strconv/ParseBool.js +35 -0
  48. package/golang/strconv/ParseInt.js +27 -0
  49. package/golang/strconv/index.js +6 -0
  50. package/golang/strings/Compare.js +19 -0
  51. package/golang/strings/Contains.js +7 -9
  52. package/golang/strings/ContainsAny.js +18 -0
  53. package/golang/strings/Count.js +20 -22
  54. package/golang/strings/EqualFold.js +13 -0
  55. package/golang/strings/Fields.js +12 -0
  56. package/golang/strings/HasPrefix.js +15 -0
  57. package/golang/strings/HasSuffix.js +20 -0
  58. package/golang/strings/Index.js +11 -0
  59. package/golang/strings/Index2.js +9 -11
  60. package/golang/strings/IndexAny.js +18 -0
  61. package/golang/strings/Join.js +16 -0
  62. package/golang/strings/LastIndex.js +10 -12
  63. package/golang/strings/LastIndexAny.js +18 -0
  64. package/golang/strings/Repeat.js +19 -0
  65. package/golang/strings/Replace.js +44 -0
  66. package/golang/strings/Split.js +24 -0
  67. package/golang/strings/ToLower.js +9 -0
  68. package/golang/strings/ToUpper.js +9 -0
  69. package/golang/strings/Trim.js +19 -0
  70. package/golang/strings/TrimLeft.js +15 -0
  71. package/golang/strings/TrimPrefix.js +14 -0
  72. package/golang/strings/TrimRight.js +15 -0
  73. package/golang/strings/TrimSpace.js +10 -0
  74. package/golang/strings/TrimSuffix.js +14 -0
  75. package/golang/strings/index.js +25 -7
  76. package/index.js +5 -8
  77. package/julia/Base/abs.js +13 -0
  78. package/julia/Base/ceil.js +16 -0
  79. package/julia/Base/floor.js +14 -0
  80. package/julia/Base/index.js +3 -0
  81. package/lua/math/abs.js +13 -0
  82. package/lua/math/ceil.js +16 -0
  83. package/lua/math/floor.js +14 -0
  84. package/lua/math/index.js +3 -0
  85. package/lua/string/index.js +3 -0
  86. package/lua/string/lower.js +11 -0
  87. package/lua/string/sub.js +33 -0
  88. package/lua/string/upper.js +11 -0
  89. package/package.json +37 -51
  90. package/perl/POSIX/ceil.js +16 -0
  91. package/perl/POSIX/floor.js +14 -0
  92. package/perl/POSIX/index.js +2 -0
  93. package/perl/core/index.js +1 -0
  94. package/perl/core/length.js +16 -0
  95. package/php/_helpers/_bc.js +524 -515
  96. package/php/_helpers/_phpCastString.js +20 -25
  97. package/php/_helpers/_php_cast_float.js +5 -10
  98. package/php/_helpers/_php_cast_int.js +6 -11
  99. package/php/_helpers/index.js +4 -7
  100. package/php/array/array_change_key_case.js +11 -16
  101. package/php/array/array_chunk.js +20 -23
  102. package/php/array/array_column.js +22 -72
  103. package/php/array/array_combine.js +13 -18
  104. package/php/array/array_count_values.js +35 -39
  105. package/php/array/array_diff.js +11 -14
  106. package/php/array/array_diff_assoc.js +11 -14
  107. package/php/array/array_diff_key.js +11 -14
  108. package/php/array/array_diff_uassoc.js +15 -19
  109. package/php/array/array_diff_ukey.js +14 -17
  110. package/php/array/array_fill.js +11 -13
  111. package/php/array/array_fill_keys.js +5 -8
  112. package/php/array/array_filter.js +12 -13
  113. package/php/array/array_flip.js +13 -15
  114. package/php/array/array_intersect.js +13 -16
  115. package/php/array/array_intersect_assoc.js +13 -16
  116. package/php/array/array_intersect_key.js +15 -18
  117. package/php/array/array_intersect_uassoc.js +17 -20
  118. package/php/array/array_intersect_ukey.js +17 -20
  119. package/php/array/array_key_exists.js +4 -7
  120. package/php/array/array_keys.js +22 -24
  121. package/php/array/array_map.js +24 -29
  122. package/php/array/array_merge.js +22 -25
  123. package/php/array/array_merge_recursive.js +51 -27
  124. package/php/array/array_multisort.js +138 -130
  125. package/php/array/array_pad.js +24 -26
  126. package/php/array/array_pop.js +10 -13
  127. package/php/array/array_product.js +15 -17
  128. package/php/array/array_push.js +16 -19
  129. package/php/array/array_rand.js +11 -14
  130. package/php/array/array_reduce.js +11 -14
  131. package/php/array/array_replace.js +9 -12
  132. package/php/array/array_replace_recursive.js +20 -24
  133. package/php/array/array_reverse.js +12 -15
  134. package/php/array/array_search.js +27 -29
  135. package/php/array/array_shift.js +3 -6
  136. package/php/array/array_slice.js +37 -39
  137. package/php/array/array_splice.js +64 -69
  138. package/php/array/array_sum.js +7 -12
  139. package/php/array/array_udiff.js +14 -17
  140. package/php/array/array_udiff_assoc.js +14 -17
  141. package/php/array/array_udiff_uassoc.js +17 -20
  142. package/php/array/array_uintersect.js +16 -19
  143. package/php/array/array_uintersect_uassoc.js +18 -21
  144. package/php/array/array_unique.js +12 -15
  145. package/php/array/array_unshift.js +4 -7
  146. package/php/array/array_values.js +11 -13
  147. package/php/array/array_walk.js +10 -15
  148. package/php/array/array_walk_recursive.js +15 -20
  149. package/php/array/arsort.js +50 -52
  150. package/php/array/asort.js +50 -51
  151. package/php/array/count.js +15 -14
  152. package/php/array/current.js +30 -32
  153. package/php/array/each.js +32 -35
  154. package/php/array/end.js +27 -30
  155. package/php/array/in_array.js +7 -10
  156. package/php/array/index.js +73 -76
  157. package/php/array/key.js +32 -34
  158. package/php/array/krsort.js +50 -51
  159. package/php/array/ksort.js +50 -51
  160. package/php/array/natcasesort.js +37 -38
  161. package/php/array/natsort.js +35 -36
  162. package/php/array/next.js +34 -36
  163. package/php/array/pos.js +10 -12
  164. package/php/array/prev.js +32 -34
  165. package/php/array/range.js +30 -33
  166. package/php/array/reset.js +24 -27
  167. package/php/array/rsort.js +47 -49
  168. package/php/array/shuffle.js +16 -18
  169. package/php/array/sizeof.js +3 -6
  170. package/php/array/sort.js +43 -45
  171. package/php/array/uasort.js +19 -21
  172. package/php/array/uksort.js +22 -24
  173. package/php/array/usort.js +20 -22
  174. package/php/bc/bcadd.js +16 -19
  175. package/php/bc/bccomp.js +12 -15
  176. package/php/bc/bcdiv.js +17 -20
  177. package/php/bc/bcmul.js +16 -19
  178. package/php/bc/bcround.js +21 -24
  179. package/php/bc/bcscale.js +8 -11
  180. package/php/bc/bcsub.js +16 -19
  181. package/php/bc/index.js +7 -10
  182. package/php/ctype/ctype_alnum.js +14 -16
  183. package/php/ctype/ctype_alpha.js +14 -16
  184. package/php/ctype/ctype_cntrl.js +9 -12
  185. package/php/ctype/ctype_digit.js +14 -16
  186. package/php/ctype/ctype_graph.js +14 -16
  187. package/php/ctype/ctype_lower.js +14 -16
  188. package/php/ctype/ctype_print.js +14 -16
  189. package/php/ctype/ctype_punct.js +14 -16
  190. package/php/ctype/ctype_space.js +9 -12
  191. package/php/ctype/ctype_upper.js +14 -16
  192. package/php/ctype/ctype_xdigit.js +14 -16
  193. package/php/ctype/index.js +11 -14
  194. package/php/datetime/checkdate.js +15 -17
  195. package/php/datetime/date.js +142 -123
  196. package/php/datetime/date_parse.js +18 -21
  197. package/php/datetime/getdate.js +38 -24
  198. package/php/datetime/gettimeofday.js +7 -10
  199. package/php/datetime/gmdate.js +17 -16
  200. package/php/datetime/gmmktime.js +23 -25
  201. package/php/datetime/gmstrftime.js +17 -14
  202. package/php/datetime/idate.js +44 -38
  203. package/php/datetime/index.js +15 -18
  204. package/php/datetime/microtime.js +11 -14
  205. package/php/datetime/mktime.js +14 -17
  206. package/php/datetime/strftime.js +122 -113
  207. package/php/datetime/strptime.js +210 -191
  208. package/php/datetime/strtotime.js +615 -496
  209. package/php/datetime/time.js +11 -13
  210. package/php/exec/escapeshellarg.js +16 -18
  211. package/php/exec/index.js +1 -4
  212. package/php/filesystem/basename.js +22 -24
  213. package/php/filesystem/dirname.js +12 -14
  214. package/php/filesystem/file_exists.js +9 -11
  215. package/php/filesystem/file_get_contents.js +3 -6
  216. package/php/filesystem/index.js +6 -9
  217. package/php/filesystem/pathinfo.js +47 -46
  218. package/php/filesystem/realpath.js +16 -19
  219. package/php/funchand/call_user_func.js +4 -7
  220. package/php/funchand/call_user_func_array.js +19 -22
  221. package/php/funchand/create_function.js +4 -7
  222. package/php/funchand/function_exists.js +4 -8
  223. package/php/funchand/get_defined_functions.js +25 -32
  224. package/php/funchand/index.js +5 -8
  225. package/php/i18n/i18n_loc_get_default.js +7 -10
  226. package/php/i18n/i18n_loc_set_default.js +12 -15
  227. package/php/i18n/index.js +2 -5
  228. package/php/index.js +20 -23
  229. package/php/info/assert_options.js +25 -27
  230. package/php/info/getenv.js +8 -10
  231. package/php/info/index.js +6 -9
  232. package/php/info/ini_get.js +9 -12
  233. package/php/info/ini_set.js +32 -34
  234. package/php/info/set_time_limit.js +8 -11
  235. package/php/info/version_compare.js +43 -44
  236. package/php/json/index.js +3 -6
  237. package/php/json/json_decode.js +42 -28
  238. package/php/json/json_encode.js +89 -66
  239. package/php/json/json_last_error.js +11 -13
  240. package/php/math/abs.js +2 -5
  241. package/php/math/acos.js +2 -5
  242. package/php/math/acosh.js +7 -9
  243. package/php/math/asin.js +2 -5
  244. package/php/math/asinh.js +7 -9
  245. package/php/math/atan.js +7 -9
  246. package/php/math/atan2.js +7 -9
  247. package/php/math/atanh.js +2 -5
  248. package/php/math/base_convert.js +8 -10
  249. package/php/math/bindec.js +12 -14
  250. package/php/math/ceil.js +7 -9
  251. package/php/math/cos.js +7 -9
  252. package/php/math/cosh.js +7 -9
  253. package/php/math/decbin.js +16 -18
  254. package/php/math/dechex.js +3 -6
  255. package/php/math/decoct.js +13 -15
  256. package/php/math/deg2rad.js +8 -10
  257. package/php/math/exp.js +7 -9
  258. package/php/math/expm1.js +9 -11
  259. package/php/math/floor.js +7 -9
  260. package/php/math/fmod.js +27 -29
  261. package/php/math/getrandmax.js +7 -9
  262. package/php/math/hexdec.js +10 -12
  263. package/php/math/hypot.js +8 -11
  264. package/php/math/index.js +46 -49
  265. package/php/math/is_finite.js +9 -14
  266. package/php/math/is_infinite.js +9 -14
  267. package/php/math/is_nan.js +8 -13
  268. package/php/math/lcg_value.js +8 -10
  269. package/php/math/log.js +8 -10
  270. package/php/math/log10.js +12 -14
  271. package/php/math/log1p.js +15 -17
  272. package/php/math/max.js +54 -59
  273. package/php/math/min.js +54 -59
  274. package/php/math/mt_getrandmax.js +7 -9
  275. package/php/math/mt_rand.js +15 -17
  276. package/php/math/octdec.js +8 -10
  277. package/php/math/pi.js +2 -5
  278. package/php/math/pow.js +2 -5
  279. package/php/math/rad2deg.js +8 -10
  280. package/php/math/rand.js +15 -17
  281. package/php/math/round.js +48 -49
  282. package/php/math/sin.js +7 -9
  283. package/php/math/sinh.js +7 -9
  284. package/php/math/sqrt.js +7 -9
  285. package/php/math/tan.js +7 -9
  286. package/php/math/tanh.js +8 -10
  287. package/php/misc/index.js +2 -5
  288. package/php/misc/pack.js +173 -165
  289. package/php/misc/uniqid.js +20 -23
  290. package/php/net-gopher/gopher_parsedir.js +27 -29
  291. package/php/net-gopher/index.js +1 -4
  292. package/php/network/index.js +6 -9
  293. package/php/network/inet_ntop.js +15 -15
  294. package/php/network/inet_pton.js +30 -34
  295. package/php/network/ip2long.js +25 -15
  296. package/php/network/long2ip.js +8 -10
  297. package/php/network/setcookie.js +11 -13
  298. package/php/network/setrawcookie.js +16 -19
  299. package/php/pcre/index.js +4 -7
  300. package/php/pcre/preg_match.js +3 -6
  301. package/php/pcre/preg_quote.js +2 -5
  302. package/php/pcre/preg_replace.js +8 -11
  303. package/php/pcre/sql_regcase.js +17 -20
  304. package/php/strings/addcslashes.js +86 -88
  305. package/php/strings/addslashes.js +15 -16
  306. package/php/strings/bin2hex.js +19 -43
  307. package/php/strings/chop.js +8 -10
  308. package/php/strings/chr.js +12 -14
  309. package/php/strings/chunk_split.js +15 -17
  310. package/php/strings/convert_cyr_string.js +137 -50
  311. package/php/strings/convert_uuencode.js +35 -38
  312. package/php/strings/count_chars.js +29 -27
  313. package/php/strings/crc32.js +276 -21
  314. package/php/strings/echo.js +28 -30
  315. package/php/strings/explode.js +31 -26
  316. package/php/strings/get_html_translation_table.js +123 -122
  317. package/php/strings/hex2bin.js +21 -21
  318. package/php/strings/html_entity_decode.js +31 -33
  319. package/php/strings/htmlentities.js +38 -34
  320. package/php/strings/htmlspecialchars.js +20 -23
  321. package/php/strings/htmlspecialchars_decode.js +19 -21
  322. package/php/strings/implode.js +23 -27
  323. package/php/strings/index.js +91 -94
  324. package/php/strings/join.js +8 -10
  325. package/php/strings/lcfirst.js +9 -11
  326. package/php/strings/levenshtein.js +37 -39
  327. package/php/strings/localeconv.js +12 -15
  328. package/php/strings/ltrim.js +12 -14
  329. package/php/strings/md5.js +216 -223
  330. package/php/strings/md5_file.js +17 -19
  331. package/php/strings/metaphone.js +112 -117
  332. package/php/strings/money_format.js +139 -126
  333. package/php/strings/nl2br.js +24 -26
  334. package/php/strings/nl_langinfo.js +32 -35
  335. package/php/strings/number_format.js +19 -22
  336. package/php/strings/ord.js +19 -21
  337. package/php/strings/parse_str.js +53 -56
  338. package/php/strings/printf.js +6 -9
  339. package/php/strings/quoted_printable_decode.js +7 -10
  340. package/php/strings/quoted_printable_encode.js +19 -20
  341. package/php/strings/quotemeta.js +7 -9
  342. package/php/strings/rtrim.js +14 -16
  343. package/php/strings/setlocale.js +148 -104
  344. package/php/strings/sha1.js +108 -106
  345. package/php/strings/sha1_file.js +15 -17
  346. package/php/strings/similar_text.js +34 -33
  347. package/php/strings/soundex.js +34 -36
  348. package/php/strings/split.js +8 -10
  349. package/php/strings/sprintf.js +112 -114
  350. package/php/strings/sscanf.js +99 -96
  351. package/php/strings/str_getcsv.js +37 -32
  352. package/php/strings/str_ireplace.js +50 -55
  353. package/php/strings/str_pad.js +18 -21
  354. package/php/strings/str_repeat.js +14 -16
  355. package/php/strings/str_replace.js +32 -37
  356. package/php/strings/str_rot13.js +15 -17
  357. package/php/strings/str_shuffle.js +12 -15
  358. package/php/strings/str_split.js +19 -21
  359. package/php/strings/str_word_count.js +51 -50
  360. package/php/strings/strcasecmp.js +12 -14
  361. package/php/strings/strchr.js +10 -12
  362. package/php/strings/strcmp.js +12 -14
  363. package/php/strings/strcoll.js +9 -12
  364. package/php/strings/strcspn.js +30 -25
  365. package/php/strings/strip_tags.js +50 -52
  366. package/php/strings/stripos.js +12 -14
  367. package/php/strings/stripslashes.js +8 -10
  368. package/php/strings/stristr.js +15 -17
  369. package/php/strings/strlen.js +23 -26
  370. package/php/strings/strnatcasecmp.js +6 -8
  371. package/php/strings/strnatcmp.js +47 -46
  372. package/php/strings/strncasecmp.js +30 -32
  373. package/php/strings/strncmp.js +5 -7
  374. package/php/strings/strpbrk.js +12 -14
  375. package/php/strings/strpos.js +11 -13
  376. package/php/strings/strrchr.js +7 -10
  377. package/php/strings/strrev.js +188 -10
  378. package/php/strings/strripos.js +16 -18
  379. package/php/strings/strrpos.js +20 -22
  380. package/php/strings/strspn.js +24 -26
  381. package/php/strings/strstr.js +20 -22
  382. package/php/strings/strtok.js +14 -16
  383. package/php/strings/strtolower.js +8 -10
  384. package/php/strings/strtoupper.js +8 -10
  385. package/php/strings/strtr.js +38 -43
  386. package/php/strings/substr.js +14 -18
  387. package/php/strings/substr_compare.js +18 -20
  388. package/php/strings/substr_count.js +11 -14
  389. package/php/strings/substr_replace.js +5 -8
  390. package/php/strings/trim.js +53 -32
  391. package/php/strings/ucfirst.js +11 -13
  392. package/php/strings/ucwords.js +3 -6
  393. package/php/strings/vprintf.js +6 -9
  394. package/php/strings/vsprintf.js +8 -10
  395. package/php/strings/wordwrap.js +32 -35
  396. package/php/url/base64_decode.js +42 -40
  397. package/php/url/base64_encode.js +51 -53
  398. package/php/url/http_build_query.js +27 -32
  399. package/php/url/index.js +8 -11
  400. package/php/url/parse_url.js +61 -25
  401. package/php/url/rawurldecode.js +8 -8
  402. package/php/url/rawurlencode.js +9 -6
  403. package/php/url/urldecode.js +9 -8
  404. package/php/url/urlencode.js +11 -6
  405. package/php/var/boolval.js +31 -33
  406. package/php/var/doubleval.js +10 -12
  407. package/php/var/empty.js +11 -16
  408. package/php/var/floatval.js +13 -15
  409. package/php/var/gettype.js +22 -23
  410. package/php/var/index.js +30 -33
  411. package/php/var/intval.js +35 -39
  412. package/php/var/is_array.js +27 -31
  413. package/php/var/is_binary.js +2 -5
  414. package/php/var/is_bool.js +10 -12
  415. package/php/var/is_buffer.js +2 -5
  416. package/php/var/is_callable.js +34 -35
  417. package/php/var/is_double.js +10 -12
  418. package/php/var/is_float.js +12 -14
  419. package/php/var/is_int.js +20 -22
  420. package/php/var/is_integer.js +12 -14
  421. package/php/var/is_long.js +3 -6
  422. package/php/var/is_null.js +9 -11
  423. package/php/var/is_numeric.js +30 -6
  424. package/php/var/is_object.js +4 -9
  425. package/php/var/is_real.js +3 -6
  426. package/php/var/is_scalar.js +2 -8
  427. package/php/var/is_string.js +9 -11
  428. package/php/var/is_unicode.js +12 -15
  429. package/php/var/isset.js +9 -12
  430. package/php/var/print_r.js +49 -53
  431. package/php/var/serialize.js +47 -52
  432. package/php/var/serialize.vitest.ts +10 -0
  433. package/php/var/strval.js +10 -13
  434. package/php/var/unserialize.js +168 -202
  435. package/php/var/var_dump.js +105 -104
  436. package/php/var/var_export.js +64 -66
  437. package/php/xdiff/index.js +2 -5
  438. package/php/xdiff/xdiff_string_diff.js +240 -226
  439. package/php/xdiff/xdiff_string_patch.js +98 -93
  440. package/php/xml/index.js +2 -5
  441. package/php/xml/utf8_decode.js +40 -42
  442. package/php/xml/utf8_encode.js +40 -42
  443. package/python/index.js +1 -4
  444. package/python/math/ceil.js +17 -0
  445. package/python/math/exp.js +12 -0
  446. package/python/math/fabs.js +14 -0
  447. package/python/math/factorial.js +29 -0
  448. package/python/math/floor.js +14 -0
  449. package/python/math/gcd.js +23 -0
  450. package/python/math/index.js +15 -0
  451. package/python/math/isfinite.js +14 -0
  452. package/python/math/isinf.js +14 -0
  453. package/python/math/isnan.js +14 -0
  454. package/python/math/log.js +16 -0
  455. package/python/math/log10.js +14 -0
  456. package/python/math/log2.js +14 -0
  457. package/python/math/pow.js +14 -0
  458. package/python/math/sqrt.js +14 -0
  459. package/python/math/trunc.js +14 -0
  460. package/python/string/ascii_letters.js +14 -14
  461. package/python/string/ascii_lowercase.js +12 -16
  462. package/python/string/ascii_uppercase.js +12 -16
  463. package/python/string/capwords.js +4 -7
  464. package/python/string/digits.js +10 -0
  465. package/python/string/hexdigits.js +10 -0
  466. package/python/string/index.js +10 -8
  467. package/python/string/octdigits.js +10 -0
  468. package/python/string/printable.js +15 -0
  469. package/python/string/punctuation.js +5 -7
  470. package/python/string/whitespace.js +10 -0
  471. package/r/base/abs.js +13 -0
  472. package/r/base/ceiling.js +16 -0
  473. package/r/base/floor.js +14 -0
  474. package/r/base/index.js +3 -0
  475. package/ruby/Array/compact.js +18 -0
  476. package/ruby/Array/first.js +22 -0
  477. package/ruby/Array/flatten.js +22 -0
  478. package/ruby/Array/index.js +6 -0
  479. package/ruby/Array/last.js +22 -0
  480. package/ruby/Array/sample.js +31 -0
  481. package/ruby/Array/uniq.js +16 -0
  482. package/ruby/Math/acos.js +2 -5
  483. package/ruby/Math/asin.js +11 -0
  484. package/ruby/Math/atan.js +11 -0
  485. package/ruby/Math/cbrt.js +13 -0
  486. package/ruby/Math/cos.js +12 -0
  487. package/ruby/Math/cosh.js +11 -0
  488. package/ruby/Math/exp.js +11 -0
  489. package/ruby/Math/index.js +15 -4
  490. package/ruby/Math/log.js +11 -0
  491. package/ruby/Math/log10.js +13 -0
  492. package/ruby/Math/log2.js +13 -0
  493. package/ruby/Math/sin.js +12 -0
  494. package/ruby/Math/sinh.js +11 -0
  495. package/ruby/Math/sqrt.js +13 -0
  496. package/ruby/Math/tan.js +11 -0
  497. package/ruby/Math/tanh.js +11 -0
  498. package/ruby/String/capitalize.js +19 -0
  499. package/ruby/String/chomp.js +27 -0
  500. package/ruby/String/chop.js +25 -0
  501. package/ruby/String/downcase.js +10 -0
  502. package/ruby/String/end_with.js +17 -0
  503. package/ruby/String/include.js +12 -0
  504. package/ruby/String/index.js +11 -0
  505. package/ruby/String/length.js +12 -0
  506. package/ruby/String/reverse.js +12 -0
  507. package/ruby/String/start_with.js +14 -0
  508. package/ruby/String/strip.js +12 -0
  509. package/ruby/String/upcase.js +10 -0
  510. package/ruby/index.js +1 -4
  511. package/_util/cli.js +0 -14
  512. package/_util/cli.js.map +0 -1
  513. package/_util/util.js +0 -620
  514. package/_util/util.js.map +0 -1
  515. package/c/index.js.map +0 -1
  516. package/c/math/abs.js.map +0 -1
  517. package/c/math/frexp.js.map +0 -1
  518. package/c/math/index.js.map +0 -1
  519. package/c/stdio/index.js.map +0 -1
  520. package/c/stdio/sprintf.js.map +0 -1
  521. package/golang/index.js.map +0 -1
  522. package/golang/strings/Contains.js.map +0 -1
  523. package/golang/strings/Count.js.map +0 -1
  524. package/golang/strings/Index2.js.map +0 -1
  525. package/golang/strings/LastIndex.js.map +0 -1
  526. package/golang/strings/index.js.map +0 -1
  527. package/index.js.map +0 -1
  528. package/php/_helpers/_bc.js.map +0 -1
  529. package/php/_helpers/_phpCastString.js.map +0 -1
  530. package/php/_helpers/_php_cast_float.js.map +0 -1
  531. package/php/_helpers/_php_cast_int.js.map +0 -1
  532. package/php/_helpers/index.js.map +0 -1
  533. package/php/array/array_change_key_case.js.map +0 -1
  534. package/php/array/array_chunk.js.map +0 -1
  535. package/php/array/array_column.js.map +0 -1
  536. package/php/array/array_combine.js.map +0 -1
  537. package/php/array/array_count_values.js.map +0 -1
  538. package/php/array/array_diff.js.map +0 -1
  539. package/php/array/array_diff_assoc.js.map +0 -1
  540. package/php/array/array_diff_key.js.map +0 -1
  541. package/php/array/array_diff_uassoc.js.map +0 -1
  542. package/php/array/array_diff_ukey.js.map +0 -1
  543. package/php/array/array_fill.js.map +0 -1
  544. package/php/array/array_fill_keys.js.map +0 -1
  545. package/php/array/array_filter.js.map +0 -1
  546. package/php/array/array_flip.js.map +0 -1
  547. package/php/array/array_intersect.js.map +0 -1
  548. package/php/array/array_intersect_assoc.js.map +0 -1
  549. package/php/array/array_intersect_key.js.map +0 -1
  550. package/php/array/array_intersect_uassoc.js.map +0 -1
  551. package/php/array/array_intersect_ukey.js.map +0 -1
  552. package/php/array/array_key_exists.js.map +0 -1
  553. package/php/array/array_keys.js.map +0 -1
  554. package/php/array/array_map.js.map +0 -1
  555. package/php/array/array_merge.js.map +0 -1
  556. package/php/array/array_merge_recursive.js.map +0 -1
  557. package/php/array/array_multisort.js.map +0 -1
  558. package/php/array/array_pad.js.map +0 -1
  559. package/php/array/array_pop.js.map +0 -1
  560. package/php/array/array_product.js.map +0 -1
  561. package/php/array/array_push.js.map +0 -1
  562. package/php/array/array_rand.js.map +0 -1
  563. package/php/array/array_reduce.js.map +0 -1
  564. package/php/array/array_replace.js.map +0 -1
  565. package/php/array/array_replace_recursive.js.map +0 -1
  566. package/php/array/array_reverse.js.map +0 -1
  567. package/php/array/array_search.js.map +0 -1
  568. package/php/array/array_shift.js.map +0 -1
  569. package/php/array/array_slice.js.map +0 -1
  570. package/php/array/array_splice.js.map +0 -1
  571. package/php/array/array_sum.js.map +0 -1
  572. package/php/array/array_udiff.js.map +0 -1
  573. package/php/array/array_udiff_assoc.js.map +0 -1
  574. package/php/array/array_udiff_uassoc.js.map +0 -1
  575. package/php/array/array_uintersect.js.map +0 -1
  576. package/php/array/array_uintersect_uassoc.js.map +0 -1
  577. package/php/array/array_unique.js.map +0 -1
  578. package/php/array/array_unshift.js.map +0 -1
  579. package/php/array/array_values.js.map +0 -1
  580. package/php/array/array_walk.js.map +0 -1
  581. package/php/array/array_walk_recursive.js.map +0 -1
  582. package/php/array/arsort.js.map +0 -1
  583. package/php/array/asort.js.map +0 -1
  584. package/php/array/count.js.map +0 -1
  585. package/php/array/current.js.map +0 -1
  586. package/php/array/each.js.map +0 -1
  587. package/php/array/end.js.map +0 -1
  588. package/php/array/in_array.js.map +0 -1
  589. package/php/array/index.js.map +0 -1
  590. package/php/array/key.js.map +0 -1
  591. package/php/array/krsort.js.map +0 -1
  592. package/php/array/ksort.js.map +0 -1
  593. package/php/array/natcasesort.js.map +0 -1
  594. package/php/array/natsort.js.map +0 -1
  595. package/php/array/next.js.map +0 -1
  596. package/php/array/pos.js.map +0 -1
  597. package/php/array/prev.js.map +0 -1
  598. package/php/array/range.js.map +0 -1
  599. package/php/array/reset.js.map +0 -1
  600. package/php/array/rsort.js.map +0 -1
  601. package/php/array/shuffle.js.map +0 -1
  602. package/php/array/sizeof.js.map +0 -1
  603. package/php/array/sort.js.map +0 -1
  604. package/php/array/uasort.js.map +0 -1
  605. package/php/array/uksort.js.map +0 -1
  606. package/php/array/usort.js.map +0 -1
  607. package/php/bc/bcadd.js.map +0 -1
  608. package/php/bc/bccomp.js.map +0 -1
  609. package/php/bc/bcdiv.js.map +0 -1
  610. package/php/bc/bcmul.js.map +0 -1
  611. package/php/bc/bcround.js.map +0 -1
  612. package/php/bc/bcscale.js.map +0 -1
  613. package/php/bc/bcsub.js.map +0 -1
  614. package/php/bc/index.js.map +0 -1
  615. package/php/ctype/ctype_alnum.js.map +0 -1
  616. package/php/ctype/ctype_alpha.js.map +0 -1
  617. package/php/ctype/ctype_cntrl.js.map +0 -1
  618. package/php/ctype/ctype_digit.js.map +0 -1
  619. package/php/ctype/ctype_graph.js.map +0 -1
  620. package/php/ctype/ctype_lower.js.map +0 -1
  621. package/php/ctype/ctype_print.js.map +0 -1
  622. package/php/ctype/ctype_punct.js.map +0 -1
  623. package/php/ctype/ctype_space.js.map +0 -1
  624. package/php/ctype/ctype_upper.js.map +0 -1
  625. package/php/ctype/ctype_xdigit.js.map +0 -1
  626. package/php/ctype/index.js.map +0 -1
  627. package/php/datetime/checkdate.js.map +0 -1
  628. package/php/datetime/date.js.map +0 -1
  629. package/php/datetime/date_parse.js.map +0 -1
  630. package/php/datetime/getdate.js.map +0 -1
  631. package/php/datetime/gettimeofday.js.map +0 -1
  632. package/php/datetime/gmdate.js.map +0 -1
  633. package/php/datetime/gmmktime.js.map +0 -1
  634. package/php/datetime/gmstrftime.js.map +0 -1
  635. package/php/datetime/idate.js.map +0 -1
  636. package/php/datetime/index.js.map +0 -1
  637. package/php/datetime/microtime.js.map +0 -1
  638. package/php/datetime/mktime.js.map +0 -1
  639. package/php/datetime/strftime.js.map +0 -1
  640. package/php/datetime/strptime.js.map +0 -1
  641. package/php/datetime/strtotime.js.map +0 -1
  642. package/php/datetime/time.js.map +0 -1
  643. package/php/exec/escapeshellarg.js.map +0 -1
  644. package/php/exec/index.js.map +0 -1
  645. package/php/filesystem/basename.js.map +0 -1
  646. package/php/filesystem/dirname.js.map +0 -1
  647. package/php/filesystem/file_exists.js.map +0 -1
  648. package/php/filesystem/file_get_contents.js.map +0 -1
  649. package/php/filesystem/index.js.map +0 -1
  650. package/php/filesystem/pathinfo.js.map +0 -1
  651. package/php/filesystem/realpath.js.map +0 -1
  652. package/php/funchand/call_user_func.js.map +0 -1
  653. package/php/funchand/call_user_func_array.js.map +0 -1
  654. package/php/funchand/create_function.js.map +0 -1
  655. package/php/funchand/function_exists.js.map +0 -1
  656. package/php/funchand/get_defined_functions.js.map +0 -1
  657. package/php/funchand/index.js.map +0 -1
  658. package/php/i18n/i18n_loc_get_default.js.map +0 -1
  659. package/php/i18n/i18n_loc_set_default.js.map +0 -1
  660. package/php/i18n/index.js.map +0 -1
  661. package/php/index.js.map +0 -1
  662. package/php/info/assert_options.js.map +0 -1
  663. package/php/info/getenv.js.map +0 -1
  664. package/php/info/index.js.map +0 -1
  665. package/php/info/ini_get.js.map +0 -1
  666. package/php/info/ini_set.js.map +0 -1
  667. package/php/info/set_time_limit.js.map +0 -1
  668. package/php/info/version_compare.js.map +0 -1
  669. package/php/json/index.js.map +0 -1
  670. package/php/json/json_decode.js.map +0 -1
  671. package/php/json/json_encode.js.map +0 -1
  672. package/php/json/json_last_error.js.map +0 -1
  673. package/php/math/abs.js.map +0 -1
  674. package/php/math/acos.js.map +0 -1
  675. package/php/math/acosh.js.map +0 -1
  676. package/php/math/asin.js.map +0 -1
  677. package/php/math/asinh.js.map +0 -1
  678. package/php/math/atan.js.map +0 -1
  679. package/php/math/atan2.js.map +0 -1
  680. package/php/math/atanh.js.map +0 -1
  681. package/php/math/base_convert.js.map +0 -1
  682. package/php/math/bindec.js.map +0 -1
  683. package/php/math/ceil.js.map +0 -1
  684. package/php/math/cos.js.map +0 -1
  685. package/php/math/cosh.js.map +0 -1
  686. package/php/math/decbin.js.map +0 -1
  687. package/php/math/dechex.js.map +0 -1
  688. package/php/math/decoct.js.map +0 -1
  689. package/php/math/deg2rad.js.map +0 -1
  690. package/php/math/exp.js.map +0 -1
  691. package/php/math/expm1.js.map +0 -1
  692. package/php/math/floor.js.map +0 -1
  693. package/php/math/fmod.js.map +0 -1
  694. package/php/math/getrandmax.js.map +0 -1
  695. package/php/math/hexdec.js.map +0 -1
  696. package/php/math/hypot.js.map +0 -1
  697. package/php/math/index.js.map +0 -1
  698. package/php/math/is_finite.js.map +0 -1
  699. package/php/math/is_infinite.js.map +0 -1
  700. package/php/math/is_nan.js.map +0 -1
  701. package/php/math/lcg_value.js.map +0 -1
  702. package/php/math/log.js.map +0 -1
  703. package/php/math/log10.js.map +0 -1
  704. package/php/math/log1p.js.map +0 -1
  705. package/php/math/max.js.map +0 -1
  706. package/php/math/min.js.map +0 -1
  707. package/php/math/mt_getrandmax.js.map +0 -1
  708. package/php/math/mt_rand.js.map +0 -1
  709. package/php/math/octdec.js.map +0 -1
  710. package/php/math/pi.js.map +0 -1
  711. package/php/math/pow.js.map +0 -1
  712. package/php/math/rad2deg.js.map +0 -1
  713. package/php/math/rand.js.map +0 -1
  714. package/php/math/round.js.map +0 -1
  715. package/php/math/sin.js.map +0 -1
  716. package/php/math/sinh.js.map +0 -1
  717. package/php/math/sqrt.js.map +0 -1
  718. package/php/math/tan.js.map +0 -1
  719. package/php/math/tanh.js.map +0 -1
  720. package/php/misc/index.js.map +0 -1
  721. package/php/misc/pack.js.map +0 -1
  722. package/php/misc/uniqid.js.map +0 -1
  723. package/php/net-gopher/gopher_parsedir.js.map +0 -1
  724. package/php/net-gopher/index.js.map +0 -1
  725. package/php/network/index.js.map +0 -1
  726. package/php/network/inet_ntop.js.map +0 -1
  727. package/php/network/inet_pton.js.map +0 -1
  728. package/php/network/ip2long.js.map +0 -1
  729. package/php/network/long2ip.js.map +0 -1
  730. package/php/network/setcookie.js.map +0 -1
  731. package/php/network/setrawcookie.js.map +0 -1
  732. package/php/pcre/index.js.map +0 -1
  733. package/php/pcre/preg_match.js.map +0 -1
  734. package/php/pcre/preg_quote.js.map +0 -1
  735. package/php/pcre/preg_replace.js.map +0 -1
  736. package/php/pcre/sql_regcase.js.map +0 -1
  737. package/php/strings/addcslashes.js.map +0 -1
  738. package/php/strings/addslashes.js.map +0 -1
  739. package/php/strings/bin2hex.js.map +0 -1
  740. package/php/strings/chop.js.map +0 -1
  741. package/php/strings/chr.js.map +0 -1
  742. package/php/strings/chunk_split.js.map +0 -1
  743. package/php/strings/convert_cyr_string.js.map +0 -1
  744. package/php/strings/convert_uuencode.js.map +0 -1
  745. package/php/strings/count_chars.js.map +0 -1
  746. package/php/strings/crc32.js.map +0 -1
  747. package/php/strings/echo.js.map +0 -1
  748. package/php/strings/explode.js.map +0 -1
  749. package/php/strings/get_html_translation_table.js.map +0 -1
  750. package/php/strings/hex2bin.js.map +0 -1
  751. package/php/strings/html_entity_decode.js.map +0 -1
  752. package/php/strings/htmlentities.js.map +0 -1
  753. package/php/strings/htmlspecialchars.js.map +0 -1
  754. package/php/strings/htmlspecialchars_decode.js.map +0 -1
  755. package/php/strings/implode.js.map +0 -1
  756. package/php/strings/index.js.map +0 -1
  757. package/php/strings/join.js.map +0 -1
  758. package/php/strings/lcfirst.js.map +0 -1
  759. package/php/strings/levenshtein.js.map +0 -1
  760. package/php/strings/localeconv.js.map +0 -1
  761. package/php/strings/ltrim.js.map +0 -1
  762. package/php/strings/md5.js.map +0 -1
  763. package/php/strings/md5_file.js.map +0 -1
  764. package/php/strings/metaphone.js.map +0 -1
  765. package/php/strings/money_format.js.map +0 -1
  766. package/php/strings/nl2br.js.map +0 -1
  767. package/php/strings/nl_langinfo.js.map +0 -1
  768. package/php/strings/number_format.js.map +0 -1
  769. package/php/strings/ord.js.map +0 -1
  770. package/php/strings/parse_str.js.map +0 -1
  771. package/php/strings/printf.js.map +0 -1
  772. package/php/strings/quoted_printable_decode.js.map +0 -1
  773. package/php/strings/quoted_printable_encode.js.map +0 -1
  774. package/php/strings/quotemeta.js.map +0 -1
  775. package/php/strings/rtrim.js.map +0 -1
  776. package/php/strings/setlocale.js.map +0 -1
  777. package/php/strings/sha1.js.map +0 -1
  778. package/php/strings/sha1_file.js.map +0 -1
  779. package/php/strings/similar_text.js.map +0 -1
  780. package/php/strings/soundex.js.map +0 -1
  781. package/php/strings/split.js.map +0 -1
  782. package/php/strings/sprintf.js.map +0 -1
  783. package/php/strings/sscanf.js.map +0 -1
  784. package/php/strings/str_getcsv.js.map +0 -1
  785. package/php/strings/str_ireplace.js.map +0 -1
  786. package/php/strings/str_pad.js.map +0 -1
  787. package/php/strings/str_repeat.js.map +0 -1
  788. package/php/strings/str_replace.js.map +0 -1
  789. package/php/strings/str_rot13.js.map +0 -1
  790. package/php/strings/str_shuffle.js.map +0 -1
  791. package/php/strings/str_split.js.map +0 -1
  792. package/php/strings/str_word_count.js.map +0 -1
  793. package/php/strings/strcasecmp.js.map +0 -1
  794. package/php/strings/strchr.js.map +0 -1
  795. package/php/strings/strcmp.js.map +0 -1
  796. package/php/strings/strcoll.js.map +0 -1
  797. package/php/strings/strcspn.js.map +0 -1
  798. package/php/strings/strip_tags.js.map +0 -1
  799. package/php/strings/stripos.js.map +0 -1
  800. package/php/strings/stripslashes.js.map +0 -1
  801. package/php/strings/stristr.js.map +0 -1
  802. package/php/strings/strlen.js.map +0 -1
  803. package/php/strings/strnatcasecmp.js.map +0 -1
  804. package/php/strings/strnatcmp.js.map +0 -1
  805. package/php/strings/strncasecmp.js.map +0 -1
  806. package/php/strings/strncmp.js.map +0 -1
  807. package/php/strings/strpbrk.js.map +0 -1
  808. package/php/strings/strpos.js.map +0 -1
  809. package/php/strings/strrchr.js.map +0 -1
  810. package/php/strings/strrev.js.map +0 -1
  811. package/php/strings/strripos.js.map +0 -1
  812. package/php/strings/strrpos.js.map +0 -1
  813. package/php/strings/strspn.js.map +0 -1
  814. package/php/strings/strstr.js.map +0 -1
  815. package/php/strings/strtok.js.map +0 -1
  816. package/php/strings/strtolower.js.map +0 -1
  817. package/php/strings/strtoupper.js.map +0 -1
  818. package/php/strings/strtr.js.map +0 -1
  819. package/php/strings/substr.js.map +0 -1
  820. package/php/strings/substr_compare.js.map +0 -1
  821. package/php/strings/substr_count.js.map +0 -1
  822. package/php/strings/substr_replace.js.map +0 -1
  823. package/php/strings/trim.js.map +0 -1
  824. package/php/strings/ucfirst.js.map +0 -1
  825. package/php/strings/ucwords.js.map +0 -1
  826. package/php/strings/vprintf.js.map +0 -1
  827. package/php/strings/vsprintf.js.map +0 -1
  828. package/php/strings/wordwrap.js.map +0 -1
  829. package/php/url/base64_decode.js.map +0 -1
  830. package/php/url/base64_encode.js.map +0 -1
  831. package/php/url/http_build_query.js.map +0 -1
  832. package/php/url/index.js.map +0 -1
  833. package/php/url/parse_url.js.map +0 -1
  834. package/php/url/rawurldecode.js.map +0 -1
  835. package/php/url/rawurlencode.js.map +0 -1
  836. package/php/url/urldecode.js.map +0 -1
  837. package/php/url/urlencode.js.map +0 -1
  838. package/php/var/boolval.js.map +0 -1
  839. package/php/var/doubleval.js.map +0 -1
  840. package/php/var/empty.js.map +0 -1
  841. package/php/var/floatval.js.map +0 -1
  842. package/php/var/gettype.js.map +0 -1
  843. package/php/var/index.js.map +0 -1
  844. package/php/var/intval.js.map +0 -1
  845. package/php/var/is_array.js.map +0 -1
  846. package/php/var/is_binary.js.map +0 -1
  847. package/php/var/is_bool.js.map +0 -1
  848. package/php/var/is_buffer.js.map +0 -1
  849. package/php/var/is_callable.js.map +0 -1
  850. package/php/var/is_double.js.map +0 -1
  851. package/php/var/is_float.js.map +0 -1
  852. package/php/var/is_int.js.map +0 -1
  853. package/php/var/is_integer.js.map +0 -1
  854. package/php/var/is_long.js.map +0 -1
  855. package/php/var/is_null.js.map +0 -1
  856. package/php/var/is_numeric.js.map +0 -1
  857. package/php/var/is_object.js.map +0 -1
  858. package/php/var/is_real.js.map +0 -1
  859. package/php/var/is_scalar.js.map +0 -1
  860. package/php/var/is_string.js.map +0 -1
  861. package/php/var/is_unicode.js.map +0 -1
  862. package/php/var/isset.js.map +0 -1
  863. package/php/var/print_r.js.map +0 -1
  864. package/php/var/serialize.js.map +0 -1
  865. package/php/var/serialize.mocha.js +0 -14
  866. package/php/var/serialize.mocha.js.map +0 -1
  867. package/php/var/strval.js.map +0 -1
  868. package/php/var/unserialize.js.map +0 -1
  869. package/php/var/var_dump.js.map +0 -1
  870. package/php/var/var_export.js.map +0 -1
  871. package/php/xdiff/index.js.map +0 -1
  872. package/php/xdiff/xdiff_string_diff.js.map +0 -1
  873. package/php/xdiff/xdiff_string_patch.js.map +0 -1
  874. package/php/xml/index.js.map +0 -1
  875. package/php/xml/utf8_decode.js.map +0 -1
  876. package/php/xml/utf8_encode.js.map +0 -1
  877. package/python/index.js.map +0 -1
  878. package/python/string/ascii_letters.js.map +0 -1
  879. package/python/string/ascii_lowercase.js.map +0 -1
  880. package/python/string/ascii_uppercase.js.map +0 -1
  881. package/python/string/capwords.js.map +0 -1
  882. package/python/string/index.js.map +0 -1
  883. package/python/string/punctuation.js.map +0 -1
  884. package/ruby/Math/acos.js.map +0 -1
  885. package/ruby/Math/index.js.map +0 -1
  886. package/ruby/index.js.map +0 -1
@@ -1,7 +1,3 @@
1
- 'use strict';
2
-
3
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
4
-
5
1
  module.exports = function array_multisort(arr) {
6
2
  // discuss at: https://locutus.io/php/array_multisort/
7
3
  // original by: Theriault (https://github.com/Theriault)
@@ -24,190 +20,203 @@ module.exports = function array_multisort(arr) {
24
20
  // note 1: bits: HGFE DCBA
25
21
  // note 1: args: Holds pointer to arguments for reassignment
26
22
 
27
- var g = void 0;
28
- var i = void 0;
29
- var j = void 0;
30
- var k = void 0;
31
- var l = void 0;
32
- var sal = void 0;
33
- var vkey = void 0;
34
- var elIndex = void 0;
35
- var lastSorts = void 0;
36
- var tmpArray = void 0;
37
- var zlast = void 0;
23
+ let g
24
+ let i
25
+ let j
26
+ let k
27
+ let l
28
+ let sal
29
+ let vkey
30
+ let elIndex
31
+ let lastSorts
32
+ let tmpArray
33
+ let zlast
38
34
 
39
- var sortFlag = [0];
40
- var thingsToSort = [];
41
- var nLastSort = [];
42
- var lastSort = [];
35
+ const sortFlag = [0]
36
+ const thingsToSort = []
37
+ let nLastSort = []
38
+ let lastSort = []
43
39
  // possibly redundant
44
- var args = arguments;
40
+ const args = arguments
45
41
 
46
- var flags = {
42
+ const flags = {
47
43
  SORT_REGULAR: 16,
48
44
  SORT_NUMERIC: 17,
49
45
  SORT_STRING: 18,
50
46
  SORT_ASC: 32,
51
- SORT_DESC: 40
52
- };
47
+ SORT_DESC: 40,
48
+ }
53
49
 
54
- var sortDuplicator = function sortDuplicator(a, b) {
55
- return nLastSort.shift();
56
- };
50
+ const sortDuplicator = function (a, b) {
51
+ return nLastSort.shift()
52
+ }
57
53
 
58
- var sortFunctions = [[function (a, b) {
59
- lastSort.push(a > b ? 1 : a < b ? -1 : 0);
60
- return a > b ? 1 : a < b ? -1 : 0;
61
- }, function (a, b) {
62
- lastSort.push(b > a ? 1 : b < a ? -1 : 0);
63
- return b > a ? 1 : b < a ? -1 : 0;
64
- }], [function (a, b) {
65
- lastSort.push(a - b);
66
- return a - b;
67
- }, function (a, b) {
68
- lastSort.push(b - a);
69
- return b - a;
70
- }], [function (a, b) {
71
- lastSort.push(a + '' > b + '' ? 1 : a + '' < b + '' ? -1 : 0);
72
- return a + '' > b + '' ? 1 : a + '' < b + '' ? -1 : 0;
73
- }, function (a, b) {
74
- lastSort.push(b + '' > a + '' ? 1 : b + '' < a + '' ? -1 : 0);
75
- return b + '' > a + '' ? 1 : b + '' < a + '' ? -1 : 0;
76
- }]];
54
+ const sortFunctions = [
55
+ [
56
+ function (a, b) {
57
+ lastSort.push(a > b ? 1 : a < b ? -1 : 0)
58
+ return a > b ? 1 : a < b ? -1 : 0
59
+ },
60
+ function (a, b) {
61
+ lastSort.push(b > a ? 1 : b < a ? -1 : 0)
62
+ return b > a ? 1 : b < a ? -1 : 0
63
+ },
64
+ ],
65
+ [
66
+ function (a, b) {
67
+ lastSort.push(a - b)
68
+ return a - b
69
+ },
70
+ function (a, b) {
71
+ lastSort.push(b - a)
72
+ return b - a
73
+ },
74
+ ],
75
+ [
76
+ function (a, b) {
77
+ lastSort.push(a + '' > b + '' ? 1 : a + '' < b + '' ? -1 : 0)
78
+ return a + '' > b + '' ? 1 : a + '' < b + '' ? -1 : 0
79
+ },
80
+ function (a, b) {
81
+ lastSort.push(b + '' > a + '' ? 1 : b + '' < a + '' ? -1 : 0)
82
+ return b + '' > a + '' ? 1 : b + '' < a + '' ? -1 : 0
83
+ },
84
+ ],
85
+ ]
77
86
 
78
- var sortArrs = [[]];
87
+ const sortArrs = [[]]
79
88
 
80
- var sortKeys = [[]];
89
+ const sortKeys = [[]]
81
90
 
82
91
  // Store first argument into sortArrs and sortKeys if an Object.
83
92
  // First Argument should be either a Javascript Array or an Object,
84
93
  // otherwise function would return FALSE like in PHP
85
- if (Object.prototype.toString.call(arr) === '[object Array]') {
86
- sortArrs[0] = arr;
87
- } else if (arr && (typeof arr === 'undefined' ? 'undefined' : _typeof(arr)) === 'object') {
94
+ if (Array.isArray(arr)) {
95
+ sortArrs[0] = arr
96
+ } else if (arr && typeof arr === 'object') {
88
97
  for (i in arr) {
89
98
  if (arr.hasOwnProperty(i)) {
90
- sortKeys[0].push(i);
91
- sortArrs[0].push(arr[i]);
99
+ sortKeys[0].push(i)
100
+ sortArrs[0].push(arr[i])
92
101
  }
93
102
  }
94
103
  } else {
95
- return false;
104
+ return false
96
105
  }
97
106
 
98
107
  // arrMainLength: Holds the length of the first array.
99
108
  // All other arrays must be of equal length, otherwise function would return FALSE like in PHP
100
109
  // sortComponents: Holds 2 indexes per every section of the array
101
110
  // that can be sorted. As this is the start, the whole array can be sorted.
102
- var arrMainLength = sortArrs[0].length;
103
- var sortComponents = [0, arrMainLength];
111
+ const arrMainLength = sortArrs[0].length
112
+ let sortComponents = [0, arrMainLength]
104
113
 
105
114
  // Loop through all other arguments, checking lengths and sort flags
106
115
  // of arrays and adding them to the above variables.
107
- var argl = arguments.length;
116
+ const argl = arguments.length
108
117
  for (j = 1; j < argl; j++) {
109
- if (Object.prototype.toString.call(arguments[j]) === '[object Array]') {
110
- sortArrs[j] = arguments[j];
111
- sortFlag[j] = 0;
118
+ if (Array.isArray(arguments[j])) {
119
+ sortArrs[j] = arguments[j]
120
+ sortFlag[j] = 0
112
121
  if (arguments[j].length !== arrMainLength) {
113
- return false;
122
+ return false
114
123
  }
115
- } else if (arguments[j] && _typeof(arguments[j]) === 'object') {
116
- sortKeys[j] = [];
117
- sortArrs[j] = [];
118
- sortFlag[j] = 0;
124
+ } else if (arguments[j] && typeof arguments[j] === 'object') {
125
+ sortKeys[j] = []
126
+ sortArrs[j] = []
127
+ sortFlag[j] = 0
119
128
  for (i in arguments[j]) {
120
129
  if (arguments[j].hasOwnProperty(i)) {
121
- sortKeys[j].push(i);
122
- sortArrs[j].push(arguments[j][i]);
130
+ sortKeys[j].push(i)
131
+ sortArrs[j].push(arguments[j][i])
123
132
  }
124
133
  }
125
134
  if (sortArrs[j].length !== arrMainLength) {
126
- return false;
135
+ return false
127
136
  }
128
137
  } else if (typeof arguments[j] === 'string') {
129
- var lFlag = sortFlag.pop();
138
+ const lFlag = sortFlag.pop()
130
139
  // Keep extra parentheses around latter flags check
131
140
  // to avoid minimization leading to CDATA closer
132
- if (typeof flags[arguments[j]] === 'undefined' || (flags[arguments[j]] >>> 4 & lFlag >>> 4) > 0) {
133
- return false;
141
+ if (typeof flags[arguments[j]] === 'undefined' || ((flags[arguments[j]] >>> 4) & (lFlag >>> 4)) > 0) {
142
+ return false
134
143
  }
135
- sortFlag.push(lFlag + flags[arguments[j]]);
144
+ sortFlag.push(lFlag + flags[arguments[j]])
136
145
  } else {
137
- return false;
146
+ return false
138
147
  }
139
148
  }
140
149
 
141
150
  for (i = 0; i !== arrMainLength; i++) {
142
- thingsToSort.push(true);
151
+ thingsToSort.push(true)
143
152
  }
144
153
 
145
154
  // Sort all the arrays....
146
155
  for (i in sortArrs) {
147
156
  if (sortArrs.hasOwnProperty(i)) {
148
- lastSorts = [];
149
- tmpArray = [];
150
- elIndex = 0;
151
- nLastSort = [];
152
- lastSort = [];
157
+ lastSorts = []
158
+ tmpArray = []
159
+ elIndex = 0
160
+ nLastSort = []
161
+ lastSort = []
153
162
 
154
163
  // If there are no sortComponents, then no more sorting is neeeded.
155
164
  // Copy the array back to the argument.
156
165
  if (sortComponents.length === 0) {
157
- if (Object.prototype.toString.call(arguments[i]) === '[object Array]') {
158
- args[i] = sortArrs[i];
166
+ if (Array.isArray(arguments[i])) {
167
+ args[i] = sortArrs[i]
159
168
  } else {
160
169
  for (k in arguments[i]) {
161
170
  if (arguments[i].hasOwnProperty(k)) {
162
- delete arguments[i][k];
171
+ delete arguments[i][k]
163
172
  }
164
173
  }
165
- sal = sortArrs[i].length;
174
+ sal = sortArrs[i].length
166
175
  for (j = 0, vkey = 0; j < sal; j++) {
167
- vkey = sortKeys[i][j];
168
- args[i][vkey] = sortArrs[i][j];
176
+ vkey = sortKeys[i][j]
177
+ args[i][vkey] = sortArrs[i][j]
169
178
  }
170
179
  }
171
- sortArrs.splice(i, 1);
172
- sortKeys.splice(i, 1);
173
- continue;
180
+ sortArrs.splice(i, 1)
181
+ sortKeys.splice(i, 1)
182
+ continue
174
183
  }
175
184
 
176
185
  // Sort function for sorting. Either sorts asc or desc, regular/string or numeric.
177
- var sFunction = sortFunctions[sortFlag[i] & 3][(sortFlag[i] & 8) > 0 ? 1 : 0];
186
+ let sFunction = sortFunctions[sortFlag[i] & 3][(sortFlag[i] & 8) > 0 ? 1 : 0]
178
187
 
179
188
  // Sort current array.
180
189
  for (l = 0; l !== sortComponents.length; l += 2) {
181
- tmpArray = sortArrs[i].slice(sortComponents[l], sortComponents[l + 1] + 1);
182
- tmpArray.sort(sFunction);
190
+ tmpArray = sortArrs[i].slice(sortComponents[l], sortComponents[l + 1] + 1)
191
+ tmpArray.sort(sFunction)
183
192
  // Is there a better way to copy an array in Javascript?
184
- lastSorts[l] = [].concat(lastSort);
185
- elIndex = sortComponents[l];
193
+ lastSorts[l] = [].concat(lastSort)
194
+ elIndex = sortComponents[l]
186
195
  for (g in tmpArray) {
187
196
  if (tmpArray.hasOwnProperty(g)) {
188
- sortArrs[i][elIndex] = tmpArray[g];
189
- elIndex++;
197
+ sortArrs[i][elIndex] = tmpArray[g]
198
+ elIndex++
190
199
  }
191
200
  }
192
201
  }
193
202
 
194
203
  // Duplicate the sorting of the current array on future arrays.
195
- sFunction = sortDuplicator;
204
+ sFunction = sortDuplicator
196
205
  for (j in sortArrs) {
197
206
  if (sortArrs.hasOwnProperty(j)) {
198
207
  if (sortArrs[j] === sortArrs[i]) {
199
- continue;
208
+ continue
200
209
  }
201
210
  for (l = 0; l !== sortComponents.length; l += 2) {
202
- tmpArray = sortArrs[j].slice(sortComponents[l], sortComponents[l + 1] + 1);
211
+ tmpArray = sortArrs[j].slice(sortComponents[l], sortComponents[l + 1] + 1)
203
212
  // alert(l + ':' + nLastSort);
204
- nLastSort = [].concat(lastSorts[l]);
205
- tmpArray.sort(sFunction);
206
- elIndex = sortComponents[l];
213
+ nLastSort = [].concat(lastSorts[l])
214
+ tmpArray.sort(sFunction)
215
+ elIndex = sortComponents[l]
207
216
  for (g in tmpArray) {
208
217
  if (tmpArray.hasOwnProperty(g)) {
209
- sortArrs[j][elIndex] = tmpArray[g];
210
- elIndex++;
218
+ sortArrs[j][elIndex] = tmpArray[g]
219
+ elIndex++
211
220
  }
212
221
  }
213
222
  }
@@ -218,14 +227,14 @@ module.exports = function array_multisort(arr) {
218
227
  for (j in sortKeys) {
219
228
  if (sortKeys.hasOwnProperty(j)) {
220
229
  for (l = 0; l !== sortComponents.length; l += 2) {
221
- tmpArray = sortKeys[j].slice(sortComponents[l], sortComponents[l + 1] + 1);
222
- nLastSort = [].concat(lastSorts[l]);
223
- tmpArray.sort(sFunction);
224
- elIndex = sortComponents[l];
230
+ tmpArray = sortKeys[j].slice(sortComponents[l], sortComponents[l + 1] + 1)
231
+ nLastSort = [].concat(lastSorts[l])
232
+ tmpArray.sort(sFunction)
233
+ elIndex = sortComponents[l]
225
234
  for (g in tmpArray) {
226
235
  if (tmpArray.hasOwnProperty(g)) {
227
- sortKeys[j][elIndex] = tmpArray[g];
228
- elIndex++;
236
+ sortKeys[j][elIndex] = tmpArray[g]
237
+ elIndex++
229
238
  }
230
239
  }
231
240
  }
@@ -233,57 +242,56 @@ module.exports = function array_multisort(arr) {
233
242
  }
234
243
 
235
244
  // Generate the next sortComponents
236
- zlast = null;
237
- sortComponents = [];
245
+ zlast = null
246
+ sortComponents = []
238
247
  for (j in sortArrs[i]) {
239
248
  if (sortArrs[i].hasOwnProperty(j)) {
240
249
  if (!thingsToSort[j]) {
241
250
  if (sortComponents.length & 1) {
242
- sortComponents.push(j - 1);
251
+ sortComponents.push(j - 1)
243
252
  }
244
- zlast = null;
245
- continue;
253
+ zlast = null
254
+ continue
246
255
  }
247
256
  if (!(sortComponents.length & 1)) {
248
257
  if (zlast !== null) {
249
258
  if (sortArrs[i][j] === zlast) {
250
- sortComponents.push(j - 1);
259
+ sortComponents.push(j - 1)
251
260
  } else {
252
- thingsToSort[j] = false;
261
+ thingsToSort[j] = false
253
262
  }
254
263
  }
255
- zlast = sortArrs[i][j];
264
+ zlast = sortArrs[i][j]
256
265
  } else {
257
266
  if (sortArrs[i][j] !== zlast) {
258
- sortComponents.push(j - 1);
259
- zlast = sortArrs[i][j];
267
+ sortComponents.push(j - 1)
268
+ zlast = sortArrs[i][j]
260
269
  }
261
270
  }
262
271
  }
263
272
  }
264
273
 
265
274
  if (sortComponents.length & 1) {
266
- sortComponents.push(j);
275
+ sortComponents.push(j)
267
276
  }
268
- if (Object.prototype.toString.call(arguments[i]) === '[object Array]') {
269
- args[i] = sortArrs[i];
277
+ if (Array.isArray(arguments[i])) {
278
+ args[i] = sortArrs[i]
270
279
  } else {
271
280
  for (j in arguments[i]) {
272
281
  if (arguments[i].hasOwnProperty(j)) {
273
- delete arguments[i][j];
282
+ delete arguments[i][j]
274
283
  }
275
284
  }
276
285
 
277
- sal = sortArrs[i].length;
286
+ sal = sortArrs[i].length
278
287
  for (j = 0, vkey = 0; j < sal; j++) {
279
- vkey = sortKeys[i][j];
280
- args[i][vkey] = sortArrs[i][j];
288
+ vkey = sortKeys[i][j]
289
+ args[i][vkey] = sortArrs[i][j]
281
290
  }
282
291
  }
283
- sortArrs.splice(i, 1);
284
- sortKeys.splice(i, 1);
292
+ sortArrs.splice(i, 1)
293
+ sortKeys.splice(i, 1)
285
294
  }
286
295
  }
287
- return true;
288
- };
289
- //# sourceMappingURL=array_multisort.js.map
296
+ return true
297
+ }
@@ -1,37 +1,35 @@
1
- 'use strict';
2
-
3
1
  module.exports = function array_pad(input, padSize, padValue) {
4
- // discuss at: https://locutus.io/php/array_pad/
5
- // original by: Waldo Malqui Silva (https://waldo.malqui.info)
6
- // example 1: array_pad([ 7, 8, 9 ], 2, 'a')
7
- // returns 1: [ 7, 8, 9]
8
- // example 2: array_pad([ 7, 8, 9 ], 5, 'a')
9
- // returns 2: [ 7, 8, 9, 'a', 'a']
10
- // example 3: array_pad([ 7, 8, 9 ], 5, 2)
11
- // returns 3: [ 7, 8, 9, 2, 2]
12
- // example 4: array_pad([ 7, 8, 9 ], -5, 'a')
13
- // returns 4: [ 'a', 'a', 7, 8, 9 ]
2
+ // discuss at: https://locutus.io/php/array_pad/
3
+ // parity verified: PHP 8.3
4
+ // original by: Waldo Malqui Silva (https://waldo.malqui.info)
5
+ // example 1: array_pad([ 7, 8, 9 ], 2, 'a')
6
+ // returns 1: [ 7, 8, 9]
7
+ // example 2: array_pad([ 7, 8, 9 ], 5, 'a')
8
+ // returns 2: [ 7, 8, 9, 'a', 'a']
9
+ // example 3: array_pad([ 7, 8, 9 ], 5, 2)
10
+ // returns 3: [ 7, 8, 9, 2, 2]
11
+ // example 4: array_pad([ 7, 8, 9 ], -5, 'a')
12
+ // returns 4: [ 'a', 'a', 7, 8, 9 ]
14
13
 
15
- var pad = [];
16
- var newArray = [];
17
- var newLength = void 0;
18
- var diff = 0;
19
- var i = 0;
14
+ let pad = []
15
+ const newArray = []
16
+ let newLength
17
+ let diff = 0
18
+ let i = 0
20
19
 
21
- if (Object.prototype.toString.call(input) === '[object Array]' && !isNaN(padSize)) {
22
- newLength = padSize < 0 ? padSize * -1 : padSize;
23
- diff = newLength - input.length;
20
+ if (Array.isArray(input) && !isNaN(padSize)) {
21
+ newLength = padSize < 0 ? padSize * -1 : padSize
22
+ diff = newLength - input.length
24
23
 
25
24
  if (diff > 0) {
26
25
  for (i = 0; i < diff; i++) {
27
- newArray[i] = padValue;
26
+ newArray[i] = padValue
28
27
  }
29
- pad = padSize < 0 ? newArray.concat(input) : input.concat(newArray);
28
+ pad = padSize < 0 ? newArray.concat(input) : input.concat(newArray)
30
29
  } else {
31
- pad = input;
30
+ pad = input
32
31
  }
33
32
  }
34
33
 
35
- return pad;
36
- };
37
- //# sourceMappingURL=array_pad.js.map
34
+ return pad
35
+ }
@@ -1,5 +1,3 @@
1
- 'use strict';
2
-
3
1
  module.exports = function array_pop(inputArr) {
4
2
  // discuss at: https://locutus.io/php/array_pop/
5
3
  // original by: Kevin van Zonneveld (https://kvz.io)
@@ -21,30 +19,29 @@ module.exports = function array_pop(inputArr) {
21
19
  // example 2: var $result = $data
22
20
  // returns 2: {firstName: 'Kevin'}
23
21
 
24
- var key = '';
25
- var lastKey = '';
22
+ let key = ''
23
+ let lastKey = ''
26
24
 
27
25
  if (inputArr.hasOwnProperty('length')) {
28
26
  // Indexed
29
27
  if (!inputArr.length) {
30
28
  // Done popping, are we?
31
- return null;
29
+ return null
32
30
  }
33
- return inputArr.pop();
31
+ return inputArr.pop()
34
32
  } else {
35
33
  // Associative
36
34
  for (key in inputArr) {
37
35
  if (inputArr.hasOwnProperty(key)) {
38
- lastKey = key;
36
+ lastKey = key
39
37
  }
40
38
  }
41
39
  if (lastKey) {
42
- var tmp = inputArr[lastKey];
43
- delete inputArr[lastKey];
44
- return tmp;
40
+ const tmp = inputArr[lastKey]
41
+ delete inputArr[lastKey]
42
+ return tmp
45
43
  } else {
46
- return null;
44
+ return null
47
45
  }
48
46
  }
49
- };
50
- //# sourceMappingURL=array_pop.js.map
47
+ }
@@ -1,25 +1,23 @@
1
- 'use strict';
2
-
3
1
  module.exports = function array_product(input) {
4
- // discuss at: https://locutus.io/php/array_product/
5
- // original by: Waldo Malqui Silva (https://waldo.malqui.info)
6
- // example 1: array_product([ 2, 4, 6, 8 ])
7
- // returns 1: 384
2
+ // discuss at: https://locutus.io/php/array_product/
3
+ // parity verified: PHP 8.3
4
+ // original by: Waldo Malqui Silva (https://waldo.malqui.info)
5
+ // example 1: array_product([ 2, 4, 6, 8 ])
6
+ // returns 1: 384
8
7
 
9
- var idx = 0;
10
- var product = 1;
11
- var il = 0;
8
+ let idx = 0
9
+ let product = 1
10
+ let il = 0
12
11
 
13
- if (Object.prototype.toString.call(input) !== '[object Array]') {
14
- return null;
12
+ if (!Array.isArray(input)) {
13
+ return null
15
14
  }
16
15
 
17
- il = input.length;
16
+ il = input.length
18
17
  while (idx < il) {
19
- product *= !isNaN(input[idx]) ? input[idx] : 0;
20
- idx++;
18
+ product *= !isNaN(input[idx]) ? input[idx] : 0
19
+ idx++
21
20
  }
22
21
 
23
- return product;
24
- };
25
- //# sourceMappingURL=array_product.js.map
22
+ return product
23
+ }
@@ -1,5 +1,3 @@
1
- 'use strict';
2
-
3
1
  module.exports = function array_push(inputArr) {
4
2
  // discuss at: https://locutus.io/php/array_push/
5
3
  // original by: Kevin van Zonneveld (https://kvz.io)
@@ -12,36 +10,35 @@ module.exports = function array_push(inputArr) {
12
10
  // example 1: array_push(['kevin','van'], 'zonneveld')
13
11
  // returns 1: 3
14
12
 
15
- var i = 0;
16
- var pr = '';
17
- var argv = arguments;
18
- var argc = argv.length;
19
- var allDigits = /^\d$/;
20
- var size = 0;
21
- var highestIdx = 0;
22
- var len = 0;
13
+ let i = 0
14
+ let pr = ''
15
+ const argv = arguments
16
+ const argc = argv.length
17
+ const allDigits = /^\d$/
18
+ let size = 0
19
+ let highestIdx = 0
20
+ let len = 0
23
21
 
24
22
  if (inputArr.hasOwnProperty('length')) {
25
23
  for (i = 1; i < argc; i++) {
26
- inputArr[inputArr.length] = argv[i];
24
+ inputArr[inputArr.length] = argv[i]
27
25
  }
28
- return inputArr.length;
26
+ return inputArr.length
29
27
  }
30
28
 
31
29
  // Associative (object)
32
30
  for (pr in inputArr) {
33
31
  if (inputArr.hasOwnProperty(pr)) {
34
- ++len;
32
+ ++len
35
33
  if (pr.search(allDigits) !== -1) {
36
- size = parseInt(pr, 10);
37
- highestIdx = size > highestIdx ? size : highestIdx;
34
+ size = parseInt(pr, 10)
35
+ highestIdx = size > highestIdx ? size : highestIdx
38
36
  }
39
37
  }
40
38
  }
41
39
  for (i = 1; i < argc; i++) {
42
- inputArr[++highestIdx] = argv[i];
40
+ inputArr[++highestIdx] = argv[i]
43
41
  }
44
42
 
45
- return len + i - 1;
46
- };
47
- //# sourceMappingURL=array_push.js.map
43
+ return len + i - 1
44
+ }
@@ -1,5 +1,3 @@
1
- 'use strict';
2
-
3
1
  module.exports = function array_rand(array, num) {
4
2
  // discuss at: https://locutus.io/php/array_rand/
5
3
  // original by: Waldo Malqui Silva (https://waldo.malqui.info)
@@ -9,27 +7,26 @@ module.exports = function array_rand(array, num) {
9
7
 
10
8
  // By using Object.keys we support both, arrays and objects
11
9
  // which phpjs wants to support
12
- var keys = Object.keys(array);
10
+ const keys = Object.keys(array)
13
11
 
14
12
  if (typeof num === 'undefined' || num === null) {
15
- num = 1;
13
+ num = 1
16
14
  } else {
17
- num = +num;
15
+ num = +num
18
16
  }
19
17
 
20
18
  if (isNaN(num) || num < 1 || num > keys.length) {
21
- return null;
19
+ return null
22
20
  }
23
21
 
24
22
  // shuffle the array of keys
25
- for (var i = keys.length - 1; i > 0; i--) {
26
- var j = Math.floor(Math.random() * (i + 1)); // 0 ≤ j ≤ i
23
+ for (let i = keys.length - 1; i > 0; i--) {
24
+ const j = Math.floor(Math.random() * (i + 1)) // 0 ≤ j ≤ i
27
25
 
28
- var tmp = keys[j];
29
- keys[j] = keys[i];
30
- keys[i] = tmp;
26
+ const tmp = keys[j]
27
+ keys[j] = keys[i]
28
+ keys[i] = tmp
31
29
  }
32
30
 
33
- return num === 1 ? keys[0] : keys.slice(0, num);
34
- };
35
- //# sourceMappingURL=array_rand.js.map
31
+ return num === 1 ? keys[0] : keys.slice(0, num)
32
+ }