locutus 2.0.32 → 2.0.34
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 +3 -0
- package/awk/builtin/int.js +13 -0
- package/awk/builtin/length.js +16 -0
- package/awk/builtin/substr.js +23 -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/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
package/php/strings/strtr.js
CHANGED
|
@@ -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 strtr(str, trFrom, trTo) {
|
|
6
2
|
// discuss at: https://locutus.io/php/strtr/
|
|
7
3
|
// original by: Brett Zamir (https://brett-zamir.me)
|
|
@@ -27,76 +23,75 @@ module.exports = function strtr(str, trFrom, trTo) {
|
|
|
27
23
|
// example 6: strtr('aa', {'a':1,'aa':2})
|
|
28
24
|
// returns 6: '2'
|
|
29
25
|
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
const krsort = require('../array/krsort')
|
|
27
|
+
const iniSet = require('../info/ini_set')
|
|
32
28
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
29
|
+
let fr = ''
|
|
30
|
+
let i = 0
|
|
31
|
+
let j = 0
|
|
32
|
+
let lenStr = 0
|
|
33
|
+
let lenFrom = 0
|
|
34
|
+
let sortByReference = false
|
|
35
|
+
let fromTypeStr = ''
|
|
36
|
+
let toTypeStr = ''
|
|
37
|
+
let istr = ''
|
|
38
|
+
const tmpFrom = []
|
|
39
|
+
const tmpTo = []
|
|
40
|
+
let ret = ''
|
|
41
|
+
let match = false
|
|
46
42
|
|
|
47
43
|
// Received replace_pairs?
|
|
48
44
|
// Convert to normal trFrom->trTo chars
|
|
49
|
-
if (
|
|
45
|
+
if (typeof trFrom === 'object') {
|
|
50
46
|
// Not thread-safe; temporarily set to true
|
|
51
47
|
// @todo: Don't rely on ini here, use internal krsort instead
|
|
52
|
-
sortByReference = iniSet('locutus.sortByReference', false)
|
|
53
|
-
trFrom = krsort(trFrom)
|
|
54
|
-
iniSet('locutus.sortByReference', sortByReference)
|
|
48
|
+
sortByReference = iniSet('locutus.sortByReference', false)
|
|
49
|
+
trFrom = krsort(trFrom)
|
|
50
|
+
iniSet('locutus.sortByReference', sortByReference)
|
|
55
51
|
|
|
56
52
|
for (fr in trFrom) {
|
|
57
53
|
if (trFrom.hasOwnProperty(fr)) {
|
|
58
|
-
tmpFrom.push(fr)
|
|
59
|
-
tmpTo.push(trFrom[fr])
|
|
54
|
+
tmpFrom.push(fr)
|
|
55
|
+
tmpTo.push(trFrom[fr])
|
|
60
56
|
}
|
|
61
57
|
}
|
|
62
58
|
|
|
63
|
-
trFrom = tmpFrom
|
|
64
|
-
trTo = tmpTo
|
|
59
|
+
trFrom = tmpFrom
|
|
60
|
+
trTo = tmpTo
|
|
65
61
|
}
|
|
66
62
|
|
|
67
63
|
// Walk through subject and replace chars when needed
|
|
68
|
-
lenStr = str.length
|
|
69
|
-
lenFrom = trFrom.length
|
|
70
|
-
fromTypeStr = typeof trFrom === 'string'
|
|
71
|
-
toTypeStr = typeof trTo === 'string'
|
|
64
|
+
lenStr = str.length
|
|
65
|
+
lenFrom = trFrom.length
|
|
66
|
+
fromTypeStr = typeof trFrom === 'string'
|
|
67
|
+
toTypeStr = typeof trTo === 'string'
|
|
72
68
|
|
|
73
69
|
for (i = 0; i < lenStr; i++) {
|
|
74
|
-
match = false
|
|
70
|
+
match = false
|
|
75
71
|
if (fromTypeStr) {
|
|
76
|
-
istr = str.charAt(i)
|
|
72
|
+
istr = str.charAt(i)
|
|
77
73
|
for (j = 0; j < lenFrom; j++) {
|
|
78
74
|
if (istr === trFrom.charAt(j)) {
|
|
79
|
-
match = true
|
|
80
|
-
break
|
|
75
|
+
match = true
|
|
76
|
+
break
|
|
81
77
|
}
|
|
82
78
|
}
|
|
83
79
|
} else {
|
|
84
80
|
for (j = 0; j < lenFrom; j++) {
|
|
85
81
|
if (str.substr(i, trFrom[j].length) === trFrom[j]) {
|
|
86
|
-
match = true
|
|
82
|
+
match = true
|
|
87
83
|
// Fast forward
|
|
88
|
-
i = i + trFrom[j].length - 1
|
|
89
|
-
break
|
|
84
|
+
i = i + trFrom[j].length - 1
|
|
85
|
+
break
|
|
90
86
|
}
|
|
91
87
|
}
|
|
92
88
|
}
|
|
93
89
|
if (match) {
|
|
94
|
-
ret += toTypeStr ? trTo.charAt(j) : trTo[j]
|
|
90
|
+
ret += toTypeStr ? trTo.charAt(j) : trTo[j]
|
|
95
91
|
} else {
|
|
96
|
-
ret += str.charAt(i)
|
|
92
|
+
ret += str.charAt(i)
|
|
97
93
|
}
|
|
98
94
|
}
|
|
99
95
|
|
|
100
|
-
return ret
|
|
101
|
-
}
|
|
102
|
-
//# sourceMappingURL=strtr.js.map
|
|
96
|
+
return ret
|
|
97
|
+
}
|
package/php/strings/substr.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
module.exports = function substr(input, start, len) {
|
|
4
2
|
// discuss at: https://locutus.io/php/substr/
|
|
5
3
|
// original by: Martijn Wieringa
|
|
@@ -28,42 +26,40 @@ module.exports = function substr(input, start, len) {
|
|
|
28
26
|
// example 7: ini_set('unicode.semantics', 'on')
|
|
29
27
|
// example 7: substr('a\uD801\uDC00z\uD801\uDC00', -3, -1)
|
|
30
28
|
// returns 7: '\uD801\uDC00z'
|
|
31
|
-
// test: skip-3 skip-4 skip-5 skip-6 skip-7
|
|
32
29
|
|
|
33
|
-
|
|
30
|
+
const _php_cast_string = require('../_helpers/_phpCastString')
|
|
34
31
|
|
|
35
|
-
input = _php_cast_string(input)
|
|
32
|
+
input = _php_cast_string(input)
|
|
36
33
|
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
const ini_get = require('../info/ini_get')
|
|
35
|
+
const multibyte = ini_get('unicode.semantics') === 'on'
|
|
39
36
|
|
|
40
37
|
if (multibyte) {
|
|
41
|
-
input = input.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\s\S]/g) || []
|
|
38
|
+
input = input.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\s\S]/g) || []
|
|
42
39
|
}
|
|
43
40
|
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
const inputLength = input.length
|
|
42
|
+
let end = inputLength
|
|
46
43
|
|
|
47
44
|
if (start < 0) {
|
|
48
|
-
start += end
|
|
45
|
+
start += end
|
|
49
46
|
}
|
|
50
47
|
|
|
51
48
|
if (typeof len !== 'undefined') {
|
|
52
49
|
if (len < 0) {
|
|
53
|
-
end = len + end
|
|
50
|
+
end = len + end
|
|
54
51
|
} else {
|
|
55
|
-
end = len + start
|
|
52
|
+
end = len + start
|
|
56
53
|
}
|
|
57
54
|
}
|
|
58
55
|
|
|
59
56
|
if (start > inputLength || start < 0 || start > end) {
|
|
60
|
-
return false
|
|
57
|
+
return false
|
|
61
58
|
}
|
|
62
59
|
|
|
63
60
|
if (multibyte) {
|
|
64
|
-
return input.slice(start, end).join('')
|
|
61
|
+
return input.slice(start, end).join('')
|
|
65
62
|
}
|
|
66
63
|
|
|
67
|
-
return input.slice(start, end)
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=substr.js.map
|
|
64
|
+
return input.slice(start, end)
|
|
65
|
+
}
|
|
@@ -1,38 +1,36 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
module.exports = function substr_compare(mainStr, str, offset, length, caseInsensitivity) {
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
2
|
+
// discuss at: https://locutus.io/php/substr_compare/
|
|
3
|
+
// parity verified: PHP 8.3
|
|
4
|
+
// original by: Brett Zamir (https://brett-zamir.me)
|
|
5
|
+
// original by: strcasecmp, strcmp
|
|
6
|
+
// example 1: substr_compare("abcde", "bc", 1, 2)
|
|
7
|
+
// returns 1: 0
|
|
9
8
|
|
|
10
9
|
if (!offset && offset !== 0) {
|
|
11
|
-
throw new Error('Missing offset for substr_compare()')
|
|
10
|
+
throw new Error('Missing offset for substr_compare()')
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
if (offset < 0) {
|
|
15
|
-
offset = mainStr.length + offset
|
|
14
|
+
offset = mainStr.length + offset
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
if (length && length > mainStr.length - offset) {
|
|
19
|
-
return false
|
|
18
|
+
return false
|
|
20
19
|
}
|
|
21
|
-
length = length || mainStr.length - offset
|
|
20
|
+
length = length || mainStr.length - offset
|
|
22
21
|
|
|
23
|
-
mainStr = mainStr.substr(offset, length)
|
|
22
|
+
mainStr = mainStr.substr(offset, length)
|
|
24
23
|
// Should only compare up to the desired length
|
|
25
|
-
str = str.substr(0, length)
|
|
24
|
+
str = str.substr(0, length)
|
|
26
25
|
if (caseInsensitivity) {
|
|
27
26
|
// Works as strcasecmp
|
|
28
|
-
mainStr = (mainStr + '').toLowerCase()
|
|
29
|
-
str = (str + '').toLowerCase()
|
|
27
|
+
mainStr = (mainStr + '').toLowerCase()
|
|
28
|
+
str = (str + '').toLowerCase()
|
|
30
29
|
if (mainStr === str) {
|
|
31
|
-
return 0
|
|
30
|
+
return 0
|
|
32
31
|
}
|
|
33
|
-
return mainStr > str ? 1 : -1
|
|
32
|
+
return mainStr > str ? 1 : -1
|
|
34
33
|
}
|
|
35
34
|
// Works as strcmp
|
|
36
|
-
return mainStr === str ? 0 : mainStr > str ? 1 : -1
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=substr_compare.js.map
|
|
35
|
+
return mainStr === str ? 0 : mainStr > str ? 1 : -1
|
|
36
|
+
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
module.exports = function substr_count(haystack, needle, offset, length) {
|
|
4
2
|
// discuss at: https://locutus.io/php/substr_count/
|
|
5
3
|
// original by: Kevin van Zonneveld (https://kvz.io)
|
|
@@ -13,28 +11,27 @@ module.exports = function substr_count(haystack, needle, offset, length) {
|
|
|
13
11
|
// example 3: substr_count('Kevin van Zonneveld', 'Z', 0, 10)
|
|
14
12
|
// returns 3: false
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
let cnt = 0
|
|
17
15
|
|
|
18
|
-
haystack += ''
|
|
19
|
-
needle += ''
|
|
16
|
+
haystack += ''
|
|
17
|
+
needle += ''
|
|
20
18
|
if (isNaN(offset)) {
|
|
21
|
-
offset = 0
|
|
19
|
+
offset = 0
|
|
22
20
|
}
|
|
23
21
|
if (isNaN(length)) {
|
|
24
|
-
length = 0
|
|
22
|
+
length = 0
|
|
25
23
|
}
|
|
26
24
|
if (needle.length === 0) {
|
|
27
|
-
return false
|
|
25
|
+
return false
|
|
28
26
|
}
|
|
29
|
-
offset
|
|
27
|
+
offset--
|
|
30
28
|
|
|
31
29
|
while ((offset = haystack.indexOf(needle, offset + 1)) !== -1) {
|
|
32
30
|
if (length > 0 && offset + needle.length > length) {
|
|
33
|
-
return false
|
|
31
|
+
return false
|
|
34
32
|
}
|
|
35
|
-
cnt
|
|
33
|
+
cnt++
|
|
36
34
|
}
|
|
37
35
|
|
|
38
|
-
return cnt
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=substr_count.js.map
|
|
36
|
+
return cnt
|
|
37
|
+
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
module.exports = function substr_replace(str, replace, start, length) {
|
|
4
2
|
// discuss at: https://locutus.io/php/substr_replace/
|
|
5
3
|
// original by: Brett Zamir (https://brett-zamir.me)
|
|
@@ -19,13 +17,12 @@ module.exports = function substr_replace(str, replace, start, length) {
|
|
|
19
17
|
|
|
20
18
|
if (start < 0) {
|
|
21
19
|
// start position in str
|
|
22
|
-
start = start + str.length
|
|
20
|
+
start = start + str.length
|
|
23
21
|
}
|
|
24
|
-
length = length !== undefined ? length : str.length
|
|
22
|
+
length = length !== undefined ? length : str.length
|
|
25
23
|
if (length < 0) {
|
|
26
|
-
length = length + str.length - start
|
|
24
|
+
length = length + str.length - start
|
|
27
25
|
}
|
|
28
26
|
|
|
29
|
-
return [str.slice(0, start), replace.substr(0, length), replace.slice(length), str.slice(start + length)].join('')
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=substr_replace.js.map
|
|
27
|
+
return [str.slice(0, start), replace.substr(0, length), replace.slice(length), str.slice(start + length)].join('')
|
|
28
|
+
}
|
package/php/strings/trim.js
CHANGED
|
@@ -1,48 +1,69 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
module.exports = function trim(str, charlist) {
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
//
|
|
2
|
+
// discuss at: https://locutus.io/php/trim/
|
|
3
|
+
// parity verified: PHP 8.3
|
|
4
|
+
// original by: Kevin van Zonneveld (https://kvz.io)
|
|
5
|
+
// improved by: mdsjack (https://www.mdsjack.bo.it)
|
|
6
|
+
// improved by: Alexander Ermolaev (https://snippets.dzone.com/user/AlexanderErmolaev)
|
|
7
|
+
// improved by: Kevin van Zonneveld (https://kvz.io)
|
|
8
|
+
// improved by: Steven Levithan (https://blog.stevenlevithan.com)
|
|
9
|
+
// improved by: Jack
|
|
10
|
+
// input by: Erkekjetter
|
|
11
|
+
// input by: DxGx
|
|
12
|
+
// bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)
|
|
13
|
+
// example 1: trim(' Kevin van Zonneveld ')
|
|
14
|
+
// returns 1: 'Kevin van Zonneveld'
|
|
15
|
+
// example 2: trim('Hello World', 'Hdle')
|
|
16
|
+
// returns 2: 'o Wor'
|
|
17
|
+
// example 3: trim(16, 1)
|
|
18
|
+
// returns 3: '6'
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
let whitespace = [
|
|
21
|
+
' ',
|
|
22
|
+
'\n',
|
|
23
|
+
'\r',
|
|
24
|
+
'\t',
|
|
25
|
+
'\f',
|
|
26
|
+
'\x0b',
|
|
27
|
+
'\xa0',
|
|
28
|
+
'\u2000',
|
|
29
|
+
'\u2001',
|
|
30
|
+
'\u2002',
|
|
31
|
+
'\u2003',
|
|
32
|
+
'\u2004',
|
|
33
|
+
'\u2005',
|
|
34
|
+
'\u2006',
|
|
35
|
+
'\u2007',
|
|
36
|
+
'\u2008',
|
|
37
|
+
'\u2009',
|
|
38
|
+
'\u200a',
|
|
39
|
+
'\u200b',
|
|
40
|
+
'\u2028',
|
|
41
|
+
'\u2029',
|
|
42
|
+
'\u3000',
|
|
43
|
+
].join('')
|
|
44
|
+
let l = 0
|
|
45
|
+
let i = 0
|
|
46
|
+
str += ''
|
|
25
47
|
|
|
26
48
|
if (charlist) {
|
|
27
|
-
whitespace = (charlist + '').replace(/([[\]().?/*{}+$^:])/g, '$1')
|
|
49
|
+
whitespace = (charlist + '').replace(/([[\]().?/*{}+$^:])/g, '$1')
|
|
28
50
|
}
|
|
29
51
|
|
|
30
|
-
l = str.length
|
|
52
|
+
l = str.length
|
|
31
53
|
for (i = 0; i < l; i++) {
|
|
32
54
|
if (whitespace.indexOf(str.charAt(i)) === -1) {
|
|
33
|
-
str = str.substring(i)
|
|
34
|
-
break
|
|
55
|
+
str = str.substring(i)
|
|
56
|
+
break
|
|
35
57
|
}
|
|
36
58
|
}
|
|
37
59
|
|
|
38
|
-
l = str.length
|
|
60
|
+
l = str.length
|
|
39
61
|
for (i = l - 1; i >= 0; i--) {
|
|
40
62
|
if (whitespace.indexOf(str.charAt(i)) === -1) {
|
|
41
|
-
str = str.substring(0, i + 1)
|
|
42
|
-
break
|
|
63
|
+
str = str.substring(0, i + 1)
|
|
64
|
+
break
|
|
43
65
|
}
|
|
44
66
|
}
|
|
45
67
|
|
|
46
|
-
return whitespace.indexOf(str.charAt(0)) === -1 ? str : ''
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=trim.js.map
|
|
68
|
+
return whitespace.indexOf(str.charAt(0)) === -1 ? str : ''
|
|
69
|
+
}
|
package/php/strings/ucfirst.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
module.exports = function ucfirst(str) {
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
2
|
+
// discuss at: https://locutus.io/php/ucfirst/
|
|
3
|
+
// parity verified: PHP 8.3
|
|
4
|
+
// original by: Kevin van Zonneveld (https://kvz.io)
|
|
5
|
+
// bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)
|
|
6
|
+
// improved by: Brett Zamir (https://brett-zamir.me)
|
|
7
|
+
// example 1: ucfirst('kevin van zonneveld')
|
|
8
|
+
// returns 1: 'Kevin van zonneveld'
|
|
10
9
|
|
|
11
|
-
str += ''
|
|
12
|
-
|
|
13
|
-
return f + str.substr(1)
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=ucfirst.js.map
|
|
10
|
+
str += ''
|
|
11
|
+
const f = str.charAt(0).toUpperCase()
|
|
12
|
+
return f + str.substr(1)
|
|
13
|
+
}
|
package/php/strings/ucwords.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
module.exports = function ucwords(str) {
|
|
4
2
|
// discuss at: https://locutus.io/php/ucwords/
|
|
5
3
|
// original by: Jonas Raoni Soares Silva (https://www.jsfromhell.com)
|
|
@@ -19,7 +17,6 @@ module.exports = function ucwords(str) {
|
|
|
19
17
|
// returns 4: 'Τάχιστη Αλώπηξ Βαφής Ψημένη Γη, Δρασκελίζει Υπέρ Νωθρού Κυνός'
|
|
20
18
|
|
|
21
19
|
return (str + '').replace(/^(.)|\s+(.)/g, function ($1) {
|
|
22
|
-
return $1.toUpperCase()
|
|
23
|
-
})
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=ucwords.js.map
|
|
20
|
+
return $1.toUpperCase()
|
|
21
|
+
})
|
|
22
|
+
}
|
package/php/strings/vprintf.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
module.exports = function vprintf(format, args) {
|
|
4
2
|
// discuss at: https://locutus.io/php/vprintf/
|
|
5
3
|
// original by: Ash Searle (https://hexmen.com/blog/)
|
|
@@ -8,11 +6,10 @@ module.exports = function vprintf(format, args) {
|
|
|
8
6
|
// example 1: vprintf("%01.2f", 123.1)
|
|
9
7
|
// returns 1: 6
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
echo(ret)
|
|
9
|
+
const sprintf = require('../strings/sprintf')
|
|
10
|
+
const echo = require('../strings/echo')
|
|
11
|
+
const ret = sprintf.apply(this, [format].concat(args))
|
|
12
|
+
echo(ret)
|
|
15
13
|
|
|
16
|
-
return ret.length
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=vprintf.js.map
|
|
14
|
+
return ret.length
|
|
15
|
+
}
|
package/php/strings/vsprintf.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
module.exports = function vsprintf(format, args) {
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
2
|
+
// discuss at: https://locutus.io/php/vsprintf/
|
|
3
|
+
// parity verified: PHP 8.3
|
|
4
|
+
// original by: ejsanders
|
|
5
|
+
// example 1: vsprintf('%04d-%02d-%02d', [1988, 8, 1])
|
|
6
|
+
// returns 1: '1988-08-01'
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
const sprintf = require('../strings/sprintf')
|
|
10
9
|
|
|
11
|
-
return sprintf.apply(this, [format].concat(args))
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=vsprintf.js.map
|
|
10
|
+
return sprintf.apply(this, [format].concat(args))
|
|
11
|
+
}
|
package/php/strings/wordwrap.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
module.exports = function wordwrap(str, intWidth, strBreak, cut) {
|
|
4
2
|
// discuss at: https://locutus.io/php/wordwrap/
|
|
5
3
|
// original by: Jonas Raoni Soares Silva (https://www.jsfromhell.com)
|
|
@@ -17,79 +15,78 @@ module.exports = function wordwrap(str, intWidth, strBreak, cut) {
|
|
|
17
15
|
// example 3: wordwrap('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.')
|
|
18
16
|
// returns 3: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod\ntempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim\nveniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea\ncommodo consequat.'
|
|
19
17
|
|
|
20
|
-
intWidth = arguments.length >= 2 ? +intWidth : 75
|
|
21
|
-
strBreak = arguments.length >= 3 ? '' + strBreak : '\n'
|
|
22
|
-
cut = arguments.length >= 4 ? !!cut : false
|
|
18
|
+
intWidth = arguments.length >= 2 ? +intWidth : 75
|
|
19
|
+
strBreak = arguments.length >= 3 ? '' + strBreak : '\n'
|
|
20
|
+
cut = arguments.length >= 4 ? !!cut : false
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
let i
|
|
23
|
+
let j
|
|
24
|
+
let line
|
|
27
25
|
|
|
28
|
-
str += ''
|
|
26
|
+
str += ''
|
|
29
27
|
|
|
30
28
|
if (intWidth < 1) {
|
|
31
|
-
return str
|
|
29
|
+
return str
|
|
32
30
|
}
|
|
33
31
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
const reLineBreaks = /\r\n|\n|\r/
|
|
33
|
+
const reBeginningUntilFirstWhitespace = /^\S*/
|
|
34
|
+
const reLastCharsWithOptionalTrailingWhitespace = /\S*(\s)?$/
|
|
37
35
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
const lines = str.split(reLineBreaks)
|
|
37
|
+
const l = lines.length
|
|
38
|
+
let match
|
|
41
39
|
|
|
42
40
|
// for each line of text
|
|
43
41
|
for (i = 0; i < l; lines[i++] += line) {
|
|
44
|
-
line = lines[i]
|
|
45
|
-
lines[i] = ''
|
|
42
|
+
line = lines[i]
|
|
43
|
+
lines[i] = ''
|
|
46
44
|
|
|
47
45
|
while (line.length > intWidth) {
|
|
48
46
|
// get slice of length one char above limit
|
|
49
|
-
|
|
47
|
+
const slice = line.slice(0, intWidth + 1)
|
|
50
48
|
|
|
51
49
|
// remove leading whitespace from rest of line to parse
|
|
52
|
-
|
|
50
|
+
let ltrim = 0
|
|
53
51
|
// remove trailing whitespace from new line content
|
|
54
|
-
|
|
52
|
+
let rtrim = 0
|
|
55
53
|
|
|
56
|
-
match = slice.match(reLastCharsWithOptionalTrailingWhitespace)
|
|
54
|
+
match = slice.match(reLastCharsWithOptionalTrailingWhitespace)
|
|
57
55
|
|
|
58
56
|
// if the slice ends with whitespace
|
|
59
57
|
if (match[1]) {
|
|
60
58
|
// then perfect moment to cut the line
|
|
61
|
-
j = intWidth
|
|
62
|
-
ltrim = 1
|
|
59
|
+
j = intWidth
|
|
60
|
+
ltrim = 1
|
|
63
61
|
} else {
|
|
64
62
|
// otherwise cut at previous whitespace
|
|
65
|
-
j = slice.length - match[0].length
|
|
63
|
+
j = slice.length - match[0].length
|
|
66
64
|
|
|
67
65
|
if (j) {
|
|
68
|
-
rtrim = 1
|
|
66
|
+
rtrim = 1
|
|
69
67
|
}
|
|
70
68
|
|
|
71
69
|
// but if there is no previous whitespace
|
|
72
70
|
// and cut is forced
|
|
73
71
|
// cut just at the defined limit
|
|
74
72
|
if (!j && cut && intWidth) {
|
|
75
|
-
j = intWidth
|
|
73
|
+
j = intWidth
|
|
76
74
|
}
|
|
77
75
|
|
|
78
76
|
// if cut wasn't forced
|
|
79
77
|
// cut at next possible whitespace after the limit
|
|
80
78
|
if (!j) {
|
|
81
|
-
|
|
79
|
+
const charsUntilNextWhitespace = (line.slice(intWidth).match(reBeginningUntilFirstWhitespace) || [''])[0]
|
|
82
80
|
|
|
83
|
-
j = slice.length + charsUntilNextWhitespace.length
|
|
81
|
+
j = slice.length + charsUntilNextWhitespace.length
|
|
84
82
|
}
|
|
85
83
|
}
|
|
86
84
|
|
|
87
|
-
lines[i] += line.slice(0, j - rtrim)
|
|
88
|
-
line = line.slice(j + ltrim)
|
|
89
|
-
lines[i] += line.length ? strBreak : ''
|
|
85
|
+
lines[i] += line.slice(0, j - rtrim)
|
|
86
|
+
line = line.slice(j + ltrim)
|
|
87
|
+
lines[i] += line.length ? strBreak : ''
|
|
90
88
|
}
|
|
91
89
|
}
|
|
92
90
|
|
|
93
|
-
return lines.join('\n')
|
|
94
|
-
}
|
|
95
|
-
//# sourceMappingURL=wordwrap.js.map
|
|
91
|
+
return lines.join('\n')
|
|
92
|
+
}
|