locutus 2.0.12 → 2.0.16
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/_util/cli.js.map +1 -1
- package/_util/util.js +11 -16
- package/_util/util.js.map +1 -1
- package/c/index.js +2 -2
- package/c/index.js.map +1 -1
- package/c/math/index.js +2 -2
- package/c/math/index.js.map +1 -1
- package/c/stdio/index.js +1 -1
- package/c/stdio/index.js.map +1 -1
- package/c/stdio/sprintf.js +8 -1
- package/c/stdio/sprintf.js.map +1 -1
- package/golang/index.js +1 -1
- package/golang/index.js.map +1 -1
- package/golang/strings/Count.js +1 -1
- package/golang/strings/Count.js.map +1 -1
- package/golang/strings/index.js +4 -4
- package/golang/strings/index.js.map +1 -1
- package/index.js +5 -5
- package/index.js.map +1 -1
- package/package.json +39 -40
- package/php/_helpers/_bc.js +104 -48
- package/php/_helpers/_bc.js.map +1 -1
- package/php/_helpers/_phpCastString.js.map +1 -1
- package/php/_helpers/_php_cast_float.js.map +1 -1
- package/php/_helpers/_php_cast_int.js.map +1 -1
- package/php/_helpers/index.js +4 -4
- package/php/_helpers/index.js.map +1 -1
- package/php/array/array_change_key_case.js +2 -2
- package/php/array/array_change_key_case.js.map +1 -1
- package/php/array/array_chunk.js +1 -1
- package/php/array/array_chunk.js.map +1 -1
- package/php/array/array_column.js.map +1 -1
- package/php/array/array_combine.js.map +1 -1
- package/php/array/array_count_values.js.map +1 -1
- package/php/array/array_diff.js.map +1 -1
- package/php/array/array_diff_assoc.js.map +1 -1
- package/php/array/array_diff_key.js.map +1 -1
- package/php/array/array_diff_uassoc.js.map +1 -1
- package/php/array/array_diff_ukey.js.map +1 -1
- package/php/array/array_fill.js +1 -1
- package/php/array/array_fill.js.map +1 -1
- package/php/array/array_fill_keys.js.map +1 -1
- package/php/array/array_filter.js +1 -1
- package/php/array/array_filter.js.map +1 -1
- package/php/array/array_flip.js +1 -1
- package/php/array/array_flip.js.map +1 -1
- package/php/array/array_intersect.js.map +1 -1
- package/php/array/array_intersect_assoc.js.map +1 -1
- package/php/array/array_intersect_key.js.map +1 -1
- package/php/array/array_intersect_uassoc.js.map +1 -1
- package/php/array/array_intersect_ukey.js.map +1 -1
- package/php/array/array_keys.js.map +1 -1
- package/php/array/array_map.js.map +1 -1
- package/php/array/array_merge.js +1 -1
- package/php/array/array_merge.js.map +1 -1
- package/php/array/array_merge_recursive.js.map +1 -1
- package/php/array/array_multisort.js +16 -16
- package/php/array/array_multisort.js.map +1 -1
- package/php/array/array_pad.js +1 -1
- package/php/array/array_pad.js.map +1 -1
- package/php/array/array_pop.js.map +1 -1
- package/php/array/array_product.js.map +1 -1
- package/php/array/array_push.js.map +1 -1
- package/php/array/array_rand.js.map +1 -1
- package/php/array/array_reduce.js.map +1 -1
- package/php/array/array_replace.js.map +1 -1
- package/php/array/array_replace_recursive.js +1 -1
- package/php/array/array_replace_recursive.js.map +1 -1
- package/php/array/array_reverse.js +1 -1
- package/php/array/array_reverse.js.map +1 -1
- package/php/array/array_search.js.map +1 -1
- package/php/array/array_shift.js +0 -19
- package/php/array/array_shift.js.map +1 -1
- package/php/array/array_slice.js.map +1 -1
- package/php/array/array_splice.js.map +1 -1
- package/php/array/array_sum.js +1 -1
- package/php/array/array_sum.js.map +1 -1
- package/php/array/array_udiff.js.map +1 -1
- package/php/array/array_udiff_assoc.js.map +1 -1
- package/php/array/array_udiff_uassoc.js.map +1 -1
- package/php/array/array_uintersect.js.map +1 -1
- package/php/array/array_uintersect_uassoc.js.map +1 -1
- package/php/array/array_unique.js.map +1 -1
- package/php/array/array_unshift.js.map +1 -1
- package/php/array/array_values.js.map +1 -1
- package/php/array/array_walk.js.map +1 -1
- package/php/array/array_walk_recursive.js.map +1 -1
- package/php/array/arsort.js +3 -3
- package/php/array/arsort.js.map +1 -1
- package/php/array/asort.js +3 -3
- package/php/array/asort.js.map +1 -1
- package/php/array/count.js +1 -1
- package/php/array/count.js.map +1 -1
- package/php/array/current.js.map +1 -1
- package/php/array/each.js.map +1 -1
- package/php/array/end.js +1 -1
- package/php/array/end.js.map +1 -1
- package/php/array/in_array.js.map +1 -1
- package/php/array/index.js +73 -72
- package/php/array/index.js.map +1 -1
- package/php/array/key.js.map +1 -1
- package/php/array/krsort.js +3 -3
- package/php/array/krsort.js.map +1 -1
- package/php/array/ksort.js +3 -3
- package/php/array/ksort.js.map +1 -1
- package/php/array/natcasesort.js +2 -2
- package/php/array/natcasesort.js.map +1 -1
- package/php/array/natsort.js +2 -2
- package/php/array/natsort.js.map +1 -1
- package/php/array/next.js.map +1 -1
- package/php/array/pos.js.map +1 -1
- package/php/array/prev.js.map +1 -1
- package/php/array/range.js +3 -3
- package/php/array/range.js.map +1 -1
- package/php/array/reset.js.map +1 -1
- package/php/array/rsort.js +3 -3
- package/php/array/rsort.js.map +1 -1
- package/php/array/shuffle.js.map +1 -1
- package/php/array/sizeof.js.map +1 -1
- package/php/array/sort.js +3 -3
- package/php/array/sort.js.map +1 -1
- package/php/array/uasort.js.map +1 -1
- package/php/array/uksort.js.map +1 -1
- package/php/array/usort.js.map +1 -1
- package/php/bc/bcadd.js +3 -1
- package/php/bc/bcadd.js.map +1 -1
- package/php/bc/bccomp.js +2 -1
- package/php/bc/bccomp.js.map +1 -1
- package/php/bc/bcdiv.js +3 -1
- package/php/bc/bcdiv.js.map +1 -1
- package/php/bc/bcmul.js +3 -1
- package/php/bc/bcmul.js.map +1 -1
- package/php/bc/bcround.js +4 -2
- package/php/bc/bcround.js.map +1 -1
- package/php/bc/bcscale.js.map +1 -1
- package/php/bc/bcsub.js +3 -1
- package/php/bc/bcsub.js.map +1 -1
- package/php/bc/index.js +7 -7
- package/php/bc/index.js.map +1 -1
- package/php/ctype/ctype_alnum.js.map +1 -1
- package/php/ctype/ctype_alpha.js.map +1 -1
- package/php/ctype/ctype_cntrl.js.map +1 -1
- package/php/ctype/ctype_digit.js.map +1 -1
- package/php/ctype/ctype_graph.js.map +1 -1
- package/php/ctype/ctype_lower.js.map +1 -1
- package/php/ctype/ctype_print.js.map +1 -1
- package/php/ctype/ctype_punct.js.map +1 -1
- package/php/ctype/ctype_space.js.map +1 -1
- package/php/ctype/ctype_upper.js.map +1 -1
- package/php/ctype/ctype_xdigit.js.map +1 -1
- package/php/ctype/index.js +11 -11
- package/php/ctype/index.js.map +1 -1
- package/php/datetime/date.js +2 -1
- package/php/datetime/date.js.map +1 -1
- package/php/datetime/date_parse.js +1 -1
- package/php/datetime/date_parse.js.map +1 -1
- package/php/datetime/getdate.js.map +1 -1
- package/php/datetime/gettimeofday.js.map +1 -1
- package/php/datetime/gmdate.js.map +1 -1
- package/php/datetime/gmmktime.js.map +1 -1
- package/php/datetime/gmstrftime.js.map +1 -1
- package/php/datetime/idate.js +1 -1
- package/php/datetime/idate.js.map +1 -1
- package/php/datetime/index.js +15 -15
- package/php/datetime/index.js.map +1 -1
- package/php/datetime/microtime.js +3 -3
- package/php/datetime/microtime.js.map +1 -1
- package/php/datetime/mktime.js.map +1 -1
- package/php/datetime/strftime.js +2 -3
- package/php/datetime/strftime.js.map +1 -1
- package/php/datetime/strptime.js +20 -21
- package/php/datetime/strptime.js.map +1 -1
- package/php/datetime/strtotime.js +170 -4
- package/php/datetime/strtotime.js.map +1 -1
- package/php/exec/escapeshellarg.js +12 -4
- package/php/exec/escapeshellarg.js.map +1 -1
- package/php/exec/index.js +1 -1
- package/php/exec/index.js.map +1 -1
- package/php/filesystem/basename.js.map +1 -1
- package/php/filesystem/file_get_contents.js.map +1 -1
- package/php/filesystem/index.js +5 -5
- package/php/filesystem/index.js.map +1 -1
- package/php/filesystem/pathinfo.js +7 -8
- package/php/filesystem/pathinfo.js.map +1 -1
- package/php/filesystem/realpath.js.map +1 -1
- package/php/funchand/call_user_func.js.map +1 -1
- package/php/funchand/call_user_func_array.js +1 -1
- package/php/funchand/call_user_func_array.js.map +1 -1
- package/php/funchand/function_exists.js.map +1 -1
- package/php/funchand/get_defined_functions.js.map +1 -1
- package/php/funchand/index.js +5 -5
- package/php/funchand/index.js.map +1 -1
- package/php/i18n/i18n_loc_get_default.js.map +1 -1
- package/php/i18n/i18n_loc_set_default.js.map +1 -1
- package/php/i18n/index.js +2 -2
- package/php/i18n/index.js.map +1 -1
- package/php/index.js +19 -19
- package/php/index.js.map +1 -1
- package/php/info/assert_options.js +2 -1
- package/php/info/assert_options.js.map +1 -1
- package/php/info/index.js +6 -6
- package/php/info/index.js.map +1 -1
- package/php/info/ini_get.js.map +1 -1
- package/php/info/ini_set.js.map +1 -1
- package/php/info/set_time_limit.js.map +1 -1
- package/php/info/version_compare.js +21 -22
- package/php/info/version_compare.js.map +1 -1
- package/php/json/index.js +3 -3
- package/php/json/index.js.map +1 -1
- package/php/json/json_decode.js +1 -1
- package/php/json/json_decode.js.map +1 -1
- package/php/json/json_encode.js +1 -1
- package/php/json/json_encode.js.map +1 -1
- package/php/json/json_last_error.js.map +1 -1
- package/php/math/fmod.js +2 -2
- package/php/math/fmod.js.map +1 -1
- package/php/math/hypot.js.map +1 -1
- package/php/math/index.js +46 -46
- package/php/math/index.js.map +1 -1
- package/php/math/is_finite.js.map +1 -1
- package/php/math/is_infinite.js.map +1 -1
- package/php/math/is_nan.js.map +1 -1
- package/php/math/log1p.js.map +1 -1
- package/php/math/max.js +7 -7
- package/php/math/max.js.map +1 -1
- package/php/math/min.js +5 -5
- package/php/math/min.js.map +1 -1
- package/php/math/mt_rand.js.map +1 -1
- package/php/math/rand.js.map +1 -1
- package/php/math/round.js +1 -1
- package/php/math/round.js.map +1 -1
- package/php/misc/index.js +2 -2
- package/php/misc/index.js.map +1 -1
- package/php/misc/pack.js +23 -18
- package/php/misc/pack.js.map +1 -1
- package/php/misc/uniqid.js +1 -1
- package/php/misc/uniqid.js.map +1 -1
- package/php/net-gopher/gopher_parsedir.js +3 -4
- package/php/net-gopher/gopher_parsedir.js.map +1 -1
- package/php/net-gopher/index.js +1 -1
- package/php/net-gopher/index.js.map +1 -1
- package/php/network/index.js +6 -6
- package/php/network/index.js.map +1 -1
- package/php/network/inet_ntop.js.map +1 -1
- package/php/network/inet_pton.js +40 -32
- package/php/network/inet_pton.js.map +1 -1
- package/php/network/setcookie.js.map +1 -1
- package/php/network/setrawcookie.js.map +1 -1
- package/php/pcre/index.js +4 -3
- package/php/pcre/index.js.map +1 -1
- package/php/pcre/preg_replace.js +24 -0
- package/php/pcre/preg_replace.js.map +1 -0
- package/php/pcre/sql_regcase.js.map +1 -1
- package/php/strings/addcslashes.js.map +1 -1
- package/php/strings/bin2hex.js +3 -3
- package/php/strings/bin2hex.js.map +1 -1
- package/php/strings/chop.js.map +1 -1
- package/php/strings/convert_cyr_string.js +1 -1
- package/php/strings/convert_cyr_string.js.map +1 -1
- package/php/strings/convert_uuencode.js.map +1 -1
- package/php/strings/count_chars.js +1 -1
- package/php/strings/count_chars.js.map +1 -1
- package/php/strings/crc32.js.map +1 -1
- package/php/strings/echo.js.map +1 -1
- package/php/strings/explode.js.map +1 -1
- package/php/strings/get_html_translation_table.js +1 -1
- package/php/strings/get_html_translation_table.js.map +1 -1
- package/php/strings/hex2bin.js +1 -1
- package/php/strings/hex2bin.js.map +1 -1
- package/php/strings/html_entity_decode.js.map +1 -1
- package/php/strings/htmlentities.js.map +1 -1
- package/php/strings/htmlspecialchars.js +6 -6
- package/php/strings/htmlspecialchars.js.map +1 -1
- package/php/strings/htmlspecialchars_decode.js +6 -6
- package/php/strings/htmlspecialchars_decode.js.map +1 -1
- package/php/strings/implode.js.map +1 -1
- package/php/strings/index.js +91 -91
- package/php/strings/index.js.map +1 -1
- package/php/strings/join.js.map +1 -1
- package/php/strings/lcfirst.js.map +1 -1
- package/php/strings/levenshtein.js +6 -1
- package/php/strings/levenshtein.js.map +1 -1
- package/php/strings/localeconv.js.map +1 -1
- package/php/strings/ltrim.js.map +1 -1
- package/php/strings/md5.js +19 -15
- package/php/strings/md5.js.map +1 -1
- package/php/strings/md5_file.js.map +1 -1
- package/php/strings/metaphone.js +2 -2
- package/php/strings/metaphone.js.map +1 -1
- package/php/strings/money_format.js.map +1 -1
- package/php/strings/nl2br.js.map +1 -1
- package/php/strings/nl_langinfo.js.map +1 -1
- package/php/strings/number_format.js.map +1 -1
- package/php/strings/ord.js.map +1 -1
- package/php/strings/parse_str.js +13 -13
- package/php/strings/parse_str.js.map +1 -1
- package/php/strings/printf.js.map +1 -1
- package/php/strings/quoted_printable_decode.js.map +1 -1
- package/php/strings/quoted_printable_encode.js.map +1 -1
- package/php/strings/rtrim.js.map +1 -1
- package/php/strings/setlocale.js +18 -19
- package/php/strings/setlocale.js.map +1 -1
- package/php/strings/sha1.js +12 -7
- package/php/strings/sha1.js.map +1 -1
- package/php/strings/sha1_file.js.map +1 -1
- package/php/strings/similar_text.js +4 -4
- package/php/strings/similar_text.js.map +1 -1
- package/php/strings/soundex.js +3 -3
- package/php/strings/soundex.js.map +1 -1
- package/php/strings/split.js.map +1 -1
- package/php/strings/sprintf.js +7 -2
- package/php/strings/sprintf.js.map +1 -1
- package/php/strings/sscanf.js +2 -2
- package/php/strings/sscanf.js.map +1 -1
- package/php/strings/str_getcsv.js +2 -2
- package/php/strings/str_getcsv.js.map +1 -1
- package/php/strings/str_ireplace.js +6 -0
- package/php/strings/str_ireplace.js.map +1 -1
- package/php/strings/str_pad.js +1 -1
- package/php/strings/str_pad.js.map +1 -1
- package/php/strings/str_repeat.js.map +1 -1
- package/php/strings/str_replace.js +6 -0
- package/php/strings/str_replace.js.map +1 -1
- package/php/strings/str_shuffle.js +1 -1
- package/php/strings/str_shuffle.js.map +1 -1
- package/php/strings/str_split.js.map +1 -1
- package/php/strings/str_word_count.js.map +1 -1
- package/php/strings/strcasecmp.js.map +1 -1
- package/php/strings/strchr.js.map +1 -1
- package/php/strings/strcoll.js.map +1 -1
- package/php/strings/strip_tags.js.map +1 -1
- package/php/strings/stripos.js.map +1 -1
- package/php/strings/stristr.js.map +1 -1
- package/php/strings/strlen.js.map +1 -1
- package/php/strings/strnatcasecmp.js.map +1 -1
- package/php/strings/strnatcmp.js.map +1 -1
- package/php/strings/strncasecmp.js +1 -1
- package/php/strings/strncasecmp.js.map +1 -1
- package/php/strings/strncmp.js.map +1 -1
- package/php/strings/strpbrk.js.map +1 -1
- package/php/strings/strpos.js.map +1 -1
- package/php/strings/strrchr.js.map +1 -1
- package/php/strings/strrev.js.map +1 -1
- package/php/strings/strripos.js.map +1 -1
- package/php/strings/strrpos.js.map +1 -1
- package/php/strings/strspn.js +3 -3
- package/php/strings/strspn.js.map +1 -1
- package/php/strings/strstr.js.map +1 -1
- package/php/strings/strtok.js.map +1 -1
- package/php/strings/strtr.js.map +1 -1
- package/php/strings/substr.js.map +1 -1
- package/php/strings/substr_count.js.map +1 -1
- package/php/strings/trim.js.map +1 -1
- package/php/strings/ucfirst.js.map +1 -1
- package/php/strings/vprintf.js.map +1 -1
- package/php/strings/vsprintf.js.map +1 -1
- package/php/strings/wordwrap.js +4 -2
- package/php/strings/wordwrap.js.map +1 -1
- package/php/url/base64_decode.js +8 -8
- package/php/url/base64_decode.js.map +1 -1
- package/php/url/base64_encode.js +8 -8
- package/php/url/base64_encode.js.map +1 -1
- package/php/url/http_build_query.js +4 -4
- package/php/url/http_build_query.js.map +1 -1
- package/php/url/index.js +8 -8
- package/php/url/index.js.map +1 -1
- package/php/url/parse_url.js +1 -1
- package/php/url/parse_url.js.map +1 -1
- package/php/var/doubleval.js.map +1 -1
- package/php/var/empty.js +4 -4
- package/php/var/empty.js.map +1 -1
- package/php/var/gettype.js +1 -1
- package/php/var/gettype.js.map +1 -1
- package/php/var/index.js +30 -30
- package/php/var/index.js.map +1 -1
- package/php/var/intval.js +2 -1
- package/php/var/intval.js.map +1 -1
- package/php/var/is_array.js.map +1 -1
- package/php/var/is_callable.js.map +1 -1
- package/php/var/is_double.js.map +1 -1
- package/php/var/is_integer.js.map +1 -1
- package/php/var/is_long.js.map +1 -1
- package/php/var/is_numeric.js.map +1 -1
- package/php/var/is_real.js.map +1 -1
- package/php/var/is_unicode.js.map +1 -1
- package/php/var/isset.js +1 -1
- package/php/var/isset.js.map +1 -1
- package/php/var/print_r.js.map +1 -1
- package/php/var/serialize.js +7 -5
- package/php/var/serialize.js.map +1 -1
- package/php/var/strval.js.map +1 -1
- package/php/var/unserialize.js +422 -236
- package/php/var/unserialize.js.map +1 -1
- package/php/var/var_dump.js +3 -3
- package/php/var/var_dump.js.map +1 -1
- package/php/var/var_export.js +5 -5
- package/php/var/var_export.js.map +1 -1
- package/php/xdiff/index.js +2 -2
- package/php/xdiff/index.js.map +1 -1
- package/php/xdiff/xdiff_string_diff.js +30 -30
- package/php/xdiff/xdiff_string_diff.js.map +1 -1
- package/php/xdiff/xdiff_string_patch.js +7 -8
- package/php/xdiff/xdiff_string_patch.js.map +1 -1
- package/php/xml/index.js +2 -2
- package/php/xml/index.js.map +1 -1
- package/php/xml/utf8_decode.js.map +1 -1
- package/php/xml/utf8_encode.js +2 -2
- package/php/xml/utf8_encode.js.map +1 -1
- package/python/index.js +1 -1
- package/python/index.js.map +1 -1
- package/python/string/capwords.js.map +1 -1
- package/python/string/index.js +4 -4
- package/python/string/index.js.map +1 -1
- package/python/string/punctuation.js +10 -0
- package/python/string/punctuation.js.map +1 -0
- package/ruby/Math/index.js +1 -1
- package/ruby/Math/index.js.map +1 -1
- package/ruby/index.js +1 -1
- package/ruby/index.js.map +1 -1
package/php/url/parse_url.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/php/url/parse_url.js"],"names":["module","exports","parse_url","str","component","query","mode","require","undefined","key","parser","php","RegExp","join","strict","loose","m","exec","uri","i","replace","toLowerCase","name","$0","$1","$2","source"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,SAAT,CAAoBC,GAApB,EAAyBC,SAAzB,EAAoC;AAAE;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,
|
|
1
|
+
{"version":3,"sources":["../../../src/php/url/parse_url.js"],"names":["module","exports","parse_url","str","component","query","mode","require","undefined","key","parser","php","RegExp","join","strict","loose","m","exec","uri","i","replace","toLowerCase","name","$0","$1","$2","source"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,SAAT,CAAoBC,GAApB,EAAyBC,SAAzB,EAAoC;AAAE;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,cAAJ;;AAEA,MAAMC,OAAO,CAAC,OAAOC,OAAP,KAAmB,WAAnB,GAAiCA,QAAQ,iBAAR,EAA2B,wBAA3B,CAAjC,GAAwFC,SAAzF,KAAuG,KAApH;;AAEA,MAAMC,MAAM,CACV,QADU,EAEV,QAFU,EAGV,WAHU,EAIV,UAJU,EAKV,MALU,EAMV,MANU,EAOV,MAPU,EAQV,MARU,EASV,UATU,EAUV,MAVU,EAWV,WAXU,EAYV,MAZU,EAaV,OAbU,EAcV,UAdU,CAAZ;;AAiBA;AACA,MAAIC,SAAS;AACXC,SAAK,IAAIC,MAAJ,CAAW,CACd,oBADc,EAEd,gFAFc,EAGd,IAHc,EAId,oEAJc,EAKdC,IALc,CAKT,EALS,CAAX,CADM;AAOXC,YAAQ,IAAIF,MAAJ,CAAW,CACjB,oBADiB,EAEjB,wEAFiB,EAGjB,0DAHiB,EAIjBC,IAJiB,CAIZ,EAJY,CAAX,CAPG;AAYXE,WAAO,IAAIH,MAAJ,CAAW,CAChB,0CADgB,EAEhB,iBAFgB,EAGhB,6DAHgB,EAIhB,wEAJgB,EAKhB,4BALgB,EAMhBC,IANgB,CAMX,EANW,CAAX;AAZI,GAAb;;AAqBA,MAAMG,IAAIN,OAAOJ,IAAP,EAAaW,IAAb,CAAkBd,GAAlB,CAAV;AACA,MAAMe,MAAM,EAAZ;AACA,MAAIC,IAAI,EAAR;;AAEA,SAAOA,GAAP,EAAY;AACV,QAAIH,EAAEG,CAAF,CAAJ,EAAU;AACRD,UAAIT,IAAIU,CAAJ,CAAJ,IAAcH,EAAEG,CAAF,CAAd;AACD;AACF;;AAED,MAAIf,SAAJ,EAAe;AACb,WAAOc,IAAId,UAAUgB,OAAV,CAAkB,UAAlB,EAA8B,EAA9B,EAAkCC,WAAlC,EAAJ,CAAP;AACD;;AAED,MAAIf,SAAS,KAAb,EAAoB;AAClB,QAAMgB,OAAO,CAAC,OAAOf,OAAP,KAAmB,WAAnB,GAAiCA,QAAQ,iBAAR,EAA2B,4BAA3B,CAAjC,GAA4FC,SAA7F,KAA2G,UAAxH;AACAE,aAAS,2BAAT;AACAQ,QAAII,IAAJ,IAAY,EAAZ;AACAjB,YAAQa,IAAIT,IAAI,EAAJ,CAAJ,KAAgB,EAAxB;AACAJ,UAAMe,OAAN,CAAcV,MAAd,EAAsB,UAAUa,EAAV,EAAcC,EAAd,EAAkBC,EAAlB,EAAsB;AAC1C,UAAID,EAAJ,EAAQ;AACNN,YAAII,IAAJ,EAAUE,EAAV,IAAgBC,EAAhB;AACD;AACF,KAJD;AAKD;;AAED,SAAOP,IAAIQ,MAAX;AACA,SAAOR,GAAP;AACD,CAhGD","file":"parse_url.js","sourcesContent":["module.exports = function parse_url (str, component) { // eslint-disable-line camelcase\n // discuss at: https://locutus.io/php/parse_url/\n // original by: Steven Levithan (https://blog.stevenlevithan.com)\n // reimplemented by: Brett Zamir (https://brett-zamir.me)\n // input by: Lorenzo Pisani\n // input by: Tony\n // improved by: Brett Zamir (https://brett-zamir.me)\n // note 1: original by https://stevenlevithan.com/demo/parseuri/js/assets/parseuri.js\n // note 1: blog post at https://blog.stevenlevithan.com/archives/parseuri\n // note 1: demo at https://stevenlevithan.com/demo/parseuri/js/assets/parseuri.js\n // note 1: Does not replace invalid characters with '_' as in PHP,\n // note 1: nor does it return false with\n // note 1: a seriously malformed URL.\n // note 1: Besides function name, is essentially the same as parseUri as\n // note 1: well as our allowing\n // note 1: an extra slash after the scheme/protocol (to allow file:/// as in PHP)\n // example 1: parse_url('https://user:pass@host/path?a=v#a')\n // returns 1: {scheme: 'https', host: 'host', user: 'user', pass: 'pass', path: '/path', query: 'a=v', fragment: 'a'}\n // example 2: parse_url('https://en.wikipedia.org/wiki/%22@%22_%28album%29')\n // returns 2: {scheme: 'https', host: 'en.wikipedia.org', path: '/wiki/%22@%22_%28album%29'}\n // example 3: parse_url('https://host.domain.tld/a@b.c/folder')\n // returns 3: {scheme: 'https', host: 'host.domain.tld', path: '/a@b.c/folder'}\n // example 4: parse_url('https://gooduser:secretpassword@www.example.com/a@b.c/folder?foo=bar')\n // returns 4: { scheme: 'https', host: 'www.example.com', path: '/a@b.c/folder', query: 'foo=bar', user: 'gooduser', pass: 'secretpassword' }\n\n let query\n\n const mode = (typeof require !== 'undefined' ? require('../info/ini_get')('locutus.parse_url.mode') : undefined) || 'php'\n\n const key = [\n 'source',\n 'scheme',\n 'authority',\n 'userInfo',\n 'user',\n 'pass',\n 'host',\n 'port',\n 'relative',\n 'path',\n 'directory',\n 'file',\n 'query',\n 'fragment'\n ]\n\n // For loose we added one optional slash to post-scheme to catch file:/// (should restrict this)\n let parser = {\n php: new RegExp([\n '(?:([^:\\\\/?#]+):)?',\n '(?:\\\\/\\\\/()(?:(?:()(?:([^:@\\\\/]*):?([^:@\\\\/]*))?@)?([^:\\\\/?#]*)(?::(\\\\d*))?))?',\n '()',\n '(?:(()(?:(?:[^?#\\\\/]*\\\\/)*)()(?:[^?#]*))(?:\\\\?([^#]*))?(?:#(.*))?)'\n ].join('')),\n strict: new RegExp([\n '(?:([^:\\\\/?#]+):)?',\n '(?:\\\\/\\\\/((?:(([^:@\\\\/]*):?([^:@\\\\/]*))?@)?([^:\\\\/?#]*)(?::(\\\\d*))?))?',\n '((((?:[^?#\\\\/]*\\\\/)*)([^?#]*))(?:\\\\?([^#]*))?(?:#(.*))?)'\n ].join('')),\n loose: new RegExp([\n '(?:(?![^:@]+:[^:@\\\\/]*@)([^:\\\\/?#.]+):)?',\n '(?:\\\\/\\\\/\\\\/?)?',\n '((?:(([^:@\\\\/]*):?([^:@\\\\/]*))?@)?([^:\\\\/?#]*)(?::(\\\\d*))?)',\n '(((\\\\/(?:[^?#](?![^?#\\\\/]*\\\\.[^?#\\\\/.]+(?:[?#]|$)))*\\\\/?)?([^?#\\\\/]*))',\n '(?:\\\\?([^#]*))?(?:#(.*))?)'\n ].join(''))\n }\n\n const m = parser[mode].exec(str)\n const uri = {}\n let i = 14\n\n while (i--) {\n if (m[i]) {\n uri[key[i]] = m[i]\n }\n }\n\n if (component) {\n return uri[component.replace('PHP_URL_', '').toLowerCase()]\n }\n\n if (mode !== 'php') {\n const name = (typeof require !== 'undefined' ? require('../info/ini_get')('locutus.parse_url.queryKey') : undefined) || 'queryKey'\n parser = /(?:^|&)([^&=]*)=?([^&]*)/g\n uri[name] = {}\n query = uri[key[12]] || ''\n query.replace(parser, function ($0, $1, $2) {\n if ($1) {\n uri[name][$1] = $2\n }\n })\n }\n\n delete uri.source\n return uri\n}\n"]}
|
package/php/var/doubleval.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/php/var/doubleval.js"],"names":["module","exports","doubleval","mixedVar","floatval","require"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,SAAT,CAAoBC,QAApB,EAA8B;AAC7C;AACA;AACA;AACA;AACA;AACA;;AAEA,
|
|
1
|
+
{"version":3,"sources":["../../../src/php/var/doubleval.js"],"names":["module","exports","doubleval","mixedVar","floatval","require"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,SAAT,CAAoBC,QAApB,EAA8B;AAC7C;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,WAAWC,QAAQ,iBAAR,CAAjB;;AAEA,SAAOD,SAASD,QAAT,CAAP;AACD,CAXD","file":"doubleval.js","sourcesContent":["module.exports = function doubleval (mixedVar) {\n // discuss at: https://locutus.io/php/doubleval/\n // original by: Brett Zamir (https://brett-zamir.me)\n // note 1: 1.0 is simplified to 1 before it can be accessed by the function, this makes\n // note 1: it different from the PHP implementation. We can't fix this unfortunately.\n // example 1: doubleval(186)\n // returns 1: 186.00\n\n const floatval = require('../var/floatval')\n\n return floatval(mixedVar)\n}\n"]}
|
package/php/var/empty.js
CHANGED
|
@@ -24,10 +24,10 @@ module.exports = function empty(mixedVar) {
|
|
|
24
24
|
// example 5: empty({'aFunc' : function () { alert('humpty'); } })
|
|
25
25
|
// returns 5: false
|
|
26
26
|
|
|
27
|
-
var undef;
|
|
28
|
-
var key;
|
|
29
|
-
var i;
|
|
30
|
-
var len;
|
|
27
|
+
var undef = void 0;
|
|
28
|
+
var key = void 0;
|
|
29
|
+
var i = void 0;
|
|
30
|
+
var len = void 0;
|
|
31
31
|
var emptyValues = [undef, null, false, 0, '', '0'];
|
|
32
32
|
|
|
33
33
|
for (i = 0, len = emptyValues.length; i < len; i++) {
|
package/php/var/empty.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/php/var/empty.js"],"names":["module","exports","empty","mixedVar","undef","key","i","len","emptyValues","length","hasOwnProperty"],"mappings":";;;;AAAAA,OAAOC,OAAP,GAAiB,SAASC,KAAT,CAAgBC,QAAhB,EAA0B;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,
|
|
1
|
+
{"version":3,"sources":["../../../src/php/var/empty.js"],"names":["module","exports","empty","mixedVar","undef","key","i","len","emptyValues","length","hasOwnProperty"],"mappings":";;;;AAAAA,OAAOC,OAAP,GAAiB,SAASC,KAAT,CAAgBC,QAAhB,EAA0B;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,cAAJ;AACA,MAAIC,YAAJ;AACA,MAAIC,UAAJ;AACA,MAAIC,YAAJ;AACA,MAAMC,cAAc,CAACJ,KAAD,EAAQ,IAAR,EAAc,KAAd,EAAqB,CAArB,EAAwB,EAAxB,EAA4B,GAA5B,CAApB;;AAEA,OAAKE,IAAI,CAAJ,EAAOC,MAAMC,YAAYC,MAA9B,EAAsCH,IAAIC,GAA1C,EAA+CD,GAA/C,EAAoD;AAClD,QAAIH,aAAaK,YAAYF,CAAZ,CAAjB,EAAiC;AAC/B,aAAO,IAAP;AACD;AACF;;AAED,MAAI,QAAOH,QAAP,yCAAOA,QAAP,OAAoB,QAAxB,EAAkC;AAChC,SAAKE,GAAL,IAAYF,QAAZ,EAAsB;AACpB,UAAIA,SAASO,cAAT,CAAwBL,GAAxB,CAAJ,EAAkC;AAChC,eAAO,KAAP;AACD;AACF;AACD,WAAO,IAAP;AACD;;AAED,SAAO,KAAP;AACD,CA5CD","file":"empty.js","sourcesContent":["module.exports = function empty (mixedVar) {\n // discuss at: https://locutus.io/php/empty/\n // original by: Philippe Baumann\n // input by: Onno Marsman (https://twitter.com/onnomarsman)\n // input by: LH\n // input by: Stoyan Kyosev (https://www.svest.org/)\n // bugfixed by: Kevin van Zonneveld (https://kvz.io)\n // improved by: Onno Marsman (https://twitter.com/onnomarsman)\n // improved by: Francesco\n // improved by: Marc Jansen\n // improved by: Rafał Kukawski (https://blog.kukawski.pl)\n // example 1: empty(null)\n // returns 1: true\n // example 2: empty(undefined)\n // returns 2: true\n // example 3: empty([])\n // returns 3: true\n // example 4: empty({})\n // returns 4: true\n // example 5: empty({'aFunc' : function () { alert('humpty'); } })\n // returns 5: false\n\n let undef\n let key\n let i\n let len\n const emptyValues = [undef, null, false, 0, '', '0']\n\n for (i = 0, len = emptyValues.length; i < len; i++) {\n if (mixedVar === emptyValues[i]) {\n return true\n }\n }\n\n if (typeof mixedVar === 'object') {\n for (key in mixedVar) {\n if (mixedVar.hasOwnProperty(key)) {\n return false\n }\n }\n return true\n }\n\n return false\n}\n"]}
|
package/php/var/gettype.js
CHANGED
|
@@ -29,7 +29,7 @@ module.exports = function gettype(mixedVar) {
|
|
|
29
29
|
var isFloat = require('../var/is_float');
|
|
30
30
|
|
|
31
31
|
var s = typeof mixedVar === 'undefined' ? 'undefined' : _typeof(mixedVar);
|
|
32
|
-
var name;
|
|
32
|
+
var name = void 0;
|
|
33
33
|
var _getFuncName = function _getFuncName(fn) {
|
|
34
34
|
var name = /\W*function\s+([\w$]+)\s*\(/.exec(fn);
|
|
35
35
|
if (!name) {
|
package/php/var/gettype.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/php/var/gettype.js"],"names":["module","exports","gettype","mixedVar","isFloat","require","s","name","_getFuncName","fn","exec","length","propertyIsEnumerable","splice","constructor"],"mappings":";;;;AAAAA,OAAOC,OAAP,GAAiB,SAASC,OAAT,CAAkBC,QAAlB,EAA4B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,
|
|
1
|
+
{"version":3,"sources":["../../../src/php/var/gettype.js"],"names":["module","exports","gettype","mixedVar","isFloat","require","s","name","_getFuncName","fn","exec","length","propertyIsEnumerable","splice","constructor"],"mappings":";;;;AAAAA,OAAOC,OAAP,GAAiB,SAASC,OAAT,CAAkBC,QAAlB,EAA4B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,UAAUC,QAAQ,iBAAR,CAAhB;;AAEA,MAAIC,WAAWH,QAAX,yCAAWA,QAAX,CAAJ;AACA,MAAII,aAAJ;AACA,MAAMC,eAAe,SAAfA,YAAe,CAAUC,EAAV,EAAc;AACjC,QAAMF,OAAQ,6BAAD,CAAgCG,IAAhC,CAAqCD,EAArC,CAAb;AACA,QAAI,CAACF,IAAL,EAAW;AACT,aAAO,aAAP;AACD;AACD,WAAOA,KAAK,CAAL,CAAP;AACD,GAND;;AAQA,MAAID,MAAM,QAAV,EAAoB;AAClB,QAAIH,aAAa,IAAjB,EAAuB;AACrB;AACA;AACA,UAAI,OAAOA,SAASQ,MAAhB,KAA2B,QAA3B,IACF,CAAER,SAASS,oBAAT,CAA8B,QAA9B,CADA,IAEF,OAAOT,SAASU,MAAhB,KAA2B,UAF7B,EAEyC;AACvCP,YAAI,OAAJ;AACD,OAJD,MAIO,IAAIH,SAASW,WAAT,IAAwBN,aAAaL,SAASW,WAAtB,CAA5B,EAAgE;AACrEP,eAAOC,aAAaL,SAASW,WAAtB,CAAP;AACA,YAAIP,SAAS,MAAb,EAAqB;AACnB;AACAD,cAAI,MAAJ;AACD,SAHD,MAGO,IAAIC,SAAS,QAAb,EAAuB;AAC5B;AACAD,cAAI,QAAJ;AACD,SAHM,MAGA,IAAIC,SAAS,kBAAb,EAAiC;AACtC;AACAD,cAAI,UAAJ;AACD;AACF;AACF,KApBD,MAoBO;AACLA,UAAI,MAAJ;AACD;AACF,GAxBD,MAwBO,IAAIA,MAAM,QAAV,EAAoB;AACzBA,QAAIF,QAAQD,QAAR,IAAoB,QAApB,GAA+B,SAAnC;AACD;;AAED,SAAOG,CAAP;AACD,CAjED","file":"gettype.js","sourcesContent":["module.exports = function gettype (mixedVar) {\n // discuss at: https://locutus.io/php/gettype/\n // original by: Paulo Freitas\n // improved by: Kevin van Zonneveld (https://kvz.io)\n // improved by: Douglas Crockford (https://javascript.crockford.com)\n // improved by: Brett Zamir (https://brett-zamir.me)\n // input by: KELAN\n // note 1: 1.0 is simplified to 1 before it can be accessed by the function, this makes\n // note 1: it different from the PHP implementation. We can't fix this unfortunately.\n // example 1: gettype(1)\n // returns 1: 'integer'\n // example 2: gettype(undefined)\n // returns 2: 'undefined'\n // example 3: gettype({0: 'Kevin van Zonneveld'})\n // returns 3: 'object'\n // example 4: gettype('foo')\n // returns 4: 'string'\n // example 5: gettype({0: function () {return false;}})\n // returns 5: 'object'\n // example 6: gettype({0: 'test', length: 1, splice: function () {}})\n // returns 6: 'object'\n // example 7: gettype(['test'])\n // returns 7: 'array'\n\n const isFloat = require('../var/is_float')\n\n let s = typeof mixedVar\n let name\n const _getFuncName = function (fn) {\n const name = (/\\W*function\\s+([\\w$]+)\\s*\\(/).exec(fn)\n if (!name) {\n return '(Anonymous)'\n }\n return name[1]\n }\n\n if (s === 'object') {\n if (mixedVar !== null) {\n // From: https://javascript.crockford.com/remedial.html\n // @todo: Break up this lengthy if statement\n if (typeof mixedVar.length === 'number' &&\n !(mixedVar.propertyIsEnumerable('length')) &&\n typeof mixedVar.splice === 'function') {\n s = 'array'\n } else if (mixedVar.constructor && _getFuncName(mixedVar.constructor)) {\n name = _getFuncName(mixedVar.constructor)\n if (name === 'Date') {\n // not in PHP\n s = 'date'\n } else if (name === 'RegExp') {\n // not in PHP\n s = 'regexp'\n } else if (name === 'LOCUTUS_Resource') {\n // Check against our own resource constructor\n s = 'resource'\n }\n }\n } else {\n s = 'null'\n }\n } else if (s === 'number') {\n s = isFloat(mixedVar) ? 'double' : 'integer'\n }\n\n return s\n}\n"]}
|
package/php/var/index.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
'use strict';
|
|
2
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
|
|
3
|
+
module.exports.boolval = require('./boolval');
|
|
4
|
+
module.exports.doubleval = require('./doubleval');
|
|
5
|
+
module.exports.empty = require('./empty');
|
|
6
|
+
module.exports.floatval = require('./floatval');
|
|
7
|
+
module.exports.gettype = require('./gettype');
|
|
8
|
+
module.exports.intval = require('./intval');
|
|
9
|
+
module.exports.is_array = require('./is_array');
|
|
10
|
+
module.exports.is_binary = require('./is_binary');
|
|
11
|
+
module.exports.is_bool = require('./is_bool');
|
|
12
|
+
module.exports.is_buffer = require('./is_buffer');
|
|
13
|
+
module.exports.is_callable = require('./is_callable');
|
|
14
|
+
module.exports.is_double = require('./is_double');
|
|
15
|
+
module.exports.is_float = require('./is_float');
|
|
16
|
+
module.exports.is_int = require('./is_int');
|
|
17
|
+
module.exports.is_integer = require('./is_integer');
|
|
18
|
+
module.exports.is_long = require('./is_long');
|
|
19
|
+
module.exports.is_null = require('./is_null');
|
|
20
|
+
module.exports.is_numeric = require('./is_numeric');
|
|
21
|
+
module.exports.is_object = require('./is_object');
|
|
22
|
+
module.exports.is_real = require('./is_real');
|
|
23
|
+
module.exports.is_scalar = require('./is_scalar');
|
|
24
|
+
module.exports.is_string = require('./is_string');
|
|
25
|
+
module.exports.is_unicode = require('./is_unicode');
|
|
26
|
+
module.exports.isset = require('./isset');
|
|
27
|
+
module.exports.print_r = require('./print_r');
|
|
28
|
+
module.exports.serialize = require('./serialize');
|
|
29
|
+
module.exports.strval = require('./strval');
|
|
30
|
+
module.exports.unserialize = require('./unserialize');
|
|
31
|
+
module.exports.var_dump = require('./var_dump');
|
|
32
|
+
module.exports.var_export = require('./var_export');
|
|
33
33
|
//# sourceMappingURL=index.js.map
|
package/php/var/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/php/var/index.js"],"names":["module","exports","require"],"mappings":";;AAAAA,OAAOC,OAAP,
|
|
1
|
+
{"version":3,"sources":["../../../src/php/var/index.js"],"names":["module","exports","boolval","require","doubleval","empty","floatval","gettype","intval","is_array","is_binary","is_bool","is_buffer","is_callable","is_double","is_float","is_int","is_integer","is_long","is_null","is_numeric","is_object","is_real","is_scalar","is_string","is_unicode","isset","print_r","serialize","strval","unserialize","var_dump","var_export"],"mappings":";;AAAAA,OAAOC,OAAP,CAAeC,OAAf,GAAyBC,QAAQ,WAAR,CAAzB;AACAH,OAAOC,OAAP,CAAeG,SAAf,GAA2BD,QAAQ,aAAR,CAA3B;AACAH,OAAOC,OAAP,CAAeI,KAAf,GAAuBF,QAAQ,SAAR,CAAvB;AACAH,OAAOC,OAAP,CAAeK,QAAf,GAA0BH,QAAQ,YAAR,CAA1B;AACAH,OAAOC,OAAP,CAAeM,OAAf,GAAyBJ,QAAQ,WAAR,CAAzB;AACAH,OAAOC,OAAP,CAAeO,MAAf,GAAwBL,QAAQ,UAAR,CAAxB;AACAH,OAAOC,OAAP,CAAeQ,QAAf,GAA0BN,QAAQ,YAAR,CAA1B;AACAH,OAAOC,OAAP,CAAeS,SAAf,GAA2BP,QAAQ,aAAR,CAA3B;AACAH,OAAOC,OAAP,CAAeU,OAAf,GAAyBR,QAAQ,WAAR,CAAzB;AACAH,OAAOC,OAAP,CAAeW,SAAf,GAA2BT,QAAQ,aAAR,CAA3B;AACAH,OAAOC,OAAP,CAAeY,WAAf,GAA6BV,QAAQ,eAAR,CAA7B;AACAH,OAAOC,OAAP,CAAea,SAAf,GAA2BX,QAAQ,aAAR,CAA3B;AACAH,OAAOC,OAAP,CAAec,QAAf,GAA0BZ,QAAQ,YAAR,CAA1B;AACAH,OAAOC,OAAP,CAAee,MAAf,GAAwBb,QAAQ,UAAR,CAAxB;AACAH,OAAOC,OAAP,CAAegB,UAAf,GAA4Bd,QAAQ,cAAR,CAA5B;AACAH,OAAOC,OAAP,CAAeiB,OAAf,GAAyBf,QAAQ,WAAR,CAAzB;AACAH,OAAOC,OAAP,CAAekB,OAAf,GAAyBhB,QAAQ,WAAR,CAAzB;AACAH,OAAOC,OAAP,CAAemB,UAAf,GAA4BjB,QAAQ,cAAR,CAA5B;AACAH,OAAOC,OAAP,CAAeoB,SAAf,GAA2BlB,QAAQ,aAAR,CAA3B;AACAH,OAAOC,OAAP,CAAeqB,OAAf,GAAyBnB,QAAQ,WAAR,CAAzB;AACAH,OAAOC,OAAP,CAAesB,SAAf,GAA2BpB,QAAQ,aAAR,CAA3B;AACAH,OAAOC,OAAP,CAAeuB,SAAf,GAA2BrB,QAAQ,aAAR,CAA3B;AACAH,OAAOC,OAAP,CAAewB,UAAf,GAA4BtB,QAAQ,cAAR,CAA5B;AACAH,OAAOC,OAAP,CAAeyB,KAAf,GAAuBvB,QAAQ,SAAR,CAAvB;AACAH,OAAOC,OAAP,CAAe0B,OAAf,GAAyBxB,QAAQ,WAAR,CAAzB;AACAH,OAAOC,OAAP,CAAe2B,SAAf,GAA2BzB,QAAQ,aAAR,CAA3B;AACAH,OAAOC,OAAP,CAAe4B,MAAf,GAAwB1B,QAAQ,UAAR,CAAxB;AACAH,OAAOC,OAAP,CAAe6B,WAAf,GAA6B3B,QAAQ,eAAR,CAA7B;AACAH,OAAOC,OAAP,CAAe8B,QAAf,GAA0B5B,QAAQ,YAAR,CAA1B;AACAH,OAAOC,OAAP,CAAe+B,UAAf,GAA4B7B,QAAQ,cAAR,CAA5B","file":"index.js","sourcesContent":["module.exports.boolval = require('./boolval')\nmodule.exports.doubleval = require('./doubleval')\nmodule.exports.empty = require('./empty')\nmodule.exports.floatval = require('./floatval')\nmodule.exports.gettype = require('./gettype')\nmodule.exports.intval = require('./intval')\nmodule.exports.is_array = require('./is_array')\nmodule.exports.is_binary = require('./is_binary')\nmodule.exports.is_bool = require('./is_bool')\nmodule.exports.is_buffer = require('./is_buffer')\nmodule.exports.is_callable = require('./is_callable')\nmodule.exports.is_double = require('./is_double')\nmodule.exports.is_float = require('./is_float')\nmodule.exports.is_int = require('./is_int')\nmodule.exports.is_integer = require('./is_integer')\nmodule.exports.is_long = require('./is_long')\nmodule.exports.is_null = require('./is_null')\nmodule.exports.is_numeric = require('./is_numeric')\nmodule.exports.is_object = require('./is_object')\nmodule.exports.is_real = require('./is_real')\nmodule.exports.is_scalar = require('./is_scalar')\nmodule.exports.is_string = require('./is_string')\nmodule.exports.is_unicode = require('./is_unicode')\nmodule.exports.isset = require('./isset')\nmodule.exports.print_r = require('./print_r')\nmodule.exports.serialize = require('./serialize')\nmodule.exports.strval = require('./strval')\nmodule.exports.unserialize = require('./unserialize')\nmodule.exports.var_dump = require('./var_dump')\nmodule.exports.var_export = require('./var_export')\n"]}
|
package/php/var/intval.js
CHANGED
package/php/var/intval.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/php/var/intval.js"],"names":["module","exports","intval","mixedVar","base","tmp","match","type","parseInt","isNaN","isFinite","Math","ceil","floor"],"mappings":";;;;AAAAA,OAAOC,OAAP,GAAiB,SAASC,MAAT,CAAiBC,QAAjB,EAA2BC,IAA3B,EAAiC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,
|
|
1
|
+
{"version":3,"sources":["../../../src/php/var/intval.js"],"names":["module","exports","intval","mixedVar","base","tmp","match","type","parseInt","isNaN","isFinite","Math","ceil","floor"],"mappings":";;;;AAAAA,OAAOC,OAAP,GAAiB,SAASC,MAAT,CAAiBC,QAAjB,EAA2BC,IAA3B,EAAiC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,YAAJ;AAAA,MAASC,cAAT;;AAEA,MAAMC,cAAcJ,QAAd,yCAAcA,QAAd,CAAN;;AAEA,MAAII,SAAS,SAAb,EAAwB;AACtB,WAAO,CAACJ,QAAR;AACD,GAFD,MAEO,IAAII,SAAS,QAAb,EAAuB;AAC5B,QAAIH,SAAS,CAAb,EAAgB;AACdE,cAAQH,SAASG,KAAT,CAAe,YAAf,CAAR;AACAF,aAAOE,QAASA,MAAM,CAAN,IAAW,EAAX,GAAgB,CAAzB,GAA8B,EAArC;AACD;AACDD,UAAMG,SAASL,QAAT,EAAmBC,QAAQ,EAA3B,CAAN;AACA,WAAQK,MAAMJ,GAAN,KAAc,CAACK,SAASL,GAAT,CAAhB,GAAiC,CAAjC,GAAqCA,GAA5C;AACD,GAPM,MAOA,IAAIE,SAAS,QAAT,IAAqBG,SAASP,QAAT,CAAzB,EAA6C;AAClD,WAAOA,WAAW,CAAX,GAAeQ,KAAKC,IAAL,CAAUT,QAAV,CAAf,GAAqCQ,KAAKE,KAAL,CAAWV,QAAX,CAA5C;AACD,GAFM,MAEA;AACL,WAAO,CAAP;AACD;AACF,CA3CD","file":"intval.js","sourcesContent":["module.exports = function intval (mixedVar, base) {\n // discuss at: https://locutus.io/php/intval/\n // original by: Kevin van Zonneveld (https://kvz.io)\n // improved by: stensi\n // bugfixed by: Kevin van Zonneveld (https://kvz.io)\n // bugfixed by: Brett Zamir (https://brett-zamir.me)\n // bugfixed by: Rafał Kukawski (https://blog.kukawski.pl)\n // input by: Matteo\n // example 1: intval('Kevin van Zonneveld')\n // returns 1: 0\n // example 2: intval(4.2)\n // returns 2: 4\n // example 3: intval(42, 8)\n // returns 3: 42\n // example 4: intval('09')\n // returns 4: 9\n // example 5: intval('1e', 16)\n // returns 5: 30\n // example 6: intval(0x200000001)\n // returns 6: 8589934593\n // example 7: intval('0xff', 0)\n // returns 7: 255\n // example 8: intval('010', 0)\n // returns 8: 8\n\n let tmp, match\n\n const type = typeof mixedVar\n\n if (type === 'boolean') {\n return +mixedVar\n } else if (type === 'string') {\n if (base === 0) {\n match = mixedVar.match(/^\\s*0(x?)/i)\n base = match ? (match[1] ? 16 : 8) : 10\n }\n tmp = parseInt(mixedVar, base || 10)\n return (isNaN(tmp) || !isFinite(tmp)) ? 0 : tmp\n } else if (type === 'number' && isFinite(mixedVar)) {\n return mixedVar < 0 ? Math.ceil(mixedVar) : Math.floor(mixedVar)\n } else {\n return 0\n }\n}\n"]}
|
package/php/var/is_array.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/php/var/is_array.js"],"names":["module","exports","is_array","mixedVar","_getFuncName","fn","name","exec","_isArray","length","len","isArray","iniVal","require","undefined","asString","Object","prototype","toString","call","asFunc","constructor"],"mappings":";;;;AAAAA,OAAOC,OAAP,GAAiB,SAASC,QAAT,CAAmBC,QAAnB,EAA6B;AAAE;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,
|
|
1
|
+
{"version":3,"sources":["../../../src/php/var/is_array.js"],"names":["module","exports","is_array","mixedVar","_getFuncName","fn","name","exec","_isArray","length","len","isArray","iniVal","require","undefined","asString","Object","prototype","toString","call","asFunc","constructor"],"mappings":";;;;AAAAA,OAAOC,OAAP,GAAiB,SAASC,QAAT,CAAmBC,QAAnB,EAA6B;AAAE;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,eAAe,SAAfA,YAAe,CAAUC,EAAV,EAAc;AACjC,QAAMC,OAAQ,6BAAD,CAAgCC,IAAhC,CAAqCF,EAArC,CAAb;AACA,QAAI,CAACC,IAAL,EAAW;AACT,aAAO,aAAP;AACD;AACD,WAAOA,KAAK,CAAL,CAAP;AACD,GAND;AAOA,MAAME,WAAW,SAAXA,QAAW,CAAUL,QAAV,EAAoB;AACnC;AACA;AACA;AACA;AACA,QAAI,CAACA,QAAD,IAAa,QAAOA,QAAP,yCAAOA,QAAP,OAAoB,QAAjC,IAA6C,OAAOA,SAASM,MAAhB,KAA2B,QAA5E,EAAsF;AACpF,aAAO,KAAP;AACD;AACD,QAAMC,MAAMP,SAASM,MAArB;AACAN,aAASA,SAASM,MAAlB,IAA4B,OAA5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAIC,QAAQP,SAASM,MAArB,EAA6B;AAC3B;AACA;AACAN,eAASM,MAAT,IAAmB,CAAnB;AACA,aAAO,IAAP;AACD;AACD;AACA;AACA;AACA;AACA,WAAON,SAASA,SAASM,MAAlB,CAAP;AACA,WAAO,KAAP;AACD,GA9BD;;AAgCA,MAAI,CAACN,QAAD,IAAa,QAAOA,QAAP,yCAAOA,QAAP,OAAoB,QAArC,EAA+C;AAC7C,WAAO,KAAP;AACD;;AAED,MAAMQ,UAAUH,SAASL,QAAT,CAAhB;;AAEA,MAAIQ,OAAJ,EAAa;AACX,WAAO,IAAP;AACD;;AAED,MAAMC,SAAS,CAAC,OAAOC,OAAP,KAAmB,WAAnB,GAAiCA,QAAQ,iBAAR,EAA2B,yBAA3B,CAAjC,GAAyFC,SAA1F,KAAwG,IAAvH;AACA,MAAIF,WAAW,IAAf,EAAqB;AACnB,QAAMG,WAAWC,OAAOC,SAAP,CAAiBC,QAAjB,CAA0BC,IAA1B,CAA+BhB,QAA/B,CAAjB;AACA,QAAMiB,SAAShB,aAAaD,SAASkB,WAAtB,CAAf;;AAEA,QAAIN,aAAa,iBAAb,IAAkCK,WAAW,QAAjD,EAA2D;AACzD;AACA,aAAO,IAAP;AACD;AACF;;AAED,SAAO,KAAP;AACD,CA3FD","file":"is_array.js","sourcesContent":["module.exports = function is_array (mixedVar) { // eslint-disable-line camelcase\n // discuss at: https://locutus.io/php/is_array/\n // original by: Kevin van Zonneveld (https://kvz.io)\n // improved by: Legaev Andrey\n // improved by: Onno Marsman (https://twitter.com/onnomarsman)\n // improved by: Brett Zamir (https://brett-zamir.me)\n // improved by: Nathan Sepulveda\n // improved by: Brett Zamir (https://brett-zamir.me)\n // bugfixed by: Cord\n // bugfixed by: Manish\n // bugfixed by: Brett Zamir (https://brett-zamir.me)\n // note 1: In Locutus, javascript objects are like php associative arrays,\n // note 1: thus JavaScript objects will also\n // note 1: return true in this function (except for objects which inherit properties,\n // note 1: being thus used as objects),\n // note 1: unless you do ini_set('locutus.objectsAsArrays', 0),\n // note 1: in which case only genuine JavaScript arrays\n // note 1: will return true\n // example 1: is_array(['Kevin', 'van', 'Zonneveld'])\n // returns 1: true\n // example 2: is_array('Kevin van Zonneveld')\n // returns 2: false\n // example 3: is_array({0: 'Kevin', 1: 'van', 2: 'Zonneveld'})\n // returns 3: true\n // example 4: ini_set('locutus.objectsAsArrays', 0)\n // example 4: is_array({0: 'Kevin', 1: 'van', 2: 'Zonneveld'})\n // returns 4: false\n // example 5: is_array(function tmp_a (){ this.name = 'Kevin' })\n // returns 5: false\n\n const _getFuncName = function (fn) {\n const name = (/\\W*function\\s+([\\w$]+)\\s*\\(/).exec(fn)\n if (!name) {\n return '(Anonymous)'\n }\n return name[1]\n }\n const _isArray = function (mixedVar) {\n // return Object.prototype.toString.call(mixedVar) === '[object Array]';\n // The above works, but let's do the even more stringent approach:\n // (since Object.prototype.toString could be overridden)\n // Null, Not an object, no length property so couldn't be an Array (or String)\n if (!mixedVar || typeof mixedVar !== 'object' || typeof mixedVar.length !== 'number') {\n return false\n }\n const len = mixedVar.length\n mixedVar[mixedVar.length] = 'bogus'\n // The only way I can think of to get around this (or where there would be trouble)\n // would be to have an object defined\n // with a custom \"length\" getter which changed behavior on each call\n // (or a setter to mess up the following below) or a custom\n // setter for numeric properties, but even that would need to listen for\n // specific indexes; but there should be no false negatives\n // and such a false positive would need to rely on later JavaScript\n // innovations like __defineSetter__\n if (len !== mixedVar.length) {\n // We know it's an array since length auto-changed with the addition of a\n // numeric property at its length end, so safely get rid of our bogus element\n mixedVar.length -= 1\n return true\n }\n // Get rid of the property we added onto a non-array object; only possible\n // side-effect is if the user adds back the property later, it will iterate\n // this property in the older order placement in IE (an order which should not\n // be depended on anyways)\n delete mixedVar[mixedVar.length]\n return false\n }\n\n if (!mixedVar || typeof mixedVar !== 'object') {\n return false\n }\n\n const isArray = _isArray(mixedVar)\n\n if (isArray) {\n return true\n }\n\n const iniVal = (typeof require !== 'undefined' ? require('../info/ini_get')('locutus.objectsAsArrays') : undefined) || 'on'\n if (iniVal === 'on') {\n const asString = Object.prototype.toString.call(mixedVar)\n const asFunc = _getFuncName(mixedVar.constructor)\n\n if (asString === '[object Object]' && asFunc === 'Object') {\n // Most likely a literal and intended as assoc. array\n return true\n }\n }\n\n return false\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/php/var/is_callable.js"],"names":["module","exports","is_callable","mixedVar","syntaxOnly","callableName","$global","window","global","validJSFunctionNamePattern","name","obj","method","validFunctionName","getFuncName","fn","exec","test","toString","match","Object","prototype","call","length","constructor","eval"],"mappings":";;;;AAAAA,OAAOC,OAAP,GAAiB,SAASC,WAAT,CAAsBC,QAAtB,EAAgCC,UAAhC,EAA4CC,YAA5C,EAA0D;AAAE;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,
|
|
1
|
+
{"version":3,"sources":["../../../src/php/var/is_callable.js"],"names":["module","exports","is_callable","mixedVar","syntaxOnly","callableName","$global","window","global","validJSFunctionNamePattern","name","obj","method","validFunctionName","getFuncName","fn","exec","test","toString","match","Object","prototype","call","length","constructor","eval"],"mappings":";;;;AAAAA,OAAOC,OAAP,GAAiB,SAASC,WAAT,CAAsBC,QAAtB,EAAgCC,UAAhC,EAA4CC,YAA5C,EAA0D;AAAE;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,UAAW,OAAOC,MAAP,KAAkB,WAAlB,GAAgCA,MAAhC,GAAyCC,MAA1D;;AAEA,MAAMC,6BAA6B,kDAAnC;;AAEA,MAAIC,OAAO,EAAX;AACA,MAAIC,MAAM,EAAV;AACA,MAAIC,SAAS,EAAb;AACA,MAAIC,oBAAoB,KAAxB;;AAEA,MAAMC,cAAc,SAAdA,WAAc,CAAUC,EAAV,EAAc;AAChC,QAAML,OAAQ,6BAAD,CAAgCM,IAAhC,CAAqCD,EAArC,CAAb;AACA,QAAI,CAACL,IAAL,EAAW;AACT,aAAO,aAAP;AACD;AACD,WAAOA,KAAK,CAAL,CAAP;AACD,GAND;;AAQA;AACA,MAAI,oBAAoBO,IAApB,CAAyBd,SAASe,QAAT,EAAzB,CAAJ,EAAmD;AACjD,WAAO,KAAP;AACD;;AAED,MAAI,OAAOf,QAAP,KAAoB,QAAxB,EAAkC;AAChCQ,UAAML,OAAN;AACAM,aAAST,QAAT;AACAO,WAAOP,QAAP;AACAU,wBAAoB,CAAC,CAACH,KAAKS,KAAL,CAAWV,0BAAX,CAAtB;AACD,GALD,MAKO,IAAI,OAAON,QAAP,KAAoB,UAAxB,EAAoC;AACzC,WAAO,IAAP;AACD,GAFM,MAEA,IAAIiB,OAAOC,SAAP,CAAiBH,QAAjB,CAA0BI,IAA1B,CAA+BnB,QAA/B,MAA6C,gBAA7C,IACTA,SAASoB,MAAT,KAAoB,CADX,IAET,QAAOpB,SAAS,CAAT,CAAP,MAAuB,QAFd,IAGT,OAAOA,SAAS,CAAT,CAAP,KAAuB,QAHlB,EAG4B;AACjCQ,UAAMR,SAAS,CAAT,CAAN;AACAS,aAAST,SAAS,CAAT,CAAT;AACAO,WAAO,CAACC,IAAIa,WAAJ,IAAmBV,YAAYH,IAAIa,WAAhB,CAApB,IAAoD,IAApD,GAA2DZ,MAAlE;AACD;;AAED,MAAIR,cAAc,OAAOO,IAAIC,MAAJ,CAAP,KAAuB,UAAzC,EAAqD;AACnD,QAAIP,YAAJ,EAAkB;AAChBC,cAAQD,YAAR,IAAwBK,IAAxB;AACD;AACD,WAAO,IAAP;AACD;;AAED;AACA,MAAIG,qBAAqB,OAAOY,KAAKb,MAAL,CAAP,KAAwB,UAAjD,EAA6D;AAAE;AAC7D,QAAIP,YAAJ,EAAkB;AAChBC,cAAQD,YAAR,IAAwBK,IAAxB;AACD;AACD,WAAO,IAAP;AACD;;AAED,SAAO,KAAP;AACD,CAtFD","file":"is_callable.js","sourcesContent":["module.exports = function is_callable (mixedVar, syntaxOnly, callableName) { // eslint-disable-line camelcase\n // discuss at: https://locutus.io/php/is_callable/\n // original by: Brett Zamir (https://brett-zamir.me)\n // input by: François\n // improved by: Brett Zamir (https://brett-zamir.me)\n // improved by: KnightYoshi\n // improved by: Waldo Malqui Silva (https://fayr.us/waldo/)\n // note 1: The variable callableName cannot work as a string variable passed by\n // note 1: reference as in PHP (since JavaScript does not support passing\n // note 1: strings by reference), but instead will take the name of\n // note 1: a global variable and set that instead.\n // note 1: When used on an object, depends on a constructor property\n // note 1: being kept on the object prototype\n // note 2: Depending on the `callableName` that is passed, this function can use eval.\n // note 2: The eval input is however checked to only allow valid function names,\n // note 2: So it should not be unsafer than uses without eval (seeing as you can)\n // note 2: already pass any function to be executed here.\n // example 1: is_callable('is_callable')\n // returns 1: true\n // example 2: is_callable('bogusFunction', true)\n // returns 2: true // gives true because does not do strict checking\n // example 3: function SomeClass () {}\n // example 3: SomeClass.prototype.someMethod = function (){}\n // example 3: var testObj = new SomeClass()\n // example 3: is_callable([testObj, 'someMethod'], true, 'myVar')\n // example 3: var $result = myVar\n // returns 3: 'SomeClass::someMethod'\n // example 4: is_callable(function () {})\n // returns 4: true\n // example 5: is_callable(class MyClass {})\n // returns 5: false\n\n const $global = (typeof window !== 'undefined' ? window : global)\n\n const validJSFunctionNamePattern = /^[_$a-zA-Z\\xA0-\\uFFFF][_$a-zA-Z0-9\\xA0-\\uFFFF]*$/\n\n let name = ''\n let obj = {}\n let method = ''\n let validFunctionName = false\n\n const getFuncName = function (fn) {\n const name = (/\\W*function\\s+([\\w$]+)\\s*\\(/).exec(fn)\n if (!name) {\n return '(Anonymous)'\n }\n return name[1]\n }\n\n // eslint-disable-next-line no-useless-escape\n if (/(^class|\\(this\\,)/.test(mixedVar.toString())) {\n return false\n }\n\n if (typeof mixedVar === 'string') {\n obj = $global\n method = mixedVar\n name = mixedVar\n validFunctionName = !!name.match(validJSFunctionNamePattern)\n } else if (typeof mixedVar === 'function') {\n return true\n } else if (Object.prototype.toString.call(mixedVar) === '[object Array]' &&\n mixedVar.length === 2 &&\n typeof mixedVar[0] === 'object' &&\n typeof mixedVar[1] === 'string') {\n obj = mixedVar[0]\n method = mixedVar[1]\n name = (obj.constructor && getFuncName(obj.constructor)) + '::' + method\n }\n\n if (syntaxOnly || typeof obj[method] === 'function') {\n if (callableName) {\n $global[callableName] = name\n }\n return true\n }\n\n // validFunctionName avoids exploits\n if (validFunctionName && typeof eval(method) === 'function') { // eslint-disable-line no-eval\n if (callableName) {\n $global[callableName] = name\n }\n return true\n }\n\n return false\n}\n"]}
|
package/php/var/is_double.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/php/var/is_double.js"],"names":["module","exports","is_double","mixedVar","_isFloat","require"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,SAAT,CAAoBC,QAApB,EAA8B;AAAE;AAC/C;AACA;AACA;AACA;AACA;AACA;;AAEA,
|
|
1
|
+
{"version":3,"sources":["../../../src/php/var/is_double.js"],"names":["module","exports","is_double","mixedVar","_isFloat","require"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,SAAT,CAAoBC,QAApB,EAA8B;AAAE;AAC/C;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,WAAWC,QAAQ,iBAAR,CAAjB;AACA,SAAOD,SAASD,QAAT,CAAP;AACD,CAVD","file":"is_double.js","sourcesContent":["module.exports = function is_double (mixedVar) { // eslint-disable-line camelcase\n // discuss at: https://locutus.io/php/is_double/\n // original by: Paulo Freitas\n // note 1: 1.0 is simplified to 1 before it can be accessed by the function, this makes\n // note 1: it different from the PHP implementation. We can't fix this unfortunately.\n // example 1: is_double(186.31)\n // returns 1: true\n\n const _isFloat = require('../var/is_float')\n return _isFloat(mixedVar)\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/php/var/is_integer.js"],"names":["module","exports","is_integer","mixedVar","_isInt","require"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,UAAT,CAAqBC,QAArB,EAA+B;AAAE;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,
|
|
1
|
+
{"version":3,"sources":["../../../src/php/var/is_integer.js"],"names":["module","exports","is_integer","mixedVar","_isInt","require"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,UAAT,CAAqBC,QAArB,EAA+B;AAAE;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,SAASC,QAAQ,eAAR,CAAf;AACA,SAAOD,OAAOD,QAAP,CAAP;AACD,CAZD","file":"is_integer.js","sourcesContent":["module.exports = function is_integer (mixedVar) { // eslint-disable-line camelcase\n // discuss at: https://locutus.io/php/is_integer/\n // original by: Paulo Freitas\n // note 1: 1.0 is simplified to 1 before it can be accessed by the function, this makes\n // note 1: it different from the PHP implementation. We can't fix this unfortunately.\n // example 1: is_integer(186.31)\n // returns 1: false\n // example 2: is_integer(12)\n // returns 2: true\n\n const _isInt = require('../var/is_int')\n return _isInt(mixedVar)\n}\n"]}
|
package/php/var/is_long.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/php/var/is_long.js"],"names":["module","exports","is_long","mixedVar","_isFloat","require"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,OAAT,CAAkBC,QAAlB,EAA4B;AAAE;AAC7C;AACA;AACA;AACA;AACA;AACA;;AAEA,
|
|
1
|
+
{"version":3,"sources":["../../../src/php/var/is_long.js"],"names":["module","exports","is_long","mixedVar","_isFloat","require"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,OAAT,CAAkBC,QAAlB,EAA4B;AAAE;AAC7C;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,WAAWC,QAAQ,iBAAR,CAAjB;AACA,SAAOD,SAASD,QAAT,CAAP;AACD,CAVD","file":"is_long.js","sourcesContent":["module.exports = function is_long (mixedVar) { // eslint-disable-line camelcase\n // discuss at: https://locutus.io/php/is_long/\n // original by: Paulo Freitas\n // note 1: 1.0 is simplified to 1 before it can be accessed by the function, this makes\n // note 1: it different from the PHP implementation. We can't fix this unfortunately.\n // example 1: is_long(186.31)\n // returns 1: true\n\n const _isFloat = require('../var/is_float')\n return _isFloat(mixedVar)\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/php/var/is_numeric.js"],"names":["module","exports","is_numeric","mixedVar","whitespace","join","indexOf","slice","isNaN"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,UAAT,CAAqBC,QAArB,EAA+B;AAAE;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,
|
|
1
|
+
{"version":3,"sources":["../../../src/php/var/is_numeric.js"],"names":["module","exports","is_numeric","mixedVar","whitespace","join","indexOf","slice","isNaN"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,UAAT,CAAqBC,QAArB,EAA+B;AAAE;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,aAAa,CACjB,GADiB,EAEjB,IAFiB,EAGjB,IAHiB,EAIjB,IAJiB,EAKjB,IALiB,EAMjB,MANiB,EAOjB,MAPiB,EAQjB,QARiB,EASjB,QATiB,EAUjB,QAViB,EAWjB,QAXiB,EAYjB,QAZiB,EAajB,QAbiB,EAcjB,QAdiB,EAejB,QAfiB,EAgBjB,QAhBiB,EAiBjB,QAjBiB,EAkBjB,QAlBiB,EAmBjB,QAnBiB,EAoBjB,QApBiB,EAqBjB,QArBiB,EAsBjB,QAtBiB,EAuBjBC,IAvBiB,CAuBZ,EAvBY,CAAnB;;AAyBA;AACA,SAAO,CAAC,OAAOF,QAAP,KAAoB,QAApB,IACL,OAAOA,QAAP,KAAoB,QAApB,IACDC,WAAWE,OAAX,CAAmBH,SAASI,KAAT,CAAe,CAAC,CAAhB,CAAnB,MAA2C,CAAC,CAFvC,KAGLJ,aAAa,EAHR,IAIL,CAACK,MAAML,QAAN,CAJH;AAKD,CArDD","file":"is_numeric.js","sourcesContent":["module.exports = function is_numeric (mixedVar) { // eslint-disable-line camelcase\n // discuss at: https://locutus.io/php/is_numeric/\n // original by: Kevin van Zonneveld (https://kvz.io)\n // improved by: David\n // improved by: taith\n // bugfixed by: Tim de Koning\n // bugfixed by: WebDevHobo (https://webdevhobo.blogspot.com/)\n // bugfixed by: Brett Zamir (https://brett-zamir.me)\n // bugfixed by: Denis Chenu (https://shnoulle.net)\n // example 1: is_numeric(186.31)\n // returns 1: true\n // example 2: is_numeric('Kevin van Zonneveld')\n // returns 2: false\n // example 3: is_numeric(' +186.31e2')\n // returns 3: true\n // example 4: is_numeric('')\n // returns 4: false\n // example 5: is_numeric([])\n // returns 5: false\n // example 6: is_numeric('1 ')\n // returns 6: false\n\n const whitespace = [\n ' ',\n '\\n',\n '\\r',\n '\\t',\n '\\f',\n '\\x0b',\n '\\xa0',\n '\\u2000',\n '\\u2001',\n '\\u2002',\n '\\u2003',\n '\\u2004',\n '\\u2005',\n '\\u2006',\n '\\u2007',\n '\\u2008',\n '\\u2009',\n '\\u200a',\n '\\u200b',\n '\\u2028',\n '\\u2029',\n '\\u3000'\n ].join('')\n\n // @todo: Break this up using many single conditions with early returns\n return (typeof mixedVar === 'number' ||\n (typeof mixedVar === 'string' &&\n whitespace.indexOf(mixedVar.slice(-1)) === -1)) &&\n mixedVar !== '' &&\n !isNaN(mixedVar)\n}\n"]}
|
package/php/var/is_real.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/php/var/is_real.js"],"names":["module","exports","is_real","mixedVar","_isFloat","require"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,OAAT,CAAkBC,QAAlB,EAA4B;AAAE;AAC7C;AACA;AACA;AACA;AACA;AACA;;AAEA,
|
|
1
|
+
{"version":3,"sources":["../../../src/php/var/is_real.js"],"names":["module","exports","is_real","mixedVar","_isFloat","require"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,OAAT,CAAkBC,QAAlB,EAA4B;AAAE;AAC7C;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,WAAWC,QAAQ,iBAAR,CAAjB;AACA,SAAOD,SAASD,QAAT,CAAP;AACD,CAVD","file":"is_real.js","sourcesContent":["module.exports = function is_real (mixedVar) { // eslint-disable-line camelcase\n // discuss at: https://locutus.io/php/is_real/\n // original by: Brett Zamir (https://brett-zamir.me)\n // note 1: 1.0 is simplified to 1 before it can be accessed by the function, this makes\n // note 1: it different from the PHP implementation. We can't fix this unfortunately.\n // example 1: is_real(186.31)\n // returns 1: true\n\n const _isFloat = require('../var/is_float')\n return _isFloat(mixedVar)\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/php/var/is_unicode.js"],"names":["module","exports","is_unicode","vr","arr","highSurrogate","lowSurrogate","highSurrogateBeforeAny","RegExp","lowSurrogateAfterAny","singleLowSurrogate","singleHighSurrogate","exec","match"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,UAAT,CAAqBC,EAArB,EAAyB;AAAE;AAC1C;AACA;AACA;AACA;AACA;;AAEA,MAAI,OAAOA,EAAP,KAAc,QAAlB,EAA4B;AAC1B,WAAO,KAAP;AACD;;AAED;AACA,MAAIC,MAAM,EAAV;AACA,
|
|
1
|
+
{"version":3,"sources":["../../../src/php/var/is_unicode.js"],"names":["module","exports","is_unicode","vr","arr","highSurrogate","lowSurrogate","highSurrogateBeforeAny","RegExp","lowSurrogateAfterAny","singleLowSurrogate","singleHighSurrogate","exec","match"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,UAAT,CAAqBC,EAArB,EAAyB;AAAE;AAC1C;AACA;AACA;AACA;AACA;;AAEA,MAAI,OAAOA,EAAP,KAAc,QAAlB,EAA4B;AAC1B,WAAO,KAAP;AACD;;AAED;AACA,MAAIC,MAAM,EAAV;AACA,MAAMC,gBAAgB,iBAAtB;AACA,MAAMC,eAAe,iBAArB;AACA,MAAMC,yBAAyB,IAAIC,MAAJ,CAAWH,gBAAgB,YAA3B,EAAyC,GAAzC,CAA/B;AACA,MAAMI,uBAAuB,IAAID,MAAJ,CAAW,eAAeF,YAA1B,EAAwC,GAAxC,CAA7B;AACA,MAAMI,qBAAqB,IAAIF,MAAJ,CAAW,MAAMF,YAAN,GAAqB,GAAhC,CAA3B;AACA,MAAMK,sBAAsB,IAAIH,MAAJ,CAAW,MAAMH,aAAN,GAAsB,GAAjC,CAA5B;;AAEA,SAAO,CAACD,MAAMG,uBAAuBK,IAAvB,CAA4BT,EAA5B,CAAP,MAA4C,IAAnD,EAAyD;AACvD,QAAI,CAACC,IAAI,CAAJ,CAAD,IAAW,CAACA,IAAI,CAAJ,EAAOS,KAAP,CAAaH,kBAAb,CAAhB,EAAkD;AAChD;AACA,aAAO,KAAP;AACD;AACF;AACD,SAAO,CAACN,MAAMK,qBAAqBG,IAArB,CAA0BT,EAA1B,CAAP,MAA0C,IAAjD,EAAuD;AACrD,QAAI,CAACC,IAAI,CAAJ,CAAD,IAAW,CAACA,IAAI,CAAJ,EAAOS,KAAP,CAAaF,mBAAb,CAAhB,EAAmD;AACjD;AACA,aAAO,KAAP;AACD;AACF;;AAED,SAAO,IAAP;AACD,CAlCD","file":"is_unicode.js","sourcesContent":["module.exports = function is_unicode (vr) { // eslint-disable-line camelcase\n // discuss at: https://locutus.io/php/is_unicode/\n // original by: Brett Zamir (https://brett-zamir.me)\n // note 1: Almost all strings in JavaScript should be Unicode\n // example 1: is_unicode('We the peoples of the United Nations...!')\n // returns 1: true\n\n if (typeof vr !== 'string') {\n return false\n }\n\n // If surrogates occur outside of high-low pairs, then this is not Unicode\n let arr = []\n const highSurrogate = '[\\uD800-\\uDBFF]'\n const lowSurrogate = '[\\uDC00-\\uDFFF]'\n const highSurrogateBeforeAny = new RegExp(highSurrogate + '([\\\\s\\\\S])', 'g')\n const lowSurrogateAfterAny = new RegExp('([\\\\s\\\\S])' + lowSurrogate, 'g')\n const singleLowSurrogate = new RegExp('^' + lowSurrogate + '$')\n const singleHighSurrogate = new RegExp('^' + highSurrogate + '$')\n\n while ((arr = highSurrogateBeforeAny.exec(vr)) !== null) {\n if (!arr[1] || !arr[1].match(singleLowSurrogate)) {\n // If high not followed by low surrogate\n return false\n }\n }\n while ((arr = lowSurrogateAfterAny.exec(vr)) !== null) {\n if (!arr[1] || !arr[1].match(singleHighSurrogate)) {\n // If low not preceded by high surrogate\n return false\n }\n }\n\n return true\n}\n"]}
|
package/php/var/isset.js
CHANGED
package/php/var/isset.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/php/var/isset.js"],"names":["module","exports","isset","a","arguments","l","length","i","undef","Error"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,KAAT,GAAkB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,
|
|
1
|
+
{"version":3,"sources":["../../../src/php/var/isset.js"],"names":["module","exports","isset","a","arguments","l","length","i","undef","Error"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,KAAT,GAAkB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,IAAIC,SAAV;AACA,MAAMC,IAAIF,EAAEG,MAAZ;AACA,MAAIC,IAAI,CAAR;AACA,MAAIC,cAAJ;;AAEA,MAAIH,MAAM,CAAV,EAAa;AACX,UAAM,IAAII,KAAJ,CAAU,aAAV,CAAN;AACD;;AAED,SAAOF,MAAMF,CAAb,EAAgB;AACd,QAAIF,EAAEI,CAAF,MAASC,KAAT,IAAkBL,EAAEI,CAAF,MAAS,IAA/B,EAAqC;AACnC,aAAO,KAAP;AACD;AACDA;AACD;;AAED,SAAO,IAAP;AACD,CA5BD","file":"isset.js","sourcesContent":["module.exports = function isset () {\n // discuss at: https://locutus.io/php/isset/\n // original by: Kevin van Zonneveld (https://kvz.io)\n // improved by: FremyCompany\n // improved by: Onno Marsman (https://twitter.com/onnomarsman)\n // improved by: Rafał Kukawski (https://blog.kukawski.pl)\n // example 1: isset( undefined, true)\n // returns 1: false\n // example 2: isset( 'Kevin van Zonneveld' )\n // returns 2: true\n\n const a = arguments\n const l = a.length\n let i = 0\n let undef\n\n if (l === 0) {\n throw new Error('Empty isset')\n }\n\n while (i !== l) {\n if (a[i] === undef || a[i] === null) {\n return false\n }\n i++\n }\n\n return true\n}\n"]}
|
package/php/var/print_r.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/php/var/print_r.js"],"names":["module","exports","print_r","array","returnVal","echo","require","output","padChar","padVal","_repeatChar","len","str","i","_formatArray","obj","curDepth","basePad","thickPad","constructor","key","Object","prototype","toString","call","undefined"],"mappings":";;;;AAAAA,OAAOC,OAAP,GAAiB,SAASC,OAAT,CAAkBC,KAAlB,EAAyBC,SAAzB,EAAoC;AAAE;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,
|
|
1
|
+
{"version":3,"sources":["../../../src/php/var/print_r.js"],"names":["module","exports","print_r","array","returnVal","echo","require","output","padChar","padVal","_repeatChar","len","str","i","_formatArray","obj","curDepth","basePad","thickPad","constructor","key","Object","prototype","toString","call","undefined"],"mappings":";;;;AAAAA,OAAOC,OAAP,GAAiB,SAASC,OAAT,CAAkBC,KAAlB,EAAyBC,SAAzB,EAAoC;AAAE;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,OAAOC,QAAQ,iBAAR,CAAb;;AAEA,MAAIC,SAAS,EAAb;AACA,MAAMC,UAAU,GAAhB;AACA,MAAMC,SAAS,CAAf;;AAEA,MAAMC,cAAc,SAAdA,WAAc,CAAUC,GAAV,EAAeH,OAAf,EAAwB;AAC1C,QAAII,MAAM,EAAV;AACA,SAAK,IAAIC,IAAI,CAAb,EAAgBA,IAAIF,GAApB,EAAyBE,GAAzB,EAA8B;AAC5BD,aAAOJ,OAAP;AACD;AACD,WAAOI,GAAP;AACD,GAND;AAOA,MAAIE,eAAe,SAAfA,YAAe,CAAUC,GAAV,EAAeC,QAAf,EAAyBP,MAAzB,EAAiCD,OAAjC,EAA0C;AAC3D,QAAIQ,WAAW,CAAf,EAAkB;AAChBA;AACD;;AAED,QAAMC,UAAUP,YAAYD,SAASO,QAArB,EAA+BR,OAA/B,CAAhB;AACA,QAAMU,WAAWR,YAAYD,UAAUO,WAAW,CAArB,CAAZ,EAAqCR,OAArC,CAAjB;AACA,QAAII,MAAM,EAAV;;AAEA,QAAI,QAAOG,GAAP,yCAAOA,GAAP,OAAe,QAAf,IACFA,QAAQ,IADN,IAEFA,IAAII,WAFN,EAEmB;AACjBP,aAAO,YAAYK,OAAZ,GAAsB,KAA7B;AACA,WAAK,IAAMG,GAAX,IAAkBL,GAAlB,EAAuB;AACrB,YAAIM,OAAOC,SAAP,CAAiBC,QAAjB,CAA0BC,IAA1B,CAA+BT,IAAIK,GAAJ,CAA/B,MAA6C,gBAAjD,EAAmE;AACjER,iBAAOM,QAAP;AACAN,iBAAO,GAAP;AACAA,iBAAOQ,GAAP;AACAR,iBAAO,OAAP;AACAA,iBAAOE,aAAaC,IAAIK,GAAJ,CAAb,EAAuBJ,WAAW,CAAlC,EAAqCP,MAArC,EAA6CD,OAA7C,CAAP;AACD,SAND,MAMO;AACLI,iBAAOM,QAAP;AACAN,iBAAO,GAAP;AACAA,iBAAOQ,GAAP;AACAR,iBAAO,OAAP;AACAA,iBAAOG,IAAIK,GAAJ,CAAP;AACAR,iBAAO,IAAP;AACD;AACF;AACDA,aAAOK,UAAU,KAAjB;AACD,KArBD,MAqBO,IAAIF,QAAQ,IAAR,IAAgBA,QAAQU,SAA5B,EAAuC;AAC5Cb,YAAM,EAAN;AACD,KAFM,MAEA;AACL;AACAA,YAAMG,IAAIQ,QAAJ,EAAN;AACD;;AAED,WAAOX,GAAP;AACD,GAtCD;;AAwCAL,WAASO,aAAaX,KAAb,EAAoB,CAApB,EAAuBM,MAAvB,EAA+BD,OAA/B,CAAT;;AAEA,MAAIJ,cAAc,IAAlB,EAAwB;AACtBC,SAAKE,MAAL;AACA,WAAO,IAAP;AACD;AACD,SAAOA,MAAP;AACD,CAtED","file":"print_r.js","sourcesContent":["module.exports = function print_r (array, returnVal) { // eslint-disable-line camelcase\n // discuss at: https://locutus.io/php/print_r/\n // original by: Michael White (https://getsprink.com)\n // improved by: Ben Bryan\n // improved by: Brett Zamir (https://brett-zamir.me)\n // improved by: Kevin van Zonneveld (https://kvz.io)\n // input by: Brett Zamir (https://brett-zamir.me)\n // example 1: print_r(1, true)\n // returns 1: '1'\n\n const echo = require('../strings/echo')\n\n let output = ''\n const padChar = ' '\n const padVal = 4\n\n const _repeatChar = function (len, padChar) {\n let str = ''\n for (let i = 0; i < len; i++) {\n str += padChar\n }\n return str\n }\n var _formatArray = function (obj, curDepth, padVal, padChar) {\n if (curDepth > 0) {\n curDepth++\n }\n\n const basePad = _repeatChar(padVal * curDepth, padChar)\n const thickPad = _repeatChar(padVal * (curDepth + 1), padChar)\n let str = ''\n\n if (typeof obj === 'object' &&\n obj !== null &&\n obj.constructor) {\n str += 'Array\\n' + basePad + '(\\n'\n for (const key in obj) {\n if (Object.prototype.toString.call(obj[key]) === '[object Array]') {\n str += thickPad\n str += '['\n str += key\n str += '] => '\n str += _formatArray(obj[key], curDepth + 1, padVal, padChar)\n } else {\n str += thickPad\n str += '['\n str += key\n str += '] => '\n str += obj[key]\n str += '\\n'\n }\n }\n str += basePad + ')\\n'\n } else if (obj === null || obj === undefined) {\n str = ''\n } else {\n // for our \"resource\" class\n str = obj.toString()\n }\n\n return str\n }\n\n output = _formatArray(array, 0, padVal, padChar)\n\n if (returnVal !== true) {\n echo(output)\n return true\n }\n return output\n}\n"]}
|
package/php/var/serialize.js
CHANGED
|
@@ -28,7 +28,9 @@ module.exports = function serialize(mixedValue) {
|
|
|
28
28
|
// example 3: serialize( {'ü': 'ü', '四': '四', '𠜎': '𠜎'})
|
|
29
29
|
// returns 3: 'a:3:{s:2:"ü";s:2:"ü";s:3:"四";s:3:"四";s:4:"𠜎";s:4:"𠜎";}'
|
|
30
30
|
|
|
31
|
-
var val
|
|
31
|
+
var val = void 0,
|
|
32
|
+
key = void 0,
|
|
33
|
+
okey = void 0;
|
|
32
34
|
var ktype = '';
|
|
33
35
|
var vals = '';
|
|
34
36
|
var count = 0;
|
|
@@ -38,10 +40,10 @@ module.exports = function serialize(mixedValue) {
|
|
|
38
40
|
};
|
|
39
41
|
|
|
40
42
|
var _getType = function _getType(inp) {
|
|
41
|
-
var match;
|
|
42
|
-
var key;
|
|
43
|
-
var cons;
|
|
44
|
-
var types;
|
|
43
|
+
var match = void 0;
|
|
44
|
+
var key = void 0;
|
|
45
|
+
var cons = void 0;
|
|
46
|
+
var types = void 0;
|
|
45
47
|
var type = typeof inp === 'undefined' ? 'undefined' : _typeof(inp);
|
|
46
48
|
|
|
47
49
|
if (type === 'object' && !inp) {
|
package/php/var/serialize.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/php/var/serialize.js"],"names":["module","exports","serialize","mixedValue","val","key","okey","ktype","vals","count","_utf8Size","str","encodeURI","split","length","_getType","inp","match","cons","types","type","constructor","toString","toLowerCase","Math","round","hasOwnProperty","parseInt"],"mappings":";;;;AAAAA,OAAOC,OAAP,GAAiB,SAASC,SAAT,CAAoBC,UAApB,EAAgC;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,
|
|
1
|
+
{"version":3,"sources":["../../../src/php/var/serialize.js"],"names":["module","exports","serialize","mixedValue","val","key","okey","ktype","vals","count","_utf8Size","str","encodeURI","split","length","_getType","inp","match","cons","types","type","constructor","toString","toLowerCase","Math","round","hasOwnProperty","parseInt"],"mappings":";;;;AAAAA,OAAOC,OAAP,GAAiB,SAASC,SAAT,CAAoBC,UAApB,EAAgC;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,YAAJ;AAAA,MAASC,YAAT;AAAA,MAAcC,aAAd;AACA,MAAIC,QAAQ,EAAZ;AACA,MAAIC,OAAO,EAAX;AACA,MAAIC,QAAQ,CAAZ;;AAEA,MAAMC,YAAY,SAAZA,SAAY,CAAUC,GAAV,EAAe;AAC/B,WAAO,CAAC,CAACC,UAAUD,GAAV,EAAeE,KAAf,CAAqB,OAArB,EAA8BC,MAAvC;AACD,GAFD;;AAIA,MAAMC,WAAW,SAAXA,QAAW,CAAUC,GAAV,EAAe;AAC9B,QAAIC,cAAJ;AACA,QAAIZ,YAAJ;AACA,QAAIa,aAAJ;AACA,QAAIC,cAAJ;AACA,QAAIC,cAAcJ,GAAd,yCAAcA,GAAd,CAAJ;;AAEA,QAAII,SAAS,QAAT,IAAqB,CAACJ,GAA1B,EAA+B;AAC7B,aAAO,MAAP;AACD;;AAED,QAAII,SAAS,QAAb,EAAuB;AACrB,UAAI,CAACJ,IAAIK,WAAT,EAAsB;AACpB,eAAO,QAAP;AACD;AACDH,aAAOF,IAAIK,WAAJ,CAAgBC,QAAhB,EAAP;AACAL,cAAQC,KAAKD,KAAL,CAAW,SAAX,CAAR;AACA,UAAIA,KAAJ,EAAW;AACTC,eAAOD,MAAM,CAAN,EAASM,WAAT,EAAP;AACD;AACDJ,cAAQ,CAAC,SAAD,EAAY,QAAZ,EAAsB,QAAtB,EAAgC,OAAhC,CAAR;AACA,WAAKd,GAAL,IAAYc,KAAZ,EAAmB;AACjB,YAAID,SAASC,MAAMd,GAAN,CAAb,EAAyB;AACvBe,iBAAOD,MAAMd,GAAN,CAAP;AACA;AACD;AACF;AACF;AACD,WAAOe,IAAP;AACD,GA7BD;;AA+BA,MAAMA,OAAOL,SAASZ,UAAT,CAAb;;AAEA,UAAQiB,IAAR;AACE,SAAK,UAAL;AACEhB,YAAM,EAAN;AACA;AACF,SAAK,SAAL;AACEA,YAAM,QAAQD,aAAa,GAAb,GAAmB,GAA3B,CAAN;AACA;AACF,SAAK,QAAL;AACEC,YAAM,CAACoB,KAAKC,KAAL,CAAWtB,UAAX,MAA2BA,UAA3B,GAAwC,GAAxC,GAA8C,GAA/C,IAAsD,GAAtD,GAA4DA,UAAlE;AACA;AACF,SAAK,QAAL;AACEC,YAAM,OAAOM,UAAUP,UAAV,CAAP,GAA+B,IAA/B,GAAsCA,UAAtC,GAAmD,GAAzD;AACA;AACF,SAAK,OAAL;AACA,SAAK,QAAL;AACEC,YAAM,GAAN;AACA;;;;;;;;;;;AAWA,WAAKC,GAAL,IAAYF,UAAZ,EAAwB;AACtB,YAAIA,WAAWuB,cAAX,CAA0BrB,GAA1B,CAAJ,EAAoC;AAClCE,kBAAQQ,SAASZ,WAAWE,GAAX,CAAT,CAAR;AACA,cAAIE,UAAU,UAAd,EAA0B;AACxB;AACD;;AAEDD,iBAAQD,IAAIY,KAAJ,CAAU,UAAV,IAAwBU,SAAStB,GAAT,EAAc,EAAd,CAAxB,GAA4CA,GAApD;AACAG,kBAAQN,UAAUI,IAAV,IAAkBJ,UAAUC,WAAWE,GAAX,CAAV,CAA1B;AACAI;AACD;AACF;AACDL,aAAO,MAAMK,KAAN,GAAc,IAAd,GAAqBD,IAArB,GAA4B,GAAnC;AACA;AACF,SAAK,WAAL;AACA;AACE;AACA;AACA;AACAJ,YAAM,GAAN;AACA;AA/CJ;AAiDA,MAAIgB,SAAS,QAAT,IAAqBA,SAAS,OAAlC,EAA2C;AACzChB,WAAO,GAAP;AACD;;AAED,SAAOA,GAAP;AACD,CA1HD","file":"serialize.js","sourcesContent":["module.exports = function serialize (mixedValue) {\n // discuss at: https://locutus.io/php/serialize/\n // original by: Arpad Ray (mailto:arpad@php.net)\n // improved by: Dino\n // improved by: Le Torbi (https://www.letorbi.de/)\n // improved by: Kevin van Zonneveld (https://kvz.io/)\n // bugfixed by: Andrej Pavlovic\n // bugfixed by: Garagoth\n // bugfixed by: Russell Walker (https://www.nbill.co.uk/)\n // bugfixed by: Jamie Beck (https://www.terabit.ca/)\n // bugfixed by: Kevin van Zonneveld (https://kvz.io/)\n // bugfixed by: Ben (https://benblume.co.uk/)\n // bugfixed by: Codestar (https://codestarlive.com/)\n // bugfixed by: idjem (https://github.com/idjem)\n // input by: DtTvB (https://dt.in.th/2008-09-16.string-length-in-bytes.html)\n // input by: Martin (https://www.erlenwiese.de/)\n // note 1: We feel the main purpose of this function should be to ease\n // note 1: the transport of data between php & js\n // note 1: Aiming for PHP-compatibility, we have to translate objects to arrays\n // example 1: serialize(['Kevin', 'van', 'Zonneveld'])\n // returns 1: 'a:3:{i:0;s:5:\"Kevin\";i:1;s:3:\"van\";i:2;s:9:\"Zonneveld\";}'\n // example 2: serialize({firstName: 'Kevin', midName: 'van'})\n // returns 2: 'a:2:{s:9:\"firstName\";s:5:\"Kevin\";s:7:\"midName\";s:3:\"van\";}'\n // example 3: serialize( {'ü': 'ü', '四': '四', '𠜎': '𠜎'})\n // returns 3: 'a:3:{s:2:\"ü\";s:2:\"ü\";s:3:\"四\";s:3:\"四\";s:4:\"𠜎\";s:4:\"𠜎\";}'\n\n let val, key, okey\n let ktype = ''\n let vals = ''\n let count = 0\n\n const _utf8Size = function (str) {\n return ~-encodeURI(str).split(/%..|./).length\n }\n\n const _getType = function (inp) {\n let match\n let key\n let cons\n let types\n let type = typeof inp\n\n if (type === 'object' && !inp) {\n return 'null'\n }\n\n if (type === 'object') {\n if (!inp.constructor) {\n return 'object'\n }\n cons = inp.constructor.toString()\n match = cons.match(/(\\w+)\\(/)\n if (match) {\n cons = match[1].toLowerCase()\n }\n types = ['boolean', 'number', 'string', 'array']\n for (key in types) {\n if (cons === types[key]) {\n type = types[key]\n break\n }\n }\n }\n return type\n }\n\n const type = _getType(mixedValue)\n\n switch (type) {\n case 'function':\n val = ''\n break\n case 'boolean':\n val = 'b:' + (mixedValue ? '1' : '0')\n break\n case 'number':\n val = (Math.round(mixedValue) === mixedValue ? 'i' : 'd') + ':' + mixedValue\n break\n case 'string':\n val = 's:' + _utf8Size(mixedValue) + ':\"' + mixedValue + '\"'\n break\n case 'array':\n case 'object':\n val = 'a'\n /*\n if (type === 'object') {\n var objname = mixedValue.constructor.toString().match(/(\\w+)\\(\\)/);\n if (objname === undefined) {\n return;\n }\n objname[1] = serialize(objname[1]);\n val = 'O' + objname[1].substring(1, objname[1].length - 1);\n }\n */\n\n for (key in mixedValue) {\n if (mixedValue.hasOwnProperty(key)) {\n ktype = _getType(mixedValue[key])\n if (ktype === 'function') {\n continue\n }\n\n okey = (key.match(/^[0-9]+$/) ? parseInt(key, 10) : key)\n vals += serialize(okey) + serialize(mixedValue[key])\n count++\n }\n }\n val += ':' + count + ':{' + vals + '}'\n break\n case 'undefined':\n default:\n // Fall-through\n // if the JS object has a property which contains a null value,\n // the string cannot be unserialized by PHP\n val = 'N'\n break\n }\n if (type !== 'object' && type !== 'array') {\n val += ';'\n }\n\n return val\n}\n"]}
|
package/php/var/strval.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/php/var/strval.js"],"names":["module","exports","strval","str","gettype","require","type"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,MAAT,CAAiBC,GAAjB,EAAsB;AACrC;AACA;AACA;AACA;AACA;AACA;;AAEA,
|
|
1
|
+
{"version":3,"sources":["../../../src/php/var/strval.js"],"names":["module","exports","strval","str","gettype","require","type"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,MAAT,CAAiBC,GAAjB,EAAsB;AACrC;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,UAAUC,QAAQ,gBAAR,CAAhB;AACA,MAAIC,OAAO,EAAX;;AAEA,MAAIH,QAAQ,IAAZ,EAAkB;AAChB,WAAO,EAAP;AACD;;AAEDG,SAAOF,QAAQD,GAAR,CAAP;;AAEA;AACA;AACA,UAAQG,IAAR;AACE,SAAK,SAAL;AACE,UAAIH,QAAQ,IAAZ,EAAkB;AAChB,eAAO,GAAP;AACD;AACD,aAAO,EAAP;AACF,SAAK,OAAL;AACE,aAAO,OAAP;AACF,SAAK,QAAL;AACE,aAAO,QAAP;AATJ;;AAYA,SAAOA,GAAP;AACD,CAhCD","file":"strval.js","sourcesContent":["module.exports = function strval (str) {\n // discuss at: https://locutus.io/php/strval/\n // original by: Brett Zamir (https://brett-zamir.me)\n // improved by: Kevin van Zonneveld (https://kvz.io)\n // bugfixed by: Brett Zamir (https://brett-zamir.me)\n // example 1: strval({red: 1, green: 2, blue: 3, white: 4})\n // returns 1: 'Object'\n\n const gettype = require('../var/gettype')\n let type = ''\n\n if (str === null) {\n return ''\n }\n\n type = gettype(str)\n\n // Comment out the entire switch if you want JS-like\n // behavior instead of PHP behavior\n switch (type) {\n case 'boolean':\n if (str === true) {\n return '1'\n }\n return ''\n case 'array':\n return 'Array'\n case 'object':\n return 'Object'\n }\n\n return str\n}\n"]}
|