{"version":3,"file":"voca.min.js","sources":["../src/helper/object/is_nil.js","../src/helper/boolean/coerce_to_boolean.js","../src/query/is_string.js","../src/helper/string/coerce_to_string.js","../src/case/capitalize.js","../src/case/lower_case.js","../src/helper/reg_exp/const.js","../src/helper/reg_exp/const_extended.js","../src/helper/undefined/nil_default.js","../src/helper/string/to_string.js","../src/split/words.js","../src/case/camel_case.js","../src/case/kebab_case.js","../src/case/swap_case.js","../src/helper/number/clip_number.js","../src/helper/number/const.js","../src/helper/number/to_integer.js","../src/chop/truncate.js","../src/helper/string/surrogate_pair.js","../src/helper/number/coerce_to_number.js","../src/helper/number/nan_default.js","../src/chop/code_point_at.js","../src/count/count_where.js","../src/helper/format/replacement/index.js","../src/helper/format/const.js","../src/manipulate/repeat.js","../src/helper/string/build_padding.js","../src/manipulate/pad_left.js","../src/manipulate/pad_right.js","../src/helper/format/type_format/add_sign_to_formatted_number.js","../src/helper/format/type_format/float.js","../src/helper/format/type_format/integer_base.js","../src/helper/format/type_format/integer_decimal.js","../src/helper/format/type_format/string.js","../src/helper/format/replacement/compute.js","../src/helper/format/align_and_pad.js","../src/helper/format/conversion_specification.js","../src/helper/format/replacement/match.js","../src/helper/format/replacement/validate.js","../src/format/sprintf.js","../src/escape/escape_html.js","../src/escape/unescape_html.js","../src/helper/string/diacritics_map.js","../src/manipulate/latinise.js","../src/manipulate/tr.js","../src/query/includes.js","../src/manipulate/trim_left.js","../src/manipulate/trim_right.js","../src/manipulate/word_wrap.js","../src/query/is_alpha.js","../src/helper/strip/parse_tag_name.js","../src/helper/object/get_global.js","../src/util/no_conflict.js","../src/util/version.js","../src/functions.js","../src/case/decapitalize.js","../src/case/snake_case.js","../src/case/title_case.js","../src/case/upper_case.js","../src/count/count.js","../src/count/count_graphemes.js","../src/count/count_substrings.js","../src/count/count_words.js","../src/escape/escape_reg_exp.js","../src/format/vprintf.js","../src/index/index_of.js","../src/index/last_index_of.js","../src/index/search.js","../src/chop/char_at.js","../src/chop/first.js","../src/chop/grapheme_at.js","../src/chop/last.js","../src/chop/prune.js","../src/chop/slice.js","../src/chop/substr.js","../src/chop/substring.js","../src/manipulate/insert.js","../src/manipulate/pad.js","../src/manipulate/replace.js","../src/manipulate/replace_all.js","../src/manipulate/reverse.js","../src/manipulate/reverse_grapheme.js","../src/manipulate/slugify.js","../src/manipulate/splice.js","../src/manipulate/trim.js","../src/query/ends_with.js","../src/query/is_alpha_digit.js","../src/query/is_blank.js","../src/query/is_digit.js","../src/query/is_empty.js","../src/query/is_lower_case.js","../src/query/is_numeric.js","../src/query/is_upper_case.js","../src/query/matches.js","../src/query/starts_with.js","../src/split/chars.js","../src/split/code_points.js","../src/split/graphemes.js","../src/split/split.js","../src/strip/strip_bom.js","../src/strip/strip_tags.js","../src/helper/strip/parse_tag_list.js","../src/helper/string/has_substring_at_index.js","../src/chain/wrapper.js","../src/index.js","../src/chain/chain.js"],"sourcesContent":["/**\n * Checks if `value` is `null` or `undefined`\n *\n * @ignore\n * @function isNil\n * @param {*} value The object to check\n * @return {boolean} Returns `true` is `value` is `undefined` or `null`, `false` otherwise\n */\nexport default function isNil(value) {\n return value === undefined || value === null;\n}\n","import isNil from 'helper/object/is_nil';\n\n/**\n * Converts the `value` to a boolean. If `value` is `undefined` or `null`, returns `defaultValue`.\n *\n * @ignore\n * @function toBoolean\n * @param {*} value The value to convert.\n * @param {boolean} [defaultValue=false] The default value.\n * @return {boolean} Returns the coercion to boolean.\n */\nexport default function coerceToBoolean(value, defaultValue = false) {\n if (isNil(value)) {\n return defaultValue;\n }\n return Boolean(value);\n}\n","/**\n * Checks whether `subject` is a string primitive type.\n *\n * @function isString\n * @static\n * @since 1.0.0\n * @memberOf Query\n * @param {string} subject The value to verify.\n * @return {boolean} Returns `true` if `subject` is string primitive type or `false` otherwise.\n * @example\n * v.isString('vacation');\n * // => true\n *\n * v.isString(560);\n * // => false\n */\nexport default function isString(subject) {\n return typeof subject === 'string';\n}\n","import isNil from 'helper/object/is_nil';\nimport isString from 'query/is_string';\n\n/**\n * Get the string representation of the `value`.\n * Converts the `value` to string.\n * If `value` is `null` or `undefined`, return `defaultValue`.\n *\n * @ignore\n * @function toString\n * @param {*} value The value to convert.\n * @param {*} [defaultValue=''] The default value to return.\n * @return {string|null} Returns the string representation of `value`. Returns `defaultValue` if `value` is\n * `null` or `undefined`.\n */\nexport default function coerceToString(value, defaultValue = '') {\n if (isNil(value)) {\n return defaultValue;\n }\n if (isString(value)) {\n return value;\n }\n return String(value);\n}\n","import coerceToBoolean from 'helper/boolean/coerce_to_boolean';\nimport coerceToString from 'helper/string/coerce_to_string';\n\n/**\n * Converts the first character of `subject` to upper case. If `restToLower` is `true`, convert the rest of\n * `subject` to lower case.\n *\n * @function capitalize\n * @static\n * @since 1.0.0\n * @memberOf Case\n * @param {string} [subject=''] The string to capitalize.\n * @param {boolean} [restToLower=false] Convert the rest of `subject` to lower case.\n * @return {string} Returns the capitalized string.\n * @example\n * v.capitalize('apple');\n * // => 'Apple'\n *\n * v.capitalize('aPPle', true);\n * // => 'Apple'\n */\nexport default function capitalize(subject, restToLower) {\n let subjectString = coerceToString(subject);\n const restToLowerCaseBoolean = coerceToBoolean(restToLower);\n if (subjectString === '') {\n return '';\n }\n if (restToLowerCaseBoolean) {\n subjectString = subjectString.toLowerCase();\n }\n return subjectString.substr(0, 1).toUpperCase() + subjectString.substr(1);\n}\n","import coerceToString from 'helper/string/coerce_to_string';\n\n/**\n * Converts the `subject` to lower case.\n *\n * @function lowerCase\n * @static\n * @since 1.0.0\n * @memberOf Case\n * @param {string} [subject=''] The string to convert to lower case.\n * @return {string} Returns the lower case string.\n * @example\n * v.lowerCase('Green');\n * // => 'green'\n *\n * v.lowerCase('BLUE');\n * // => 'blue'\n */\nexport default function lowerCase(subject) {\n const subjectString = coerceToString(subject, '');\n return subjectString.toLowerCase();\n}\n","/**\n * A regular expression string matching digits\n *\n * @type {string}\n * @ignore\n */\nexport const digit = '\\\\d';\n\n/**\n * A regular expression string matching whitespace\n *\n * @type {string}\n * @ignore\n */\nexport const whitespace = '\\\\s\\\\uFEFF\\\\xA0';\n\n/**\n * A regular expression string matching high surrogate\n *\n * @type {string}\n * @ignore\n */\nexport const highSurrogate = '\\\\uD800-\\\\uDBFF';\n\n/**\n * A regular expression string matching low surrogate\n *\n * @type {string}\n * @ignore\n */\nexport const lowSurrogate = '\\\\uDC00-\\\\uDFFF';\n\n/**\n * A regular expression string matching diacritical mark\n *\n * @type {string}\n * @ignore\n */\nexport const diacriticalMark = '\\\\u0300-\\\\u036F\\\\u1AB0-\\\\u1AFF\\\\u1DC0-\\\\u1DFF\\\\u20D0-\\\\u20FF\\\\uFE20-\\\\uFE2F';\n\n/**\n * A regular expression to match the base character for a combining mark\n *\n * @type {string}\n * @ignore\n */\nexport const base =\n '\\\\0-\\\\u02FF\\\\u0370-\\\\u1AAF\\\\u1B00-\\\\u1DBF\\\\u1E00-\\\\u20CF\\\\u2100-\\\\uD7FF\\\\uE000-\\\\uFE1F\\\\uFE30-\\\\uFFFF';\n\n/**\n * Regular expression to match combining marks\n *\n * @see http://unicode.org/faq/char_combmark.html\n * @type {RegExp}\n * @ignore\n */\nexport const REGEXP_COMBINING_MARKS = new RegExp(\n '([' +\n base +\n ']|[' +\n highSurrogate +\n '][' +\n lowSurrogate +\n ']|[' +\n highSurrogate +\n '](?![' +\n lowSurrogate +\n '])|(?:[^' +\n highSurrogate +\n ']|^)[' +\n lowSurrogate +\n '])([' +\n diacriticalMark +\n ']+)',\n 'g'\n);\n\n/**\n * Regular expression to match surrogate pairs\n *\n * @see http://www.unicode.org/faq/utf_bom.html#utf16-2\n * @type {RegExp}\n * @ignore\n */\nexport const REGEXP_SURROGATE_PAIRS = new RegExp('([' + highSurrogate + '])([' + lowSurrogate + '])', 'g');\n\n/**\n * Regular expression to match a unicode character\n *\n * @type {RegExp}\n * @ignore\n */\nexport const REGEXP_UNICODE_CHARACTER = new RegExp(\n '((?:[' +\n base +\n ']|[' +\n highSurrogate +\n '][' +\n lowSurrogate +\n ']|[' +\n highSurrogate +\n '](?![' +\n lowSurrogate +\n '])|(?:[^' +\n highSurrogate +\n ']|^)[' +\n lowSurrogate +\n '])(?:[' +\n diacriticalMark +\n ']+))|\\\n([' +\n highSurrogate +\n '][' +\n lowSurrogate +\n '])|\\\n([\\\\n\\\\r\\\\u2028\\\\u2029])|\\\n(.)',\n 'g'\n);\n\n/**\n * Regular expression to match whitespaces\n *\n * @type {RegExp}\n * @ignore\n */\nexport const REGEXP_WHITESPACE = new RegExp('[' + whitespace + ']');\n\n/**\n * Regular expression to match whitespaces from the left side\n *\n * @type {RegExp}\n * @ignore\n */\nexport const REGEXP_TRIM_LEFT = new RegExp('^[' + whitespace + ']+');\n\n/**\n * Regular expression to match whitespaces from the right side\n *\n * @type {RegExp}\n * @ignore\n */\nexport const REGEXP_TRIM_RIGHT = new RegExp('[' + whitespace + ']+$');\n\n/**\n * Regular expression to match digit characters\n *\n * @type {RegExp}\n * @ignore\n */\nexport const REGEXP_DIGIT = new RegExp('^' + digit + '+$');\n\n/**\n * Regular expression to match regular expression special characters\n *\n * @type {RegExp}\n * @ignore\n */\nexport const REGEXP_SPECIAL_CHARACTERS = /[-[\\]{}()*+!<=:?./\\\\^$|#,]/g;\n\n/**\n * Regular expression to match not latin characters\n *\n * @type {RegExp}\n * @ignore\n */\nexport const REGEXP_NON_LATIN = /[^A-Za-z0-9]/g;\n\n/**\n * Regular expression to match HTML special characters.\n *\n * @type {RegExp}\n * @ignore\n */\nexport const REGEXP_HTML_SPECIAL_CHARACTERS = /[<>&\"'`]/g;\n\n/**\n * Regular expression to match sprintf format string\n *\n * @type {RegExp}\n * @ignore\n */\nexport const REGEXP_CONVERSION_SPECIFICATION = /(%{1,2})(?:(\\d+)\\$)?(\\+)?([ 0]|'.{1})?(-)?(\\d+)?(?:\\.(\\d+))?([bcdiouxXeEfgGs])?/g;\n\n/**\n * Regular expression to match trailing zeros in a number\n *\n * @type {RegExp}\n * @ignore\n */\nexport const REGEXP_TRAILING_ZEROS = /\\.?0+$/g;\n\n/**\n * Regular expression to match flags from a regular expression.\n *\n * @type {RegExp}\n * @ignore\n */\nexport const REGEXP_FLAGS = /[gimuy]*$/;\n\n/**\n * Regular expression to match a list of tags.\n *\n * @see https://html.spec.whatwg.org/multipage/syntax.html#syntax-tag-name\n * @type {RegExp}\n * @ignore\n */\n\nexport const REGEXP_TAG_LIST = /<([A-Za-z0-9]+)>/g;\n","import { diacriticalMark, digit, whitespace } from 'helper/reg_exp/const';\n\n/**\n * A regular expression to match the General Punctuation Unicode block\n *\n * @type {string}\n * @ignore\n */\nconst generalPunctuationBlock = '\\\\u2000-\\\\u206F';\n\n/**\n * A regular expression to match non characters from from Basic Latin and Latin-1 Supplement Unicode blocks\n *\n * @type {string}\n * @ignore\n */\nconst nonCharacter = '\\\\x00-\\\\x2F\\\\x3A-\\\\x40\\\\x5B-\\\\x60\\\\x7b-\\\\xBF\\\\xD7\\\\xF7';\n\n/**\n * A regular expression to match the dingbat Unicode block\n *\n * @type {string}\n * @ignore\n */\nconst dingbatBlock = '\\\\u2700-\\\\u27BF';\n\n/**\n * A regular expression string that matches lower case letters: LATIN\n *\n * @type {string}\n * @ignore\n */\nconst lowerCaseLetter =\n 'a-z\\\\xB5\\\\xDF-\\\\xF6\\\\xF8-\\\\xFF\\\\u0101\\\\u0103\\\\u0105\\\\u0107\\\\u0109\\\\u010B\\\\u010D\\\\u010F\\\\u0111\\\\u0113\\\\u0115\\\\u0117\\\\u0119\\\\u011B\\\\u011D\\\\u011F\\\\u0121\\\\u0123\\\\u0125\\\\u0127\\\\u0129\\\\u012B\\\\u012D\\\\u012F\\\\u0131\\\\u0133\\\\u0135\\\\u0137\\\\u0138\\\\u013A\\\\u013C\\\\u013E\\\\u0140\\\\u0142\\\\u0144\\\\u0146\\\\u0148\\\\u0149\\\\u014B\\\\u014D\\\\u014F\\\\u0151\\\\u0153\\\\u0155\\\\u0157\\\\u0159\\\\u015B\\\\u015D\\\\u015F\\\\u0161\\\\u0163\\\\u0165\\\\u0167\\\\u0169\\\\u016B\\\\u016D\\\\u016F\\\\u0171\\\\u0173\\\\u0175\\\\u0177\\\\u017A\\\\u017C\\\\u017E-\\\\u0180\\\\u0183\\\\u0185\\\\u0188\\\\u018C\\\\u018D\\\\u0192\\\\u0195\\\\u0199-\\\\u019B\\\\u019E\\\\u01A1\\\\u01A3\\\\u01A5\\\\u01A8\\\\u01AA\\\\u01AB\\\\u01AD\\\\u01B0\\\\u01B4\\\\u01B6\\\\u01B9\\\\u01BA\\\\u01BD-\\\\u01BF\\\\u01C6\\\\u01C9\\\\u01CC\\\\u01CE\\\\u01D0\\\\u01D2\\\\u01D4\\\\u01D6\\\\u01D8\\\\u01DA\\\\u01DC\\\\u01DD\\\\u01DF\\\\u01E1\\\\u01E3\\\\u01E5\\\\u01E7\\\\u01E9\\\\u01EB\\\\u01ED\\\\u01EF\\\\u01F0\\\\u01F3\\\\u01F5\\\\u01F9\\\\u01FB\\\\u01FD\\\\u01FF\\\\u0201\\\\u0203\\\\u0205\\\\u0207\\\\u0209\\\\u020B\\\\u020D\\\\u020F\\\\u0211\\\\u0213\\\\u0215\\\\u0217\\\\u0219\\\\u021B\\\\u021D\\\\u021F\\\\u0221\\\\u0223\\\\u0225\\\\u0227\\\\u0229\\\\u022B\\\\u022D\\\\u022F\\\\u0231\\\\u0233-\\\\u0239\\\\u023C\\\\u023F\\\\u0240\\\\u0242\\\\u0247\\\\u0249\\\\u024B\\\\u024D\\\\u024F';\n\n/**\n * A regular expression string that matches upper case letters: LATIN\n *\n * @type {string}\n * @ignore\n */\nconst upperCaseLetter =\n '\\\\x41-\\\\x5a\\\\xc0-\\\\xd6\\\\xd8-\\\\xde\\\\u0100\\\\u0102\\\\u0104\\\\u0106\\\\u0108\\\\u010a\\\\u010c\\\\u010e\\\\u0110\\\\u0112\\\\u0114\\\\u0116\\\\u0118\\\\u011a\\\\u011c\\\\u011e\\\\u0120\\\\u0122\\\\u0124\\\\u0126\\\\u0128\\\\u012a\\\\u012c\\\\u012e\\\\u0130\\\\u0132\\\\u0134\\\\u0136\\\\u0139\\\\u013b\\\\u013d\\\\u013f\\\\u0141\\\\u0143\\\\u0145\\\\u0147\\\\u014a\\\\u014c\\\\u014e\\\\u0150\\\\u0152\\\\u0154\\\\u0156\\\\u0158\\\\u015a\\\\u015c\\\\u015e\\\\u0160\\\\u0162\\\\u0164\\\\u0166\\\\u0168\\\\u016a\\\\u016c\\\\u016e\\\\u0170\\\\u0172\\\\u0174\\\\u0176\\\\u0178\\\\u0179\\\\u017b\\\\u017d\\\\u0181\\\\u0182\\\\u0184\\\\u0186\\\\u0187\\\\u0189-\\\\u018b\\\\u018e-\\\\u0191\\\\u0193\\\\u0194\\\\u0196-\\\\u0198\\\\u019c\\\\u019d\\\\u019f\\\\u01a0\\\\u01a2\\\\u01a4\\\\u01a6\\\\u01a7\\\\u01a9\\\\u01ac\\\\u01ae\\\\u01af\\\\u01b1-\\\\u01b3\\\\u01b5\\\\u01b7\\\\u01b8\\\\u01bc\\\\u01c4\\\\u01c5\\\\u01c7\\\\u01c8\\\\u01ca\\\\u01cb\\\\u01cd\\\\u01cf\\\\u01d1\\\\u01d3\\\\u01d5\\\\u01d7\\\\u01d9\\\\u01db\\\\u01de\\\\u01e0\\\\u01e2\\\\u01e4\\\\u01e6\\\\u01e8\\\\u01ea\\\\u01ec\\\\u01ee\\\\u01f1\\\\u01f2\\\\u01f4\\\\u01f6-\\\\u01f8\\\\u01fa\\\\u01fc\\\\u01fe\\\\u0200\\\\u0202\\\\u0204\\\\u0206\\\\u0208\\\\u020a\\\\u020c\\\\u020e\\\\u0210\\\\u0212\\\\u0214\\\\u0216\\\\u0218\\\\u021a\\\\u021c\\\\u021e\\\\u0220\\\\u0222\\\\u0224\\\\u0226\\\\u0228\\\\u022a\\\\u022c\\\\u022e\\\\u0230\\\\u0232\\\\u023a\\\\u023b\\\\u023d\\\\u023e\\\\u0241\\\\u0243-\\\\u0246\\\\u0248\\\\u024a\\\\u024c\\\\u024e';\n\n/**\n * Regular expression to match Unicode words\n *\n * @type {RegExp}\n * @ignore\n */\nexport const REGEXP_WORD = new RegExp(\n '(?:[' +\n upperCaseLetter +\n '][' +\n diacriticalMark +\n ']*)?(?:[' +\n lowerCaseLetter +\n '][' +\n diacriticalMark +\n ']*)+|\\\n(?:[' +\n upperCaseLetter +\n '][' +\n diacriticalMark +\n ']*)+(?![' +\n lowerCaseLetter +\n '])|\\\n[' +\n digit +\n ']+|\\\n[' +\n dingbatBlock +\n ']|\\\n[^' +\n nonCharacter +\n generalPunctuationBlock +\n whitespace +\n ']+',\n 'g'\n);\n\n/**\n * Regular expression to match words from Basic Latin and Latin-1 Supplement blocks\n *\n * @type {RegExp}\n * @ignore\n */\nexport const REGEXP_LATIN_WORD = /[A-Z\\xC0-\\xD6\\xD8-\\xDE]?[a-z\\xDF-\\xF6\\xF8-\\xFF]+|[A-Z\\xC0-\\xD6\\xD8-\\xDE]+(?![a-z\\xDF-\\xF6\\xF8-\\xFF])|\\d+/g;\n\n/**\n * Regular expression to match alpha characters\n *\n * @see http://stackoverflow.com/a/22075070/1894471\n * @type {RegExp}\n * @ignore\n */\nexport const REGEXP_ALPHA = new RegExp('^(?:[' + lowerCaseLetter + upperCaseLetter + '][' + diacriticalMark + ']*)+$');\n\n/**\n * Regular expression to match alpha and digit characters\n *\n * @see http://stackoverflow.com/a/22075070/1894471\n * @type {RegExp}\n * @ignore\n */\nexport const REGEXP_ALPHA_DIGIT = new RegExp(\n '^((?:[' + lowerCaseLetter + upperCaseLetter + '][' + diacriticalMark + ']*)|[' + digit + '])+$'\n);\n\n/**\n * Regular expression to match Extended ASCII characters, i.e. the first 255\n *\n * @type {RegExp}\n * @ignore\n */\nexport const REGEXP_EXTENDED_ASCII = /^[\\x01-\\xFF]*$/;\n","/**\n * Verifies if `value` is `undefined` or `null` and returns `defaultValue`. In other case returns `value`.\n *\n * @ignore\n * @function nilDefault\n * @param {*} value The value to verify.\n * @param {*} defaultValue The default value.\n * @return {*} Returns `defaultValue` if `value` is `undefined` or `null`, otherwise `defaultValue`.\n */\nexport default function nilDefault(value, defaultValue) {\n return value == null ? defaultValue : value;\n}\n","import isNil from 'helper/object/is_nil';\nimport isString from 'query/is_string';\n\n/**\n * Get the string representation of the `value`.\n * Converts the `value` to string.\n *\n * @ignore\n * @function toString\n * @param {*} value The value to convert.\n * @return {string|null} Returns the string representation of `value`.\n */\nexport default function toString(value) {\n if (isNil(value)) {\n return null;\n }\n if (isString(value)) {\n return value;\n }\n return String(value);\n}\n","import { REGEXP_EXTENDED_ASCII, REGEXP_LATIN_WORD, REGEXP_WORD } from 'helper/reg_exp/const_extended';\nimport coerceToString from 'helper/string/coerce_to_string';\nimport isNil from 'helper/object/is_nil';\nimport nilDefault from 'helper/undefined/nil_default';\nimport toString from 'helper/string/to_string';\n\n/**\n * Splits `subject` into an array of words.\n *\n * @function words\n * @static\n * @since 1.0.0\n * @memberOf Split\n * @param {string} [subject=''] The string to split into words.\n * @param {string|RegExp} [pattern] The pattern to watch words. If `pattern` is not RegExp, it is transformed to `new RegExp(pattern, flags)`.\n * @param {string} [flags=''] The regular expression flags. Applies when `pattern` is string type.\n * @return {Array} Returns the array of words.\n * @example\n * v.words('gravity can cross dimensions');\n * // => ['gravity', 'can', 'cross', 'dimensions']\n *\n * v.words('GravityCanCrossDimensions');\n * // => ['Gravity', 'Can', 'Cross', 'Dimensions']\n *\n * v.words('Gravity - can cross dimensions!');\n * // => ['Gravity', 'can', 'cross', 'dimensions']\n *\n * v.words('Earth gravity', /[^\\s]+/g);\n * // => ['Earth', 'gravity']\n */\nexport default function words(subject, pattern, flags) {\n const subjectString = coerceToString(subject);\n let patternRegExp;\n if (isNil(pattern)) {\n patternRegExp = REGEXP_EXTENDED_ASCII.test(subjectString) ? REGEXP_LATIN_WORD : REGEXP_WORD;\n } else if (pattern instanceof RegExp) {\n patternRegExp = pattern;\n } else {\n const flagsString = toString(nilDefault(flags, ''));\n patternRegExp = new RegExp(toString(pattern), flagsString);\n }\n return nilDefault(subjectString.match(patternRegExp), []);\n}\n","import capitalize from 'case/capitalize';\nimport coerceToString from 'helper/string/coerce_to_string';\nimport lowerCase from 'case/lower_case';\nimport words from 'split/words';\n\n/**\n * Transforms the `word` into camel case chunk.\n *\n * @param {string} word The word string\n * @param {number} index The index of the word in phrase.\n * @return {string} The transformed word.\n * @ignore\n */\nfunction wordToCamel(word, index) {\n return index === 0 ? lowerCase(word) : capitalize(word, true);\n}\n\n/**\n * Converts the `subject` to camel case.\n *\n * @function camelCase\n * @static\n * @since 1.0.0\n * @memberOf Case\n * @param {string} [subject=''] The string to convert to camel case.\n * @return {string} The camel case string.\n * @example\n * v.camelCase('bird flight');\n * // => 'birdFlight'\n *\n * v.camelCase('BirdFlight');\n * // => 'birdFlight'\n *\n * v.camelCase('-BIRD-FLIGHT-');\n * // => 'birdFlight'\n */\nexport default function camelCase(subject) {\n const subjectString = coerceToString(subject);\n if (subjectString === '') {\n return '';\n }\n return words(subjectString)\n .map(wordToCamel)\n .join('');\n}\n","import coerceToString from 'helper/string/coerce_to_string';\nimport lowerCase from 'case/lower_case';\nimport words from 'split/words';\n\n/**\n * Converts the `subject` to kebab case,\n * also called spinal case or lisp case.\n *\n * @function kebabCase\n * @static\n * @since 1.0.0\n * @memberOf Case\n * @param {string} [subject=''] The string to convert to kebab case.\n * @return {string} Returns the kebab case string.\n * @example\n * v.kebabCase('goodbye blue sky');\n * // => 'goodbye-blue-sky'\n *\n * v.kebabCase('GoodbyeBlueSky');\n * // => 'goodbye-blue-sky'\n *\n * v.kebabCase('-Goodbye-Blue-Sky-');\n * // => 'goodbye-blue-sky'\n */\nexport default function kebabCase(subject) {\n const subjectString = coerceToString(subject);\n if (subjectString === '') {\n return '';\n }\n return words(subjectString)\n .map(lowerCase)\n .join('-');\n}\n","import coerceToString from 'helper/string/coerce_to_string';\n\n/**\n * Converts the uppercase alpha caracters of `subject` to lowercase and lowercase\n * characters to uppercase.\n *\n * @function swapCase\n * @static\n * @since 1.3.0\n * @memberOf Case\n * @param {string} [subject=''] The string to swap the case.\n * @return {string} Returns the converted string.\n * @example\n * v.swapCase('League of Shadows');\n * // => 'lEAGUE OF sHADOWS'\n *\n * v.swapCase('2 Bees');\n * // => '2 bEES'\n */\nexport default function swapCase(subject) {\n const subjectString = coerceToString(subject);\n return subjectString.split('').reduce(swapAndConcat, '');\n}\n\nfunction swapAndConcat(swapped, character) {\n const lowerCase = character.toLowerCase();\n const upperCase = character.toUpperCase();\n return swapped + (character === lowerCase ? upperCase : lowerCase);\n}\n","/**\n * Clip the number to interval `downLimit` to `upLimit`.\n *\n * @ignore\n * @function clipNumber\n * @param {number} value The number to clip\n * @param {number} downLimit The down limit\n * @param {number} upLimit The upper limit\n * @return {number} The clipped number\n */\nexport default function clipNumber(value, downLimit, upLimit) {\n if (value <= downLimit) {\n return downLimit;\n }\n if (value >= upLimit) {\n return upLimit;\n }\n return value;\n}\n","/**\n * Max save integer value\n *\n * @ignore\n * @type {number}\n */\nexport const MAX_SAFE_INTEGER = 0x1fffffffffffff;\n","import { MAX_SAFE_INTEGER } from 'helper/number/const';\n\n/**\n * Transforms `value` to an integer.\n *\n * @ignore\n * @function toInteger\n * @param {number} value The number to transform.\n * @returns {number} Returns the transformed integer.\n */\nexport default function toInteger(value) {\n if (value === Infinity) {\n return MAX_SAFE_INTEGER;\n }\n if (value === -Infinity) {\n return -MAX_SAFE_INTEGER;\n }\n return ~~value;\n}\n","import clipNumber from 'helper/number/clip_number';\nimport coerceToString from 'helper/string/coerce_to_string';\nimport isNil from 'helper/object/is_nil';\nimport { MAX_SAFE_INTEGER } from 'helper/number/const';\nimport toInteger from 'helper/number/to_integer';\n\n/**\n * Truncates `subject` to a new `length`.\n *\n * @function truncate\n * @static\n * @since 1.0.0\n * @memberOf Chop\n * @param {string} [subject=''] The string to truncate.\n * @param {int} length The length to truncate the string.\n * @param {string} [end='...'] The string to be added at the end.\n * @return {string} Returns the truncated string.\n * @example\n * v.truncate('Once upon a time', 7);\n * // => 'Once...'\n *\n * v.truncate('Good day, Little Red Riding Hood', 14, ' (...)');\n * // => 'Good day (...)'\n *\n * v.truncate('Once upon', 10);\n * // => 'Once upon'\n */\nexport default function truncate(subject, length, end) {\n const subjectString = coerceToString(subject);\n const lengthInt = isNil(length) ? subjectString.length : clipNumber(toInteger(length), 0, MAX_SAFE_INTEGER);\n const endString = coerceToString(end, '...');\n if (lengthInt >= subjectString.length) {\n return subjectString;\n }\n return subjectString.substr(0, length - endString.length) + endString;\n}\n","const HIGH_SURROGATE_START = 0xd800;\nconst HIGH_SURROGATE_END = 0xdbff;\nconst LOW_SURROGATE_START = 0xdc00;\nconst LOW_SURROGATE_END = 0xdfff;\n\n/**\n * Checks if `codePoint` is a high-surrogate number from range 0xD800 to 0xDBFF.\n *\n * @ignore\n * @param {number} codePoint The code point number to be verified\n * @return {boolean} Returns a boolean whether `codePoint` is a high-surrogate number.\n */\nexport function isHighSurrogate(codePoint) {\n return codePoint >= HIGH_SURROGATE_START && codePoint <= HIGH_SURROGATE_END;\n}\n\n/**\n * Checks if `codePoint` is a low-surrogate number from range 0xDC00 to 0xDFFF.\n *\n * @ignore\n * @param {number} codePoint The code point number to be verified\n * @return {boolean} Returns a boolean whether `codePoint` is a low-surrogate number.\n */\nexport function isLowSurrogate(codePoint) {\n return codePoint >= LOW_SURROGATE_START && codePoint <= LOW_SURROGATE_END;\n}\n\n/**\n * Get the astral code point number based on surrogate pair numbers.\n *\n * @ignore\n * @param {number} highSurrogate The high-surrogate code point number.\n * @param {number} lowSurrogate The low-surrogate code point number.\n * @return {number} Returns the astral symbol number.\n */\nexport function getAstralNumberFromSurrogatePair(highSurrogate, lowSurrogate) {\n return (highSurrogate - HIGH_SURROGATE_START) * 0x400 + lowSurrogate - LOW_SURROGATE_START + 0x10000;\n}\n","import isNil from 'helper/object/is_nil';\n\n/**\n * Get the number representation of the `value`.\n * Converts the `value` to number.\n * If `value` is `null` or `undefined`, return `defaultValue`.\n *\n * @ignore\n * @function toString\n * @param {*} value The value to convert.\n * @param {*} [defaultValue=''] The default value to return.\n * @return {number|null} Returns the number representation of `value`. Returns `defaultValue` if `value` is\n * `null` or `undefined`.\n */\nexport default function coerceToNumber(value, defaultValue = 0) {\n if (isNil(value)) {\n return defaultValue;\n }\n if (typeof value === 'number') {\n return value;\n }\n return Number(value);\n}\n","/**\n * If `value` is `NaN`, return `defaultValue`. In other case returns `value`.\n *\n * @ignore\n * @function nanDefault\n * @param {*} value The value to verify.\n * @param {*} defaultValue The default value.\n * @return {*} Returns `defaultValue` if `value` is `NaN`, otherwise `defaultValue`.\n */\nexport default function nanDefault(value, defaultValue) {\n return value !== value ? defaultValue : value;\n}\n","import { getAstralNumberFromSurrogatePair, isHighSurrogate, isLowSurrogate } from 'helper/string/surrogate_pair';\nimport coerceToNumber from 'helper/number/coerce_to_number';\nimport coerceToString from 'helper/string/coerce_to_string';\nimport nanDefault from 'helper/number/nan_default';\n\n/**\n * Get the Unicode code point value of the character at `position`.
\n * If a valid UTF-16 \n * surrogate pair starts at `position`, the\n * astral code point\n * value at `position` is returned.\n *\n * @function codePointAt\n * @static\n * @since 1.0.0\n * @memberOf Chop\n * @param {string} [subject=''] The string to extract from.\n * @param {number} position The position to get the code point number.\n * @return {number} Returns a non-negative number less than or equal to `0x10FFFF`.\n * @example\n * v.codePointAt('rain', 1);\n * // => 97, or 0x0061\n *\n * v.codePointAt('\\uD83D\\uDE00 is smile', 0); // or '😀 is smile'\n * // => 128512, or 0x1F600\n */\nexport default function codePointAt(subject, position) {\n const subjectString = coerceToString(subject);\n const subjectStringLength = subjectString.length;\n let positionNumber = coerceToNumber(position);\n positionNumber = nanDefault(positionNumber, 0);\n if (positionNumber < 0 || positionNumber >= subjectStringLength) {\n return undefined;\n }\n const firstCodePoint = subjectString.charCodeAt(positionNumber);\n let secondCodePoint;\n if (isHighSurrogate(firstCodePoint) && subjectStringLength > positionNumber + 1) {\n secondCodePoint = subjectString.charCodeAt(positionNumber + 1);\n if (isLowSurrogate(secondCodePoint)) {\n return getAstralNumberFromSurrogatePair(firstCodePoint, secondCodePoint);\n }\n }\n return firstCodePoint;\n}\n","import coerceToString from 'helper/string/coerce_to_string';\n\nconst reduce = Array.prototype.reduce;\n\n/**\n * Counts the characters in `subject` for which `predicate` returns truthy.\n *\n * @function countWhere\n * @static\n * @since 1.0.0\n * @memberOf Count\n * @param {string} [subject=''] The string to count characters.\n * @param {Function} predicate The predicate function invoked on each character with parameters `(character, index, string)`.\n * @param {Object} [context] The context to invoke the `predicate`.\n * @return {number} Returns the number of characters for which `predicate` returns truthy.\n * @example\n * v.countWhere('hola!', v.isAlpha);\n * // => 4\n *\n * v.countWhere('2022', function(character, index, str) {\n * return character === '2';\n * });\n * // => 3\n */\nexport default function countWhere(subject, predicate, context) {\n const subjectString = coerceToString(subject);\n if (subjectString === '' || typeof predicate !== 'function') {\n return 0;\n }\n const predicateWithContext = predicate.bind(context);\n return reduce.call(\n subjectString,\n function(countTruthy, character, index) {\n return predicateWithContext(character, index, subjectString) ? countTruthy + 1 : countTruthy;\n },\n 0\n );\n}\n","import isNil from 'helper/object/is_nil';\n\n/**\n * The current index.\n *\n * @ignore\n * @name ReplacementIndex#index\n * @type {number}\n * @return {ReplacementIndex} ReplacementIndex instance.\n */\nfunction ReplacementIndex() {\n this.index = 0;\n}\n\n/**\n * Increment the current index.\n *\n * @ignore\n * @return {undefined}\n */\nReplacementIndex.prototype.increment = function() {\n this.index++;\n};\n\n/**\n * Increment the current index by position.\n *\n * @ignore\n * @param {number} [position] The replacement position.\n * @return {undefined}\n */\nReplacementIndex.prototype.incrementOnEmptyPosition = function(position) {\n if (isNil(position)) {\n this.increment();\n }\n};\n\n/**\n * Get the replacement index by position.\n *\n * @ignore\n * @param {number} [position] The replacement position.\n * @return {number} The replacement index.\n */\nReplacementIndex.prototype.getIndexByPosition = function(position) {\n return isNil(position) ? this.index : position - 1;\n};\n\nexport default ReplacementIndex;\n","// Type specifiers\nexport const TYPE_INTEGER = 'i';\nexport const TYPE_INTEGER_BINARY = 'b';\nexport const TYPE_INTEGER_ASCII_CHARACTER = 'c';\nexport const TYPE_INTEGER_DECIMAL = 'd';\nexport const TYPE_INTEGER_OCTAL = 'o';\nexport const TYPE_INTEGER_UNSIGNED_DECIMAL = 'u';\nexport const TYPE_INTEGER_HEXADECIMAL = 'x';\nexport const TYPE_INTEGER_HEXADECIMAL_UPPERCASE = 'X';\nexport const TYPE_FLOAT_SCIENTIFIC = 'e';\nexport const TYPE_FLOAT_SCIENTIFIC_UPPERCASE = 'E';\nexport const TYPE_FLOAT = 'f';\nexport const TYPE_FLOAT_SHORT = 'g';\nexport const TYPE_FLOAT_SHORT_UPPERCASE = 'G';\nexport const TYPE_STRING = 's';\n\n// Simple literals\nexport const LITERAL_PERCENT = '%';\nexport const LITERAL_SINGLE_QUOTE = \"'\";\nexport const LITERAL_PLUS = '+';\nexport const LITERAL_MINUS = '-';\nexport const LITERAL_PERCENT_SPECIFIER = '%%';\n\n// Radix constants to format numbers\nexport const RADIX_BINARY = 2;\nexport const RADIX_OCTAL = 8;\nexport const RADIX_DECIMAL = 10;\nexport const RADIX_HEXADECIMAL = 16;\n","import clipNumber from 'helper/number/clip_number';\nimport coerceToString from 'helper/string/coerce_to_string';\nimport isNil from 'helper/object/is_nil';\nimport { MAX_SAFE_INTEGER } from 'helper/number/const';\nimport toInteger from 'helper/number/to_integer';\n\n/**\n * Repeats the `subject` number of `times`.\n *\n * @function repeat\n * @static\n * @since 1.0.0\n * @memberOf Manipulate\n * @param {string} [subject=''] The string to repeat.\n * @param {number} [times=1] The number of times to repeat.\n * @return {string} Returns the repeated string.\n * @example\n * v.repeat('w', 3);\n * // => 'www'\n *\n * v.repeat('world', 0);\n * // => ''\n */\nexport default function repeat(subject, times) {\n let subjectString = coerceToString(subject);\n let timesInt = isNil(times) ? 1 : clipNumber(toInteger(times), 0, MAX_SAFE_INTEGER);\n let repeatString = '';\n while (timesInt) {\n if (timesInt & 1) {\n repeatString += subjectString;\n }\n if (timesInt > 1) {\n subjectString += subjectString;\n }\n timesInt >>= 1;\n }\n return repeatString;\n}\n","import repeat from 'manipulate/repeat';\nimport toInteger from 'helper/number/to_integer';\n\n/**\n * Creates the padding string.\n *\n * @ignore\n * @param {string} padCharacters The characters to create padding string.\n * @param {number} length The padding string length.\n * @return {string} The padding string.\n */\nexport default function buildPadding(padCharacters, length) {\n const padStringRepeat = toInteger(length / padCharacters.length);\n const padStringRest = length % padCharacters.length;\n return repeat(padCharacters, padStringRepeat + padStringRest).substr(0, length);\n}\n","import buildPadding from 'helper/string/build_padding';\nimport clipNumber from 'helper/number/clip_number';\nimport coerceToString from 'helper/string/coerce_to_string';\nimport isNil from 'helper/object/is_nil';\nimport { MAX_SAFE_INTEGER } from 'helper/number/const';\nimport toInteger from 'helper/number/to_integer';\n\n/**\n * Pads `subject` from left to a new `length`.\n *\n * @function padLeft\n * @static\n * @since 1.0.0\n * @memberOf Manipulate\n * @param {string} [subject=''] The string to pad.\n * @param {int} [length=0] The length to left pad the string. No changes are made if `length` is less than `subject.length`.\n * @param {string} [pad=' '] The string to be used for padding.\n * @return {string} Returns the left padded string.\n * @example\n * v.padLeft('dog', 5);\n * // => ' dog'\n *\n * v.padLeft('bird', 6, '-');\n * // => '--bird'\n *\n * v.padLeft('cat', 6, '-=');\n * // => '-=-cat'\n */\nexport default function padLeft(subject, length, pad) {\n const subjectString = coerceToString(subject);\n const lengthInt = isNil(length) ? 0 : clipNumber(toInteger(length), 0, MAX_SAFE_INTEGER);\n const padString = coerceToString(pad, ' ');\n if (lengthInt <= subjectString.length) {\n return subjectString;\n }\n return buildPadding(padString, lengthInt - subjectString.length) + subjectString;\n}\n","import buildPadding from 'helper/string/build_padding';\nimport clipNumber from 'helper/number/clip_number';\nimport coerceToString from 'helper/string/coerce_to_string';\nimport isNil from 'helper/object/is_nil';\nimport { MAX_SAFE_INTEGER } from 'helper/number/const';\nimport toInteger from 'helper/number/to_integer';\n\n/**\n * Pads `subject` from right to a new `length`.\n *\n * @function padRight\n * @static\n * @since 1.0.0\n * @memberOf Manipulate\n * @param {string} [subject=''] The string to pad.\n * @param {int} [length=0] The length to right pad the string. No changes are made if `length` is less than `subject.length`.\n * @param {string} [pad=' '] The string to be used for padding.\n * @return {string} Returns the right padded string.\n * @example\n * v.padRight('dog', 5);\n * // => 'dog '\n *\n * v.padRight('bird', 6, '-');\n * // => 'bird--'\n *\n * v.padRight('cat', 6, '-=');\n * // => 'cat-=-'\n */\nexport default function padRight(subject, length, pad) {\n const subjectString = coerceToString(subject);\n const lengthInt = isNil(length) ? 0 : clipNumber(toInteger(length), 0, MAX_SAFE_INTEGER);\n const padString = coerceToString(pad, ' ');\n if (lengthInt <= subjectString.length) {\n return subjectString;\n }\n return subjectString + buildPadding(padString, lengthInt - subjectString.length);\n}\n","import { LITERAL_PLUS } from 'helper/format/const';\n\n/**\n * Add sign to the formatted number.\n *\n * @ignore\n * @name addSignToFormattedNumber\n * @param {number} replacementNumber The number to be replaced.\n * @param {string} formattedReplacement The formatted version of number.\n * @param {ConversionSpecification} conversion The conversion specification object.\n * @return {string} Returns the formatted number string with a sign.\n */\nexport default function addSignToFormattedNumber(replacementNumber, formattedReplacement, conversion) {\n if (conversion.signSpecifier === LITERAL_PLUS && replacementNumber >= 0) {\n formattedReplacement = LITERAL_PLUS + formattedReplacement;\n }\n return formattedReplacement;\n}\n","import {\n TYPE_FLOAT,\n TYPE_FLOAT_SCIENTIFIC,\n TYPE_FLOAT_SCIENTIFIC_UPPERCASE,\n TYPE_FLOAT_SHORT,\n TYPE_FLOAT_SHORT_UPPERCASE,\n} from 'helper/format/const';\nimport addSignToFormattedNumber from 'helper/format/type_format/add_sign_to_formatted_number';\nimport coerceToNumber from 'helper/number/coerce_to_number';\nimport { REGEXP_TRAILING_ZEROS } from 'helper/reg_exp/const';\nimport toString from 'helper/string/coerce_to_string';\n\n/**\n * Formats a float type according to specifiers.\n *\n * @ignore\n * @param {string} replacement The string to be formatted.\n * @param {ConversionSpecification} conversion The conversion specification object.\n * @return {string} Returns the formatted string.\n */\n\nexport default function float(replacement, conversion) {\n let replacementNumber = parseFloat(replacement);\n let formattedReplacement;\n if (isNaN(replacementNumber)) {\n replacementNumber = 0;\n }\n const precision = coerceToNumber(conversion.precision, 6);\n switch (conversion.typeSpecifier) {\n case TYPE_FLOAT:\n formattedReplacement = replacementNumber.toFixed(precision);\n break;\n case TYPE_FLOAT_SCIENTIFIC:\n formattedReplacement = replacementNumber.toExponential(precision);\n break;\n case TYPE_FLOAT_SCIENTIFIC_UPPERCASE:\n formattedReplacement = replacementNumber.toExponential(precision).toUpperCase();\n break;\n case TYPE_FLOAT_SHORT:\n case TYPE_FLOAT_SHORT_UPPERCASE:\n formattedReplacement = formatFloatAsShort(replacementNumber, precision, conversion);\n break;\n }\n formattedReplacement = addSignToFormattedNumber(replacementNumber, formattedReplacement, conversion);\n return toString(formattedReplacement);\n}\n\n/**\n * Formats the short float.\n *\n * @ignore\n * @param {number} replacementNumber The number to format.\n * @param {number} precision The precision to format the float.\n * @param {ConversionSpecification} conversion The conversion specification object.\n * @return {string} Returns the formatted short float.\n */\nfunction formatFloatAsShort(replacementNumber, precision, conversion) {\n if (replacementNumber === 0) {\n return '0';\n }\n const nonZeroPrecision = precision === 0 ? 1 : precision;\n let formattedReplacement = replacementNumber.toPrecision(nonZeroPrecision).replace(REGEXP_TRAILING_ZEROS, '');\n if (conversion.typeSpecifier === TYPE_FLOAT_SHORT_UPPERCASE) {\n formattedReplacement = formattedReplacement.toUpperCase();\n }\n return formattedReplacement;\n}\n","import {\n RADIX_BINARY,\n RADIX_HEXADECIMAL,\n RADIX_OCTAL,\n TYPE_INTEGER_ASCII_CHARACTER,\n TYPE_INTEGER_BINARY,\n TYPE_INTEGER_HEXADECIMAL,\n TYPE_INTEGER_HEXADECIMAL_UPPERCASE,\n TYPE_INTEGER_OCTAL,\n} from 'helper/format/const';\nimport toString from 'helper/string/coerce_to_string';\n\n/**\n * Formats an integer type according to specifiers.\n *\n * @ignore\n * @param {string} replacement The string to be formatted.\n * @param {ConversionSpecification} conversion The conversion specification object.\n * @return {string} Returns the formatted string.\n */\n\nexport default function integerBase(replacement, conversion) {\n let integer = parseInt(replacement);\n if (isNaN(integer)) {\n integer = 0;\n }\n integer = integer >>> 0;\n switch (conversion.typeSpecifier) {\n case TYPE_INTEGER_ASCII_CHARACTER:\n integer = String.fromCharCode(integer);\n break;\n case TYPE_INTEGER_BINARY:\n integer = integer.toString(RADIX_BINARY);\n break;\n case TYPE_INTEGER_OCTAL:\n integer = integer.toString(RADIX_OCTAL);\n break;\n case TYPE_INTEGER_HEXADECIMAL:\n integer = integer.toString(RADIX_HEXADECIMAL);\n break;\n case TYPE_INTEGER_HEXADECIMAL_UPPERCASE:\n integer = integer.toString(RADIX_HEXADECIMAL).toUpperCase();\n break;\n }\n return toString(integer);\n}\n","import addSignToFormattedNumber from 'helper/format/type_format/add_sign_to_formatted_number';\nimport toString from 'helper/string/to_string';\n\n/**\n * Formats a decimal integer type according to specifiers.\n *\n * @ignore\n * @param {string} replacement The string to be formatted.\n * @param {ConversionSpecification} conversion The conversion specification object.\n * @return {string} Returns the formatted string.\n */\n\nexport default function integerDecimal(replacement, conversion) {\n let integer = parseInt(replacement);\n if (isNaN(integer)) {\n integer = 0;\n }\n return addSignToFormattedNumber(integer, toString(integer), conversion);\n}\n","import isNil from 'helper/object/is_nil';\nimport truncate from 'chop/truncate';\n\n/**\n * Formats a string type according to specifiers.\n *\n * @ignore\n * @param {string} replacement The string to be formatted.\n * @param {ConversionSpecification} conversion The conversion specification object.\n * @return {string} Returns the formatted string.\n */\nexport default function stringFormat(replacement, conversion) {\n let formattedReplacement = replacement;\n const precision = conversion.precision;\n if (!isNil(precision) && formattedReplacement.length > precision) {\n formattedReplacement = truncate(formattedReplacement, precision, '');\n }\n return formattedReplacement;\n}\n","import {\n TYPE_FLOAT,\n TYPE_FLOAT_SCIENTIFIC,\n TYPE_FLOAT_SCIENTIFIC_UPPERCASE,\n TYPE_FLOAT_SHORT,\n TYPE_FLOAT_SHORT_UPPERCASE,\n TYPE_INTEGER,\n TYPE_INTEGER_ASCII_CHARACTER,\n TYPE_INTEGER_BINARY,\n TYPE_INTEGER_DECIMAL,\n TYPE_INTEGER_HEXADECIMAL,\n TYPE_INTEGER_HEXADECIMAL_UPPERCASE,\n TYPE_INTEGER_OCTAL,\n TYPE_INTEGER_UNSIGNED_DECIMAL,\n TYPE_STRING,\n} from 'helper/format/const';\nimport alignAndPad from 'helper/format/align_and_pad';\nimport formatFloat from 'helper/format/type_format/float';\nimport formatIntegerBase from 'helper/format/type_format/integer_base';\nimport formatIntegerDecimal from 'helper/format/type_format/integer_decimal';\nimport formatString from 'helper/format/type_format/string';\n\n/**\n * Returns the computed string based on format specifiers.\n *\n * @ignore\n * @name computeReplacement\n * @param {string} replacement The replacement value.\n * @param {ConversionSpecification} conversion The conversion specification object.\n * @return {string} Returns the computed string.\n */\nexport default function compute(replacement, conversion) {\n let formatFunction;\n switch (conversion.typeSpecifier) {\n case TYPE_STRING:\n formatFunction = formatString;\n break;\n case TYPE_INTEGER_DECIMAL:\n case TYPE_INTEGER:\n formatFunction = formatIntegerDecimal;\n break;\n case TYPE_INTEGER_ASCII_CHARACTER:\n case TYPE_INTEGER_BINARY:\n case TYPE_INTEGER_OCTAL:\n case TYPE_INTEGER_HEXADECIMAL:\n case TYPE_INTEGER_HEXADECIMAL_UPPERCASE:\n case TYPE_INTEGER_UNSIGNED_DECIMAL:\n formatFunction = formatIntegerBase;\n break;\n case TYPE_FLOAT:\n case TYPE_FLOAT_SCIENTIFIC:\n case TYPE_FLOAT_SCIENTIFIC_UPPERCASE:\n case TYPE_FLOAT_SHORT:\n case TYPE_FLOAT_SHORT_UPPERCASE:\n formatFunction = formatFloat;\n break;\n }\n const formattedString = formatFunction(replacement, conversion);\n return alignAndPad(formattedString, conversion);\n}\n","import isNil from 'helper/object/is_nil';\nimport { LITERAL_MINUS } from 'helper/format/const';\nimport padLeft from 'manipulate/pad_left';\nimport padRight from 'manipulate/pad_right';\n\n/**\n * Aligns and pads `subject` string.\n *\n * @ignore\n * @param {string} subject The subject string.\n * @param {ConversionSpecification} conversion The conversion specification object.\n * @return {string} Returns the aligned and padded string.\n */\nexport default function alignAndPad(subject, conversion) {\n const width = conversion.width;\n if (isNil(width) || subject.length >= width) {\n return subject;\n }\n const padType = conversion.alignmentSpecifier === LITERAL_MINUS ? padRight : padLeft;\n return padType(subject, width, conversion.getPaddingCharacter());\n}\n","import { LITERAL_PERCENT_SPECIFIER, LITERAL_SINGLE_QUOTE } from 'helper/format/const';\nimport nilDefault from 'helper/undefined/nil_default';\n\n/**\n * Construct the new conversion specification object.\n *\n * @ignore\n * @param {Object} properties An object with properties to initialize.\n * @return {ConversionSpecification} ConversionSpecification instance.\n */\nfunction ConversionSpecification(properties) {\n /**\n * The percent characters from conversion specification.\n *\n * @ignore\n * @name ConversionSpecification#percent\n * @type {string}\n */\n this.percent = properties.percent;\n\n /**\n * The sign specifier to force a sign to be used on a number.\n *\n * @ignore\n * @name ConversionSpecification#signSpecifier\n * @type {string}\n */\n this.signSpecifier = properties.signSpecifier;\n\n /**\n * The padding specifier that says what padding character will be used.\n *\n * @ignore\n * @name ConversionSpecification#paddingSpecifier\n * @type {string}\n */\n this.paddingSpecifier = properties.paddingSpecifier;\n\n /**\n * The alignment specifier that says if the result should be left-justified or right-justified.\n *\n * @ignore\n * @name ConversionSpecification#alignmentSpecifier\n * @type {string}\n */\n this.alignmentSpecifier = properties.alignmentSpecifier;\n\n /**\n * The width specifier how many characters this conversion should result in.\n *\n * @ignore\n * @name ConversionSpecification#width\n * @type {number}\n */\n this.width = properties.width;\n\n /**\n * The precision specifier says how many decimal digits should be displayed for floating-point numbers.\n *\n * @ignore\n * @name ConversionSpecification#precision\n * @type {number}\n */\n this.precision = properties.precision;\n\n /**\n * The type specifier says what type the argument data should be treated as.\n *\n * @ignore\n * @name ConversionSpecification#typeSpecifier\n * @type {string}\n */\n this.typeSpecifier = properties.typeSpecifier;\n}\n\n/**\n * Check if the conversion specification is a percent literal \"%%\".\n *\n * @ignore\n * @return {boolean} Returns true if the conversion is a percent literal, false otherwise.\n */\nConversionSpecification.prototype.isPercentLiteral = function() {\n return LITERAL_PERCENT_SPECIFIER === this.percent;\n};\n\n/**\n * Get the padding character from padding specifier.\n *\n * @ignore\n * @returns {string} Returns the padding character.\n */\nConversionSpecification.prototype.getPaddingCharacter = function() {\n let paddingCharacter = nilDefault(this.paddingSpecifier, ' ');\n if (paddingCharacter.length === 2 && paddingCharacter[0] === LITERAL_SINGLE_QUOTE) {\n paddingCharacter = paddingCharacter[1];\n }\n return paddingCharacter;\n};\n\nexport default ConversionSpecification;\n","import coerceToNumber from 'helper/number/coerce_to_number';\nimport computeReplacement from 'helper/format/replacement/compute';\nimport ConversionSpecification from 'helper/format/conversion_specification';\nimport validateReplacement from 'helper/format/replacement/validate';\n\n/**\n * Return the replacement for regular expression match of the conversion specification.\n *\n * @ignore\n * @name matchReplacement\n * @param {ReplacementIndex} replacementIndex The replacement index object.\n * @param {string[]} replacements The array of replacements.\n * @param {string} conversionSpecification The conversion specification.\n * @param {string} percent The percent characters from conversion specification.\n * @param {string} position The position to insert the replacement.\n * @param {string} signSpecifier The sign specifier to force a sign to be used on a number.\n * @param {string} paddingSpecifier The padding specifier that says what padding character will be used.\n * @param {string} alignmentSpecifier The alignment specifier that says if the result should be left-justified or right-justified.\n * @param {string} widthSpecifier The width specifier how many characters this conversion should result in.\n * @param {string} precisionSpecifier The precision specifier says how many decimal digits should be displayed for floating-point numbers.\n * @param {string} typeSpecifier The type specifier says what type the argument data should be treated as.\n * @return {string} Returns the computed replacement.\n */\nexport default function match(\n replacementIndex,\n replacements,\n conversionSpecification,\n percent,\n position,\n signSpecifier,\n paddingSpecifier,\n alignmentSpecifier,\n widthSpecifier,\n precisionSpecifier,\n typeSpecifier\n) {\n const conversion = new ConversionSpecification({\n percent,\n signSpecifier,\n paddingSpecifier,\n alignmentSpecifier,\n width: coerceToNumber(widthSpecifier, null),\n precision: coerceToNumber(precisionSpecifier, null),\n typeSpecifier,\n });\n if (conversion.isPercentLiteral()) {\n return conversionSpecification.slice(1);\n }\n const actualReplacementIndex = replacementIndex.getIndexByPosition(position);\n replacementIndex.incrementOnEmptyPosition(position);\n validateReplacement(actualReplacementIndex, replacements.length, conversion);\n return computeReplacement(replacements[actualReplacementIndex], conversion);\n}\n","import isNil from 'helper/object/is_nil';\n\n/**\n * Validates the specifier type and replacement position.\n *\n * @ignore\n * @throws {Error} Throws an exception on insufficient arguments or unknown specifier.\n * @param {number} index The index of the matched specifier.\n * @param {number} replacementsLength The number of replacements.\n * @param {ConversionSpecification} conversion The conversion specification object.\n * @return {undefined}\n */\nexport default function validate(index, replacementsLength, conversion) {\n if (isNil(conversion.typeSpecifier)) {\n throw new Error('sprintf(): Unknown type specifier');\n }\n if (index > replacementsLength - 1) {\n throw new Error('sprintf(): Too few arguments');\n }\n if (index < 0) {\n throw new Error('sprintf(): Argument number must be greater than zero');\n }\n}\n","import coerceToString from 'helper/string/coerce_to_string';\nimport { REGEXP_CONVERSION_SPECIFICATION } from 'helper/reg_exp/const';\nimport ReplacementIndex from 'helper/format/replacement/index.js';\nimport replacementMatch from 'helper/format/replacement/match';\n\n/**\n * Produces a string according to `format`.\n *\n *
%
), which are copied unchanged\n * to the output string and conversion specifications, each of which results in fetching zero or more subsequent\n * arguments. %
, and ends with a conversion\n * specifier. In between there may be (in this order) zero or more flags, an optional minimum field width\n * and an optional precision.%
is followed by zero or more of the following flags:+ | \n * \n * A sign (+ or - ) should always be placed before a number produced by a\n * signed conversion. By default a sign is used only for negative numbers.\n * | \n *
0 | \n * The value should be zero padded. | \n *
␣ | \n * (a space) The value should be space padded. | \n *
' | \n * Indicates alternate padding character, specified by prefixing it with a single quote ' . | \n *
- | \n * The converted value is to be left adjusted on the field boundary (the default is right justification). | \n *
`s` | \n *The string argument is treated as and presented as a string. | \n *
`d` `i` | \n *The integer argument is converted to signed decimal notation. | \n *
`b` | \n *The unsigned integer argument is converted to unsigned binary. | \n *
`c` | \n *The unsigned integer argument is converted to an ASCII character with that number. | \n *
`o` | \n *The unsigned integer argument is converted to unsigned octal. | \n *
`u` | \n *The unsigned integer argument is converted to unsigned decimal. | \n *
`x` `X` | \n *The unsigned integer argument is converted to unsigned hexadecimal. The letters `abcdef` are used for `x`\n * conversions; the letters `ABCDEF` are used for `X` conversions. | \n *
`f` | \n *\n * The float argument is rounded and converted to decimal notation in the style `[-]ddd.ddd`, where the number of\n * digits after the decimal-point character is equal to the precision specification. If the precision is missing,\n * it is taken as 6; if the precision is explicitly zero, no decimal-point character appears.\n * If a decimal point appears, at least one digit appears before it.\n * | \n *
`e` `E` | \n *\n * The float argument is rounded and converted in the style `[-]d.ddde±dd`, where there is one digit\n * before the decimal-point character and the number of digits after it is equal to the precision. If\n * the precision is missing, it is taken as `6`; if the precision is zero, no decimal-point character\n * appears. An `E` conversion uses the letter `E` (rather than `e`) to introduce the exponent.\n * | \n *
`g` `G` | \n *\n * The float argument is converted in style `f` or `e` (or `F` or `E` for `G` conversions). The precision specifies\n * the number of significant digits. If the precision is missing, `6` digits are given; if the\n * precision is zero, it is treated as `1`. Style `e` is used if the exponent from its conversion is less\n * than `-6` or greater than or equal to the precision. Trailing zeros are removed from the fractional\n * part of the result; a decimal point appears only if it is followed by at least one digit.\n * | \n *
`%` | \n *A literal `%` is written. No argument is converted. The complete conversion specification is `%%`. | \n *
< > & ' \" `
in subject
.\n *\n * @function escapeHtml\n * @static\n * @since 1.0.0\n * @memberOf Escape\n * @param {string} [subject=''] The string to escape.\n * @return {string} Returns the escaped string.\n * @example\n * v.escapeHtml('wonderful world
');\n * // => '<p>wonderful world</p>'\n */\nexport default function escapeHtml(subject) {\n return coerceToString(subject).replace(REGEXP_HTML_SPECIAL_CHARACTERS, replaceSpecialCharacter);\n}\n","import coerceToString from 'helper/string/coerce_to_string';\n\nconst unescapeCharactersMap = {\n '<': /(<)|(*3c;)|(*60;)/gi,\n '>': /(>)|(*3e;)|(*62;)/gi,\n '&': /(&)|(*26;)|(*38;)/gi,\n '\"': /(")|(*22;)|(*34;)/gi,\n \"'\": /(*27;)|(*39;)/gi,\n '`': /(*60;)|(*96;)/gi,\n};\nconst characters = Object.keys(unescapeCharactersMap);\n\n/**\n * Replaces the HTML entities with corresponding characters.\n *\n * @ignore\n * @param {string} string The accumulator string.\n * @param {string} key The character.\n * @return {string} The string with replaced HTML entity\n */\nfunction reduceUnescapedString(string, key) {\n return string.replace(unescapeCharactersMap[key], key);\n}\n\n/**\n * Unescapes HTML special characters from< > & " ' `
\n * to corresponding < > & ' \" `
in subject
.\n *\n * @function unescapeHtml\n * @static\n * @since 1.0.0\n * @memberOf Escape\n * @param {string} [subject=''] The string to unescape.\n * @return {string} Returns the unescaped string.\n * @example\n * v.unescapeHtml('<p>wonderful world</p>');\n * // => 'wonderful world
'\n */\nexport default function unescapeHtml(subject) {\n const subjectString = coerceToString(subject);\n return characters.reduce(reduceUnescapedString, subjectString);\n}\n","/**\n * Generated diacritics map. See bellow the base code.\n * @ignore\n * @type Object\n */\n\nconst diacritics = {\n '3': '\\u039e\\u03be',\n '8': '\\u0398\\u03b8',\n A: '\\x41\\xc0\\xc1\\xc2\\xc3\\xc4\\xc5\\u0100\\u0102\\u0104\\u01cd\\u01de\\u01e0\\u01fa\\u0200\\u0202\\u0226\\u023a\\u0386\\u0391\\u0410',\n B: '\\x42\\u0181\\u0182\\u0243\\u0392\\u0411',\n C: '\\x43\\xc7\\u0106\\u0108\\u010a\\u010c\\u0187\\u023b\\u0426',\n D: '\\x44\\u010e\\u0110\\u0189\\u018a\\u018b\\xd0\\u0394\\u0414',\n E: '\\x45\\xc8\\xc9\\xca\\xcb\\u0112\\u0114\\u0116\\u0118\\u011a\\u018e\\u0190\\u0204\\u0206\\u0228\\u0388\\u0395\\u0415\\u042d',\n F: '\\x46\\u0191\\u03a6\\u0424',\n G: '\\x47\\u011c\\u011e\\u0120\\u0122\\u0193\\u01e4\\u01e6\\u01f4\\u0393\\u0413\\u0490',\n H: '\\x48\\u0124\\u0126\\u021e\\u0389\\u0397\\u0425',\n I: '\\x49\\xcc\\xcd\\xce\\xcf\\u0128\\u012a\\u012c\\u012e\\u0130\\u0197\\u01cf\\u0208\\u020a\\u038a\\u0399\\u03aa\\u0406\\u0418',\n J: '\\x4a\\u0134\\u0248\\u0419',\n K: '\\x4b\\u0136\\u0198\\u01e8\\u039a\\u041a',\n L: '\\x4c\\u0139\\u013b\\u013d\\u013f\\u0141\\u023d\\u039b\\u041b',\n M: '\\x4d\\u019c\\u039c\\u041c',\n N: '\\x4e\\xd1\\u0143\\u0145\\u0147\\u019d\\u01f8\\u0220\\u039d\\u041d',\n O:\n '\\x4f\\xd2\\xd3\\xd4\\xd5\\xd6\\xd8\\u014c\\u014e\\u0150\\u0186\\u019f\\u01a0\\u01d1\\u01ea\\u01ec\\u01fe\\u020c\\u020e\\u022a\\u022c\\u022e\\u0230\\u038c\\u039f\\u041e',\n P: '\\x50\\u01a4\\u03a0\\u041f',\n Q: '\\x51\\u024a',\n R: '\\x52\\u0154\\u0156\\u0158\\u0210\\u0212\\u024c\\u03a1\\u0420',\n S: '\\x53\\u015a\\u015c\\u015e\\u0160\\u0218\\u03a3\\u0421',\n T: '\\x54\\u0162\\u0164\\u0166\\u01ac\\u01ae\\u021a\\u023e\\u03a4\\u0422',\n U:\n '\\x55\\xd9\\xda\\xdb\\xdc\\u0168\\u016a\\u016c\\u016e\\u0170\\u0172\\u01af\\u01d3\\u01d5\\u01d7\\u01d9\\u01db\\u0214\\u0216\\u0244\\u0423\\u042a',\n V: '\\x56\\u01b2\\u0245\\u0412',\n W: '\\x57\\u0174\\u038f\\u03a9',\n X: '\\x58\\u03a7',\n Y: '\\x59\\xdd\\u0176\\u0178\\u01b3\\u0232\\u024e\\u038e\\u03a5\\u03ab\\u042b',\n Z: '\\x5a\\u0179\\u017b\\u017d\\u01b5\\u0224\\u0396\\u0417',\n a: '\\x61\\xe0\\xe1\\xe2\\xe3\\xe4\\xe5\\u0101\\u0103\\u0105\\u01ce\\u01df\\u01e1\\u01fb\\u0201\\u0203\\u0227\\u0250\\u03ac\\u03b1\\u0430',\n b: '\\x62\\u0180\\u0183\\u0253\\u03b2\\u0431',\n c: '\\x63\\xe7\\u0107\\u0109\\u010b\\u010d\\u0188\\u023c\\u0446',\n d: '\\x64\\u010f\\u0111\\u018c\\u0256\\u0257\\xf0\\u03b4\\u0434',\n e: '\\x65\\xe8\\xe9\\xea\\xeb\\u0113\\u0115\\u0117\\u0119\\u011b\\u01dd\\u0205\\u0207\\u0229\\u0247\\u025b\\u03ad\\u03b5\\u0435\\u044d',\n f: '\\x66\\u0192\\u03c6\\u0444',\n g: '\\x67\\u011d\\u011f\\u0121\\u0123\\u01e5\\u01e7\\u01f5\\u0260\\u03b3\\u0433\\u0491',\n h: '\\x68\\u0125\\u0127\\u021f\\u0265\\u03ae\\u03b7\\u0445',\n i: '\\x69\\xec\\xed\\xee\\xef\\u0129\\u012b\\u012d\\u012f\\u0131\\u01d0\\u0209\\u020b\\u0268\\u0390\\u03af\\u03b9\\u03ca\\u0438\\u0456',\n j: '\\x6a\\u0135\\u01f0\\u0249\\u0439',\n k: '\\x6b\\u0137\\u0199\\u01e9\\u03ba\\u043a',\n l: '\\x6c\\u013a\\u013c\\u013e\\u0140\\u0142\\u017f\\u019a\\u026b\\u03bb\\u043b',\n m: '\\x6d\\u026f\\u0271\\u03bc\\u043c',\n n: '\\x6e\\xf1\\u0144\\u0146\\u0148\\u0149\\u019e\\u01f9\\u0272\\u03bd\\u043d',\n o:\n '\\x6f\\xf2\\xf3\\xf4\\xf5\\xf6\\xf8\\u014d\\u014f\\u0151\\u01a1\\u01d2\\u01eb\\u01ed\\u01ff\\u020d\\u020f\\u022b\\u022d\\u022f\\u0231\\u0254\\u0275\\u03bf\\u03cc\\u043e',\n p: '\\x70\\u01a5\\u03c0\\u043f',\n q: '\\x71\\u024b',\n r: '\\x72\\u0155\\u0157\\u0159\\u0211\\u0213\\u024d\\u027d\\u03c1\\u0440',\n s: '\\x73\\xdf\\u015b\\u015d\\u015f\\u0161\\u0219\\u023f\\u03c2\\u03c3\\u0441',\n t: '\\x74\\u0163\\u0165\\u0167\\u01ad\\u021b\\u0288\\u03c4\\u0442',\n u:\n '\\x75\\xf9\\xfa\\xfb\\xfc\\u0169\\u016b\\u016d\\u016f\\u0171\\u0173\\u01b0\\u01d4\\u01d6\\u01d8\\u01da\\u01dc\\u0215\\u0217\\u0289\\u0443\\u044a',\n v: '\\x76\\u028b\\u028c\\u0432',\n w: '\\x77\\u0175\\u03c9\\u03ce',\n x: '\\x78\\u03c7',\n y: '\\x79\\xfd\\xff\\u0177\\u01b4\\u0233\\u024f\\u03b0\\u03c5\\u03cb\\u03cd\\u044b',\n z: '\\x7a\\u017a\\u017c\\u017e\\u01b6\\u0225\\u0240\\u03b6\\u0437',\n OE: '\\x8c\\u0152',\n oe: '\\x9c\\u0153',\n AE: '\\xc6\\u01e2\\u01fc',\n ae: '\\xe6\\u01e3\\u01fd',\n hv: '\\u0195',\n OI: '\\u01a2',\n oi: '\\u01a3',\n DZ: '\\u01c4\\u01f1',\n Dz: '\\u01c5\\u01f2',\n dz: '\\u01c6\\u01f3',\n LJ: '\\u01c7',\n Lj: '\\u01c8',\n lj: '\\u01c9',\n NJ: '\\u01ca',\n Nj: '\\u01cb',\n nj: '\\u01cc',\n OU: '\\u0222',\n ou: '\\u0223',\n TH: '\\xde',\n th: '\\xfe',\n PS: '\\u03a8',\n ps: '\\u03c8',\n Yo: '\\u0401',\n Ye: '\\u0404',\n Yi: '\\u0407',\n Zh: '\\u0416',\n Ch: '\\u0427',\n Sh: '\\u0428\\u0429',\n '': '\\u042a\\u042c\\u044c',\n Yu: '\\u042e',\n Ya: '\\u042f',\n zh: '\\u0436',\n ch: '\\u0447',\n sh: '\\u0448\\u0449',\n yu: '\\u044e',\n ya: '\\u044f',\n yo: '\\u0451',\n ye: '\\u0454',\n yi: '\\u0457',\n};\n\nlet diacriticsMap = null;\n\n/**\n * Creates a map of the diacritics.\n *\n * @ignore\n * @returns {Object} Returns the diacritics map.\n */\nfunction getDiacriticsMap() {\n if (diacriticsMap !== null) {\n return diacriticsMap;\n }\n diacriticsMap = {};\n Object.keys(diacritics).forEach(function(key) {\n const characters = diacritics[key];\n for (let index = 0; index < characters.length; index++) {\n const character = characters[index];\n diacriticsMap[character] = key;\n }\n });\n return diacriticsMap;\n}\n\n/**\n * Get the latin character from character with diacritics.\n *\n * @ignore\n * @param {string} character The character with diacritics.\n * @returns {string} Returns the character without diacritics.\n */\nexport function getLatinCharacter(character) {\n const characterWithoutDiacritic = getDiacriticsMap()[character];\n return characterWithoutDiacritic ? characterWithoutDiacritic : character;\n}\n","import { REGEXP_COMBINING_MARKS, REGEXP_NON_LATIN } from 'helper/reg_exp/const';\nimport coerceToString from 'helper/string/coerce_to_string';\nimport { getLatinCharacter } from 'helper/string/diacritics_map';\n\n/**\n * Returns the `cleanCharacter` from combining marks regular expression match.\n *\n * @ignore\n * @param {string} character The character with combining marks\n * @param {string} cleanCharacter The character without combining marks.\n * @return {string} The character without combining marks.\n */\nfunction removeCombiningMarks(character, cleanCharacter) {\n return cleanCharacter;\n}\n\n/**\n * Latinises the `subject` by removing diacritic characters.\n *\n * @function latinise\n * @static\n * @since 1.0.0\n * @memberOf Manipulate\n * @param {string} [subject=''] The string to latinise.\n * @return {string} Returns the latinised string.\n * @example\n * v.latinise('cafe\\u0301'); // or 'café'\n * // => 'cafe'\n *\n * v.latinise('août décembre');\n * // => 'aout decembre'\n *\n * v.latinise('как прекрасен этот мир');\n * // => 'kak prekrasen etot mir'\n */\nexport default function latinise(subject) {\n const subjectString = coerceToString(subject);\n if (subjectString === '') {\n return '';\n }\n return subjectString\n .replace(REGEXP_NON_LATIN, getLatinCharacter)\n .replace(REGEXP_COMBINING_MARKS, removeCombiningMarks);\n}\n","import coerceToString from 'helper/string/coerce_to_string';\nimport isString from 'query/is_string';\nimport nilDefault from 'helper/undefined/nil_default';\n\n/**\n * Translates characters or replaces substrings in `subject`.\n *\n * @function tr\n * @static\n * @since 1.3.0\n * @memberOf Manipulate\n * @param {string} [subject=''] The string to translate.\n * @param {string|Object} from The string of characters to translate from. Or an object, then the object keys are replaced with corresponding values (longest keys are tried first).\n * @param {string} to The string of characters to translate to. Ignored when `from` is an object.\n * @return {string} Returns the translated string.\n * @example\n * v.tr('hello', 'el', 'ip');\n * // => 'hippo'\n *\n * v.tr('légèreté', 'éè', 'ee');\n * // => 'legerete'\n *\n * v.tr('Yes. The fire rises.', {\n * 'Yes': 'Awesome',\n * 'fire': 'flame'\n * })\n * // => 'Awesome. The flame rises.'\n *\n * v.tr(':where is the birthplace of :what', {\n * ':where': 'Africa',\n * ':what': 'Humanity'\n * });\n * // => 'Africa is the birthplace of Humanity'\n *\n */\nexport default function tr(subject, from, to) {\n const subjectString = coerceToString(subject);\n let keys;\n let values;\n if (isString(from) && isString(to)) {\n keys = from.split('');\n values = to.split('');\n } else {\n [keys, values] = extractKeysAndValues(nilDefault(from, {}));\n }\n const keysLength = keys.length;\n if (keysLength === 0) {\n return subjectString;\n }\n let result = '';\n const valuesLength = values.length;\n for (let index = 0; index < subjectString.length; index++) {\n let isMatch = false;\n let matchValue;\n for (let keyIndex = 0; keyIndex < keysLength && keyIndex < valuesLength; keyIndex++) {\n const key = keys[keyIndex];\n if (subjectString.substr(index, key.length) === key) {\n isMatch = true;\n matchValue = values[keyIndex];\n index = index + key.length - 1;\n break;\n }\n }\n result += isMatch ? matchValue : subjectString[index];\n }\n return result;\n}\n\nfunction extractKeysAndValues(object) {\n const keys = Object.keys(object);\n const values = keys.sort(sortStringByLength).map(function(key) {\n return object[key];\n });\n return [keys, values];\n}\n\nfunction sortStringByLength(str1, str2) {\n if (str1.length === str2.length) {\n return 0;\n }\n return str1.length < str2.length ? 1 : -1;\n}\n","import clipNumber from 'helper/number/clip_number';\nimport coerceToString from 'helper/string/coerce_to_string';\nimport isNil from 'helper/object/is_nil';\nimport toInteger from 'helper/number/to_integer';\nimport toString from 'helper/string/to_string';\n\n/**\n * Checks whether `subject` includes `search` starting from `position`.\n *\n * @function includes\n * @static\n * @since 1.0.0\n * @memberOf Query\n * @param {string} [subject=''] The string where to search.\n * @param {string} search The string to search.\n * @param {number} [position=0] The position to start searching.\n * @return {boolean} Returns `true` if `subject` includes `search` or `false` otherwise.\n * @example\n * v.includes('starship', 'star');\n * // => true\n *\n * v.includes('galaxy', 'g', 1);\n * // => false\n */\nexport default function includes(subject, search, position) {\n const subjectString = coerceToString(subject);\n const searchString = toString(search);\n if (searchString === null) {\n return false;\n }\n if (searchString === '') {\n return true;\n }\n position = isNil(position) ? 0 : clipNumber(toInteger(position), 0, subjectString.length);\n return subjectString.indexOf(searchString, position) !== -1;\n}\n","import coerceToString from 'helper/string/coerce_to_string';\nimport includes from 'query/includes';\nimport isNil from 'helper/object/is_nil';\nimport { REGEXP_TRIM_LEFT } from 'helper/reg_exp/const';\nimport toString from 'helper/string/to_string';\n\nconst reduce = Array.prototype.reduce;\n\n/**\n * Removes whitespaces from the left side of the `subject`.\n *\n * @function trimLeft\n * @static\n * @since 1.0.0\n * @memberOf Manipulate\n * @param {string} [subject=''] The string to trim.\n * @param {string} [whitespace=whitespace] The whitespace characters to trim. List all characters that you want to be stripped.\n * @return {string} Returns the trimmed string.\n * @example\n * v.trimLeft(' Starship Troopers');\n * // => 'Starship Troopers'\n *\n * v.trimLeft('***Mobile Infantry', '*');\n * // => 'Mobile Infantry'\n */\nexport default function trimLeft(subject, whitespace) {\n const subjectString = coerceToString(subject);\n if (whitespace === '' || subjectString === '') {\n return subjectString;\n }\n const whitespaceString = toString(whitespace);\n if (isNil(whitespaceString)) {\n return subjectString.replace(REGEXP_TRIM_LEFT, '');\n }\n let matchWhitespace = true;\n return reduce.call(\n subjectString,\n function(trimmed, character) {\n if (matchWhitespace && includes(whitespaceString, character)) {\n return trimmed;\n }\n matchWhitespace = false;\n return trimmed + character;\n },\n ''\n );\n}\n","import coerceToString from 'helper/string/coerce_to_string';\nimport includes from 'query/includes';\nimport isNil from 'helper/object/is_nil';\nimport { REGEXP_TRIM_RIGHT } from 'helper/reg_exp/const';\nimport toString from 'helper/string/to_string';\n\nconst reduceRight = Array.prototype.reduceRight;\n\n/**\n * Removes whitespaces from the right side of the `subject`.\n *\n * @function trimRight\n * @static\n * @since 1.0.0\n * @memberOf Manipulate\n * @param {string} [subject=''] The string to trim.\n * @param {string} [whitespace=whitespace] The whitespace characters to trim. List all characters that you want to be stripped.\n * @return {string} Returns the trimmed string.\n * @example\n * v.trimRight('the fire rises ');\n * // => 'the fire rises'\n *\n * v.trimRight('do you feel in charge?!!!', '!');\n * // => 'do you feel in charge?'\n */\nexport default function trimRight(subject, whitespace) {\n const subjectString = coerceToString(subject);\n if (whitespace === '' || subjectString === '') {\n return subjectString;\n }\n const whitespaceString = toString(whitespace);\n if (isNil(whitespaceString)) {\n return subjectString.replace(REGEXP_TRIM_RIGHT, '');\n }\n let matchWhitespace = true;\n return reduceRight.call(\n subjectString,\n function(trimmed, character) {\n if (matchWhitespace && includes(whitespaceString, character)) {\n return trimmed;\n }\n matchWhitespace = false;\n return character + trimmed;\n },\n ''\n );\n}\n","import coerceToBoolean from 'helper/boolean/coerce_to_boolean';\nimport coerceToNumber from 'helper/number/coerce_to_number';\nimport coerceToString from 'helper/string/coerce_to_string';\n\nconst OPTION_WIDTH = 'width';\nconst OPTION_NEW_LINE = 'newLine';\nconst OPTION_INDENT = 'indent';\nconst OPTION_CUT = 'cut';\n\n/**\n * Wraps `subject` to a given number of characters using a string break character.\n *\n * @function wordWrap\n * @static\n * @since 1.0.0\n * @memberOf Manipulate\n * @param {string} [subject=''] The string to wrap.\n * @param {Object} [options={}] The wrap options.\n * @param {number} [options.width=75] The number of characters at which to wrap.\n * @param {string} [options.newLine='\\n'] The string to add at the end of line.\n * @param {string} [options.indent=''] The string to intend the line.\n * @param {boolean} [options.cut=false] When `false` (default) does not split the word even if word length is bigger than `width`.sprintf()
,\n * with the only difference that accepts the formatting arguments in an array `values`.