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.
- package/README.md +18 -0
- package/_data/rosetta.yml +325 -0
- package/awk/builtin/index.js +5 -0
- package/awk/builtin/int.js +13 -0
- package/awk/builtin/length.js +16 -0
- package/awk/builtin/substr.js +23 -0
- package/awk/builtin/tolower.js +11 -0
- package/awk/builtin/toupper.js +11 -0
- package/c/ctype/index.js +8 -0
- package/c/ctype/isalnum.js +15 -0
- package/c/ctype/isalpha.js +17 -0
- package/c/ctype/isdigit.js +15 -0
- package/c/ctype/islower.js +15 -0
- package/c/ctype/isspace.js +15 -0
- package/c/ctype/isupper.js +15 -0
- package/c/ctype/tolower.js +15 -0
- package/c/ctype/toupper.js +15 -0
- package/c/index.js +2 -5
- package/c/math/abs.js +14 -18
- package/c/math/frexp.js +19 -20
- package/c/math/index.js +2 -5
- package/c/stdio/index.js +1 -4
- package/c/stdio/sprintf.js +71 -81
- package/c/stdlib/atof.js +15 -0
- package/c/stdlib/atoi.js +17 -0
- package/c/stdlib/index.js +2 -0
- package/c/string/index.js +5 -0
- package/c/string/strcat.js +12 -0
- package/c/string/strchr.js +15 -0
- package/c/string/strcmp.js +21 -0
- package/c/string/strlen.js +12 -0
- package/c/string/strstr.js +15 -0
- package/clojure/Math/abs.js +13 -0
- package/clojure/Math/ceil.js +15 -0
- package/clojure/Math/floor.js +14 -0
- package/clojure/Math/index.js +3 -0
- package/elixir/Float/ceil.js +16 -0
- package/elixir/Float/floor.js +14 -0
- package/elixir/Float/index.js +2 -0
- package/elixir/Kernel/abs.js +13 -0
- package/elixir/Kernel/index.js +1 -0
- package/golang/index.js +1 -4
- package/golang/strconv/Atoi.js +26 -0
- package/golang/strconv/FormatBool.js +12 -0
- package/golang/strconv/FormatInt.js +21 -0
- package/golang/strconv/Itoa.js +14 -0
- package/golang/strconv/ParseBool.js +35 -0
- package/golang/strconv/ParseInt.js +27 -0
- package/golang/strconv/index.js +6 -0
- package/golang/strings/Compare.js +19 -0
- package/golang/strings/Contains.js +7 -9
- package/golang/strings/ContainsAny.js +18 -0
- package/golang/strings/Count.js +20 -22
- package/golang/strings/EqualFold.js +13 -0
- package/golang/strings/Fields.js +12 -0
- package/golang/strings/HasPrefix.js +15 -0
- package/golang/strings/HasSuffix.js +20 -0
- package/golang/strings/Index.js +11 -0
- package/golang/strings/Index2.js +9 -11
- package/golang/strings/IndexAny.js +18 -0
- package/golang/strings/Join.js +16 -0
- package/golang/strings/LastIndex.js +10 -12
- package/golang/strings/LastIndexAny.js +18 -0
- package/golang/strings/Repeat.js +19 -0
- package/golang/strings/Replace.js +44 -0
- package/golang/strings/Split.js +24 -0
- package/golang/strings/ToLower.js +9 -0
- package/golang/strings/ToUpper.js +9 -0
- package/golang/strings/Trim.js +19 -0
- package/golang/strings/TrimLeft.js +15 -0
- package/golang/strings/TrimPrefix.js +14 -0
- package/golang/strings/TrimRight.js +15 -0
- package/golang/strings/TrimSpace.js +10 -0
- package/golang/strings/TrimSuffix.js +14 -0
- package/golang/strings/index.js +25 -7
- package/index.js +5 -8
- package/julia/Base/abs.js +13 -0
- package/julia/Base/ceil.js +16 -0
- package/julia/Base/floor.js +14 -0
- package/julia/Base/index.js +3 -0
- package/lua/math/abs.js +13 -0
- package/lua/math/ceil.js +16 -0
- package/lua/math/floor.js +14 -0
- package/lua/math/index.js +3 -0
- package/lua/string/index.js +3 -0
- package/lua/string/lower.js +11 -0
- package/lua/string/sub.js +33 -0
- package/lua/string/upper.js +11 -0
- package/package.json +37 -51
- package/perl/POSIX/ceil.js +16 -0
- package/perl/POSIX/floor.js +14 -0
- package/perl/POSIX/index.js +2 -0
- package/perl/core/index.js +1 -0
- package/perl/core/length.js +16 -0
- package/php/_helpers/_bc.js +524 -515
- package/php/_helpers/_phpCastString.js +20 -25
- package/php/_helpers/_php_cast_float.js +5 -10
- package/php/_helpers/_php_cast_int.js +6 -11
- package/php/_helpers/index.js +4 -7
- package/php/array/array_change_key_case.js +11 -16
- package/php/array/array_chunk.js +20 -23
- package/php/array/array_column.js +22 -72
- package/php/array/array_combine.js +13 -18
- package/php/array/array_count_values.js +35 -39
- package/php/array/array_diff.js +11 -14
- package/php/array/array_diff_assoc.js +11 -14
- package/php/array/array_diff_key.js +11 -14
- package/php/array/array_diff_uassoc.js +15 -19
- package/php/array/array_diff_ukey.js +14 -17
- package/php/array/array_fill.js +11 -13
- package/php/array/array_fill_keys.js +5 -8
- package/php/array/array_filter.js +12 -13
- package/php/array/array_flip.js +13 -15
- package/php/array/array_intersect.js +13 -16
- package/php/array/array_intersect_assoc.js +13 -16
- package/php/array/array_intersect_key.js +15 -18
- package/php/array/array_intersect_uassoc.js +17 -20
- package/php/array/array_intersect_ukey.js +17 -20
- package/php/array/array_key_exists.js +4 -7
- package/php/array/array_keys.js +22 -24
- package/php/array/array_map.js +24 -29
- package/php/array/array_merge.js +22 -25
- package/php/array/array_merge_recursive.js +51 -27
- package/php/array/array_multisort.js +138 -130
- package/php/array/array_pad.js +24 -26
- package/php/array/array_pop.js +10 -13
- package/php/array/array_product.js +15 -17
- package/php/array/array_push.js +16 -19
- package/php/array/array_rand.js +11 -14
- package/php/array/array_reduce.js +11 -14
- package/php/array/array_replace.js +9 -12
- package/php/array/array_replace_recursive.js +20 -24
- package/php/array/array_reverse.js +12 -15
- package/php/array/array_search.js +27 -29
- package/php/array/array_shift.js +3 -6
- package/php/array/array_slice.js +37 -39
- package/php/array/array_splice.js +64 -69
- package/php/array/array_sum.js +7 -12
- package/php/array/array_udiff.js +14 -17
- package/php/array/array_udiff_assoc.js +14 -17
- package/php/array/array_udiff_uassoc.js +17 -20
- package/php/array/array_uintersect.js +16 -19
- package/php/array/array_uintersect_uassoc.js +18 -21
- package/php/array/array_unique.js +12 -15
- package/php/array/array_unshift.js +4 -7
- package/php/array/array_values.js +11 -13
- package/php/array/array_walk.js +10 -15
- package/php/array/array_walk_recursive.js +15 -20
- package/php/array/arsort.js +50 -52
- package/php/array/asort.js +50 -51
- package/php/array/count.js +15 -14
- package/php/array/current.js +30 -32
- package/php/array/each.js +32 -35
- package/php/array/end.js +27 -30
- package/php/array/in_array.js +7 -10
- package/php/array/index.js +73 -76
- package/php/array/key.js +32 -34
- package/php/array/krsort.js +50 -51
- package/php/array/ksort.js +50 -51
- package/php/array/natcasesort.js +37 -38
- package/php/array/natsort.js +35 -36
- package/php/array/next.js +34 -36
- package/php/array/pos.js +10 -12
- package/php/array/prev.js +32 -34
- package/php/array/range.js +30 -33
- package/php/array/reset.js +24 -27
- package/php/array/rsort.js +47 -49
- package/php/array/shuffle.js +16 -18
- package/php/array/sizeof.js +3 -6
- package/php/array/sort.js +43 -45
- package/php/array/uasort.js +19 -21
- package/php/array/uksort.js +22 -24
- package/php/array/usort.js +20 -22
- package/php/bc/bcadd.js +16 -19
- package/php/bc/bccomp.js +12 -15
- package/php/bc/bcdiv.js +17 -20
- package/php/bc/bcmul.js +16 -19
- package/php/bc/bcround.js +21 -24
- package/php/bc/bcscale.js +8 -11
- package/php/bc/bcsub.js +16 -19
- package/php/bc/index.js +7 -10
- package/php/ctype/ctype_alnum.js +14 -16
- package/php/ctype/ctype_alpha.js +14 -16
- package/php/ctype/ctype_cntrl.js +9 -12
- package/php/ctype/ctype_digit.js +14 -16
- package/php/ctype/ctype_graph.js +14 -16
- package/php/ctype/ctype_lower.js +14 -16
- package/php/ctype/ctype_print.js +14 -16
- package/php/ctype/ctype_punct.js +14 -16
- package/php/ctype/ctype_space.js +9 -12
- package/php/ctype/ctype_upper.js +14 -16
- package/php/ctype/ctype_xdigit.js +14 -16
- package/php/ctype/index.js +11 -14
- package/php/datetime/checkdate.js +15 -17
- package/php/datetime/date.js +142 -123
- package/php/datetime/date_parse.js +18 -21
- package/php/datetime/getdate.js +38 -24
- package/php/datetime/gettimeofday.js +7 -10
- package/php/datetime/gmdate.js +17 -16
- package/php/datetime/gmmktime.js +23 -25
- package/php/datetime/gmstrftime.js +17 -14
- package/php/datetime/idate.js +44 -38
- package/php/datetime/index.js +15 -18
- package/php/datetime/microtime.js +11 -14
- package/php/datetime/mktime.js +14 -17
- package/php/datetime/strftime.js +122 -113
- package/php/datetime/strptime.js +210 -191
- package/php/datetime/strtotime.js +615 -496
- package/php/datetime/time.js +11 -13
- package/php/exec/escapeshellarg.js +16 -18
- package/php/exec/index.js +1 -4
- package/php/filesystem/basename.js +22 -24
- package/php/filesystem/dirname.js +12 -14
- package/php/filesystem/file_exists.js +9 -11
- package/php/filesystem/file_get_contents.js +3 -6
- package/php/filesystem/index.js +6 -9
- package/php/filesystem/pathinfo.js +47 -46
- package/php/filesystem/realpath.js +16 -19
- package/php/funchand/call_user_func.js +4 -7
- package/php/funchand/call_user_func_array.js +19 -22
- package/php/funchand/create_function.js +4 -7
- package/php/funchand/function_exists.js +4 -8
- package/php/funchand/get_defined_functions.js +25 -32
- package/php/funchand/index.js +5 -8
- package/php/i18n/i18n_loc_get_default.js +7 -10
- package/php/i18n/i18n_loc_set_default.js +12 -15
- package/php/i18n/index.js +2 -5
- package/php/index.js +20 -23
- package/php/info/assert_options.js +25 -27
- package/php/info/getenv.js +8 -10
- package/php/info/index.js +6 -9
- package/php/info/ini_get.js +9 -12
- package/php/info/ini_set.js +32 -34
- package/php/info/set_time_limit.js +8 -11
- package/php/info/version_compare.js +43 -44
- package/php/json/index.js +3 -6
- package/php/json/json_decode.js +42 -28
- package/php/json/json_encode.js +89 -66
- package/php/json/json_last_error.js +11 -13
- package/php/math/abs.js +2 -5
- package/php/math/acos.js +2 -5
- package/php/math/acosh.js +7 -9
- package/php/math/asin.js +2 -5
- package/php/math/asinh.js +7 -9
- package/php/math/atan.js +7 -9
- package/php/math/atan2.js +7 -9
- package/php/math/atanh.js +2 -5
- package/php/math/base_convert.js +8 -10
- package/php/math/bindec.js +12 -14
- package/php/math/ceil.js +7 -9
- package/php/math/cos.js +7 -9
- package/php/math/cosh.js +7 -9
- package/php/math/decbin.js +16 -18
- package/php/math/dechex.js +3 -6
- package/php/math/decoct.js +13 -15
- package/php/math/deg2rad.js +8 -10
- package/php/math/exp.js +7 -9
- package/php/math/expm1.js +9 -11
- package/php/math/floor.js +7 -9
- package/php/math/fmod.js +27 -29
- package/php/math/getrandmax.js +7 -9
- package/php/math/hexdec.js +10 -12
- package/php/math/hypot.js +8 -11
- package/php/math/index.js +46 -49
- package/php/math/is_finite.js +9 -14
- package/php/math/is_infinite.js +9 -14
- package/php/math/is_nan.js +8 -13
- package/php/math/lcg_value.js +8 -10
- package/php/math/log.js +8 -10
- package/php/math/log10.js +12 -14
- package/php/math/log1p.js +15 -17
- package/php/math/max.js +54 -59
- package/php/math/min.js +54 -59
- package/php/math/mt_getrandmax.js +7 -9
- package/php/math/mt_rand.js +15 -17
- package/php/math/octdec.js +8 -10
- package/php/math/pi.js +2 -5
- package/php/math/pow.js +2 -5
- package/php/math/rad2deg.js +8 -10
- package/php/math/rand.js +15 -17
- package/php/math/round.js +48 -49
- package/php/math/sin.js +7 -9
- package/php/math/sinh.js +7 -9
- package/php/math/sqrt.js +7 -9
- package/php/math/tan.js +7 -9
- package/php/math/tanh.js +8 -10
- package/php/misc/index.js +2 -5
- package/php/misc/pack.js +173 -165
- package/php/misc/uniqid.js +20 -23
- package/php/net-gopher/gopher_parsedir.js +27 -29
- package/php/net-gopher/index.js +1 -4
- package/php/network/index.js +6 -9
- package/php/network/inet_ntop.js +15 -15
- package/php/network/inet_pton.js +30 -34
- package/php/network/ip2long.js +25 -15
- package/php/network/long2ip.js +8 -10
- package/php/network/setcookie.js +11 -13
- package/php/network/setrawcookie.js +16 -19
- package/php/pcre/index.js +4 -7
- package/php/pcre/preg_match.js +3 -6
- package/php/pcre/preg_quote.js +2 -5
- package/php/pcre/preg_replace.js +8 -11
- package/php/pcre/sql_regcase.js +17 -20
- package/php/strings/addcslashes.js +86 -88
- package/php/strings/addslashes.js +15 -16
- package/php/strings/bin2hex.js +19 -43
- package/php/strings/chop.js +8 -10
- package/php/strings/chr.js +12 -14
- package/php/strings/chunk_split.js +15 -17
- package/php/strings/convert_cyr_string.js +137 -50
- package/php/strings/convert_uuencode.js +35 -38
- package/php/strings/count_chars.js +29 -27
- package/php/strings/crc32.js +276 -21
- package/php/strings/echo.js +28 -30
- package/php/strings/explode.js +31 -26
- package/php/strings/get_html_translation_table.js +123 -122
- package/php/strings/hex2bin.js +21 -21
- package/php/strings/html_entity_decode.js +31 -33
- package/php/strings/htmlentities.js +38 -34
- package/php/strings/htmlspecialchars.js +20 -23
- package/php/strings/htmlspecialchars_decode.js +19 -21
- package/php/strings/implode.js +23 -27
- package/php/strings/index.js +91 -94
- package/php/strings/join.js +8 -10
- package/php/strings/lcfirst.js +9 -11
- package/php/strings/levenshtein.js +37 -39
- package/php/strings/localeconv.js +12 -15
- package/php/strings/ltrim.js +12 -14
- package/php/strings/md5.js +216 -223
- package/php/strings/md5_file.js +17 -19
- package/php/strings/metaphone.js +112 -117
- package/php/strings/money_format.js +139 -126
- package/php/strings/nl2br.js +24 -26
- package/php/strings/nl_langinfo.js +32 -35
- package/php/strings/number_format.js +19 -22
- package/php/strings/ord.js +19 -21
- package/php/strings/parse_str.js +53 -56
- package/php/strings/printf.js +6 -9
- package/php/strings/quoted_printable_decode.js +7 -10
- package/php/strings/quoted_printable_encode.js +19 -20
- package/php/strings/quotemeta.js +7 -9
- package/php/strings/rtrim.js +14 -16
- package/php/strings/setlocale.js +148 -104
- package/php/strings/sha1.js +108 -106
- package/php/strings/sha1_file.js +15 -17
- package/php/strings/similar_text.js +34 -33
- package/php/strings/soundex.js +34 -36
- package/php/strings/split.js +8 -10
- package/php/strings/sprintf.js +112 -114
- package/php/strings/sscanf.js +99 -96
- package/php/strings/str_getcsv.js +37 -32
- package/php/strings/str_ireplace.js +50 -55
- package/php/strings/str_pad.js +18 -21
- package/php/strings/str_repeat.js +14 -16
- package/php/strings/str_replace.js +32 -37
- package/php/strings/str_rot13.js +15 -17
- package/php/strings/str_shuffle.js +12 -15
- package/php/strings/str_split.js +19 -21
- package/php/strings/str_word_count.js +51 -50
- package/php/strings/strcasecmp.js +12 -14
- package/php/strings/strchr.js +10 -12
- package/php/strings/strcmp.js +12 -14
- package/php/strings/strcoll.js +9 -12
- package/php/strings/strcspn.js +30 -25
- package/php/strings/strip_tags.js +50 -52
- package/php/strings/stripos.js +12 -14
- package/php/strings/stripslashes.js +8 -10
- package/php/strings/stristr.js +15 -17
- package/php/strings/strlen.js +23 -26
- package/php/strings/strnatcasecmp.js +6 -8
- package/php/strings/strnatcmp.js +47 -46
- package/php/strings/strncasecmp.js +30 -32
- package/php/strings/strncmp.js +5 -7
- package/php/strings/strpbrk.js +12 -14
- package/php/strings/strpos.js +11 -13
- package/php/strings/strrchr.js +7 -10
- package/php/strings/strrev.js +188 -10
- package/php/strings/strripos.js +16 -18
- package/php/strings/strrpos.js +20 -22
- package/php/strings/strspn.js +24 -26
- package/php/strings/strstr.js +20 -22
- package/php/strings/strtok.js +14 -16
- package/php/strings/strtolower.js +8 -10
- package/php/strings/strtoupper.js +8 -10
- package/php/strings/strtr.js +38 -43
- package/php/strings/substr.js +14 -18
- package/php/strings/substr_compare.js +18 -20
- package/php/strings/substr_count.js +11 -14
- package/php/strings/substr_replace.js +5 -8
- package/php/strings/trim.js +53 -32
- package/php/strings/ucfirst.js +11 -13
- package/php/strings/ucwords.js +3 -6
- package/php/strings/vprintf.js +6 -9
- package/php/strings/vsprintf.js +8 -10
- package/php/strings/wordwrap.js +32 -35
- package/php/url/base64_decode.js +42 -40
- package/php/url/base64_encode.js +51 -53
- package/php/url/http_build_query.js +27 -32
- package/php/url/index.js +8 -11
- package/php/url/parse_url.js +61 -25
- package/php/url/rawurldecode.js +8 -8
- package/php/url/rawurlencode.js +9 -6
- package/php/url/urldecode.js +9 -8
- package/php/url/urlencode.js +11 -6
- package/php/var/boolval.js +31 -33
- package/php/var/doubleval.js +10 -12
- package/php/var/empty.js +11 -16
- package/php/var/floatval.js +13 -15
- package/php/var/gettype.js +22 -23
- package/php/var/index.js +30 -33
- package/php/var/intval.js +35 -39
- package/php/var/is_array.js +27 -31
- package/php/var/is_binary.js +2 -5
- package/php/var/is_bool.js +10 -12
- package/php/var/is_buffer.js +2 -5
- package/php/var/is_callable.js +34 -35
- package/php/var/is_double.js +10 -12
- package/php/var/is_float.js +12 -14
- package/php/var/is_int.js +20 -22
- package/php/var/is_integer.js +12 -14
- package/php/var/is_long.js +3 -6
- package/php/var/is_null.js +9 -11
- package/php/var/is_numeric.js +30 -6
- package/php/var/is_object.js +4 -9
- package/php/var/is_real.js +3 -6
- package/php/var/is_scalar.js +2 -8
- package/php/var/is_string.js +9 -11
- package/php/var/is_unicode.js +12 -15
- package/php/var/isset.js +9 -12
- package/php/var/print_r.js +49 -53
- package/php/var/serialize.js +47 -52
- package/php/var/serialize.vitest.ts +10 -0
- package/php/var/strval.js +10 -13
- package/php/var/unserialize.js +168 -202
- package/php/var/var_dump.js +105 -104
- package/php/var/var_export.js +64 -66
- package/php/xdiff/index.js +2 -5
- package/php/xdiff/xdiff_string_diff.js +240 -226
- package/php/xdiff/xdiff_string_patch.js +98 -93
- package/php/xml/index.js +2 -5
- package/php/xml/utf8_decode.js +40 -42
- package/php/xml/utf8_encode.js +40 -42
- package/python/index.js +1 -4
- package/python/math/ceil.js +17 -0
- package/python/math/exp.js +12 -0
- package/python/math/fabs.js +14 -0
- package/python/math/factorial.js +29 -0
- package/python/math/floor.js +14 -0
- package/python/math/gcd.js +23 -0
- package/python/math/index.js +15 -0
- package/python/math/isfinite.js +14 -0
- package/python/math/isinf.js +14 -0
- package/python/math/isnan.js +14 -0
- package/python/math/log.js +16 -0
- package/python/math/log10.js +14 -0
- package/python/math/log2.js +14 -0
- package/python/math/pow.js +14 -0
- package/python/math/sqrt.js +14 -0
- package/python/math/trunc.js +14 -0
- package/python/string/ascii_letters.js +14 -14
- package/python/string/ascii_lowercase.js +12 -16
- package/python/string/ascii_uppercase.js +12 -16
- package/python/string/capwords.js +4 -7
- package/python/string/digits.js +10 -0
- package/python/string/hexdigits.js +10 -0
- package/python/string/index.js +10 -8
- package/python/string/octdigits.js +10 -0
- package/python/string/printable.js +15 -0
- package/python/string/punctuation.js +5 -7
- package/python/string/whitespace.js +10 -0
- package/r/base/abs.js +13 -0
- package/r/base/ceiling.js +16 -0
- package/r/base/floor.js +14 -0
- package/r/base/index.js +3 -0
- package/ruby/Array/compact.js +18 -0
- package/ruby/Array/first.js +22 -0
- package/ruby/Array/flatten.js +22 -0
- package/ruby/Array/index.js +6 -0
- package/ruby/Array/last.js +22 -0
- package/ruby/Array/sample.js +31 -0
- package/ruby/Array/uniq.js +16 -0
- package/ruby/Math/acos.js +2 -5
- package/ruby/Math/asin.js +11 -0
- package/ruby/Math/atan.js +11 -0
- package/ruby/Math/cbrt.js +13 -0
- package/ruby/Math/cos.js +12 -0
- package/ruby/Math/cosh.js +11 -0
- package/ruby/Math/exp.js +11 -0
- package/ruby/Math/index.js +15 -4
- package/ruby/Math/log.js +11 -0
- package/ruby/Math/log10.js +13 -0
- package/ruby/Math/log2.js +13 -0
- package/ruby/Math/sin.js +12 -0
- package/ruby/Math/sinh.js +11 -0
- package/ruby/Math/sqrt.js +13 -0
- package/ruby/Math/tan.js +11 -0
- package/ruby/Math/tanh.js +11 -0
- package/ruby/String/capitalize.js +19 -0
- package/ruby/String/chomp.js +27 -0
- package/ruby/String/chop.js +25 -0
- package/ruby/String/downcase.js +10 -0
- package/ruby/String/end_with.js +17 -0
- package/ruby/String/include.js +12 -0
- package/ruby/String/index.js +11 -0
- package/ruby/String/length.js +12 -0
- package/ruby/String/reverse.js +12 -0
- package/ruby/String/start_with.js +14 -0
- package/ruby/String/strip.js +12 -0
- package/ruby/String/upcase.js +10 -0
- package/ruby/index.js +1 -4
- package/_util/cli.js +0 -14
- package/_util/cli.js.map +0 -1
- package/_util/util.js +0 -620
- package/_util/util.js.map +0 -1
- package/c/index.js.map +0 -1
- package/c/math/abs.js.map +0 -1
- package/c/math/frexp.js.map +0 -1
- package/c/math/index.js.map +0 -1
- package/c/stdio/index.js.map +0 -1
- package/c/stdio/sprintf.js.map +0 -1
- package/golang/index.js.map +0 -1
- package/golang/strings/Contains.js.map +0 -1
- package/golang/strings/Count.js.map +0 -1
- package/golang/strings/Index2.js.map +0 -1
- package/golang/strings/LastIndex.js.map +0 -1
- package/golang/strings/index.js.map +0 -1
- package/index.js.map +0 -1
- package/php/_helpers/_bc.js.map +0 -1
- package/php/_helpers/_phpCastString.js.map +0 -1
- package/php/_helpers/_php_cast_float.js.map +0 -1
- package/php/_helpers/_php_cast_int.js.map +0 -1
- package/php/_helpers/index.js.map +0 -1
- package/php/array/array_change_key_case.js.map +0 -1
- package/php/array/array_chunk.js.map +0 -1
- package/php/array/array_column.js.map +0 -1
- package/php/array/array_combine.js.map +0 -1
- package/php/array/array_count_values.js.map +0 -1
- package/php/array/array_diff.js.map +0 -1
- package/php/array/array_diff_assoc.js.map +0 -1
- package/php/array/array_diff_key.js.map +0 -1
- package/php/array/array_diff_uassoc.js.map +0 -1
- package/php/array/array_diff_ukey.js.map +0 -1
- package/php/array/array_fill.js.map +0 -1
- package/php/array/array_fill_keys.js.map +0 -1
- package/php/array/array_filter.js.map +0 -1
- package/php/array/array_flip.js.map +0 -1
- package/php/array/array_intersect.js.map +0 -1
- package/php/array/array_intersect_assoc.js.map +0 -1
- package/php/array/array_intersect_key.js.map +0 -1
- package/php/array/array_intersect_uassoc.js.map +0 -1
- package/php/array/array_intersect_ukey.js.map +0 -1
- package/php/array/array_key_exists.js.map +0 -1
- package/php/array/array_keys.js.map +0 -1
- package/php/array/array_map.js.map +0 -1
- package/php/array/array_merge.js.map +0 -1
- package/php/array/array_merge_recursive.js.map +0 -1
- package/php/array/array_multisort.js.map +0 -1
- package/php/array/array_pad.js.map +0 -1
- package/php/array/array_pop.js.map +0 -1
- package/php/array/array_product.js.map +0 -1
- package/php/array/array_push.js.map +0 -1
- package/php/array/array_rand.js.map +0 -1
- package/php/array/array_reduce.js.map +0 -1
- package/php/array/array_replace.js.map +0 -1
- package/php/array/array_replace_recursive.js.map +0 -1
- package/php/array/array_reverse.js.map +0 -1
- package/php/array/array_search.js.map +0 -1
- package/php/array/array_shift.js.map +0 -1
- package/php/array/array_slice.js.map +0 -1
- package/php/array/array_splice.js.map +0 -1
- package/php/array/array_sum.js.map +0 -1
- package/php/array/array_udiff.js.map +0 -1
- package/php/array/array_udiff_assoc.js.map +0 -1
- package/php/array/array_udiff_uassoc.js.map +0 -1
- package/php/array/array_uintersect.js.map +0 -1
- package/php/array/array_uintersect_uassoc.js.map +0 -1
- package/php/array/array_unique.js.map +0 -1
- package/php/array/array_unshift.js.map +0 -1
- package/php/array/array_values.js.map +0 -1
- package/php/array/array_walk.js.map +0 -1
- package/php/array/array_walk_recursive.js.map +0 -1
- package/php/array/arsort.js.map +0 -1
- package/php/array/asort.js.map +0 -1
- package/php/array/count.js.map +0 -1
- package/php/array/current.js.map +0 -1
- package/php/array/each.js.map +0 -1
- package/php/array/end.js.map +0 -1
- package/php/array/in_array.js.map +0 -1
- package/php/array/index.js.map +0 -1
- package/php/array/key.js.map +0 -1
- package/php/array/krsort.js.map +0 -1
- package/php/array/ksort.js.map +0 -1
- package/php/array/natcasesort.js.map +0 -1
- package/php/array/natsort.js.map +0 -1
- package/php/array/next.js.map +0 -1
- package/php/array/pos.js.map +0 -1
- package/php/array/prev.js.map +0 -1
- package/php/array/range.js.map +0 -1
- package/php/array/reset.js.map +0 -1
- package/php/array/rsort.js.map +0 -1
- package/php/array/shuffle.js.map +0 -1
- package/php/array/sizeof.js.map +0 -1
- package/php/array/sort.js.map +0 -1
- package/php/array/uasort.js.map +0 -1
- package/php/array/uksort.js.map +0 -1
- package/php/array/usort.js.map +0 -1
- package/php/bc/bcadd.js.map +0 -1
- package/php/bc/bccomp.js.map +0 -1
- package/php/bc/bcdiv.js.map +0 -1
- package/php/bc/bcmul.js.map +0 -1
- package/php/bc/bcround.js.map +0 -1
- package/php/bc/bcscale.js.map +0 -1
- package/php/bc/bcsub.js.map +0 -1
- package/php/bc/index.js.map +0 -1
- package/php/ctype/ctype_alnum.js.map +0 -1
- package/php/ctype/ctype_alpha.js.map +0 -1
- package/php/ctype/ctype_cntrl.js.map +0 -1
- package/php/ctype/ctype_digit.js.map +0 -1
- package/php/ctype/ctype_graph.js.map +0 -1
- package/php/ctype/ctype_lower.js.map +0 -1
- package/php/ctype/ctype_print.js.map +0 -1
- package/php/ctype/ctype_punct.js.map +0 -1
- package/php/ctype/ctype_space.js.map +0 -1
- package/php/ctype/ctype_upper.js.map +0 -1
- package/php/ctype/ctype_xdigit.js.map +0 -1
- package/php/ctype/index.js.map +0 -1
- package/php/datetime/checkdate.js.map +0 -1
- package/php/datetime/date.js.map +0 -1
- package/php/datetime/date_parse.js.map +0 -1
- package/php/datetime/getdate.js.map +0 -1
- package/php/datetime/gettimeofday.js.map +0 -1
- package/php/datetime/gmdate.js.map +0 -1
- package/php/datetime/gmmktime.js.map +0 -1
- package/php/datetime/gmstrftime.js.map +0 -1
- package/php/datetime/idate.js.map +0 -1
- package/php/datetime/index.js.map +0 -1
- package/php/datetime/microtime.js.map +0 -1
- package/php/datetime/mktime.js.map +0 -1
- package/php/datetime/strftime.js.map +0 -1
- package/php/datetime/strptime.js.map +0 -1
- package/php/datetime/strtotime.js.map +0 -1
- package/php/datetime/time.js.map +0 -1
- package/php/exec/escapeshellarg.js.map +0 -1
- package/php/exec/index.js.map +0 -1
- package/php/filesystem/basename.js.map +0 -1
- package/php/filesystem/dirname.js.map +0 -1
- package/php/filesystem/file_exists.js.map +0 -1
- package/php/filesystem/file_get_contents.js.map +0 -1
- package/php/filesystem/index.js.map +0 -1
- package/php/filesystem/pathinfo.js.map +0 -1
- package/php/filesystem/realpath.js.map +0 -1
- package/php/funchand/call_user_func.js.map +0 -1
- package/php/funchand/call_user_func_array.js.map +0 -1
- package/php/funchand/create_function.js.map +0 -1
- package/php/funchand/function_exists.js.map +0 -1
- package/php/funchand/get_defined_functions.js.map +0 -1
- package/php/funchand/index.js.map +0 -1
- package/php/i18n/i18n_loc_get_default.js.map +0 -1
- package/php/i18n/i18n_loc_set_default.js.map +0 -1
- package/php/i18n/index.js.map +0 -1
- package/php/index.js.map +0 -1
- package/php/info/assert_options.js.map +0 -1
- package/php/info/getenv.js.map +0 -1
- package/php/info/index.js.map +0 -1
- package/php/info/ini_get.js.map +0 -1
- package/php/info/ini_set.js.map +0 -1
- package/php/info/set_time_limit.js.map +0 -1
- package/php/info/version_compare.js.map +0 -1
- package/php/json/index.js.map +0 -1
- package/php/json/json_decode.js.map +0 -1
- package/php/json/json_encode.js.map +0 -1
- package/php/json/json_last_error.js.map +0 -1
- package/php/math/abs.js.map +0 -1
- package/php/math/acos.js.map +0 -1
- package/php/math/acosh.js.map +0 -1
- package/php/math/asin.js.map +0 -1
- package/php/math/asinh.js.map +0 -1
- package/php/math/atan.js.map +0 -1
- package/php/math/atan2.js.map +0 -1
- package/php/math/atanh.js.map +0 -1
- package/php/math/base_convert.js.map +0 -1
- package/php/math/bindec.js.map +0 -1
- package/php/math/ceil.js.map +0 -1
- package/php/math/cos.js.map +0 -1
- package/php/math/cosh.js.map +0 -1
- package/php/math/decbin.js.map +0 -1
- package/php/math/dechex.js.map +0 -1
- package/php/math/decoct.js.map +0 -1
- package/php/math/deg2rad.js.map +0 -1
- package/php/math/exp.js.map +0 -1
- package/php/math/expm1.js.map +0 -1
- package/php/math/floor.js.map +0 -1
- package/php/math/fmod.js.map +0 -1
- package/php/math/getrandmax.js.map +0 -1
- package/php/math/hexdec.js.map +0 -1
- package/php/math/hypot.js.map +0 -1
- package/php/math/index.js.map +0 -1
- package/php/math/is_finite.js.map +0 -1
- package/php/math/is_infinite.js.map +0 -1
- package/php/math/is_nan.js.map +0 -1
- package/php/math/lcg_value.js.map +0 -1
- package/php/math/log.js.map +0 -1
- package/php/math/log10.js.map +0 -1
- package/php/math/log1p.js.map +0 -1
- package/php/math/max.js.map +0 -1
- package/php/math/min.js.map +0 -1
- package/php/math/mt_getrandmax.js.map +0 -1
- package/php/math/mt_rand.js.map +0 -1
- package/php/math/octdec.js.map +0 -1
- package/php/math/pi.js.map +0 -1
- package/php/math/pow.js.map +0 -1
- package/php/math/rad2deg.js.map +0 -1
- package/php/math/rand.js.map +0 -1
- package/php/math/round.js.map +0 -1
- package/php/math/sin.js.map +0 -1
- package/php/math/sinh.js.map +0 -1
- package/php/math/sqrt.js.map +0 -1
- package/php/math/tan.js.map +0 -1
- package/php/math/tanh.js.map +0 -1
- package/php/misc/index.js.map +0 -1
- package/php/misc/pack.js.map +0 -1
- package/php/misc/uniqid.js.map +0 -1
- package/php/net-gopher/gopher_parsedir.js.map +0 -1
- package/php/net-gopher/index.js.map +0 -1
- package/php/network/index.js.map +0 -1
- package/php/network/inet_ntop.js.map +0 -1
- package/php/network/inet_pton.js.map +0 -1
- package/php/network/ip2long.js.map +0 -1
- package/php/network/long2ip.js.map +0 -1
- package/php/network/setcookie.js.map +0 -1
- package/php/network/setrawcookie.js.map +0 -1
- package/php/pcre/index.js.map +0 -1
- package/php/pcre/preg_match.js.map +0 -1
- package/php/pcre/preg_quote.js.map +0 -1
- package/php/pcre/preg_replace.js.map +0 -1
- package/php/pcre/sql_regcase.js.map +0 -1
- package/php/strings/addcslashes.js.map +0 -1
- package/php/strings/addslashes.js.map +0 -1
- package/php/strings/bin2hex.js.map +0 -1
- package/php/strings/chop.js.map +0 -1
- package/php/strings/chr.js.map +0 -1
- package/php/strings/chunk_split.js.map +0 -1
- package/php/strings/convert_cyr_string.js.map +0 -1
- package/php/strings/convert_uuencode.js.map +0 -1
- package/php/strings/count_chars.js.map +0 -1
- package/php/strings/crc32.js.map +0 -1
- package/php/strings/echo.js.map +0 -1
- package/php/strings/explode.js.map +0 -1
- package/php/strings/get_html_translation_table.js.map +0 -1
- package/php/strings/hex2bin.js.map +0 -1
- package/php/strings/html_entity_decode.js.map +0 -1
- package/php/strings/htmlentities.js.map +0 -1
- package/php/strings/htmlspecialchars.js.map +0 -1
- package/php/strings/htmlspecialchars_decode.js.map +0 -1
- package/php/strings/implode.js.map +0 -1
- package/php/strings/index.js.map +0 -1
- package/php/strings/join.js.map +0 -1
- package/php/strings/lcfirst.js.map +0 -1
- package/php/strings/levenshtein.js.map +0 -1
- package/php/strings/localeconv.js.map +0 -1
- package/php/strings/ltrim.js.map +0 -1
- package/php/strings/md5.js.map +0 -1
- package/php/strings/md5_file.js.map +0 -1
- package/php/strings/metaphone.js.map +0 -1
- package/php/strings/money_format.js.map +0 -1
- package/php/strings/nl2br.js.map +0 -1
- package/php/strings/nl_langinfo.js.map +0 -1
- package/php/strings/number_format.js.map +0 -1
- package/php/strings/ord.js.map +0 -1
- package/php/strings/parse_str.js.map +0 -1
- package/php/strings/printf.js.map +0 -1
- package/php/strings/quoted_printable_decode.js.map +0 -1
- package/php/strings/quoted_printable_encode.js.map +0 -1
- package/php/strings/quotemeta.js.map +0 -1
- package/php/strings/rtrim.js.map +0 -1
- package/php/strings/setlocale.js.map +0 -1
- package/php/strings/sha1.js.map +0 -1
- package/php/strings/sha1_file.js.map +0 -1
- package/php/strings/similar_text.js.map +0 -1
- package/php/strings/soundex.js.map +0 -1
- package/php/strings/split.js.map +0 -1
- package/php/strings/sprintf.js.map +0 -1
- package/php/strings/sscanf.js.map +0 -1
- package/php/strings/str_getcsv.js.map +0 -1
- package/php/strings/str_ireplace.js.map +0 -1
- package/php/strings/str_pad.js.map +0 -1
- package/php/strings/str_repeat.js.map +0 -1
- package/php/strings/str_replace.js.map +0 -1
- package/php/strings/str_rot13.js.map +0 -1
- package/php/strings/str_shuffle.js.map +0 -1
- package/php/strings/str_split.js.map +0 -1
- package/php/strings/str_word_count.js.map +0 -1
- package/php/strings/strcasecmp.js.map +0 -1
- package/php/strings/strchr.js.map +0 -1
- package/php/strings/strcmp.js.map +0 -1
- package/php/strings/strcoll.js.map +0 -1
- package/php/strings/strcspn.js.map +0 -1
- package/php/strings/strip_tags.js.map +0 -1
- package/php/strings/stripos.js.map +0 -1
- package/php/strings/stripslashes.js.map +0 -1
- package/php/strings/stristr.js.map +0 -1
- package/php/strings/strlen.js.map +0 -1
- package/php/strings/strnatcasecmp.js.map +0 -1
- package/php/strings/strnatcmp.js.map +0 -1
- package/php/strings/strncasecmp.js.map +0 -1
- package/php/strings/strncmp.js.map +0 -1
- package/php/strings/strpbrk.js.map +0 -1
- package/php/strings/strpos.js.map +0 -1
- package/php/strings/strrchr.js.map +0 -1
- package/php/strings/strrev.js.map +0 -1
- package/php/strings/strripos.js.map +0 -1
- package/php/strings/strrpos.js.map +0 -1
- package/php/strings/strspn.js.map +0 -1
- package/php/strings/strstr.js.map +0 -1
- package/php/strings/strtok.js.map +0 -1
- package/php/strings/strtolower.js.map +0 -1
- package/php/strings/strtoupper.js.map +0 -1
- package/php/strings/strtr.js.map +0 -1
- package/php/strings/substr.js.map +0 -1
- package/php/strings/substr_compare.js.map +0 -1
- package/php/strings/substr_count.js.map +0 -1
- package/php/strings/substr_replace.js.map +0 -1
- package/php/strings/trim.js.map +0 -1
- package/php/strings/ucfirst.js.map +0 -1
- package/php/strings/ucwords.js.map +0 -1
- package/php/strings/vprintf.js.map +0 -1
- package/php/strings/vsprintf.js.map +0 -1
- package/php/strings/wordwrap.js.map +0 -1
- package/php/url/base64_decode.js.map +0 -1
- package/php/url/base64_encode.js.map +0 -1
- package/php/url/http_build_query.js.map +0 -1
- package/php/url/index.js.map +0 -1
- package/php/url/parse_url.js.map +0 -1
- package/php/url/rawurldecode.js.map +0 -1
- package/php/url/rawurlencode.js.map +0 -1
- package/php/url/urldecode.js.map +0 -1
- package/php/url/urlencode.js.map +0 -1
- package/php/var/boolval.js.map +0 -1
- package/php/var/doubleval.js.map +0 -1
- package/php/var/empty.js.map +0 -1
- package/php/var/floatval.js.map +0 -1
- package/php/var/gettype.js.map +0 -1
- package/php/var/index.js.map +0 -1
- package/php/var/intval.js.map +0 -1
- package/php/var/is_array.js.map +0 -1
- package/php/var/is_binary.js.map +0 -1
- package/php/var/is_bool.js.map +0 -1
- package/php/var/is_buffer.js.map +0 -1
- package/php/var/is_callable.js.map +0 -1
- package/php/var/is_double.js.map +0 -1
- package/php/var/is_float.js.map +0 -1
- package/php/var/is_int.js.map +0 -1
- package/php/var/is_integer.js.map +0 -1
- package/php/var/is_long.js.map +0 -1
- package/php/var/is_null.js.map +0 -1
- package/php/var/is_numeric.js.map +0 -1
- package/php/var/is_object.js.map +0 -1
- package/php/var/is_real.js.map +0 -1
- package/php/var/is_scalar.js.map +0 -1
- package/php/var/is_string.js.map +0 -1
- package/php/var/is_unicode.js.map +0 -1
- package/php/var/isset.js.map +0 -1
- package/php/var/print_r.js.map +0 -1
- package/php/var/serialize.js.map +0 -1
- package/php/var/serialize.mocha.js +0 -14
- package/php/var/serialize.mocha.js.map +0 -1
- package/php/var/strval.js.map +0 -1
- package/php/var/unserialize.js.map +0 -1
- package/php/var/var_dump.js.map +0 -1
- package/php/var/var_export.js.map +0 -1
- package/php/xdiff/index.js.map +0 -1
- package/php/xdiff/xdiff_string_diff.js.map +0 -1
- package/php/xdiff/xdiff_string_patch.js.map +0 -1
- package/php/xml/index.js.map +0 -1
- package/php/xml/utf8_decode.js.map +0 -1
- package/php/xml/utf8_encode.js.map +0 -1
- package/python/index.js.map +0 -1
- package/python/string/ascii_letters.js.map +0 -1
- package/python/string/ascii_lowercase.js.map +0 -1
- package/python/string/ascii_uppercase.js.map +0 -1
- package/python/string/capwords.js.map +0 -1
- package/python/string/index.js.map +0 -1
- package/python/string/punctuation.js.map +0 -1
- package/ruby/Math/acos.js.map +0 -1
- package/ruby/Math/index.js.map +0 -1
- package/ruby/index.js.map +0 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
module.exports = function htmlspecialchars_decode(string, quoteStyle) {
|
|
4
2
|
// discuss at: https://locutus.io/php/htmlspecialchars_decode/
|
|
3
|
+
// parity verified: PHP 8.3
|
|
5
4
|
// original by: Mirek Slugen
|
|
6
5
|
// improved by: Kevin van Zonneveld (https://kvz.io)
|
|
7
6
|
// bugfixed by: Mateusz "loonquawl" Zalega
|
|
@@ -21,50 +20,49 @@ module.exports = function htmlspecialchars_decode(string, quoteStyle) {
|
|
|
21
20
|
// example 2: htmlspecialchars_decode(""")
|
|
22
21
|
// returns 2: '"'
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
let optTemp = 0
|
|
24
|
+
let i = 0
|
|
25
|
+
let noquotes = false
|
|
27
26
|
|
|
28
27
|
if (typeof quoteStyle === 'undefined') {
|
|
29
|
-
quoteStyle = 2
|
|
28
|
+
quoteStyle = 2
|
|
30
29
|
}
|
|
31
|
-
string = string.toString().replace(/</g, '<').replace(/>/g, '>')
|
|
32
|
-
|
|
30
|
+
string = string.toString().replace(/</g, '<').replace(/>/g, '>')
|
|
31
|
+
const OPTS = {
|
|
33
32
|
ENT_NOQUOTES: 0,
|
|
34
33
|
ENT_HTML_QUOTE_SINGLE: 1,
|
|
35
34
|
ENT_HTML_QUOTE_DOUBLE: 2,
|
|
36
35
|
ENT_COMPAT: 2,
|
|
37
36
|
ENT_QUOTES: 3,
|
|
38
|
-
ENT_IGNORE: 4
|
|
39
|
-
}
|
|
37
|
+
ENT_IGNORE: 4,
|
|
38
|
+
}
|
|
40
39
|
if (quoteStyle === 0) {
|
|
41
|
-
noquotes = true
|
|
40
|
+
noquotes = true
|
|
42
41
|
}
|
|
43
42
|
if (typeof quoteStyle !== 'number') {
|
|
44
43
|
// Allow for a single string or an array of string flags
|
|
45
|
-
quoteStyle = [].concat(quoteStyle)
|
|
44
|
+
quoteStyle = [].concat(quoteStyle)
|
|
46
45
|
for (i = 0; i < quoteStyle.length; i++) {
|
|
47
46
|
// Resolve string input to bitwise e.g. 'PATHINFO_EXTENSION' becomes 4
|
|
48
47
|
if (OPTS[quoteStyle[i]] === 0) {
|
|
49
|
-
noquotes = true
|
|
48
|
+
noquotes = true
|
|
50
49
|
} else if (OPTS[quoteStyle[i]]) {
|
|
51
|
-
optTemp = optTemp | OPTS[quoteStyle[i]]
|
|
50
|
+
optTemp = optTemp | OPTS[quoteStyle[i]]
|
|
52
51
|
}
|
|
53
52
|
}
|
|
54
|
-
quoteStyle = optTemp
|
|
53
|
+
quoteStyle = optTemp
|
|
55
54
|
}
|
|
56
55
|
if (quoteStyle & OPTS.ENT_HTML_QUOTE_SINGLE) {
|
|
57
56
|
// PHP doesn't currently escape if more than one 0, but it should:
|
|
58
|
-
string = string.replace(/�*39;/g, "'")
|
|
57
|
+
string = string.replace(/�*39;/g, "'")
|
|
59
58
|
// This would also be useful here, but not a part of PHP:
|
|
60
59
|
// string = string.replace(/'|�*27;/g, "'");
|
|
61
60
|
}
|
|
62
61
|
if (!noquotes) {
|
|
63
|
-
string = string.replace(/"/g, '"')
|
|
62
|
+
string = string.replace(/"/g, '"')
|
|
64
63
|
}
|
|
65
64
|
// Put this in last place to avoid escape being double-decoded
|
|
66
|
-
string = string.replace(/&/g, '&')
|
|
65
|
+
string = string.replace(/&/g, '&')
|
|
67
66
|
|
|
68
|
-
return string
|
|
69
|
-
}
|
|
70
|
-
//# sourceMappingURL=htmlspecialchars_decode.js.map
|
|
67
|
+
return string
|
|
68
|
+
}
|
package/php/strings/implode.js
CHANGED
|
@@ -1,38 +1,34 @@
|
|
|
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 implode(glue, pieces) {
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
2
|
+
// discuss at: https://locutus.io/php/implode/
|
|
3
|
+
// parity verified: PHP 8.3
|
|
4
|
+
// original by: Kevin van Zonneveld (https://kvz.io)
|
|
5
|
+
// improved by: Waldo Malqui Silva (https://waldo.malqui.info)
|
|
6
|
+
// improved by: Itsacon (https://www.itsacon.net/)
|
|
7
|
+
// bugfixed by: Brett Zamir (https://brett-zamir.me)
|
|
8
|
+
// example 1: implode(' ', ['Kevin', 'van', 'Zonneveld'])
|
|
9
|
+
// returns 1: 'Kevin van Zonneveld'
|
|
10
|
+
// example 2: implode(' ', {first:'Kevin', last: 'van Zonneveld'})
|
|
11
|
+
// returns 2: 'Kevin van Zonneveld'
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
let i = ''
|
|
14
|
+
let retVal = ''
|
|
15
|
+
let tGlue = ''
|
|
19
16
|
|
|
20
17
|
if (arguments.length === 1) {
|
|
21
|
-
pieces = glue
|
|
22
|
-
glue = ''
|
|
18
|
+
pieces = glue
|
|
19
|
+
glue = ''
|
|
23
20
|
}
|
|
24
21
|
|
|
25
|
-
if (
|
|
26
|
-
if (
|
|
27
|
-
return pieces.join(glue)
|
|
22
|
+
if (typeof pieces === 'object') {
|
|
23
|
+
if (Array.isArray(pieces)) {
|
|
24
|
+
return pieces.join(glue)
|
|
28
25
|
}
|
|
29
26
|
for (i in pieces) {
|
|
30
|
-
retVal += tGlue + pieces[i]
|
|
31
|
-
tGlue = glue
|
|
27
|
+
retVal += tGlue + pieces[i]
|
|
28
|
+
tGlue = glue
|
|
32
29
|
}
|
|
33
|
-
return retVal
|
|
30
|
+
return retVal
|
|
34
31
|
}
|
|
35
32
|
|
|
36
|
-
return pieces
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=implode.js.map
|
|
33
|
+
return pieces
|
|
34
|
+
}
|
package/php/strings/index.js
CHANGED
|
@@ -1,94 +1,91 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
module.exports.
|
|
4
|
-
module.exports.
|
|
5
|
-
module.exports.
|
|
6
|
-
module.exports.
|
|
7
|
-
module.exports.
|
|
8
|
-
module.exports.
|
|
9
|
-
module.exports.
|
|
10
|
-
module.exports.
|
|
11
|
-
module.exports.
|
|
12
|
-
module.exports.
|
|
13
|
-
module.exports.
|
|
14
|
-
module.exports.
|
|
15
|
-
module.exports.
|
|
16
|
-
module.exports.
|
|
17
|
-
module.exports.
|
|
18
|
-
module.exports.
|
|
19
|
-
module.exports.
|
|
20
|
-
module.exports.
|
|
21
|
-
module.exports.
|
|
22
|
-
module.exports.
|
|
23
|
-
module.exports.
|
|
24
|
-
module.exports.
|
|
25
|
-
module.exports.
|
|
26
|
-
module.exports.
|
|
27
|
-
module.exports.
|
|
28
|
-
module.exports.
|
|
29
|
-
module.exports.
|
|
30
|
-
module.exports.
|
|
31
|
-
module.exports.
|
|
32
|
-
module.exports.
|
|
33
|
-
module.exports.
|
|
34
|
-
module.exports.
|
|
35
|
-
module.exports.
|
|
36
|
-
module.exports.
|
|
37
|
-
module.exports.
|
|
38
|
-
module.exports.
|
|
39
|
-
module.exports.
|
|
40
|
-
module.exports.
|
|
41
|
-
module.exports.
|
|
42
|
-
module.exports.
|
|
43
|
-
module.exports.
|
|
44
|
-
module.exports.
|
|
45
|
-
module.exports.
|
|
46
|
-
module.exports.
|
|
47
|
-
module.exports.
|
|
48
|
-
module.exports.
|
|
49
|
-
module.exports.
|
|
50
|
-
module.exports.
|
|
51
|
-
module.exports.
|
|
52
|
-
module.exports.
|
|
53
|
-
module.exports.
|
|
54
|
-
module.exports.
|
|
55
|
-
module.exports.
|
|
56
|
-
module.exports.
|
|
57
|
-
module.exports.
|
|
58
|
-
module.exports.
|
|
59
|
-
module.exports.
|
|
60
|
-
module.exports.
|
|
61
|
-
module.exports.
|
|
62
|
-
module.exports.
|
|
63
|
-
module.exports.
|
|
64
|
-
module.exports.
|
|
65
|
-
module.exports.
|
|
66
|
-
module.exports.
|
|
67
|
-
module.exports.
|
|
68
|
-
module.exports.
|
|
69
|
-
module.exports.
|
|
70
|
-
module.exports.
|
|
71
|
-
module.exports.
|
|
72
|
-
module.exports.
|
|
73
|
-
module.exports.
|
|
74
|
-
module.exports.
|
|
75
|
-
module.exports.
|
|
76
|
-
module.exports.
|
|
77
|
-
module.exports.
|
|
78
|
-
module.exports.
|
|
79
|
-
module.exports.
|
|
80
|
-
module.exports.
|
|
81
|
-
module.exports.
|
|
82
|
-
module.exports.
|
|
83
|
-
module.exports.
|
|
84
|
-
module.exports.
|
|
85
|
-
module.exports.
|
|
86
|
-
module.exports.
|
|
87
|
-
module.exports.
|
|
88
|
-
module.exports.
|
|
89
|
-
module.exports.
|
|
90
|
-
module.exports.
|
|
91
|
-
module.exports.
|
|
92
|
-
module.exports.vsprintf = require('./vsprintf');
|
|
93
|
-
module.exports.wordwrap = require('./wordwrap');
|
|
94
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
module.exports.addcslashes = require('./addcslashes')
|
|
2
|
+
module.exports.addslashes = require('./addslashes')
|
|
3
|
+
module.exports.bin2hex = require('./bin2hex')
|
|
4
|
+
module.exports.chop = require('./chop')
|
|
5
|
+
module.exports.chr = require('./chr')
|
|
6
|
+
module.exports.chunk_split = require('./chunk_split')
|
|
7
|
+
module.exports.convert_cyr_string = require('./convert_cyr_string')
|
|
8
|
+
module.exports.convert_uuencode = require('./convert_uuencode')
|
|
9
|
+
module.exports.count_chars = require('./count_chars')
|
|
10
|
+
module.exports.crc32 = require('./crc32')
|
|
11
|
+
module.exports.echo = require('./echo')
|
|
12
|
+
module.exports.explode = require('./explode')
|
|
13
|
+
module.exports.get_html_translation_table = require('./get_html_translation_table')
|
|
14
|
+
module.exports.hex2bin = require('./hex2bin')
|
|
15
|
+
module.exports.html_entity_decode = require('./html_entity_decode')
|
|
16
|
+
module.exports.htmlentities = require('./htmlentities')
|
|
17
|
+
module.exports.htmlspecialchars = require('./htmlspecialchars')
|
|
18
|
+
module.exports.htmlspecialchars_decode = require('./htmlspecialchars_decode')
|
|
19
|
+
module.exports.implode = require('./implode')
|
|
20
|
+
module.exports.join = require('./join')
|
|
21
|
+
module.exports.lcfirst = require('./lcfirst')
|
|
22
|
+
module.exports.levenshtein = require('./levenshtein')
|
|
23
|
+
module.exports.localeconv = require('./localeconv')
|
|
24
|
+
module.exports.ltrim = require('./ltrim')
|
|
25
|
+
module.exports.md5 = require('./md5')
|
|
26
|
+
module.exports.md5_file = require('./md5_file')
|
|
27
|
+
module.exports.metaphone = require('./metaphone')
|
|
28
|
+
module.exports.money_format = require('./money_format')
|
|
29
|
+
module.exports.nl2br = require('./nl2br')
|
|
30
|
+
module.exports.nl_langinfo = require('./nl_langinfo')
|
|
31
|
+
module.exports.number_format = require('./number_format')
|
|
32
|
+
module.exports.ord = require('./ord')
|
|
33
|
+
module.exports.parse_str = require('./parse_str')
|
|
34
|
+
module.exports.printf = require('./printf')
|
|
35
|
+
module.exports.quoted_printable_decode = require('./quoted_printable_decode')
|
|
36
|
+
module.exports.quoted_printable_encode = require('./quoted_printable_encode')
|
|
37
|
+
module.exports.quotemeta = require('./quotemeta')
|
|
38
|
+
module.exports.rtrim = require('./rtrim')
|
|
39
|
+
module.exports.setlocale = require('./setlocale')
|
|
40
|
+
module.exports.sha1 = require('./sha1')
|
|
41
|
+
module.exports.sha1_file = require('./sha1_file')
|
|
42
|
+
module.exports.similar_text = require('./similar_text')
|
|
43
|
+
module.exports.soundex = require('./soundex')
|
|
44
|
+
module.exports.split = require('./split')
|
|
45
|
+
module.exports.sprintf = require('./sprintf')
|
|
46
|
+
module.exports.sscanf = require('./sscanf')
|
|
47
|
+
module.exports.str_getcsv = require('./str_getcsv')
|
|
48
|
+
module.exports.str_ireplace = require('./str_ireplace')
|
|
49
|
+
module.exports.str_pad = require('./str_pad')
|
|
50
|
+
module.exports.str_repeat = require('./str_repeat')
|
|
51
|
+
module.exports.str_replace = require('./str_replace')
|
|
52
|
+
module.exports.str_rot13 = require('./str_rot13')
|
|
53
|
+
module.exports.str_shuffle = require('./str_shuffle')
|
|
54
|
+
module.exports.str_split = require('./str_split')
|
|
55
|
+
module.exports.str_word_count = require('./str_word_count')
|
|
56
|
+
module.exports.strcasecmp = require('./strcasecmp')
|
|
57
|
+
module.exports.strchr = require('./strchr')
|
|
58
|
+
module.exports.strcmp = require('./strcmp')
|
|
59
|
+
module.exports.strcoll = require('./strcoll')
|
|
60
|
+
module.exports.strcspn = require('./strcspn')
|
|
61
|
+
module.exports.strip_tags = require('./strip_tags')
|
|
62
|
+
module.exports.stripos = require('./stripos')
|
|
63
|
+
module.exports.stripslashes = require('./stripslashes')
|
|
64
|
+
module.exports.stristr = require('./stristr')
|
|
65
|
+
module.exports.strlen = require('./strlen')
|
|
66
|
+
module.exports.strnatcasecmp = require('./strnatcasecmp')
|
|
67
|
+
module.exports.strnatcmp = require('./strnatcmp')
|
|
68
|
+
module.exports.strncasecmp = require('./strncasecmp')
|
|
69
|
+
module.exports.strncmp = require('./strncmp')
|
|
70
|
+
module.exports.strpbrk = require('./strpbrk')
|
|
71
|
+
module.exports.strpos = require('./strpos')
|
|
72
|
+
module.exports.strrchr = require('./strrchr')
|
|
73
|
+
module.exports.strrev = require('./strrev')
|
|
74
|
+
module.exports.strripos = require('./strripos')
|
|
75
|
+
module.exports.strrpos = require('./strrpos')
|
|
76
|
+
module.exports.strspn = require('./strspn')
|
|
77
|
+
module.exports.strstr = require('./strstr')
|
|
78
|
+
module.exports.strtok = require('./strtok')
|
|
79
|
+
module.exports.strtolower = require('./strtolower')
|
|
80
|
+
module.exports.strtoupper = require('./strtoupper')
|
|
81
|
+
module.exports.strtr = require('./strtr')
|
|
82
|
+
module.exports.substr = require('./substr')
|
|
83
|
+
module.exports.substr_compare = require('./substr_compare')
|
|
84
|
+
module.exports.substr_count = require('./substr_count')
|
|
85
|
+
module.exports.substr_replace = require('./substr_replace')
|
|
86
|
+
module.exports.trim = require('./trim')
|
|
87
|
+
module.exports.ucfirst = require('./ucfirst')
|
|
88
|
+
module.exports.ucwords = require('./ucwords')
|
|
89
|
+
module.exports.vprintf = require('./vprintf')
|
|
90
|
+
module.exports.vsprintf = require('./vsprintf')
|
|
91
|
+
module.exports.wordwrap = require('./wordwrap')
|
package/php/strings/join.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
module.exports = function join(glue, pieces) {
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
2
|
+
// discuss at: https://locutus.io/php/join/
|
|
3
|
+
// parity verified: PHP 8.3
|
|
4
|
+
// original by: Kevin van Zonneveld (https://kvz.io)
|
|
5
|
+
// example 1: join(' ', ['Kevin', 'van', 'Zonneveld'])
|
|
6
|
+
// returns 1: 'Kevin van Zonneveld'
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
return implode(glue, pieces)
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=join.js.map
|
|
8
|
+
const implode = require('../strings/implode')
|
|
9
|
+
return implode(glue, pieces)
|
|
10
|
+
}
|
package/php/strings/lcfirst.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
module.exports = function lcfirst(str) {
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
2
|
+
// discuss at: https://locutus.io/php/lcfirst/
|
|
3
|
+
// parity verified: PHP 8.3
|
|
4
|
+
// original by: Brett Zamir (https://brett-zamir.me)
|
|
5
|
+
// example 1: lcfirst('Kevin Van Zonneveld')
|
|
6
|
+
// returns 1: 'kevin Van Zonneveld'
|
|
8
7
|
|
|
9
|
-
str += ''
|
|
10
|
-
|
|
11
|
-
return f + str.substr(1)
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=lcfirst.js.map
|
|
8
|
+
str += ''
|
|
9
|
+
const f = str.charAt(0).toLowerCase()
|
|
10
|
+
return f + str.substr(1)
|
|
11
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
module.exports = function levenshtein(s1, s2, costIns, costRep, costDel) {
|
|
4
2
|
// discuss at: https://locutus.io/php/levenshtein/
|
|
3
|
+
// parity verified: PHP 8.3
|
|
5
4
|
// original by: Carlos R. L. Rodrigues (https://www.jsfromhell.com)
|
|
6
5
|
// bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)
|
|
7
6
|
// revised by: Andrea Giammarchi (https://webreflection.blogspot.com)
|
|
@@ -17,22 +16,22 @@ module.exports = function levenshtein(s1, s2, costIns, costRep, costDel) {
|
|
|
17
16
|
|
|
18
17
|
// var LEVENSHTEIN_MAX_LENGTH = 255 // PHP limits the function to max 255 character-long strings
|
|
19
18
|
|
|
20
|
-
costIns = costIns == null ? 1 : +costIns
|
|
21
|
-
costRep = costRep == null ? 1 : +costRep
|
|
22
|
-
costDel = costDel == null ? 1 : +costDel
|
|
19
|
+
costIns = costIns == null ? 1 : +costIns
|
|
20
|
+
costRep = costRep == null ? 1 : +costRep
|
|
21
|
+
costDel = costDel == null ? 1 : +costDel
|
|
23
22
|
|
|
24
23
|
if (s1 === s2) {
|
|
25
|
-
return 0
|
|
24
|
+
return 0
|
|
26
25
|
}
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
const l1 = s1.length
|
|
28
|
+
const l2 = s2.length
|
|
30
29
|
|
|
31
30
|
if (l1 === 0) {
|
|
32
|
-
return l2 * costIns
|
|
31
|
+
return l2 * costIns
|
|
33
32
|
}
|
|
34
33
|
if (l2 === 0) {
|
|
35
|
-
return l1 * costDel
|
|
34
|
+
return l1 * costDel
|
|
36
35
|
}
|
|
37
36
|
|
|
38
37
|
// Enable the 3 lines below to set the same limits on string length as PHP does
|
|
@@ -40,60 +39,59 @@ module.exports = function levenshtein(s1, s2, costIns, costRep, costDel) {
|
|
|
40
39
|
// return -1;
|
|
41
40
|
// }
|
|
42
41
|
|
|
43
|
-
|
|
42
|
+
let split = false
|
|
44
43
|
try {
|
|
45
|
-
split = !'0'[0]
|
|
46
|
-
} catch (
|
|
44
|
+
split = !'0'[0]
|
|
45
|
+
} catch (_e) {
|
|
47
46
|
// Earlier IE may not support access by string index
|
|
48
|
-
split = true
|
|
47
|
+
split = true
|
|
49
48
|
}
|
|
50
49
|
|
|
51
50
|
if (split) {
|
|
52
|
-
s1 = s1.split('')
|
|
53
|
-
s2 = s2.split('')
|
|
51
|
+
s1 = s1.split('')
|
|
52
|
+
s2 = s2.split('')
|
|
54
53
|
}
|
|
55
54
|
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
let p1 = new Array(l2 + 1)
|
|
56
|
+
let p2 = new Array(l2 + 1)
|
|
58
57
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
let i1
|
|
59
|
+
let i2
|
|
60
|
+
let c0
|
|
61
|
+
let c1
|
|
62
|
+
let c2
|
|
63
|
+
let tmp
|
|
65
64
|
|
|
66
65
|
for (i2 = 0; i2 <= l2; i2++) {
|
|
67
|
-
p1[i2] = i2 * costIns
|
|
66
|
+
p1[i2] = i2 * costIns
|
|
68
67
|
}
|
|
69
68
|
|
|
70
69
|
for (i1 = 0; i1 < l1; i1++) {
|
|
71
|
-
p2[0] = p1[0] + costDel
|
|
70
|
+
p2[0] = p1[0] + costDel
|
|
72
71
|
|
|
73
72
|
for (i2 = 0; i2 < l2; i2++) {
|
|
74
|
-
c0 = p1[i2] + (s1[i1] === s2[i2] ? 0 : costRep)
|
|
75
|
-
c1 = p1[i2 + 1] + costDel
|
|
73
|
+
c0 = p1[i2] + (s1[i1] === s2[i2] ? 0 : costRep)
|
|
74
|
+
c1 = p1[i2 + 1] + costDel
|
|
76
75
|
|
|
77
76
|
if (c1 < c0) {
|
|
78
|
-
c0 = c1
|
|
77
|
+
c0 = c1
|
|
79
78
|
}
|
|
80
79
|
|
|
81
|
-
c2 = p2[i2] + costIns
|
|
80
|
+
c2 = p2[i2] + costIns
|
|
82
81
|
|
|
83
82
|
if (c2 < c0) {
|
|
84
|
-
c0 = c2
|
|
83
|
+
c0 = c2
|
|
85
84
|
}
|
|
86
85
|
|
|
87
|
-
p2[i2 + 1] = c0
|
|
86
|
+
p2[i2 + 1] = c0
|
|
88
87
|
}
|
|
89
88
|
|
|
90
|
-
tmp = p1
|
|
91
|
-
p1 = p2
|
|
92
|
-
p2 = tmp
|
|
89
|
+
tmp = p1
|
|
90
|
+
p1 = p2
|
|
91
|
+
p2 = tmp
|
|
93
92
|
}
|
|
94
93
|
|
|
95
|
-
c0 = p1[l2]
|
|
94
|
+
c0 = p1[l2]
|
|
96
95
|
|
|
97
|
-
return c0
|
|
98
|
-
}
|
|
99
|
-
//# sourceMappingURL=levenshtein.js.map
|
|
96
|
+
return c0
|
|
97
|
+
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
module.exports = function localeconv() {
|
|
4
2
|
// discuss at: https://locutus.io/php/localeconv/
|
|
5
3
|
// original by: Brett Zamir (https://brett-zamir.me)
|
|
@@ -7,27 +5,26 @@ module.exports = function localeconv() {
|
|
|
7
5
|
// example 1: localeconv()
|
|
8
6
|
// returns 1: {decimal_point: '.', thousands_sep: '', positive_sign: '', negative_sign: '-', int_frac_digits: 2, frac_digits: 2, p_cs_precedes: 1, p_sep_by_space: 0, n_cs_precedes: 1, n_sep_by_space: 0, p_sign_posn: 1, n_sign_posn: 1, grouping: [], int_curr_symbol: 'USD ', currency_symbol: '$', mon_decimal_point: '.', mon_thousands_sep: ',', mon_grouping: [3, 3]}
|
|
9
7
|
|
|
10
|
-
|
|
8
|
+
const setlocale = require('../strings/setlocale')
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const arr = {}
|
|
11
|
+
let prop = ''
|
|
14
12
|
|
|
15
13
|
// ensure setup of localization variables takes place, if not already
|
|
16
|
-
setlocale('LC_ALL', 0)
|
|
14
|
+
setlocale('LC_ALL', 0)
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
$global.$locutus = $global.$locutus || {}
|
|
20
|
-
|
|
21
|
-
$locutus.php = $locutus.php || {}
|
|
16
|
+
const $global = typeof window !== 'undefined' ? window : global
|
|
17
|
+
$global.$locutus = $global.$locutus || {}
|
|
18
|
+
const $locutus = $global.$locutus
|
|
19
|
+
$locutus.php = $locutus.php || {}
|
|
22
20
|
|
|
23
21
|
// Make copies
|
|
24
22
|
for (prop in $locutus.php.locales[$locutus.php.localeCategories.LC_NUMERIC].LC_NUMERIC) {
|
|
25
|
-
arr[prop] = $locutus.php.locales[$locutus.php.localeCategories.LC_NUMERIC].LC_NUMERIC[prop]
|
|
23
|
+
arr[prop] = $locutus.php.locales[$locutus.php.localeCategories.LC_NUMERIC].LC_NUMERIC[prop]
|
|
26
24
|
}
|
|
27
25
|
for (prop in $locutus.php.locales[$locutus.php.localeCategories.LC_MONETARY].LC_MONETARY) {
|
|
28
|
-
arr[prop] = $locutus.php.locales[$locutus.php.localeCategories.LC_MONETARY].LC_MONETARY[prop]
|
|
26
|
+
arr[prop] = $locutus.php.locales[$locutus.php.localeCategories.LC_MONETARY].LC_MONETARY[prop]
|
|
29
27
|
}
|
|
30
28
|
|
|
31
|
-
return arr
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=localeconv.js.map
|
|
29
|
+
return arr
|
|
30
|
+
}
|
package/php/strings/ltrim.js
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
module.exports = function ltrim(str, charlist) {
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
2
|
+
// discuss at: https://locutus.io/php/ltrim/
|
|
3
|
+
// parity verified: PHP 8.3
|
|
4
|
+
// original by: Kevin van Zonneveld (https://kvz.io)
|
|
5
|
+
// input by: Erkekjetter
|
|
6
|
+
// improved by: Kevin van Zonneveld (https://kvz.io)
|
|
7
|
+
// bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)
|
|
8
|
+
// example 1: ltrim(' Kevin van Zonneveld ')
|
|
9
|
+
// returns 1: 'Kevin van Zonneveld '
|
|
11
10
|
|
|
12
|
-
charlist = !charlist ? ' \\s\
|
|
11
|
+
charlist = !charlist ? ' \\s\u00A0' : (charlist + '').replace(/([[\]().?/*{}+$^:])/g, '$1')
|
|
13
12
|
|
|
14
|
-
|
|
13
|
+
const re = new RegExp('^[' + charlist + ']+', 'g')
|
|
15
14
|
|
|
16
|
-
return (str + '').replace(re, '')
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=ltrim.js.map
|
|
15
|
+
return (str + '').replace(re, '')
|
|
16
|
+
}
|