pax_global_header00006660000000000000000000000064137175162300014517gustar00rootroot0000000000000052 comment=c7a857352a79d7a50e8f535a6081ab518577ce91 d3-format-1.4.5/000077500000000000000000000000001371751623000133225ustar00rootroot00000000000000d3-format-1.4.5/.eslintrc.json000066400000000000000000000003421371751623000161150ustar00rootroot00000000000000{ "extends": "eslint:recommended", "parserOptions": { "sourceType": "module", "ecmaVersion": 8 }, "env": { "es6": true, "node": true, "browser": true }, "rules": { "no-cond-assign": 0 } } d3-format-1.4.5/.gitignore000066400000000000000000000000771371751623000153160ustar00rootroot00000000000000*.sublime-workspace .DS_Store dist/ node_modules npm-debug.log d3-format-1.4.5/LICENSE000066400000000000000000000027031371751623000143310ustar00rootroot00000000000000Copyright 2010-2015 Mike Bostock All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. d3-format-1.4.5/README.md000066400000000000000000000372131371751623000146070ustar00rootroot00000000000000# d3-format Ever noticed how sometimes JavaScript doesn’t display numbers the way you expect? Like, you tried to print tenths with a simple loop: ```js for (var i = 0; i < 10; i++) { console.log(0.1 * i); } ``` And you got this: ```js 0 0.1 0.2 0.30000000000000004 0.4 0.5 0.6000000000000001 0.7000000000000001 0.8 0.9 ``` Welcome to [binary floating point](https://en.wikipedia.org/wiki/Double-precision_floating-point_format)! ಠ_ಠ Yet rounding error is not the only reason to customize number formatting. A table of numbers should be formatted consistently for comparison; above, 0.0 would be better than 0. Large numbers should have grouped digits (e.g., 42,000) or be in scientific or metric notation (4.2e+4, 42k). Currencies should have fixed precision ($3.50). Reported numerical results should be rounded to significant digits (4021 becomes 4000). Number formats should appropriate to the reader’s locale (42.000,00 or 42,000.00). The list goes on. Formatting numbers for human consumption is the purpose of d3-format, which is modeled after Python 3’s [format specification mini-language](https://docs.python.org/3/library/string.html#format-specification-mini-language) ([PEP 3101](https://www.python.org/dev/peps/pep-3101/)). Revisiting the example above: ```js var f = d3.format(".1f"); for (var i = 0; i < 10; i++) { console.log(f(0.1 * i)); } ``` Now you get this: ```js 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 ``` But d3-format is much more than an alias for [number.toFixed](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed)! A few more examples: ```js d3.format(".0%")(0.123); // rounded percentage, "12%" d3.format("($.2f")(-3.5); // localized fixed-point currency, "(£3.50)" d3.format("+20")(42); // space-filled and signed, " +42" d3.format(".^20")(42); // dot-filled and centered, ".........42........." d3.format(".2s")(42e6); // SI-prefix with two significant digits, "42M" d3.format("#x")(48879); // prefixed lowercase hexadecimal, "0xbeef" d3.format(",.2r")(4223); // grouped thousands with two significant digits, "4,200" ``` See [*locale*.format](#locale_format) for a detailed specification, and try running [d3.formatSpecifier](#formatSpecifier) on the above formats to decode their meaning. ## Installing If you use NPM, `npm install d3-format`. Otherwise, download the [latest release](https://github.com/d3/d3-format/releases/latest). You can also load directly from [d3js.org](https://d3js.org), either as a [standalone library](https://d3js.org/d3-format.v1.min.js) or as part of [D3](https://github.com/d3/d3). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3` global is exported: ```html ``` Locale files are published to npm and can be loaded using [d3.json](https://github.com/d3/d3-request/blob/master/README.md#json). For example, to set Russian as the default locale: ```js d3.json("https://cdn.jsdelivr.net/npm/d3-format@1/locale/ru-RU.json", function(error, locale) { if (error) throw error; d3.formatDefaultLocale(locale); var format = d3.format("$,"); console.log(format(1234.56)); // 1 234,56 руб. }); ``` [Try d3-format in your browser.](https://observablehq.com/@d3/d3-format) ## API Reference # d3.format(specifier) [<>](https://github.com/d3/d3-format/blob/master/src/defaultLocale.js#L4 "Source") An alias for [*locale*.format](#locale_format) on the [default locale](#formatDefaultLocale). # d3.formatPrefix(specifier, value) [<>](https://github.com/d3/d3-format/blob/master/src/defaultLocale.js#L5 "Source") An alias for [*locale*.formatPrefix](#locale_formatPrefix) on the [default locale](#formatDefaultLocale). # locale.format(specifier) [<>](https://github.com/d3/d3-format/blob/master/src/locale.js#L18 "Source") Returns a new format function for the given string *specifier*. The returned function takes a number as the only argument, and returns a string representing the formatted number. The general form of a specifier is: ``` [​[fill]align][sign][symbol][0][width][,][.precision][~][type] ``` The *fill* can be any character. The presence of a fill character is signaled by the *align* character following it, which must be one of the following: * `>` - Forces the field to be right-aligned within the available space. (Default behavior). * `<` - Forces the field to be left-aligned within the available space. * `^` - Forces the field to be centered within the available space. * `=` - like `>`, but with any sign and symbol to the left of any padding. The *sign* can be: * `-` - nothing for zero or positive and a minus sign for negative. (Default behavior.) * `+` - a plus sign for zero or positive and a minus sign for negative. * `(` - nothing for zero or positive and parentheses for negative. * ` ` (space) - a space for zero or positive and a minus sign for negative. The *symbol* can be: * `$` - apply currency symbols per the locale definition. * `#` - for binary, octal, or hexadecimal notation, prefix by `0b`, `0o`, or `0x`, respectively. The *zero* (`0`) option enables zero-padding; this implicitly sets *fill* to `0` and *align* to `=`. The *width* defines the minimum field width; if not specified, then the width will be determined by the content. The *comma* (`,`) option enables the use of a group separator, such as a comma for thousands. Depending on the *type*, the *precision* either indicates the number of digits that follow the decimal point (types `f` and `%`), or the number of significant digits (types `​`, `e`, `g`, `r`, `s` and `p`). If the precision is not specified, it defaults to 6 for all types except `​` (none), which defaults to 12. Precision is ignored for integer formats (types `b`, `o`, `d`, `x`, `X` and `c`). See [precisionFixed](#precisionFixed) and [precisionRound](#precisionRound) for help picking an appropriate precision. The `~` option trims insignificant trailing zeros across all format types. This is most commonly used in conjunction with types `r`, `e`, `s` and `%`. For example: ```js d3.format("s")(1500); // "1.50000k" d3.format("~s")(1500); // "1.5k" ``` The available *type* values are: * `e` - exponent notation. * `f` - fixed point notation. * `g` - either decimal or exponent notation, rounded to significant digits. * `r` - decimal notation, rounded to significant digits. * `s` - decimal notation with an [SI prefix](#locale_formatPrefix), rounded to significant digits. * `%` - multiply by 100, and then decimal notation with a percent sign. * `p` - multiply by 100, round to significant digits, and then decimal notation with a percent sign. * `b` - binary notation, rounded to integer. * `o` - octal notation, rounded to integer. * `d` - decimal notation, rounded to integer. * `x` - hexadecimal notation, using lower-case letters, rounded to integer. * `X` - hexadecimal notation, using upper-case letters, rounded to integer. * `c` - converts the integer to the corresponding unicode character before printing. The type `​` (none) is also supported as shorthand for `~g` (with a default precision of 12 instead of 6), and the type `n` is shorthand for `,g`. For the `g`, `n` and `​` (none) types, decimal notation is used if the resulting string would have *precision* or fewer digits; otherwise, exponent notation is used. For example: ```js d3.format(".2")(42); // "42" d3.format(".2")(4.2); // "4.2" d3.format(".1")(42); // "4e+1" d3.format(".1")(4.2); // "4" ``` # locale.formatPrefix(specifier, value) [<>](https://github.com/d3/d3-format/blob/master/src/locale.js#L127 "Source") Equivalent to [*locale*.format](#locale_format), except the returned function will convert values to the units of the appropriate [SI prefix](https://en.wikipedia.org/wiki/Metric_prefix#List_of_SI_prefixes) for the specified numeric reference *value* before formatting in fixed point notation. The following prefixes are supported: * `y` - yocto, 10⁻²⁴ * `z` - zepto, 10⁻²¹ * `a` - atto, 10⁻¹⁸ * `f` - femto, 10⁻¹⁵ * `p` - pico, 10⁻¹² * `n` - nano, 10⁻⁹ * `µ` - micro, 10⁻⁶ * `m` - milli, 10⁻³ * `​` (none) - 10⁰ * `k` - kilo, 10³ * `M` - mega, 10⁶ * `G` - giga, 10⁹ * `T` - tera, 10¹² * `P` - peta, 10¹⁵ * `E` - exa, 10¹⁸ * `Z` - zetta, 10²¹ * `Y` - yotta, 10²⁴ Unlike [*locale*.format](#locale_format) with the `s` format type, this method returns a formatter with a consistent SI prefix, rather than computing the prefix dynamically for each number. In addition, the *precision* for the given *specifier* represents the number of digits past the decimal point (as with `f` fixed point notation), not the number of significant digits. For example: ```js var f = d3.formatPrefix(",.0", 1e-6); f(0.00042); // "420µ" f(0.0042); // "4,200µ" ``` This method is useful when formatting multiple numbers in the same units for easy comparison. See [precisionPrefix](#precisionPrefix) for help picking an appropriate precision, and [bl.ocks.org/9764126](http://bl.ocks.org/mbostock/9764126) for an example. # d3.formatSpecifier(specifier) [<>](https://github.com/d3/d3-format/blob/master/src/formatSpecifier.js "Source") Parses the specified *specifier*, returning an object with exposed fields that correspond to the [format specification mini-language](#locale_format) and a toString method that reconstructs the specifier. For example, `formatSpecifier("s")` returns: ```js FormatSpecifier { "fill": " ", "align": ">", "sign": "-", "symbol": "", "zero": false, "width": undefined, "comma": false, "precision": undefined, "trim": false, "type": "s" } ``` This method is useful for understanding how format specifiers are parsed and for deriving new specifiers. For example, you might compute an appropriate precision based on the numbers you want to format using [precisionFixed](#precisionFixed) and then create a new format: ```js var s = d3.formatSpecifier("f"); s.precision = d3.precisionFixed(0.01); var f = d3.format(s); f(42); // "42.00"; ``` # new d3.FormatSpecifier(specifier) [<>](https://github.com/d3/d3-format/blob/master/src/formatSpecifier.js "Source") Given the specified *specifier* object, returning an object with exposed fields that correspond to the [format specification mini-language](#locale_format) and a toString method that reconstructs the specifier. For example, `new FormatSpecifier({type: "s"})` returns: ```js FormatSpecifier { "fill": " ", "align": ">", "sign": "-", "symbol": "", "zero": false, "width": undefined, "comma": false, "precision": undefined, "trim": false, "type": "s" } ``` # d3.precisionFixed(step) [<>](https://github.com/d3/d3-format/blob/master/src/precisionFixed.js "Source") Returns a suggested decimal precision for fixed point notation given the specified numeric *step* value. The *step* represents the minimum absolute difference between values that will be formatted. (This assumes that the values to be formatted are also multiples of *step*.) For example, given the numbers 1, 1.5, and 2, the *step* should be 0.5 and the suggested precision is 1: ```js var p = d3.precisionFixed(0.5), f = d3.format("." + p + "f"); f(1); // "1.0" f(1.5); // "1.5" f(2); // "2.0" ``` Whereas for the numbers 1, 2 and 3, the *step* should be 1 and the suggested precision is 0: ```js var p = d3.precisionFixed(1), f = d3.format("." + p + "f"); f(1); // "1" f(2); // "2" f(3); // "3" ``` Note: for the `%` format type, subtract two: ```js var p = Math.max(0, d3.precisionFixed(0.05) - 2), f = d3.format("." + p + "%"); f(0.45); // "45%" f(0.50); // "50%" f(0.55); // "55%" ``` # d3.precisionPrefix(step, value) [<>](https://github.com/d3/d3-format/blob/master/src/precisionPrefix.js "Source") Returns a suggested decimal precision for use with [*locale*.formatPrefix](#locale_formatPrefix) given the specified numeric *step* and reference *value*. The *step* represents the minimum absolute difference between values that will be formatted, and *value* determines which SI prefix will be used. (This assumes that the values to be formatted are also multiples of *step*.) For example, given the numbers 1.1e6, 1.2e6, and 1.3e6, the *step* should be 1e5, the *value* could be 1.3e6, and the suggested precision is 1: ```js var p = d3.precisionPrefix(1e5, 1.3e6), f = d3.formatPrefix("." + p, 1.3e6); f(1.1e6); // "1.1M" f(1.2e6); // "1.2M" f(1.3e6); // "1.3M" ``` # d3.precisionRound(step, max) [<>](https://github.com/d3/d3-format/blob/master/src/precisionRound.js "Source") Returns a suggested decimal precision for format types that round to significant digits given the specified numeric *step* and *max* values. The *step* represents the minimum absolute difference between values that will be formatted, and the *max* represents the largest absolute value that will be formatted. (This assumes that the values to be formatted are also multiples of *step*.) For example, given the numbers 0.99, 1.0, and 1.01, the *step* should be 0.01, the *max* should be 1.01, and the suggested precision is 3: ```js var p = d3.precisionRound(0.01, 1.01), f = d3.format("." + p + "r"); f(0.99); // "0.990" f(1.0); // "1.00" f(1.01); // "1.01" ``` Whereas for the numbers 0.9, 1.0, and 1.1, the *step* should be 0.1, the *max* should be 1.1, and the suggested precision is 2: ```js var p = d3.precisionRound(0.1, 1.1), f = d3.format("." + p + "r"); f(0.9); // "0.90" f(1.0); // "1.0" f(1.1); // "1.1" ``` Note: for the `e` format type, subtract one: ```js var p = Math.max(0, d3.precisionRound(0.01, 1.01) - 1), f = d3.format("." + p + "e"); f(0.01); // "1.00e-2" f(1.01); // "1.01e+0" ``` ### Locales # d3.formatLocale(definition) [<>](https://github.com/d3/d3-format/blob/master/src/locale.js "Source") Returns a *locale* object for the specified *definition* with [*locale*.format](#locale_format) and [*locale*.formatPrefix](#locale_formatPrefix) methods. The *definition* must include the following properties: * `decimal` - the decimal point (e.g., `"."`). * `thousands` - the group separator (e.g., `","`). * `grouping` - the array of group sizes (e.g., `[3]`), cycled as needed. * `currency` - the currency prefix and suffix (e.g., `["$", ""]`). * `numerals` - optional; an array of ten strings to replace the numerals 0-9. * `percent` - optional; the percent sign (defaults to `"%"`). * `minus` - optional; the minus sign (defaults to hyphen-minus, `"-"`). * `nan` - optional; the not-a-number value (defaults `"NaN"`). Note that the *thousands* property is a misnomer, as the grouping definition allows groups other than thousands. # d3.formatDefaultLocale(definition) [<>](https://github.com/d3/d3-format/blob/master/src/defaultLocale.js "Source") Equivalent to [d3.formatLocale](#formatLocale), except it also redefines [d3.format](#format) and [d3.formatPrefix](#formatPrefix) to the new locale’s [*locale*.format](#locale_format) and [*locale*.formatPrefix](#locale_formatPrefix). If you do not set a default locale, it defaults to [U.S. English](https://github.com/d3/d3-format/blob/master/locale/en-US.json). d3-format-1.4.5/d3-format.sublime-project000066400000000000000000000005241371751623000201450ustar00rootroot00000000000000{ "folders": [ { "path": ".", "file_exclude_patterns": ["*.sublime-workspace"], "folder_exclude_patterns": ["dist"] } ], "build_systems": [ { "name": "yarn test", "cmd": ["yarn", "test"], "file_regex": "\\((...*?):([0-9]*):([0-9]*)\\)", "working_dir": "$project_path" } ] } d3-format-1.4.5/locale/000077500000000000000000000000001371751623000145615ustar00rootroot00000000000000d3-format-1.4.5/locale/ar-001.json000066400000000000000000000003231371751623000163520ustar00rootroot00000000000000{ "decimal": "\u066b", "thousands": "\u066c", "grouping": [3], "currency": ["", ""], "numerals" : ["\u0660", "\u0661", "\u0662", "\u0663", "\u0664", "\u0665", "\u0666", "\u0667", "\u0668", "\u0669"] } d3-format-1.4.5/locale/ar-AE.json000066400000000000000000000003541371751623000163430ustar00rootroot00000000000000{ "decimal": "\u066b", "thousands": "\u066c", "grouping": [3], "currency": ["", " \u062f\u002e\u0625\u002e"], "numerals" : ["\u0660", "\u0661", "\u0662", "\u0663", "\u0664", "\u0665", "\u0666", "\u0667", "\u0668", "\u0669"] } d3-format-1.4.5/locale/ar-BH.json000066400000000000000000000003541371751623000163470ustar00rootroot00000000000000{ "decimal": "\u066b", "thousands": "\u066c", "grouping": [3], "currency": ["", " \u062f\u002e\u0628\u002e"], "numerals" : ["\u0660", "\u0661", "\u0662", "\u0663", "\u0664", "\u0665", "\u0666", "\u0667", "\u0668", "\u0669"] } d3-format-1.4.5/locale/ar-DJ.json000066400000000000000000000003541371751623000163530ustar00rootroot00000000000000{ "decimal": "\u066b", "thousands": "\u066c", "grouping": [3], "currency": ["\u200f\u0046\u0064\u006a ", ""], "numerals" : ["\u0660", "\u0661", "\u0662", "\u0663", "\u0664", "\u0665", "\u0666", "\u0667", "\u0668", "\u0669"] } d3-format-1.4.5/locale/ar-DZ.json000066400000000000000000000001671371751623000163750ustar00rootroot00000000000000{ "decimal": "\u002c", "thousands": "\u002e", "grouping": [3], "currency": ["\u062f\u002e\u062c\u002e ", ""] } d3-format-1.4.5/locale/ar-EG.json000066400000000000000000000003541371751623000163510ustar00rootroot00000000000000{ "decimal": "\u066b", "thousands": "\u066c", "grouping": [3], "currency": ["", " \u062c\u002e\u0645\u002e"], "numerals" : ["\u0660", "\u0661", "\u0662", "\u0663", "\u0664", "\u0665", "\u0666", "\u0667", "\u0668", "\u0669"] } d3-format-1.4.5/locale/ar-EH.json000066400000000000000000000001671371751623000163540ustar00rootroot00000000000000{ "decimal": "\u002e", "thousands": "\u002c", "grouping": [3], "currency": ["\u062f\u002e\u0645\u002e ", ""] } d3-format-1.4.5/locale/ar-ER.json000066400000000000000000000003461371751623000163650ustar00rootroot00000000000000{ "decimal": "\u066b", "thousands": "\u066c", "grouping": [3], "currency": ["\u004e\u0066\u006b ", ""], "numerals" : ["\u0660", "\u0661", "\u0662", "\u0663", "\u0664", "\u0665", "\u0666", "\u0667", "\u0668", "\u0669"] } d3-format-1.4.5/locale/ar-IL.json000066400000000000000000000003321371751623000163560ustar00rootroot00000000000000{ "decimal": "\u066b", "thousands": "\u066c", "grouping": [3], "currency": ["\u20aa ", ""], "numerals" : ["\u0660", "\u0661", "\u0662", "\u0663", "\u0664", "\u0665", "\u0666", "\u0667", "\u0668", "\u0669"] } d3-format-1.4.5/locale/ar-IQ.json000066400000000000000000000003541371751623000163670ustar00rootroot00000000000000{ "decimal": "\u066b", "thousands": "\u066c", "grouping": [3], "currency": ["", " \u062f\u002e\u0639\u002e"], "numerals" : ["\u0660", "\u0661", "\u0662", "\u0663", "\u0664", "\u0665", "\u0666", "\u0667", "\u0668", "\u0669"] } d3-format-1.4.5/locale/ar-JO.json000066400000000000000000000003541371751623000163660ustar00rootroot00000000000000{ "decimal": "\u066b", "thousands": "\u066c", "grouping": [3], "currency": ["", " \u062f\u002e\u0623\u002e"], "numerals" : ["\u0660", "\u0661", "\u0662", "\u0663", "\u0664", "\u0665", "\u0666", "\u0667", "\u0668", "\u0669"] } d3-format-1.4.5/locale/ar-KM.json000066400000000000000000000003701371751623000163630ustar00rootroot00000000000000{ "decimal": "\u066b", "thousands": "\u066c", "grouping": [3], "currency": ["", " \u0641\u002e\u062c\u002e\u0642\u002e"], "numerals" : ["\u0660", "\u0661", "\u0662", "\u0663", "\u0664", "\u0665", "\u0666", "\u0667", "\u0668", "\u0669"] } d3-format-1.4.5/locale/ar-KW.json000066400000000000000000000003541371751623000163770ustar00rootroot00000000000000{ "decimal": "\u066b", "thousands": "\u066c", "grouping": [3], "currency": ["", " \u062f\u002e\u0643\u002e"], "numerals" : ["\u0660", "\u0661", "\u0662", "\u0663", "\u0664", "\u0665", "\u0666", "\u0667", "\u0668", "\u0669"] } d3-format-1.4.5/locale/ar-LB.json000066400000000000000000000003541371751623000163530ustar00rootroot00000000000000{ "decimal": "\u066b", "thousands": "\u066c", "grouping": [3], "currency": ["", " \u0644\u002e\u0644\u002e"], "numerals" : ["\u0660", "\u0661", "\u0662", "\u0663", "\u0664", "\u0665", "\u0666", "\u0667", "\u0668", "\u0669"] } d3-format-1.4.5/locale/ar-LY.json000066400000000000000000000001671371751623000164040ustar00rootroot00000000000000{ "decimal": "\u002c", "thousands": "\u002e", "grouping": [3], "currency": ["\u062f\u002e\u0644\u002e ", ""] } d3-format-1.4.5/locale/ar-MA.json000066400000000000000000000001671371751623000163550ustar00rootroot00000000000000{ "decimal": "\u002c", "thousands": "\u002e", "grouping": [3], "currency": ["\u062f\u002e\u0645\u002e ", ""] } d3-format-1.4.5/locale/ar-MR.json000066400000000000000000000003541371751623000163740ustar00rootroot00000000000000{ "decimal": "\u066b", "thousands": "\u066c", "grouping": [3], "currency": ["", " \u0623\u002e\u0645\u002e"], "numerals" : ["\u0660", "\u0661", "\u0662", "\u0663", "\u0664", "\u0665", "\u0666", "\u0667", "\u0668", "\u0669"] } d3-format-1.4.5/locale/ar-OM.json000066400000000000000000000003541371751623000163710ustar00rootroot00000000000000{ "decimal": "\u066b", "thousands": "\u066c", "grouping": [3], "currency": ["", " \u0631\u002e\u0639\u002e"], "numerals" : ["\u0660", "\u0661", "\u0662", "\u0663", "\u0664", "\u0665", "\u0666", "\u0667", "\u0668", "\u0669"] } d3-format-1.4.5/locale/ar-PS.json000066400000000000000000000003321371751623000163740ustar00rootroot00000000000000{ "decimal": "\u066b", "thousands": "\u066c", "grouping": [3], "currency": ["\u20aa ", ""], "numerals" : ["\u0660", "\u0661", "\u0662", "\u0663", "\u0664", "\u0665", "\u0666", "\u0667", "\u0668", "\u0669"] } d3-format-1.4.5/locale/ar-QA.json000066400000000000000000000003541371751623000163570ustar00rootroot00000000000000{ "decimal": "\u066b", "thousands": "\u066c", "grouping": [3], "currency": ["", " \u0631\u002e\u0642\u002e"], "numerals" : ["\u0660", "\u0661", "\u0662", "\u0663", "\u0664", "\u0665", "\u0666", "\u0667", "\u0668", "\u0669"] } d3-format-1.4.5/locale/ar-SA.json000066400000000000000000000003541371751623000163610ustar00rootroot00000000000000{ "decimal": "\u066b", "thousands": "\u066c", "grouping": [3], "currency": ["", " \u0631\u002e\u0633\u002e"], "numerals" : ["\u0660", "\u0661", "\u0662", "\u0663", "\u0664", "\u0665", "\u0666", "\u0667", "\u0668", "\u0669"] } d3-format-1.4.5/locale/ar-SD.json000066400000000000000000000003541371751623000163640ustar00rootroot00000000000000{ "decimal": "\u066b", "thousands": "\u066c", "grouping": [3], "currency": ["", " \u062c\u002e\u0633\u002e"], "numerals" : ["\u0660", "\u0661", "\u0662", "\u0663", "\u0664", "\u0665", "\u0666", "\u0667", "\u0668", "\u0669"] } d3-format-1.4.5/locale/ar-SO.json000066400000000000000000000003401371751623000163720ustar00rootroot00000000000000{ "decimal": "\u066b", "thousands": "\u066c", "grouping": [3], "currency": ["\u200f\u0053 ", ""], "numerals" : ["\u0660", "\u0661", "\u0662", "\u0663", "\u0664", "\u0665", "\u0666", "\u0667", "\u0668", "\u0669"] } d3-format-1.4.5/locale/ar-SS.json000066400000000000000000000003321371751623000163770ustar00rootroot00000000000000{ "decimal": "\u066b", "thousands": "\u066c", "grouping": [3], "currency": ["\u00a3 ", ""], "numerals" : ["\u0660", "\u0661", "\u0662", "\u0663", "\u0664", "\u0665", "\u0666", "\u0667", "\u0668", "\u0669"] } d3-format-1.4.5/locale/ar-SY.json000066400000000000000000000003541371751623000164110ustar00rootroot00000000000000{ "decimal": "\u066b", "thousands": "\u066c", "grouping": [3], "currency": ["", " \u0644\u002e\u0633\u002e"], "numerals" : ["\u0660", "\u0661", "\u0662", "\u0663", "\u0664", "\u0665", "\u0666", "\u0667", "\u0668", "\u0669"] } d3-format-1.4.5/locale/ar-TD.json000066400000000000000000000003621371751623000163640ustar00rootroot00000000000000{ "decimal": "\u066b", "thousands": "\u066c", "grouping": [3], "currency": ["\u200f\u0046\u0043\u0046\u0041 ", ""], "numerals" : ["\u0660", "\u0661", "\u0662", "\u0663", "\u0664", "\u0665", "\u0666", "\u0667", "\u0668", "\u0669"] } d3-format-1.4.5/locale/ar-TN.json000066400000000000000000000001671371751623000164010ustar00rootroot00000000000000{ "decimal": "\u002c", "thousands": "\u002e", "grouping": [3], "currency": ["\u062f\u002e\u062a\u002e ", ""] } d3-format-1.4.5/locale/ar-YE.json000066400000000000000000000003541371751623000163730ustar00rootroot00000000000000{ "decimal": "\u066b", "thousands": "\u066c", "grouping": [3], "currency": ["", " \u0631\u002e\u0649\u002e"], "numerals" : ["\u0660", "\u0661", "\u0662", "\u0663", "\u0664", "\u0665", "\u0666", "\u0667", "\u0668", "\u0669"] } d3-format-1.4.5/locale/ca-ES.json000066400000000000000000000001351371751623000163430ustar00rootroot00000000000000{ "decimal": ",", "thousands": ".", "grouping": [3], "currency": ["", "\u00a0€"] } d3-format-1.4.5/locale/cs-CZ.json000066400000000000000000000001421371751623000163700ustar00rootroot00000000000000{ "decimal": ",", "thousands": "\u00a0", "grouping": [3], "currency": ["", "\u00a0Kč"] } d3-format-1.4.5/locale/de-CH.json000066400000000000000000000001351371751623000163330ustar00rootroot00000000000000{ "decimal": ",", "thousands": "'", "grouping": [3], "currency": ["", "\u00a0CHF"] } d3-format-1.4.5/locale/de-DE.json000066400000000000000000000001351371751623000163310ustar00rootroot00000000000000{ "decimal": ",", "thousands": ".", "grouping": [3], "currency": ["", "\u00a0€"] } d3-format-1.4.5/locale/en-CA.json000066400000000000000000000001251371751623000163350ustar00rootroot00000000000000{ "decimal": ".", "thousands": ",", "grouping": [3], "currency": ["$", ""] } d3-format-1.4.5/locale/en-GB.json000066400000000000000000000001261371751623000163430ustar00rootroot00000000000000{ "decimal": ".", "thousands": ",", "grouping": [3], "currency": ["£", ""] } d3-format-1.4.5/locale/en-IE.json000066400000000000000000000001271371751623000163510ustar00rootroot00000000000000{ "decimal": ".", "thousands": ",", "grouping": [3], "currency": ["€", ""] } d3-format-1.4.5/locale/en-IN.json000066400000000000000000000001621371751623000163610ustar00rootroot00000000000000{ "decimal": ".", "thousands": ",", "grouping": [3, 2, 2, 2, 2, 2, 2, 2, 2, 2], "currency": ["₹", ""] } d3-format-1.4.5/locale/en-US.json000066400000000000000000000001251371751623000164010ustar00rootroot00000000000000{ "decimal": ".", "thousands": ",", "grouping": [3], "currency": ["$", ""] } d3-format-1.4.5/locale/es-BO.json000066400000000000000000000001641371751623000163620ustar00rootroot00000000000000{ "decimal": ",", "thousands": ".", "grouping": [3], "currency": ["Bs\u00a0", ""], "percent": "\u202f%" } d3-format-1.4.5/locale/es-ES.json000066400000000000000000000001351371751623000163670ustar00rootroot00000000000000{ "decimal": ",", "thousands": ".", "grouping": [3], "currency": ["", "\u00a0€"] } d3-format-1.4.5/locale/es-MX.json000066400000000000000000000001251371751623000164030ustar00rootroot00000000000000{ "decimal": ".", "thousands": ",", "grouping": [3], "currency": ["$", ""] } d3-format-1.4.5/locale/fi-FI.json000066400000000000000000000001421371751623000163430ustar00rootroot00000000000000{ "decimal": ",", "thousands": "\u00a0", "grouping": [3], "currency": ["", "\u00a0€"] } d3-format-1.4.5/locale/fr-CA.json000066400000000000000000000001321371751623000163400ustar00rootroot00000000000000{ "decimal": ",", "thousands": "\u00a0", "grouping": [3], "currency": ["", "$"] } d3-format-1.4.5/locale/fr-FR.json000066400000000000000000000001721371751623000163700ustar00rootroot00000000000000{ "decimal": ",", "thousands": "\u00a0", "grouping": [3], "currency": ["", "\u00a0€"], "percent": "\u202f%" } d3-format-1.4.5/locale/he-IL.json000066400000000000000000000001271371751623000163520ustar00rootroot00000000000000{ "decimal": ".", "thousands": ",", "grouping": [3], "currency": ["₪", ""] } d3-format-1.4.5/locale/hu-HU.json000066400000000000000000000001411371751623000163760ustar00rootroot00000000000000{ "decimal": ",", "thousands": "\u00a0", "grouping": [3], "currency": ["", "\u00a0Ft"] } d3-format-1.4.5/locale/it-IT.json000066400000000000000000000001271371751623000164020ustar00rootroot00000000000000{ "decimal": ",", "thousands": ".", "grouping": [3], "currency": ["€", ""] } d3-format-1.4.5/locale/ja-JP.json000066400000000000000000000001271371751623000163550ustar00rootroot00000000000000{ "decimal": ".", "thousands": ",", "grouping": [3], "currency": ["", "円"] } d3-format-1.4.5/locale/ko-KR.json000066400000000000000000000001271371751623000163770ustar00rootroot00000000000000{ "decimal": ".", "thousands": ",", "grouping": [3], "currency": ["₩", ""] } d3-format-1.4.5/locale/mk-MK.json000066400000000000000000000001411371751623000163640ustar00rootroot00000000000000{ "decimal": ",", "thousands": ".", "grouping": [3], "currency": ["", "\u00a0ден."] } d3-format-1.4.5/locale/nl-NL.json000066400000000000000000000001351371751623000163730ustar00rootroot00000000000000{ "decimal": ",", "thousands": ".", "grouping": [3], "currency": ["€\u00a0", ""] } d3-format-1.4.5/locale/pl-PL.json000066400000000000000000000001271371751623000164000ustar00rootroot00000000000000{ "decimal": ",", "thousands": ".", "grouping": [3], "currency": ["", "zł"] } d3-format-1.4.5/locale/pt-BR.json000066400000000000000000000001261371751623000163770ustar00rootroot00000000000000{ "decimal": ",", "thousands": ".", "grouping": [3], "currency": ["R$", ""] } d3-format-1.4.5/locale/ru-RU.json000066400000000000000000000001461371751623000164270ustar00rootroot00000000000000{ "decimal": ",", "thousands": "\u00a0", "grouping": [3], "currency": ["", "\u00a0руб."] } d3-format-1.4.5/locale/sv-SE.json000066400000000000000000000001341371751623000164070ustar00rootroot00000000000000{ "decimal": ",", "thousands": "\u00a0", "grouping": [3], "currency": ["", " kr"] } d3-format-1.4.5/locale/uk-UA.json000066400000000000000000000001431371751623000163740ustar00rootroot00000000000000{ "decimal": ",", "thousands": "\u00a0", "grouping": [3], "currency": ["", "\u00a0₴."] } d3-format-1.4.5/locale/zh-CN.json000066400000000000000000000001261371751623000163720ustar00rootroot00000000000000{ "decimal": ".", "thousands": ",", "grouping": [3], "currency": ["¥", ""] } d3-format-1.4.5/package.json000066400000000000000000000031031371751623000156050ustar00rootroot00000000000000{ "name": "d3-format", "version": "1.4.5", "description": "Format numbers for human consumption.", "keywords": [ "d3", "d3-module", "format", "localization" ], "homepage": "https://d3js.org/d3-format/", "license": "BSD-3-Clause", "author": { "name": "Mike Bostock", "url": "http://bost.ocks.org/mike" }, "main": "dist/d3-format.js", "unpkg": "dist/d3-format.min.js", "jsdelivr": "dist/d3-format.min.js", "module": "src/index.js", "repository": { "type": "git", "url": "https://github.com/d3/d3-format.git" }, "files": [ "dist/**/*.js", "src/**/*.js", "locale/*.json" ], "scripts": { "pretest": "rollup -c", "test": "tape 'test/**/*-test.js' && eslint src test", "prepublishOnly": "rm -rf dist && yarn test", "postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../${npm_package_name}/dist/${npm_package_name}.js ${npm_package_name}.v${npm_package_version%%.*}.js && cp ../${npm_package_name}/dist/${npm_package_name}.min.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git add ${npm_package_name}.v${npm_package_version%%.*}.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git commit -m \"${npm_package_name} ${npm_package_version}\" && git push && cd - && zip -j dist/${npm_package_name}.zip -- LICENSE README.md dist/${npm_package_name}.js dist/${npm_package_name}.min.js" }, "sideEffects": [ "./src/defaultLocale.js" ], "devDependencies": { "eslint": "7", "rollup": "2", "rollup-plugin-terser": "7", "tape": "5" } } d3-format-1.4.5/rollup.config.js000066400000000000000000000015451371751623000164460ustar00rootroot00000000000000import {terser} from "rollup-plugin-terser"; import * as meta from "./package.json"; const config = { input: "src/index.js", external: Object.keys(meta.dependencies || {}).filter(key => /^d3-/.test(key)), output: { file: `dist/${meta.name}.js`, name: "d3", format: "umd", indent: false, extend: true, banner: `// ${meta.homepage} v${meta.version} Copyright ${(new Date).getFullYear()} ${meta.author.name}`, globals: Object.assign({}, ...Object.keys(meta.dependencies || {}).filter(key => /^d3-/.test(key)).map(key => ({[key]: "d3"}))) }, plugins: [] }; export default [ config, { ...config, output: { ...config.output, file: `dist/${meta.name}.min.js` }, plugins: [ ...config.plugins, terser({ output: { preamble: config.output.banner } }) ] } ]; d3-format-1.4.5/src/000077500000000000000000000000001371751623000141115ustar00rootroot00000000000000d3-format-1.4.5/src/defaultLocale.js000066400000000000000000000005721371751623000172170ustar00rootroot00000000000000import formatLocale from "./locale.js"; var locale; export var format; export var formatPrefix; defaultLocale({ decimal: ".", thousands: ",", grouping: [3], currency: ["$", ""], minus: "-" }); export default function defaultLocale(definition) { locale = formatLocale(definition); format = locale.format; formatPrefix = locale.formatPrefix; return locale; } d3-format-1.4.5/src/exponent.js000066400000000000000000000002251371751623000163060ustar00rootroot00000000000000import {formatDecimalParts} from "./formatDecimal.js"; export default function(x) { return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN; } d3-format-1.4.5/src/formatDecimal.js000066400000000000000000000014661371751623000172250ustar00rootroot00000000000000export default function(x) { return Math.abs(x = Math.round(x)) >= 1e21 ? x.toLocaleString("en").replace(/,/g, "") : x.toString(10); } // Computes the decimal coefficient and exponent of the specified number x with // significant digits p, where x is positive and p is in [1, 21] or undefined. // For example, formatDecimalParts(1.23) returns ["123", 0]. export function formatDecimalParts(x, p) { if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null; // NaN, ±Infinity var i, coefficient = x.slice(0, i); // The string returned by toExponential either has the form \d\.\d+e[-+]\d+ // (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3). return [ coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient, +x.slice(i + 1) ]; } d3-format-1.4.5/src/formatGroup.js000066400000000000000000000007331371751623000167570ustar00rootroot00000000000000export default function(grouping, thousands) { return function(value, width) { var i = value.length, t = [], j = 0, g = grouping[0], length = 0; while (i > 0 && g > 0) { if (length + g + 1 > width) g = Math.max(1, width - length); t.push(value.substring(i -= g, i + g)); if ((length += g + 1) > width) break; g = grouping[j = (j + 1) % grouping.length]; } return t.reverse().join(thousands); }; } d3-format-1.4.5/src/formatNumerals.js000066400000000000000000000002321371751623000174430ustar00rootroot00000000000000export default function(numerals) { return function(value) { return value.replace(/[0-9]/g, function(i) { return numerals[+i]; }); }; } d3-format-1.4.5/src/formatPrefixAuto.js000066400000000000000000000011671371751623000177530ustar00rootroot00000000000000import {formatDecimalParts} from "./formatDecimal.js"; export var prefixExponent; export default function(x, p) { var d = formatDecimalParts(x, p); if (!d) return x + ""; var coefficient = d[0], exponent = d[1], i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1, n = coefficient.length; return i === n ? coefficient : i > n ? coefficient + new Array(i - n + 1).join("0") : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i) : "0." + new Array(1 - i).join("0") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y! } d3-format-1.4.5/src/formatRounded.js000066400000000000000000000007311371751623000172610ustar00rootroot00000000000000import {formatDecimalParts} from "./formatDecimal.js"; export default function(x, p) { var d = formatDecimalParts(x, p); if (!d) return x + ""; var coefficient = d[0], exponent = d[1]; return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1) : coefficient + new Array(exponent - coefficient.length + 2).join("0"); } d3-format-1.4.5/src/formatSpecifier.js000066400000000000000000000032671371751623000176010ustar00rootroot00000000000000// [[fill]align][sign][symbol][0][width][,][.precision][~][type] var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i; export default function formatSpecifier(specifier) { if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier); var match; return new FormatSpecifier({ fill: match[1], align: match[2], sign: match[3], symbol: match[4], zero: match[5], width: match[6], comma: match[7], precision: match[8] && match[8].slice(1), trim: match[9], type: match[10] }); } formatSpecifier.prototype = FormatSpecifier.prototype; // instanceof export function FormatSpecifier(specifier) { this.fill = specifier.fill === undefined ? " " : specifier.fill + ""; this.align = specifier.align === undefined ? ">" : specifier.align + ""; this.sign = specifier.sign === undefined ? "-" : specifier.sign + ""; this.symbol = specifier.symbol === undefined ? "" : specifier.symbol + ""; this.zero = !!specifier.zero; this.width = specifier.width === undefined ? undefined : +specifier.width; this.comma = !!specifier.comma; this.precision = specifier.precision === undefined ? undefined : +specifier.precision; this.trim = !!specifier.trim; this.type = specifier.type === undefined ? "" : specifier.type + ""; } FormatSpecifier.prototype.toString = function() { return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === undefined ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === undefined ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type; }; d3-format-1.4.5/src/formatTrim.js000066400000000000000000000006171371751623000165770ustar00rootroot00000000000000// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k. export default function(s) { out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) { switch (s[i]) { case ".": i0 = i1 = i; break; case "0": if (i0 === 0) i0 = i; i1 = i; break; default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break; } } return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s; } d3-format-1.4.5/src/formatTypes.js000066400000000000000000000014351371751623000167670ustar00rootroot00000000000000import formatDecimal from "./formatDecimal.js"; import formatPrefixAuto from "./formatPrefixAuto.js"; import formatRounded from "./formatRounded.js"; export default { "%": function(x, p) { return (x * 100).toFixed(p); }, "b": function(x) { return Math.round(x).toString(2); }, "c": function(x) { return x + ""; }, "d": formatDecimal, "e": function(x, p) { return x.toExponential(p); }, "f": function(x, p) { return x.toFixed(p); }, "g": function(x, p) { return x.toPrecision(p); }, "o": function(x) { return Math.round(x).toString(8); }, "p": function(x, p) { return formatRounded(x * 100, p); }, "r": formatRounded, "s": formatPrefixAuto, "X": function(x) { return Math.round(x).toString(16).toUpperCase(); }, "x": function(x) { return Math.round(x).toString(16); } }; d3-format-1.4.5/src/identity.js000066400000000000000000000000531371751623000162760ustar00rootroot00000000000000export default function(x) { return x; } d3-format-1.4.5/src/index.js000066400000000000000000000006371371751623000155640ustar00rootroot00000000000000export {default as formatDefaultLocale, format, formatPrefix} from "./defaultLocale.js"; export {default as formatLocale} from "./locale.js"; export {default as formatSpecifier, FormatSpecifier} from "./formatSpecifier.js"; export {default as precisionFixed} from "./precisionFixed.js"; export {default as precisionPrefix} from "./precisionPrefix.js"; export {default as precisionRound} from "./precisionRound.js"; d3-format-1.4.5/src/locale.js000066400000000000000000000140341371751623000157100ustar00rootroot00000000000000import exponent from "./exponent.js"; import formatGroup from "./formatGroup.js"; import formatNumerals from "./formatNumerals.js"; import formatSpecifier from "./formatSpecifier.js"; import formatTrim from "./formatTrim.js"; import formatTypes from "./formatTypes.js"; import {prefixExponent} from "./formatPrefixAuto.js"; import identity from "./identity.js"; var map = Array.prototype.map, prefixes = ["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"]; export default function(locale) { var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + ""), currencyPrefix = locale.currency === undefined ? "" : locale.currency[0] + "", currencySuffix = locale.currency === undefined ? "" : locale.currency[1] + "", decimal = locale.decimal === undefined ? "." : locale.decimal + "", numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)), percent = locale.percent === undefined ? "%" : locale.percent + "", minus = locale.minus === undefined ? "-" : locale.minus + "", nan = locale.nan === undefined ? "NaN" : locale.nan + ""; function newFormat(specifier) { specifier = formatSpecifier(specifier); var fill = specifier.fill, align = specifier.align, sign = specifier.sign, symbol = specifier.symbol, zero = specifier.zero, width = specifier.width, comma = specifier.comma, precision = specifier.precision, trim = specifier.trim, type = specifier.type; // The "n" type is an alias for ",g". if (type === "n") comma = true, type = "g"; // The "" type, and any invalid type, is an alias for ".12~g". else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = "g"; // If zero fill is specified, padding goes after sign and before digits. if (zero || (fill === "0" && align === "=")) zero = true, fill = "0", align = "="; // Compute the prefix and suffix. // For SI-prefix, the suffix is lazily computed. var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "", suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : ""; // What format function should we use? // Is this an integer type? // Can this type generate exponential notation? var formatType = formatTypes[type], maybeSuffix = /[defgprs%]/.test(type); // Set the default precision if not specified, // or clamp the specified precision to the supported range. // For significant precision, it must be in [1, 21]. // For fixed precision, it must be in [0, 20]. precision = precision === undefined ? 6 : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision)) : Math.max(0, Math.min(20, precision)); function format(value) { var valuePrefix = prefix, valueSuffix = suffix, i, n, c; if (type === "c") { valueSuffix = formatType(value) + valueSuffix; value = ""; } else { value = +value; // Determine the sign. -0 is not less than 0, but 1 / -0 is! var valueNegative = value < 0 || 1 / value < 0; // Perform the initial formatting. value = isNaN(value) ? nan : formatType(Math.abs(value), precision); // Trim insignificant zeros. if (trim) value = formatTrim(value); // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign. if (valueNegative && +value === 0 && sign !== "+") valueNegative = false; // Compute the prefix and suffix. valuePrefix = (valueNegative ? (sign === "(" ? sign : minus) : sign === "-" || sign === "(" ? "" : sign) + valuePrefix; valueSuffix = (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : ""); // Break the formatted value into the integer “value” part that can be // grouped, and fractional or exponential “suffix” part that is not. if (maybeSuffix) { i = -1, n = value.length; while (++i < n) { if (c = value.charCodeAt(i), 48 > c || c > 57) { valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix; value = value.slice(0, i); break; } } } } // If the fill character is not "0", grouping is applied before padding. if (comma && !zero) value = group(value, Infinity); // Compute the padding. var length = valuePrefix.length + value.length + valueSuffix.length, padding = length < width ? new Array(width - length + 1).join(fill) : ""; // If the fill character is "0", grouping is applied after padding. if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = ""; // Reconstruct the final output based on the desired alignment. switch (align) { case "<": value = valuePrefix + value + valueSuffix + padding; break; case "=": value = valuePrefix + padding + value + valueSuffix; break; case "^": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break; default: value = padding + valuePrefix + value + valueSuffix; break; } return numerals(value); } format.toString = function() { return specifier + ""; }; return format; } function formatPrefix(specifier, value) { var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)), e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3, k = Math.pow(10, -e), prefix = prefixes[8 + e / 3]; return function(value) { return f(k * value) + prefix; }; } return { format: newFormat, formatPrefix: formatPrefix }; } d3-format-1.4.5/src/precisionFixed.js000066400000000000000000000001721371751623000174220ustar00rootroot00000000000000import exponent from "./exponent.js"; export default function(step) { return Math.max(0, -exponent(Math.abs(step))); } d3-format-1.4.5/src/precisionPrefix.js000066400000000000000000000003011371751623000176120ustar00rootroot00000000000000import exponent from "./exponent.js"; export default function(step, value) { return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step))); } d3-format-1.4.5/src/precisionRound.js000066400000000000000000000002751371751623000174560ustar00rootroot00000000000000import exponent from "./exponent.js"; export default function(step, max) { step = Math.abs(step), max = Math.abs(max) - step; return Math.max(0, exponent(max) - exponent(step)) + 1; } d3-format-1.4.5/test/000077500000000000000000000000001371751623000143015ustar00rootroot00000000000000d3-format-1.4.5/test/arabicLocale-test.js000066400000000000000000000143261371751623000201630ustar00rootroot00000000000000var tape = require("tape"), d3 = require("../"); tape("formatLocale(…) can format numbers using ar-001 locale.", function(test) { var locale = d3.formatLocale(require("../locale/ar-001")); test.equal(locale.format("$,.2f")(-1234.56), "-١٬٢٣٤٫٥٦"); test.end(); }); tape("formatLocale(…) can format numbers using ar-AE locale.", function(test) { var locale = d3.formatLocale(require("../locale/ar-AE")); test.equal(locale.format("$,.2f")(1234.56), "١٬٢٣٤٫٥٦ د.إ."); test.end(); }); tape("formatLocale(…) can format numbers using ar-BH locale.", function(test) { var locale = d3.formatLocale(require("../locale/ar-BH")); test.equal(locale.format("$,.2f")(1234.56), "١٬٢٣٤٫٥٦ د.ب."); test.end(); }); tape("formatLocale(…) can format numbers using ar-DJ locale.", function(test) { var locale = d3.formatLocale(require("../locale/ar-DJ")); test.equal(locale.format("$,.2f")(1234.56), "\u200fFdj ١٬٢٣٤٫٥٦"); test.end(); }); tape("formatLocale(…) can format numbers using ar-DZ locale.", function(test) { var locale = d3.formatLocale(require("../locale/ar-DZ")); test.equal(locale.format("$,.2f")(1234.56), "د.ج. 1.234,56"); test.end(); }); tape("formatLocale(…) can format numbers using ar-EG locale.", function(test) { var locale = d3.formatLocale(require("../locale/ar-EG")); test.equal(locale.format("$,.2f")(1234.56), "١٬٢٣٤٫٥٦ ج.م."); test.end(); }); tape("formatLocale(…) can format numbers using ar-EH locale.", function(test) { var locale = d3.formatLocale(require("../locale/ar-EH")); test.equal(locale.format("$,.2f")(1234.56), "د.م. 1,234.56"); test.end(); }); tape("formatLocale(…) can format numbers using ar-ER locale.", function(test) { var locale = d3.formatLocale(require("../locale/ar-ER")); test.equal(locale.format("$,.2f")(1234.56), "Nfk ١٬٢٣٤٫٥٦"); test.end(); }); tape("formatLocale(…) can format numbers using ar-IL locale.", function(test) { var locale = d3.formatLocale(require("../locale/ar-IL")); test.equal(locale.format("$,.2f")(1234.56), "₪ ١٬٢٣٤٫٥٦"); test.end(); }); tape("formatLocale(…) can format numbers using ar-IQ locale.", function(test) { var locale = d3.formatLocale(require("../locale/ar-IQ")); test.equal(locale.format("$,.2f")(1234.56), "١٬٢٣٤٫٥٦ د.ع."); test.end(); }); tape("formatLocale(…) can format numbers using ar-JO locale.", function(test) { var locale = d3.formatLocale(require("../locale/ar-JO")); test.equal(locale.format("$,.2f")(1234.56), "١٬٢٣٤٫٥٦ د.أ."); test.end(); }); tape("formatLocale(…) can format numbers using ar-KM locale.", function(test) { var locale = d3.formatLocale(require("../locale/ar-KM")); test.equal(locale.format("$,.2f")(1234.56), "١٬٢٣٤٫٥٦ ف.ج.ق."); test.end(); }); tape("formatLocale(…) can format numbers using ar-KW locale.", function(test) { var locale = d3.formatLocale(require("../locale/ar-KW")); test.equal(locale.format("$,.2f")(1234.56), "١٬٢٣٤٫٥٦ د.ك."); test.end(); }); tape("formatLocale(…) can format numbers using ar-LB locale.", function(test) { var locale = d3.formatLocale(require("../locale/ar-LB")); test.equal(locale.format("$,.2f")(1234.56), "١٬٢٣٤٫٥٦ ل.ل."); test.end(); }); tape("formatLocale(…) can format numbers using ar-MA locale.", function(test) { var locale = d3.formatLocale(require("../locale/ar-MA")); test.equal(locale.format("$,.2f")(1234.56), "د.م. 1.234,56"); test.end(); }); tape("formatLocale(…) can format numbers using ar-MR locale.", function(test) { var locale = d3.formatLocale(require("../locale/ar-MR")); test.equal(locale.format("$,.2f")(1234.56), "١٬٢٣٤٫٥٦ أ.م."); test.end(); }); tape("formatLocale(…) can format numbers using ar-OM locale.", function(test) { var locale = d3.formatLocale(require("../locale/ar-OM")); test.equal(locale.format("$,.2f")(1234.56), "١٬٢٣٤٫٥٦ ر.ع."); test.end(); }); tape("formatLocale(…) can format numbers using ar-PS locale.", function(test) { var locale = d3.formatLocale(require("../locale/ar-PS")); test.equal(locale.format("$,.2f")(1234.56), "₪ ١٬٢٣٤٫٥٦"); test.end(); }); tape("formatLocale(…) can format numbers using ar-QA locale.", function(test) { var locale = d3.formatLocale(require("../locale/ar-QA")); test.equal(locale.format("$,.2f")(1234.56), "١٬٢٣٤٫٥٦ ر.ق."); test.end(); }); tape("formatLocale(…) can format numbers using ar-SA locale.", function(test) { var locale = d3.formatLocale(require("../locale/ar-SA")); test.equal(locale.format("$,.2f")(1234.56), "١٬٢٣٤٫٥٦ ر.س."); test.end(); }); tape("formatLocale(…) can format numbers using ar-SD locale.", function(test) { var locale = d3.formatLocale(require("../locale/ar-SD")); test.equal(locale.format("$,.2f")(1234.56), "١٬٢٣٤٫٥٦ ج.س."); test.end(); }); tape("formatLocale(…) can format numbers using ar-SO locale.", function(test) { var locale = d3.formatLocale(require("../locale/ar-SO")); test.equal(locale.format("$,.2f")(1234.56), "‏S ١٬٢٣٤٫٥٦"); test.end(); }); tape("formatLocale(…) can format numbers using ar-SS locale.", function(test) { var locale = d3.formatLocale(require("../locale/ar-SS")); test.equal(locale.format("$,.2f")(1234.56), "£ ١٬٢٣٤٫٥٦"); test.end(); }); tape("formatLocale(…) can format numbers using ar-SY locale.", function(test) { var locale = d3.formatLocale(require("../locale/ar-SY")); test.equal(locale.format("$,.2f")(1234.56), "١٬٢٣٤٫٥٦ ل.س."); test.end(); }); tape("formatLocale(…) can format numbers using ar-TD locale.", function(test) { var locale = d3.formatLocale(require("../locale/ar-TD")); test.equal(locale.format("$,.2f")(1234.56), "\u200fFCFA ١٬٢٣٤٫٥٦"); test.end(); }); tape("formatLocale(…) can format numbers using ar-TN locale.", function(test) { var locale = d3.formatLocale(require("../locale/ar-TN")); test.equal(locale.format("$,.2f")(1234.56), "د.ت. 1.234,56"); test.end(); }); tape("formatLocale(…) can format numbers using ar-YE locale.", function(test) { var locale = d3.formatLocale(require("../locale/ar-YE")); test.equal(locale.format("$,.2f")(1234.56), "١٬٢٣٤٫٥٦ ر.ى."); test.end(); }); d3-format-1.4.5/test/defaultLocale-test.js000066400000000000000000000024261371751623000203640ustar00rootroot00000000000000var tape = require("tape"), d3 = require("../"); var enUs = { "decimal": ".", "thousands": ",", "grouping": [3], "currency": ["$", ""] }; var frFr = { "decimal": ",", "thousands": ".", "grouping": [3], "currency": ["", "\u00a0€"], "percent": "\u202f%" }; tape("d3.formatDefaultLocale(definition) returns the new default locale", function(test) { var locale = d3.formatDefaultLocale(frFr); try { test.equal(locale.format("$,.2f")(12345678.90), "12.345.678,90 €"); test.equal(locale.format(",.0%")(12345678.90), "1.234.567.890\u202f%"); test.end(); } finally { d3.formatDefaultLocale(enUs); } }); tape("d3.formatDefaultLocale(definition) affects d3.format", function(test) { var locale = d3.formatDefaultLocale(frFr); try { test.equal(d3.format, locale.format); test.equal(d3.format("$,.2f")(12345678.90), "12.345.678,90 €"); test.end(); } finally { d3.formatDefaultLocale(enUs); } }); tape("d3.formatDefaultLocale(definition) affects d3.formatPrefix", function(test) { var locale = d3.formatDefaultLocale(frFr); try { test.equal(d3.formatPrefix, locale.formatPrefix); test.equal(d3.formatPrefix(",.2", 1e3)(12345678.90), "12.345,68k"); test.end(); } finally { d3.formatDefaultLocale(enUs); } }); d3-format-1.4.5/test/format-test.js000066400000000000000000000041231371751623000171040ustar00rootroot00000000000000var tape = require("tape"), format = require("../"); tape("format(specifier)(number) returns a string", function(test) { test.equal(typeof format.format("d")(0), "string"); test.end(); }); tape("format(specifier).toString() returns the normalized specifier", function(test) { test.equal(format.format("d") + "", " >-d"); test.end(); }); tape("format(specifier) throws an error for invalid formats", function(test) { test.throws(function() { format.format("foo"); }, /invalid format: foo/); test.throws(function() { format.format(".-2s"); }, /invalid format: \.-2s/); test.throws(function() { format.format(".f"); }, /invalid format: \.f/); test.end(); }); tape("format(\",.\") unreasonable precision values are clamped to reasonable values", function(test) { test.equal(format.format(".30f")(0), "0.00000000000000000000"); test.equal(format.format(".0g")(1), "1"); test.end(); }); tape("format(\"s\") handles very small and very large values", function(test) { test.equal(format.format("s")(Number.MIN_VALUE), "0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005y"); test.equal(format.format("s")(Number.MAX_VALUE), "179769000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Y"); test.end(); }); tape("format(\"n\") is equivalent to format(\",g\")", function(test) { test.equal(format.format("n")(123456.78), "123,457"); test.equal(format.format(",g")(123456.78), "123,457"); test.end(); }); tape("format(\"012\") is equivalent to format(\"0=12\")", function(test) { test.equal(format.format("012")(123.456), "00000123.456"); test.equal(format.format("0=12")(123.456), "00000123.456"); test.end(); }); d3-format-1.4.5/test/format-trim-test.js000066400000000000000000000055161371751623000200640ustar00rootroot00000000000000var tape = require("tape"), format = require("../"); tape("format(\"~r\") trims insignificant zeros", function(test) { var f = format.format("~r"); test.equal(f(1), "1"); test.equal(f(0.1), "0.1"); test.equal(f(0.01), "0.01"); test.equal(f(10.0001), "10.0001"); test.equal(f(123.45), "123.45"); test.equal(f(123.456), "123.456"); test.equal(f(123.4567), "123.457"); test.equal(f(0.000009), "0.000009"); test.equal(f(0.0000009), "0.0000009"); test.equal(f(0.00000009), "0.00000009"); test.equal(f(0.111119), "0.111119"); test.equal(f(0.1111119), "0.111112"); test.equal(f(0.11111119), "0.111111"); test.end(); }); tape("format(\"~e\") trims insignificant zeros", function(test) { var f = format.format("~e"); test.equal(f(0), "0e+0"); test.equal(f(42), "4.2e+1"); test.equal(f(42000000), "4.2e+7"); test.equal(f(0.042), "4.2e-2"); test.equal(f(-4), "-4e+0"); test.equal(f(-42), "-4.2e+1"); test.equal(f(42000000000), "4.2e+10"); test.equal(f(0.00000000042), "4.2e-10"); test.end(); }); tape("format(\".4~e\") trims insignificant zeros", function(test) { var f = format.format(".4~e"); test.equal(f(0.00000000012345), "1.2345e-10"); test.equal(f(0.00000000012340), "1.234e-10"); test.equal(f(0.00000000012300), "1.23e-10"); test.equal(f(-0.00000000012345), "-1.2345e-10"); test.equal(f(-0.00000000012340), "-1.234e-10"); test.equal(f(-0.00000000012300), "-1.23e-10"); test.equal(f(12345000000), "1.2345e+10"); test.equal(f(12340000000), "1.234e+10"); test.equal(f(12300000000), "1.23e+10"); test.equal(f(-12345000000), "-1.2345e+10"); test.equal(f(-12340000000), "-1.234e+10"); test.equal(f(-12300000000), "-1.23e+10"); test.end(); }); tape("format(\"~s\") trims insignificant zeros", function(test) { var f = format.format("~s"); test.equal(f(0), "0"); test.equal(f(1), "1"); test.equal(f(10), "10"); test.equal(f(100), "100"); test.equal(f(999.5), "999.5"); test.equal(f(999500), "999.5k"); test.equal(f(1000), "1k"); test.equal(f(1400), "1.4k"); test.equal(f(1500), "1.5k"); test.equal(f(1500.5), "1.5005k"); test.equal(f(1e-15), "1f"); test.equal(f(1e-12), "1p"); test.equal(f(1e-9), "1n"); test.equal(f(1e-6), "1µ"); test.equal(f(1e-3), "1m"); test.equal(f(1e0), "1"); test.equal(f(1e3), "1k"); test.equal(f(1e6), "1M"); test.equal(f(1e9), "1G"); test.equal(f(1e12), "1T"); test.equal(f(1e15), "1P"); test.end(); }); tape("format(\"~%\") trims insignificant zeros", function(test) { var f = format.format("~%"); test.equal(f(0), "0%"); test.equal(f(0.1), "10%"); test.equal(f(0.01), "1%"); test.equal(f(0.001), "0.1%"); test.equal(f(0.0001), "0.01%"); test.end(); }); tape("trimming respects commas", function(test) { var f = format.format(",~g"); test.equal(f(10000.0), "10,000"); test.equal(f(10000.1), "10,000.1"); test.end(); }); d3-format-1.4.5/test/format-type-%-test.js000066400000000000000000000021731371751623000202100ustar00rootroot00000000000000var tape = require("tape"), format = require("../"); tape("format(\"%\") can output a whole percentage", function(test) { var f = format.format(".0%"); test.equal(f(0), "0%"); test.equal(f(.042), "4%"); test.equal(f(.42), "42%"); test.equal(f(4.2), "420%"); test.equal(f(-.042), "-4%"); test.equal(f(-.42), "-42%"); test.equal(f(-4.2), "-420%"); test.end(); }); tape("format(\".%\") can output a percentage with precision", function(test) { var f1 = format.format(".1%"); test.equal(f1(.234), "23.4%"); var f2 = format.format(".2%"); test.equal(f2(.234), "23.40%"); test.end(); }); tape("format(\"%\") fill respects suffix", function(test) { test.equal(format.format("020.0%")(42), "0000000000000004200%"); test.equal(format.format("20.0%")(42), " 4200%"); test.end(); }); tape("format(\"^%\") align center puts suffix adjacent to number", function(test) { test.equal(format.format("^21.0%")(.42), " 42% "); test.equal(format.format("^21,.0%")(422), " 42,200% "); test.equal(format.format("^21,.0%")(-422), " -42,200% "); test.end(); }); d3-format-1.4.5/test/format-type-b-test.js000066400000000000000000000004471371751623000203070ustar00rootroot00000000000000var tape = require("tape"), format = require("../"); tape("format(\"b\") binary", function(test) { test.equal(format.format("b")(10), "1010"); test.end(); }); tape("format(\"#b\") binary with prefix", function(test) { test.equal(format.format("#b")(10), "0b1010"); test.end(); }); d3-format-1.4.5/test/format-type-c-test.js000066400000000000000000000010321371751623000202770ustar00rootroot00000000000000var tape = require("tape"), format = require("../"); tape("format(\"c\") unicode character", function(test) { test.equal(format.format("c")("☃"), "☃"); test.equal(format.format("020c")("☃"), "0000000000000000000☃"); test.equal(format.format(" ^20c")("☃"), " ☃ "); test.equal(format.format("$c")("☃"), "$☃"); test.end(); }); tape("format(\"c\") does not localize a decimal point", function(test) { test.equal(format.formatLocale({decimal: "/"}).format("c")("."), "."); test.end(); }); d3-format-1.4.5/test/format-type-d-test.js000066400000000000000000000221511371751623000203050ustar00rootroot00000000000000var tape = require("tape"), format = require("../"); tape("format(\"d\") can zero fill", function(test) { var f = format.format("08d"); test.equal(f(0), "00000000"); test.equal(f(42), "00000042"); test.equal(f(42000000), "42000000"); test.equal(f(420000000), "420000000"); test.equal(f(-4), "-0000004"); test.equal(f(-42), "-0000042"); test.equal(f(-4200000), "-4200000"); test.equal(f(-42000000), "-42000000"); test.end(); }); tape("format(\"d\") can space fill", function(test) { var f = format.format("8d"); test.equal(f(0), " 0"); test.equal(f(42), " 42"); test.equal(f(42000000), "42000000"); test.equal(f(420000000), "420000000"); test.equal(f(-4), " -4"); test.equal(f(-42), " -42"); test.equal(f(-4200000), "-4200000"); test.equal(f(-42000000), "-42000000"); test.end(); }); tape("format(\"d\") can underscore fill", function(test) { var f = format.format("_>8d"); test.equal(f(0), "_______0"); test.equal(f(42), "______42"); test.equal(f(42000000), "42000000"); test.equal(f(420000000), "420000000"); test.equal(f(-4), "______-4"); test.equal(f(-42), "_____-42"); test.equal(f(-4200000), "-4200000"); test.equal(f(-42000000), "-42000000"); test.end(); }); tape("format(\"d\") can zero fill with sign and group", function(test) { var f = format.format("+08,d"); test.equal(f(0), "+0,000,000"); test.equal(f(42), "+0,000,042"); test.equal(f(42000000), "+42,000,000"); test.equal(f(420000000), "+420,000,000"); test.equal(f(-4), "-0,000,004"); test.equal(f(-42), "-0,000,042"); test.equal(f(-4200000), "-4,200,000"); test.equal(f(-42000000), "-42,000,000"); test.end(); }); tape("format(\"d\") always uses zero precision", function(test) { var f = format.format(".2d"); test.equal(f(0), "0"); test.equal(f(42), "42"); test.equal(f(-4.2), "-4"); test.end(); }); tape("format(\"d\") rounds non-integers", function(test) { var f = format.format("d"); test.equal(f(4.2), "4"); test.end(); }); tape("format(\",d\") can group thousands", function(test) { var f = format.format(",d"); test.equal(f(0), "0"); test.equal(f(42), "42"); test.equal(f(42000000), "42,000,000"); test.equal(f(420000000), "420,000,000"); test.equal(f(-4), "-4"); test.equal(f(-42), "-42"); test.equal(f(-4200000), "-4,200,000"); test.equal(f(-42000000), "-42,000,000"); test.equal(f(1e21), "1,000,000,000,000,000,000,000"); test.equal(f(1.3e27), "1,300,000,000,000,000,000,000,000,000"); test.equal(f(1.3e107), "130,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000"); test.end(); }); tape("format(\"0,d\") can group thousands and zero fill", function(test) { test.equal(format.format("01,d")(0), "0"); test.equal(format.format("01,d")(0), "0"); test.equal(format.format("02,d")(0), "00"); test.equal(format.format("03,d")(0), "000"); test.equal(format.format("04,d")(0), "0,000"); test.equal(format.format("05,d")(0), "0,000"); test.equal(format.format("06,d")(0), "00,000"); test.equal(format.format("08,d")(0), "0,000,000"); test.equal(format.format("013,d")(0), "0,000,000,000"); test.equal(format.format("021,d")(0), "0,000,000,000,000,000"); test.equal(format.format("013,d")(-42000000), "-0,042,000,000"); test.equal(format.format("012,d")(1e21), "1,000,000,000,000,000,000,000"); test.equal(format.format("013,d")(1e21), "1,000,000,000,000,000,000,000"); test.equal(format.format("014,d")(1e21), "1,000,000,000,000,000,000,000"); test.equal(format.format("015,d")(1e21), "1,000,000,000,000,000,000,000"); test.end(); }); tape("format(\"0,d\") can group thousands and zero fill with overflow", function(test) { test.equal(format.format("01,d")(1), "1"); test.equal(format.format("01,d")(1), "1"); test.equal(format.format("02,d")(12), "12"); test.equal(format.format("03,d")(123), "123"); test.equal(format.format("05,d")(12345), "12,345"); test.equal(format.format("08,d")(12345678), "12,345,678"); test.equal(format.format("013,d")(1234567890123), "1,234,567,890,123"); test.end(); }); tape("format(\",d\") can group thousands and space fill", function(test) { test.equal(format.format("1,d")(0), "0"); test.equal(format.format("1,d")(0), "0"); test.equal(format.format("2,d")(0), " 0"); test.equal(format.format("3,d")(0), " 0"); test.equal(format.format("5,d")(0), " 0"); test.equal(format.format("8,d")(0), " 0"); test.equal(format.format("13,d")(0), " 0"); test.equal(format.format("21,d")(0), " 0"); test.end(); }); tape("format(\",d\") can group thousands and space fill with overflow", function(test) { test.equal(format.format("1,d")(1), "1"); test.equal(format.format("1,d")(1), "1"); test.equal(format.format("2,d")(12), "12"); test.equal(format.format("3,d")(123), "123"); test.equal(format.format("5,d")(12345), "12,345"); test.equal(format.format("8,d")(12345678), "12,345,678"); test.equal(format.format("13,d")(1234567890123), "1,234,567,890,123"); test.end(); }); tape("format(\"d\") align right", function(test) { test.equal(format.format(">1,d")(0), "0"); test.equal(format.format(">1,d")(0), "0"); test.equal(format.format(">2,d")(0), " 0"); test.equal(format.format(">3,d")(0), " 0"); test.equal(format.format(">5,d")(0), " 0"); test.equal(format.format(">8,d")(0), " 0"); test.equal(format.format(">13,d")(0), " 0"); test.equal(format.format(">21,d")(0), " 0"); test.equal(format.format(">21,d")(1000), " 1,000"); test.equal(format.format(">21,d")(1e21), "1,000,000,000,000,000,000,000"); test.end(); }); tape("format(\"^d\") align center", function(test) { test.equal(format.format("^1,d")(0), "0"); test.equal(format.format("^1,d")(0), "0"); test.equal(format.format("^2,d")(0), "0 "); test.equal(format.format("^3,d")(0), " 0 "); test.equal(format.format("^5,d")(0), " 0 "); test.equal(format.format("^8,d")(0), " 0 "); test.equal(format.format("^13,d")(0), " 0 "); test.equal(format.format("^21,d")(0), " 0 "); test.equal(format.format("^21,d")(1000), " 1,000 "); test.equal(format.format("^21,d")(1e21), "1,000,000,000,000,000,000,000"); test.end(); }); tape("format(\"=+,d\") pad after sign", function(test) { test.equal(format.format("=+1,d")(0), "+0"); test.equal(format.format("=+1,d")(0), "+0"); test.equal(format.format("=+2,d")(0), "+0"); test.equal(format.format("=+3,d")(0), "+ 0"); test.equal(format.format("=+5,d")(0), "+ 0"); test.equal(format.format("=+8,d")(0), "+ 0"); test.equal(format.format("=+13,d")(0), "+ 0"); test.equal(format.format("=+21,d")(0), "+ 0"); test.equal(format.format("=+21,d")(1e21), "+1,000,000,000,000,000,000,000"); test.end(); }); tape("format(\"=+$,d\") pad after sign with currency", function(test) { test.equal(format.format("=+$1,d")(0), "+$0"); test.equal(format.format("=+$1,d")(0), "+$0"); test.equal(format.format("=+$2,d")(0), "+$0"); test.equal(format.format("=+$3,d")(0), "+$0"); test.equal(format.format("=+$5,d")(0), "+$ 0"); test.equal(format.format("=+$8,d")(0), "+$ 0"); test.equal(format.format("=+$13,d")(0), "+$ 0"); test.equal(format.format("=+$21,d")(0), "+$ 0"); test.equal(format.format("=+$21,d")(1e21), "+$1,000,000,000,000,000,000,000"); test.end(); }); tape("format(\" ,d\") a space can denote positive numbers", function(test) { test.equal(format.format(" 1,d")(-1), "-1"); test.equal(format.format(" 1,d")(0), " 0"); test.equal(format.format(" 2,d")(0), " 0"); test.equal(format.format(" 3,d")(0), " 0"); test.equal(format.format(" 5,d")(0), " 0"); test.equal(format.format(" 8,d")(0), " 0"); test.equal(format.format(" 13,d")(0), " 0"); test.equal(format.format(" 21,d")(0), " 0"); test.equal(format.format(" 21,d")(1e21), " 1,000,000,000,000,000,000,000"); test.end(); }); tape("format(\"-,d\") explicitly only use a sign for negative numbers", function(test) { test.equal(format.format("-1,d")(-1), "-1"); test.equal(format.format("-1,d")(0), "0"); test.equal(format.format("-2,d")(0), " 0"); test.equal(format.format("-3,d")(0), " 0"); test.equal(format.format("-5,d")(0), " 0"); test.equal(format.format("-8,d")(0), " 0"); test.equal(format.format("-13,d")(0), " 0"); test.equal(format.format("-21,d")(0), " 0"); test.end(); }); tape("format(\"d\") can format negative zero as zero", function(test) { test.equal(format.format("1d")(-0), "0"); test.equal(format.format("1d")(-1e-12), "0"); test.end(); }); d3-format-1.4.5/test/format-type-e-test.js000066400000000000000000000020741371751623000203100ustar00rootroot00000000000000var tape = require("tape"), format = require("../"); tape("format(\"e\") can output exponent notation", function(test) { var f = format.format("e"); test.equal(f(0), "0.000000e+0"); test.equal(f(42), "4.200000e+1"); test.equal(f(42000000), "4.200000e+7"); test.equal(f(420000000), "4.200000e+8"); test.equal(f(-4), "-4.000000e+0"); test.equal(f(-42), "-4.200000e+1"); test.equal(f(-4200000), "-4.200000e+6"); test.equal(f(-42000000), "-4.200000e+7"); test.equal(format.format(".0e")(42), "4e+1") test.equal(format.format(".3e")(42), "4.200e+1") test.end(); }); tape("format(\"e\") can format negative zero as zero", function(test) { test.equal(format.format("1e")(-0), "0.000000e+0"); test.equal(format.format("1e")(-1e-12), "-1.000000e-12"); test.end(); }); tape("format(\",e\") does not group Infinity", function(test) { test.equal(format.format(",e")(Infinity), "Infinity"); test.end(); }); tape("format(\".3e\") can format negative infinity", function(test) { test.equal(format.format(".3e")(-Infinity), "-Infinity"); test.end(); }); d3-format-1.4.5/test/format-type-f-test.js000066400000000000000000000046671371751623000203230ustar00rootroot00000000000000var tape = require("tape"), format = require("../"); tape("format(\"f\") can output fixed-point notation", function(test) { test.equal(format.format(".1f")(0.49), "0.5"); test.equal(format.format(".2f")(0.449), "0.45"); test.equal(format.format(".3f")(0.4449), "0.445"); test.equal(format.format(".5f")(0.444449), "0.44445"); test.equal(format.format(".1f")(100), "100.0"); test.equal(format.format(".2f")(100), "100.00"); test.equal(format.format(".3f")(100), "100.000"); test.equal(format.format(".5f")(100), "100.00000"); test.end(); }); tape("format(\"+$,f\") can output a currency with comma-grouping and sign", function(test) { var f = format.format("+$,.2f"); test.equal(f(0), "+$0.00"); test.equal(f(0.429), "+$0.43"); test.equal(f(-0.429), "-$0.43"); test.equal(f(-1), "-$1.00"); test.equal(f(1e4), "+$10,000.00"); test.end(); }); tape("format(\",.f\") can group thousands, space fill, and round to significant digits", function(test) { test.equal(format.format("10,.1f")(123456.49), " 123,456.5"); test.equal(format.format("10,.2f")(1234567.449), "1,234,567.45"); test.equal(format.format("10,.3f")(12345678.4449), "12,345,678.445"); test.equal(format.format("10,.5f")(123456789.444449), "123,456,789.44445"); test.equal(format.format("10,.1f")(123456), " 123,456.0"); test.equal(format.format("10,.2f")(1234567), "1,234,567.00"); test.equal(format.format("10,.3f")(12345678), "12,345,678.000"); test.equal(format.format("10,.5f")(123456789), "123,456,789.00000"); test.end(); }); tape("format(\"f\") can display integers in fixed-point notation", function(test) { test.equal(format.format("f")(42), "42.000000"); test.end(); }); tape("format(\"f\") can format negative zero as zero", function(test) { test.equal(format.format("f")(-0), "0.000000"); test.equal(format.format("f")(-1e-12), "0.000000"); test.end(); }); tape("format(\"+f\") signs negative zero correctly", function(test) { test.equal(format.format("+f")(-0), "-0.000000"); test.equal(format.format("+f")(+0), "+0.000000"); test.equal(format.format("+f")(-1e-12), "-0.000000"); test.equal(format.format("+f")(+1e-12), "+0.000000"); test.end(); }); tape("format(\"f\") can format negative infinity", function(test) { test.equal(format.format("f")(-Infinity), "-Infinity"); test.end(); }); tape("format(\",f\") does not group Infinity", function(test) { test.equal(format.format(",f")(Infinity), "Infinity"); test.end(); }); d3-format-1.4.5/test/format-type-g-test.js000066400000000000000000000022421371751623000203070ustar00rootroot00000000000000var tape = require("tape"), format = require("../"); tape("format(\"g\") can output general notation", function(test) { test.equal(format.format(".1g")(0.049), "0.05"); test.equal(format.format(".1g")(0.49), "0.5"); test.equal(format.format(".2g")(0.449), "0.45"); test.equal(format.format(".3g")(0.4449), "0.445"); test.equal(format.format(".5g")(0.444449), "0.44445"); test.equal(format.format(".1g")(100), "1e+2"); test.equal(format.format(".2g")(100), "1.0e+2"); test.equal(format.format(".3g")(100), "100"); test.equal(format.format(".5g")(100), "100.00"); test.equal(format.format(".5g")(100.2), "100.20"); test.equal(format.format(".2g")(0.002), "0.0020"); test.end(); }); tape("format(\",g\") can group thousands with general notation", function(test) { var f = format.format(",.12g"); test.equal(f(0), "0.00000000000"); test.equal(f(42), "42.0000000000"); test.equal(f(42000000), "42,000,000.0000"); test.equal(f(420000000), "420,000,000.000"); test.equal(f(-4), "-4.00000000000"); test.equal(f(-42), "-42.0000000000"); test.equal(f(-4200000), "-4,200,000.00000"); test.equal(f(-42000000), "-42,000,000.0000"); test.end(); }); d3-format-1.4.5/test/format-type-n-test.js000066400000000000000000000022041371751623000203140ustar00rootroot00000000000000var tape = require("tape"), format = require("../"); tape("format(\"n\") is an alias for \",g\"", function(test) { var f = format.format(".12n"); test.equal(f(0), "0.00000000000"); test.equal(f(42), "42.0000000000"); test.equal(f(42000000), "42,000,000.0000"); test.equal(f(420000000), "420,000,000.000"); test.equal(f(-4), "-4.00000000000"); test.equal(f(-42), "-42.0000000000"); test.equal(f(-4200000), "-4,200,000.00000"); test.equal(f(-42000000), "-42,000,000.0000"); test.equal(f(.0042), "0.00420000000000"); test.equal(f(.42), "0.420000000000"); test.equal(f(1e21), "1.00000000000e+21"); test.end(); }); tape("format(\"n\") uses zero padding", function(test) { test.equal(format.format("01.0n")(0), "0"); test.equal(format.format("02.0n")(0), "00"); test.equal(format.format("03.0n")(0), "000"); test.equal(format.format("05.0n")(0), "0,000"); test.equal(format.format("08.0n")(0), "0,000,000"); test.equal(format.format("013.0n")(0), "0,000,000,000"); test.equal(format.format("021.0n")(0), "0,000,000,000,000,000"); test.equal(format.format("013.8n")(-42000000), "-0,042,000,000"); test.end(); }); d3-format-1.4.5/test/format-type-none-test.js000066400000000000000000000047331371751623000210270ustar00rootroot00000000000000var tape = require("tape"), format = require("../"); tape("format(\".[precision]\") uses significant precision and trims insignificant zeros", function(test) { test.equal(format.format(".1")(4.9), "5"); test.equal(format.format(".1")(0.49), "0.5"); test.equal(format.format(".2")(4.9), "4.9"); test.equal(format.format(".2")(0.49), "0.49"); test.equal(format.format(".2")(0.449), "0.45"); test.equal(format.format(".3")(4.9), "4.9"); test.equal(format.format(".3")(0.49), "0.49"); test.equal(format.format(".3")(0.449), "0.449"); test.equal(format.format(".3")(0.4449), "0.445"); test.equal(format.format(".5")(0.444449), "0.44445"); test.end(); }); tape("format(\".[precision]\") does not trim significant zeros", function(test) { test.equal(format.format(".5")(10), "10"); test.equal(format.format(".5")(100), "100"); test.equal(format.format(".5")(1000), "1000"); test.equal(format.format(".5")(21010), "21010"); test.equal(format.format(".5")(1.10001), "1.1"); test.equal(format.format(".5")(1.10001e6), "1.1e+6"); test.equal(format.format(".6")(1.10001), "1.10001"); test.equal(format.format(".6")(1.10001e6), "1.10001e+6"); test.end(); }); tape("format(\".[precision]\") also trims the decimal point if there are only insignificant zeros", function(test) { test.equal(format.format(".5")(1.00001), "1"); test.equal(format.format(".5")(1.00001e6), "1e+6"); test.equal(format.format(".6")(1.00001), "1.00001"); test.equal(format.format(".6")(1.00001e6), "1.00001e+6"); test.end(); }); tape("format(\"$\") can output a currency", function(test) { var f = format.format("$"); test.equal(f(0), "$0"); test.equal(f(.042), "$0.042"); test.equal(f(.42), "$0.42"); test.equal(f(4.2), "$4.2"); test.equal(f(-.042), "-$0.042"); test.equal(f(-.42), "-$0.42"); test.equal(f(-4.2), "-$4.2"); test.end(); }); tape("format(\"($\") can output a currency with parentheses for negative values", function(test) { var f = format.format("($"); test.equal(f(0), "$0"); test.equal(f(.042), "$0.042"); test.equal(f(.42), "$0.42"); test.equal(f(4.2), "$4.2"); test.equal(f(-.042), "($0.042)"); test.equal(f(-.42), "($0.42)"); test.equal(f(-4.2), "($4.2)"); test.end(); }); tape("format(\"\") can format negative zero as zero", function(test) { test.equal(format.format("")(-0), "0"); test.end(); }); tape("format(\"\") can format negative infinity", function(test) { test.equal(format.format("")(-Infinity), "-Infinity"); test.end(); }); d3-format-1.4.5/test/format-type-o-test.js000066400000000000000000000004411371751623000203160ustar00rootroot00000000000000var tape = require("tape"), format = require("../"); tape("format(\"o\") octal", function(test) { test.equal(format.format("o")(10), "12"); test.end(); }); tape("format(\"#o\") octal with prefix", function(test) { test.equal(format.format("#o")(10), "0o12"); test.end(); }); d3-format-1.4.5/test/format-type-p-test.js000066400000000000000000000016111371751623000203170ustar00rootroot00000000000000var tape = require("tape"), format = require("../"); tape("format(\"p\") can output a percentage", function(test) { var f = format.format("p"); test.equal(f(.00123), "0.123000%"); test.equal(f(.0123), "1.23000%"); test.equal(f(.123), "12.3000%"); test.equal(f(.234), "23.4000%"); test.equal(f(1.23), "123.000%"); test.equal(f(-.00123), "-0.123000%"); test.equal(f(-.0123), "-1.23000%"); test.equal(f(-.123), "-12.3000%"); test.equal(f(-1.23), "-123.000%"); test.end(); }); tape("format(\"+p\") can output a percentage with rounding and sign", function(test) { var f = format.format("+.2p"); test.equal(f(.00123), "+0.12%"); test.equal(f(.0123), "+1.2%"); test.equal(f(.123), "+12%"); test.equal(f(1.23), "+120%"); test.equal(f(-.00123), "-0.12%"); test.equal(f(-.0123), "-1.2%"); test.equal(f(-.123), "-12%"); test.equal(f(-1.23), "-120%"); test.end(); }); d3-format-1.4.5/test/format-type-r-test.js000066400000000000000000000035121371751623000203230ustar00rootroot00000000000000var tape = require("tape"), format = require("../"); tape("format(\"r\") can round to significant digits", function(test) { test.equal(format.format(".2r")(0), "0.0"); test.equal(format.format(".1r")(0.049), "0.05"); test.equal(format.format(".1r")(-0.049), "-0.05"); test.equal(format.format(".1r")(0.49), "0.5"); test.equal(format.format(".1r")(-0.49), "-0.5"); test.equal(format.format(".2r")(0.449), "0.45"); test.equal(format.format(".3r")(0.4449), "0.445"); test.equal(format.format(".3r")(1.00), "1.00"); test.equal(format.format(".3r")(0.9995), "1.00"); test.equal(format.format(".5r")(0.444449), "0.44445"); test.equal(format.format("r")(123.45), "123.450"); test.equal(format.format(".1r")(123.45), "100"); test.equal(format.format(".2r")(123.45), "120"); test.equal(format.format(".3r")(123.45), "123"); test.equal(format.format(".4r")(123.45), "123.5"); test.equal(format.format(".5r")(123.45), "123.45"); test.equal(format.format(".6r")(123.45), "123.450"); test.equal(format.format(".1r")(.9), "0.9"); test.equal(format.format(".1r")(.09), "0.09"); test.equal(format.format(".1r")(.949), "0.9"); test.equal(format.format(".1r")(.0949), "0.09"); test.equal(format.format(".1r")(.0000000129), "0.00000001"); test.equal(format.format(".2r")(.0000000129), "0.000000013"); test.equal(format.format(".2r")(.00000000129), "0.0000000013"); test.equal(format.format(".3r")(.00000000129), "0.00000000129"); test.equal(format.format(".4r")(.00000000129), "0.000000001290"); test.equal(format.format(".10r")(.9999999999), "0.9999999999"); test.equal(format.format(".15r")(.999999999999999), "0.999999999999999"); test.end(); }); tape("format(\"r\") can round very small numbers", function(test) { var f = format.format(".2r"); test.equal(f(1e-22), "0.00000000000000000000010"); test.end(); }); d3-format-1.4.5/test/format-type-s-test.js000066400000000000000000000127101371751623000203240ustar00rootroot00000000000000var tape = require("tape"), format = require("../"); tape("format(\"s\") outputs SI-prefix notation with default precision 6", function(test) { var f = format.format("s"); test.equal(f(0), "0.00000"); test.equal(f(1), "1.00000"); test.equal(f(10), "10.0000"); test.equal(f(100), "100.000"); test.equal(f(999.5), "999.500"); test.equal(f(999500), "999.500k"); test.equal(f(1000), "1.00000k"); test.equal(f(100), "100.000"); test.equal(f(1400), "1.40000k"); test.equal(f(1500.5), "1.50050k"); test.equal(f(.00001), "10.0000µ"); test.equal(f(.000001), "1.00000µ"); test.end(); }); tape("format(\"[.precision]s\") outputs SI-prefix notation with precision significant digits", function(test) { var f1 = format.format(".3s"); test.equal(f1(0), "0.00"); test.equal(f1(1), "1.00"); test.equal(f1(10), "10.0"); test.equal(f1(100), "100"); test.equal(f1(999.5), "1.00k"); test.equal(f1(999500), "1.00M"); test.equal(f1(1000), "1.00k"); test.equal(f1(1500.5), "1.50k"); test.equal(f1(145500000), "146M"); test.equal(f1(145999999.999999347), "146M"); test.equal(f1(1e26), "100Y"); test.equal(f1(.000001), "1.00µ"); test.equal(f1(.009995), "10.0m"); var f2 = format.format(".4s"); test.equal(f2(999.5), "999.5"); test.equal(f2(999500), "999.5k"); test.equal(f2(.009995), "9.995m"); test.end(); }); tape("format(\"s\") formats numbers smaller than 1e-24 with yocto", function(test) { var f = format.format(".8s"); test.equal(f(1.29e-30), "0.0000013y"); // Note: rounded! test.equal(f(1.29e-29), "0.0000129y"); test.equal(f(1.29e-28), "0.0001290y"); test.equal(f(1.29e-27), "0.0012900y"); test.equal(f(1.29e-26), "0.0129000y"); test.equal(f(1.29e-25), "0.1290000y"); test.equal(f(1.29e-24), "1.2900000y"); test.equal(f(1.29e-23), "12.900000y"); test.equal(f(1.29e-22), "129.00000y"); test.equal(f(1.29e-21), "1.2900000z"); test.equal(f(-1.29e-30), "-0.0000013y"); // Note: rounded! test.equal(f(-1.29e-29), "-0.0000129y"); test.equal(f(-1.29e-28), "-0.0001290y"); test.equal(f(-1.29e-27), "-0.0012900y"); test.equal(f(-1.29e-26), "-0.0129000y"); test.equal(f(-1.29e-25), "-0.1290000y"); test.equal(f(-1.29e-24), "-1.2900000y"); test.equal(f(-1.29e-23), "-12.900000y"); test.equal(f(-1.29e-22), "-129.00000y"); test.equal(f(-1.29e-21), "-1.2900000z"); test.end(); }); tape("format(\"s\") formats numbers larger than 1e24 with yotta", function(test) { var f = format.format(".8s"); test.equal(f(1.23e+21), "1.2300000Z"); test.equal(f(1.23e+22), "12.300000Z"); test.equal(f(1.23e+23), "123.00000Z"); test.equal(f(1.23e+24), "1.2300000Y"); test.equal(f(1.23e+25), "12.300000Y"); test.equal(f(1.23e+26), "123.00000Y"); test.equal(f(1.23e+27), "1230.0000Y"); test.equal(f(1.23e+28), "12300.000Y"); test.equal(f(1.23e+29), "123000.00Y"); test.equal(f(1.23e+30), "1230000.0Y"); test.equal(f(-1.23e+21), "-1.2300000Z"); test.equal(f(-1.23e+22), "-12.300000Z"); test.equal(f(-1.23e+23), "-123.00000Z"); test.equal(f(-1.23e+24), "-1.2300000Y"); test.equal(f(-1.23e+25), "-12.300000Y"); test.equal(f(-1.23e+26), "-123.00000Y"); test.equal(f(-1.23e+27), "-1230.0000Y"); test.equal(f(-1.23e+28), "-12300.000Y"); test.equal(f(-1.23e+29), "-123000.00Y"); test.equal(f(-1.23e+30), "-1230000.0Y"); test.end(); }); tape("format(\"$s\") outputs SI-prefix notation with a currency symbol", function(test) { var f1 = format.format("$.2s"); test.equal(f1(0), "$0.0"); test.equal(f1(2.5e5), "$250k"); test.equal(f1(-2.5e8), "-$250M"); test.equal(f1(2.5e11), "$250G"); var f2 = format.format("$.3s"); test.equal(f2(0), "$0.00"); test.equal(f2(1), "$1.00"); test.equal(f2(10), "$10.0"); test.equal(f2(100), "$100"); test.equal(f2(999.5), "$1.00k"); test.equal(f2(999500), "$1.00M"); test.equal(f2(1000), "$1.00k"); test.equal(f2(1500.5), "$1.50k"); test.equal(f2(145500000), "$146M"); test.equal(f2(145999999.999999347), "$146M"); test.equal(f2(1e26), "$100Y"); test.equal(f2(.000001), "$1.00µ"); test.equal(f2(.009995), "$10.0m"); var f3 = format.format("$.4s"); test.equal(f3(999.5), "$999.5"); test.equal(f3(999500), "$999.5k"); test.equal(f3(.009995), "$9.995m"); test.end(); }); tape("format(\"s\") SI-prefix notation precision is consistent for small and large numbers", function(test) { var f1 = format.format(".0s"); test.equal(f1(1e-5), "10µ"); test.equal(f1(1e-4), "100µ"); test.equal(f1(1e-3), "1m"); test.equal(f1(1e-2), "10m"); test.equal(f1(1e-1), "100m"); test.equal(f1(1e+0), "1"); test.equal(f1(1e+1), "10"); test.equal(f1(1e+2), "100"); test.equal(f1(1e+3), "1k"); test.equal(f1(1e+4), "10k"); test.equal(f1(1e+5), "100k"); var f2 = format.format(".4s"); test.equal(f2(1e-5), "10.00µ"); test.equal(f2(1e-4), "100.0µ"); test.equal(f2(1e-3), "1.000m"); test.equal(f2(1e-2), "10.00m"); test.equal(f2(1e-1), "100.0m"); test.equal(f2(1e+0), "1.000"); test.equal(f2(1e+1), "10.00"); test.equal(f2(1e+2), "100.0"); test.equal(f2(1e+3), "1.000k"); test.equal(f2(1e+4), "10.00k"); test.equal(f2(1e+5), "100.0k"); test.end(); }); tape("format(\"0[width],s\") will group thousands due to zero fill", function(test) { var f = format.format("020,s"); test.equal(f(42), "000,000,000,042.0000"); test.equal(f(42e12), "00,000,000,042.0000T"); test.end(); }); tape("format(\",s\") will group thousands for very large numbers", function(test) { var f = format.format(",s"); test.equal(f(42e30), "42,000,000Y"); test.end(); }); d3-format-1.4.5/test/format-type-x-test.js000066400000000000000000000057561371751623000203450ustar00rootroot00000000000000var tape = require("tape"), format = require("../"); tape("format(\"x\") returns the expected hexadecimal (lowercase) string", function(test) { test.equal(format.format("x")(0xdeadbeef), "deadbeef"); test.end(); }); tape("format(\"#x\") returns the expected hexadecimal (lowercase) string with prefix", function(test) { test.equal(format.format("#x")(0xdeadbeef), "0xdeadbeef"); test.end(); }); tape("format(\",x\") groups thousands", function(test) { test.equal(format.format(",x")(0xdeadbeef), "de,adb,eef"); test.end(); }); tape("format(\",x\") groups thousands", function(test) { test.equal(format.format(",x")(0xdeadbeef), "de,adb,eef"); test.end(); }); tape("format(\"#,x\") does not group the prefix", function(test) { test.equal(format.format("#,x")(0xadeadbeef), "0xade,adb,eef"); test.end(); }); tape("format(\"+#x\") puts the sign before the prefix", function(test) { test.equal(format.format("+#x")(0xdeadbeef), "+0xdeadbeef"); test.equal(format.format("+#x")(-0xdeadbeef), "-0xdeadbeef"); test.equal(format.format(" #x")(0xdeadbeef), " 0xdeadbeef"); test.equal(format.format(" #x")(-0xdeadbeef), "-0xdeadbeef"); test.end(); }); tape("format(\"$,x\") formats hexadecimal currency", function(test) { test.equal(format.format("$,x")(0xdeadbeef), "$de,adb,eef"); test.end(); }); tape("format(\"[.precision]x\") always has precision zero", function(test) { test.equal(format.format(".2x")(0xdeadbeef), "deadbeef"); test.equal(format.format(".2x")(-4.2), "-4"); test.end(); }); tape("format(\"x\") rounds non-integers", function(test) { test.equal(format.format("x")(2.4), "2"); test.end(); }); tape("format(\"x\") can format negative zero as zero", function(test) { test.equal(format.format("x")(-0), "0"); test.equal(format.format("x")(-1e-12), "0"); test.end(); }); tape("format(\"x\") does not consider -0xeee to be positive", function(test) { test.equal(format.format("x")(-0xeee), "-eee"); test.end(); }); tape("format(\"X\") returns the expected hexadecimal (uppercase) string", function(test) { test.equal(format.format("X")(0xdeadbeef), "DEADBEEF"); test.end(); }); tape("format(\"#X\") returns the expected hexadecimal (uppercase) string with prefix", function(test) { test.equal(format.format("#X")(0xdeadbeef), "0xDEADBEEF"); test.end(); }); tape("format(\"X\") can format negative zero as zero", function(test) { test.equal(format.format("X")(-0), "0"); test.equal(format.format("X")(-1e-12), "0"); test.end(); }); tape("format(\"X\") does not consider -0xeee to be positive", function(test) { test.equal(format.format("X")(-0xeee), "-EEE"); test.end(); }); tape("format(\"#[width]x\") considers the prefix", function(test) { test.equal(format.format("20x")(0xdeadbeef), " deadbeef"); test.equal(format.format("#20x")(0xdeadbeef), " 0xdeadbeef"); test.equal(format.format("020x")(0xdeadbeef), "000000000000deadbeef"); test.equal(format.format("#020x")(0xdeadbeef), "0x0000000000deadbeef"); test.end(); }); d3-format-1.4.5/test/formatPrefix-test.js000066400000000000000000000017701371751623000202670ustar00rootroot00000000000000var tape = require("tape"), format = require("../"); tape("formatPrefix(\"s\", value)(number) formats with the SI prefix appropriate to the specified value", function(test) { test.equal(format.formatPrefix(",.0s", 1e-6)(.00042), "420µ"); test.equal(format.formatPrefix(",.0s", 1e-6)(.0042), "4,200µ"); test.equal(format.formatPrefix(",.3s", 1e-3)(.00042), "0.420m"); test.end(); }); tape("formatPrefix(\"s\", value)(number) uses yocto for very small reference values", function(test) { test.equal(format.formatPrefix(",.0s", 1e-27)(1e-24), "1y"); test.end(); }); tape("formatPrefix(\"s\", value)(number) uses yotta for very small reference values", function(test) { test.equal(format.formatPrefix(",.0s", 1e27)(1e24), "1Y"); test.end(); }); tape("formatPrefix(\"$,s\", value)(number) formats with the specified SI prefix", function(test) { var f = format.formatPrefix(" $12,.1s", 1e6); test.equal(f(-42e6), " -$42.0M"); test.equal(f(+4.2e6), " $4.2M"); test.end(); }); d3-format-1.4.5/test/formatSpecifier-test.js000066400000000000000000000070651371751623000207460ustar00rootroot00000000000000var tape = require("tape"), format = require("../"); tape("formatSpecifier(specifier) throws an error for invalid formats", function(test) { test.throws(function() { format.formatSpecifier("foo"); }, /invalid format: foo/); test.throws(function() { format.formatSpecifier(".-2s"); }, /invalid format: \.-2s/); test.throws(function() { format.formatSpecifier(".f"); }, /invalid format: \.f/); test.end(); }); tape("formatSpecifier(specifier) returns an instanceof formatSpecifier", function(test) { var s = format.formatSpecifier(""); test.equal(s instanceof format.formatSpecifier, true); test.end(); }); tape("formatSpecifier(\"\") has the expected defaults", function(test) { var s = format.formatSpecifier(""); test.equal(s.fill, " "); test.equal(s.align, ">"); test.equal(s.sign, "-"); test.equal(s.symbol, ""); test.equal(s.zero, false); test.equal(s.width, undefined); test.equal(s.comma, false); test.equal(s.precision, undefined); test.equal(s.trim, false); test.equal(s.type, ""); test.end(); }); tape("formatSpecifier(specifier) preserves unknown types", function(test) { var s = format.formatSpecifier("q"); test.equal(s.trim, false); test.equal(s.type, "q"); test.end(); }); tape("formatSpecifier(specifier) preserves shorthand", function(test) { var s = format.formatSpecifier(""); test.equal(s.trim, false); test.equal(s.type, ""); test.end(); }); tape("formatSpecifier(specifier).toString() reflects current field values", function(test) { var s = format.formatSpecifier(""); test.equal((s.fill = "_", s) + "", "_>-"); test.equal((s.align = "^", s) + "", "_^-"); test.equal((s.sign = "+", s) + "", "_^+"); test.equal((s.symbol = "$", s) + "", "_^+$"); test.equal((s.zero = true, s) + "", "_^+$0"); test.equal((s.width = 12, s) + "", "_^+$012"); test.equal((s.comma = true, s) + "", "_^+$012,"); test.equal((s.precision = 2, s) + "", "_^+$012,.2"); test.equal((s.type = "f", s) + "", "_^+$012,.2f"); test.equal((s.trim = true, s) + "", "_^+$012,.2~f"); test.equal(format.format(s)(42), "+$0,000,000,042"); test.end(); }); tape("formatSpecifier(specifier).toString() clamps precision to zero", function(test) { var s = format.formatSpecifier(""); test.equal((s.precision = -1, s) + "", " >-.0"); test.end(); }); tape("formatSpecifier(specifier).toString() clamps width to one", function(test) { var s = format.formatSpecifier(""); test.equal((s.width = -1, s) + "", " >-1"); test.end(); }); tape("new FormatSpecifier({}) has the expected defaults", function(test) { var s = new format.FormatSpecifier({}); test.strictEqual(s.fill, " "); test.strictEqual(s.align, ">"); test.strictEqual(s.sign, "-"); test.strictEqual(s.symbol, ""); test.strictEqual(s.zero, false); test.strictEqual(s.width, undefined); test.strictEqual(s.comma, false); test.strictEqual(s.precision, undefined); test.strictEqual(s.trim, false); test.strictEqual(s.type, ""); test.end(); }); tape("new FormatSpecifier({…}) coerces all inputs to the expected types", function(test) { var s = new format.FormatSpecifier({ fill: 1, align: 2, sign: 3, symbol: 4, zero: 5, width: 6, comma: 7, precision: 8, trim: 9, type: 10 }); test.strictEqual(s.fill, "1"); test.strictEqual(s.align, "2"); test.strictEqual(s.sign, "3"); test.strictEqual(s.symbol, "4"); test.strictEqual(s.zero, true); test.strictEqual(s.width, 6); test.strictEqual(s.comma, true); test.strictEqual(s.precision, 8); test.strictEqual(s.trim, true); test.strictEqual(s.type, "10"); test.end(); }); d3-format-1.4.5/test/inDelta.js000066400000000000000000000004171371751623000162210ustar00rootroot00000000000000var tape = require("tape"); tape.Test.prototype.inDelta = function(actual, expected) { this._assert(expected - 1e-6 < actual && actual < expected + 1e-6, { message: "should be in delta", operator: "inDelta", actual: actual, expected: expected }); }; d3-format-1.4.5/test/locale-test.js000066400000000000000000000111461371751623000170560ustar00rootroot00000000000000var fs = require("fs").promises, path = require("path"), tape = require("tape"), d3 = require("../"); tape("formatLocale({decimal: decimal}) observes the specified decimal point", function(test) { test.equal(d3.formatLocale({decimal: "|"}).format("06.2f")(2), "002|00"); test.equal(d3.formatLocale({decimal: "/"}).format("06.2f")(2), "002/00"); test.end(); }); tape("formatLocale({currency: [prefix, suffix]}) observes the specified currency prefix and suffix", function(test) { test.equal(d3.formatLocale({decimal: ".", currency: ["฿", ""]}).format("$06.2f")(2), "฿02.00"); test.equal(d3.formatLocale({decimal: ".", currency: ["", "฿"]}).format("$06.2f")(2), "02.00฿"); test.end(); }); tape("formatLocale({currency: [prefix, suffix]}) places the currency suffix after the SI suffix", function(test) { test.equal(d3.formatLocale({decimal: ",", currency: ["", " €"]}).format("$.3s")(1.2e9), "1,20G €"); test.end(); }); tape("formatLocale({grouping: undefined}) does not perform any grouping", function(test) { test.equal(d3.formatLocale({decimal: "."}).format("012,.2f")(2), "000000002.00"); test.end(); }); tape("formatLocale({grouping: [sizes…]}) observes the specified group sizes", function(test) { test.equal(d3.formatLocale({decimal: ".", grouping: [3], thousands: ","}).format("012,.2f")(2), "0,000,002.00"); test.equal(d3.formatLocale({decimal: ".", grouping: [2], thousands: ","}).format("012,.2f")(2), "0,00,00,02.00"); test.equal(d3.formatLocale({decimal: ".", grouping: [2, 3], thousands: ","}).format("012,.2f")(2), "00,000,02.00"); test.equal(d3.formatLocale({decimal: ".", grouping: [3, 2, 2, 2, 2, 2, 2], thousands: ","}).format(",d")(1e12), "10,00,00,00,00,000"); test.end(); }); tape("formatLocale(…) can format numbers using the Indian numbering system.", function(test) { var format = d3.formatLocale(require("../locale/en-IN")).format(","); test.equal(format(10), "10"); test.equal(format(100), "100"); test.equal(format(1000), "1,000"); test.equal(format(10000), "10,000"); test.equal(format(100000), "1,00,000"); test.equal(format(1000000), "10,00,000"); test.equal(format(10000000), "1,00,00,000"); test.equal(format(10000000.4543), "1,00,00,000.4543"); test.equal(format(1000.321), "1,000.321"); test.equal(format(10.5), "10.5"); test.equal(format(-10), "-10"); test.equal(format(-100), "-100"); test.equal(format(-1000), "-1,000"); test.equal(format(-10000), "-10,000"); test.equal(format(-100000), "-1,00,000"); test.equal(format(-1000000), "-10,00,000"); test.equal(format(-10000000), "-1,00,00,000"); test.equal(format(-10000000.4543), "-1,00,00,000.4543"); test.equal(format(-1000.321), "-1,000.321"); test.equal(format(-10.5), "-10.5"); test.end(); }); tape("formatLocale({thousands: separator}) observes the specified group separator", function(test) { test.equal(d3.formatLocale({decimal: ".", grouping: [3], thousands: " "}).format("012,.2f")(2), "0 000 002.00"); test.equal(d3.formatLocale({decimal: ".", grouping: [3], thousands: "/"}).format("012,.2f")(2), "0/000/002.00"); test.end(); }); tape("formatLocale({percent: percent}) observes the specified percent sign", function(test) { test.equal(d3.formatLocale({decimal: ".", percent: "!"}).format("06.2%")(2), "200.00!"); test.equal(d3.formatLocale({decimal: ".", percent: "﹪"}).format("06.2%")(2), "200.00﹪"); test.end(); }); tape("formatLocale({minus: minus}) observes the specified minus sign", function(test) { test.equal(d3.formatLocale({decimal: ".", minus: "-"}).format("06.2f")(-2), "-02.00"); test.equal(d3.formatLocale({decimal: ".", minus: "−"}).format("06.2f")(-2), "−02.00"); test.equal(d3.formatLocale({decimal: ".", minus: "➖"}).format("06.2f")(-2), "➖02.00"); test.equal(d3.formatLocale({decimal: "."}).format("06.2f")(-2), "-02.00"); test.end(); }); tape("formatLocale({nan: nan}) observes the specified not-a-number representation", function(test) { test.equal(d3.formatLocale({nan: "N/A"}).format("6.2f")(undefined), " N/A"); test.equal(d3.formatLocale({nan: "-"}).format("<6.2g")(undefined), "- "); test.equal(d3.formatLocale({}).format(" 6.2f")(undefined), " NaN"); test.end(); }); tape("locale data is valid", async function(test) { for (const file of await fs.readdir("locale")) { if (!/\.json$/i.test(file)) continue; const locale = JSON.parse(await fs.readFile(path.join("locale", file), "utf8")); test.equal("currency" in locale, true); test.equal("decimal" in locale, true); test.equal("grouping" in locale, true); test.equal("thousands" in locale, true); d3.formatLocale(locale); } test.end(); }); d3-format-1.4.5/test/precisionFixed-test.js000066400000000000000000000006531371751623000205730ustar00rootroot00000000000000var tape = require("tape"), format = require("../"); tape("precisionFixed(number) returns the expected value", function(test) { test.equal(format.precisionFixed(8.9), 0); test.equal(format.precisionFixed(1.1), 0); test.equal(format.precisionFixed(0.89), 1); test.equal(format.precisionFixed(0.11), 1); test.equal(format.precisionFixed(0.089), 2); test.equal(format.precisionFixed(0.011), 2); test.end(); }); d3-format-1.4.5/test/precisionPrefix-test.js000066400000000000000000000037271371751623000207760ustar00rootroot00000000000000var tape = require("tape"), format = require("../"); // A generalization from µ to all prefixes: // test.equal(format.precisionPrefix(1e-6, 1e-6), 0); // 1µ // test.equal(format.precisionPrefix(1e-6, 1e-7), 0); // 10µ // test.equal(format.precisionPrefix(1e-6, 1e-8), 0); // 100µ tape("precisionPrefix(step, value) returns zero if step has the same units as value", function(test) { for (var i = -24; i <= 24; i += 3) { for (var j = i; j < i + 3; ++j) { test.equal(format.precisionPrefix(+("1e" + i), +("1e" + j)), 0); } } test.end(); }); // A generalization from µ to all prefixes: // test.equal(format.precisionPrefix(1e-9, 1e-6), 3); // 0.001µ // test.equal(format.precisionPrefix(1e-8, 1e-6), 2); // 0.01µ // test.equal(format.precisionPrefix(1e-7, 1e-6), 1); // 0.1µ tape("precisionPrefix(step, value) returns greater than zero if fractional digits are needed", function(test) { for (var i = -24; i <= 24; i += 3) { for (var j = i - 4; j < i; ++j) { test.equal(format.precisionPrefix(+("1e" + j), +("1e" + i)), i - j); } } test.end(); }); tape("precisionPrefix(step, value) returns the expected precision when value is less than one yocto", function(test) { test.equal(format.precisionPrefix(1e-24, 1e-24), 0); // 1y test.equal(format.precisionPrefix(1e-25, 1e-25), 1); // 0.1y test.equal(format.precisionPrefix(1e-26, 1e-26), 2); // 0.01y test.equal(format.precisionPrefix(1e-27, 1e-27), 3); // 0.001y test.equal(format.precisionPrefix(1e-28, 1e-28), 4); // 0.0001y test.end(); }); tape("precisionPrefix(step, value) returns the expected precision when value is greater than than one yotta", function(test) { test.equal(format.precisionPrefix(1e24, 1e24), 0); // 1Y test.equal(format.precisionPrefix(1e24, 1e25), 0); // 10Y test.equal(format.precisionPrefix(1e24, 1e26), 0); // 100Y test.equal(format.precisionPrefix(1e24, 1e27), 0); // 1000Y test.equal(format.precisionPrefix(1e23, 1e27), 1); // 1000.0Y test.end(); }); d3-format-1.4.5/test/precisionRound-test.js000066400000000000000000000006551371751623000206250ustar00rootroot00000000000000var tape = require("tape"), format = require("../"); tape("precisionRound(step, max) returns the expected value", function(test) { test.equal(format.precisionRound(0.1, 1.1), 2); // "1.0", "1.1" test.equal(format.precisionRound(0.01, 0.99), 2); // "0.98", "0.99" test.equal(format.precisionRound(0.01, 1.00), 2); // "0.99", "1.0" test.equal(format.precisionRound(0.01, 1.01), 3); // "1.00", "1.01" test.end(); }); d3-format-1.4.5/yarn.lock000066400000000000000000001430341371751623000151520ustar00rootroot00000000000000# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a" integrity sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg== dependencies: "@babel/highlight" "^7.10.4" "@babel/helper-validator-identifier@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz#a78c7a7251e01f616512d31b10adcf52ada5e0d2" integrity sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw== "@babel/highlight@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.10.4.tgz#7d1bdfd65753538fabe6c38596cdb76d9ac60143" integrity sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA== dependencies: "@babel/helper-validator-identifier" "^7.10.4" chalk "^2.0.0" js-tokens "^4.0.0" "@types/color-name@^1.1.1": version "1.1.1" resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== "@types/node@*": version "14.6.0" resolved "https://registry.yarnpkg.com/@types/node/-/node-14.6.0.tgz#7d4411bf5157339337d7cff864d9ff45f177b499" integrity sha512-mikldZQitV94akrc4sCcSjtJfsTKt4p+e/s0AGscVA6XArQ9kFclP+ZiYUMnq987rc6QlYxXv/EivqlfSLxpKA== acorn-jsx@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.2.0.tgz#4c66069173d6fdd68ed85239fc256226182b2ebe" integrity sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ== acorn@^7.3.1: version "7.4.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.0.tgz#e1ad486e6c54501634c6c397c5c121daa383607c" integrity sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w== ajv@^6.10.0, ajv@^6.10.2: version "6.12.4" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.4.tgz#0614facc4522127fa713445c6bfd3ebd376e2234" integrity sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ== dependencies: fast-deep-equal "^3.1.1" fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.4.1" uri-js "^4.2.2" ansi-colors@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== ansi-regex@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== ansi-regex@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== ansi-styles@^3.2.0, ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== dependencies: color-convert "^1.9.0" ansi-styles@^4.1.0: version "4.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.2.1.tgz#90ae75c424d008d2624c5bf29ead3177ebfcf359" integrity sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA== dependencies: "@types/color-name" "^1.1.1" color-convert "^2.0.1" argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== dependencies: sprintf-js "~1.0.2" array-filter@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-1.0.0.tgz#baf79e62e6ef4c2a4c0b831232daffec251f9d83" integrity sha1-uveeYubvTCpMC4MSMtr/7CUfnYM= astral-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== available-typed-arrays@^1.0.0, available-typed-arrays@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.2.tgz#6b098ca9d8039079ee3f77f7b783c4480ba513f5" integrity sha512-XWX3OX8Onv97LMk/ftVyBibpGwY5a8SmuxZPzeOxqmuEqUCOM9ZE+uIaD1VNJ5QnvU2UQusvmKbuM1FR8QWGfQ== dependencies: array-filter "^1.0.0" balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== dependencies: balanced-match "^1.0.0" concat-map "0.0.1" buffer-from@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== chalk@^2.0.0: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== dependencies: ansi-styles "^3.2.1" escape-string-regexp "^1.0.5" supports-color "^5.3.0" chalk@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== dependencies: ansi-styles "^4.1.0" supports-color "^7.1.0" color-convert@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== dependencies: color-name "1.1.3" color-convert@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== dependencies: color-name "~1.1.4" color-name@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= color-name@~1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== commander@^2.20.0: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= cross-spawn@^7.0.2: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== dependencies: path-key "^3.1.0" shebang-command "^2.0.0" which "^2.0.1" debug@^4.0.1: version "4.1.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== dependencies: ms "^2.1.1" deep-equal@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-2.0.3.tgz#cad1c15277ad78a5c01c49c2dee0f54de8a6a7b0" integrity sha512-Spqdl4H+ky45I9ByyJtXteOm9CaIrPmnIPmOhrkKGNYWeDgCvJ8jNYVCTjChxW4FqGuZnLHADc8EKRMX6+CgvA== dependencies: es-abstract "^1.17.5" es-get-iterator "^1.1.0" is-arguments "^1.0.4" is-date-object "^1.0.2" is-regex "^1.0.5" isarray "^2.0.5" object-is "^1.1.2" object-keys "^1.1.1" object.assign "^4.1.0" regexp.prototype.flags "^1.3.0" side-channel "^1.0.2" which-boxed-primitive "^1.0.1" which-collection "^1.0.1" which-typed-array "^1.1.2" deep-is@^0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= define-properties@^1.1.2, define-properties@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== dependencies: object-keys "^1.0.12" defined@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" integrity sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM= doctrine@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== dependencies: esutils "^2.0.2" dotignore@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/dotignore/-/dotignore-0.1.2.tgz#f942f2200d28c3a76fbdd6f0ee9f3257c8a2e905" integrity sha512-UGGGWfSauusaVJC+8fgV+NVvBXkCTmVv7sk6nojDZZvuOUNGUy0Zk4UpHQD6EDjS0jpBwcACvH4eofvyzBcRDw== dependencies: minimatch "^3.0.4" emoji-regex@^7.0.1: version "7.0.3" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== enquirer@^2.3.5: version "2.3.6" resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== dependencies: ansi-colors "^4.1.1" es-abstract@^1.17.0-next.1, es-abstract@^1.17.4, es-abstract@^1.17.5: version "1.17.6" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.6.tgz#9142071707857b2cacc7b89ecb670316c3e2d52a" integrity sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw== dependencies: es-to-primitive "^1.2.1" function-bind "^1.1.1" has "^1.0.3" has-symbols "^1.0.1" is-callable "^1.2.0" is-regex "^1.1.0" object-inspect "^1.7.0" object-keys "^1.1.1" object.assign "^4.1.0" string.prototype.trimend "^1.0.1" string.prototype.trimstart "^1.0.1" es-get-iterator@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/es-get-iterator/-/es-get-iterator-1.1.0.tgz#bb98ad9d6d63b31aacdc8f89d5d0ee57bcb5b4c8" integrity sha512-UfrmHuWQlNMTs35e1ypnvikg6jCz3SK8v8ImvmDsh36fCVUR1MqoFDiyn0/k52C8NqO3YsO8Oe0azeesNuqSsQ== dependencies: es-abstract "^1.17.4" has-symbols "^1.0.1" is-arguments "^1.0.4" is-map "^2.0.1" is-set "^2.0.1" is-string "^1.0.5" isarray "^2.0.5" es-to-primitive@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== dependencies: is-callable "^1.1.4" is-date-object "^1.0.1" is-symbol "^1.0.2" escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= eslint-scope@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.0.tgz#d0f971dfe59c69e0cada684b23d49dbf82600ce5" integrity sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w== dependencies: esrecurse "^4.1.0" estraverse "^4.1.1" eslint-utils@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== dependencies: eslint-visitor-keys "^1.1.0" eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== eslint@7: version "7.7.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.7.0.tgz#18beba51411927c4b64da0a8ceadefe4030d6073" integrity sha512-1KUxLzos0ZVsyL81PnRN335nDtQ8/vZUD6uMtWbF+5zDtjKcsklIi78XoE0MVL93QvWTu+E5y44VyyCsOMBrIg== dependencies: "@babel/code-frame" "^7.0.0" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" debug "^4.0.1" doctrine "^3.0.0" enquirer "^2.3.5" eslint-scope "^5.1.0" eslint-utils "^2.1.0" eslint-visitor-keys "^1.3.0" espree "^7.2.0" esquery "^1.2.0" esutils "^2.0.2" file-entry-cache "^5.0.1" functional-red-black-tree "^1.0.1" glob-parent "^5.0.0" globals "^12.1.0" ignore "^4.0.6" import-fresh "^3.0.0" imurmurhash "^0.1.4" is-glob "^4.0.0" js-yaml "^3.13.1" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" lodash "^4.17.19" minimatch "^3.0.4" natural-compare "^1.4.0" optionator "^0.9.1" progress "^2.0.0" regexpp "^3.1.0" semver "^7.2.1" strip-ansi "^6.0.0" strip-json-comments "^3.1.0" table "^5.2.3" text-table "^0.2.0" v8-compile-cache "^2.0.3" espree@^7.2.0: version "7.2.0" resolved "https://registry.yarnpkg.com/espree/-/espree-7.2.0.tgz#1c263d5b513dbad0ac30c4991b93ac354e948d69" integrity sha512-H+cQ3+3JYRMEIOl87e7QdHX70ocly5iW4+dttuR8iYSPr/hXKFb+7dBsZ7+u1adC4VrnPlTkv0+OwuPnDop19g== dependencies: acorn "^7.3.1" acorn-jsx "^5.2.0" eslint-visitor-keys "^1.3.0" esprima@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== esquery@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.3.1.tgz#b78b5828aa8e214e29fb74c4d5b752e1c033da57" integrity sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ== dependencies: estraverse "^5.1.0" esrecurse@^4.1.0: version "4.2.1" resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ== dependencies: estraverse "^4.1.0" estraverse@^4.1.0, estraverse@^4.1.1: version "4.3.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== estraverse@^5.1.0: version "5.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== esutils@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== fast-deep-equal@^3.1.1: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== fast-json-stable-stringify@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== fast-levenshtein@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= file-entry-cache@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== dependencies: flat-cache "^2.0.1" flat-cache@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== dependencies: flatted "^2.0.0" rimraf "2.6.3" write "1.0.3" flatted@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== for-each@^0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== dependencies: is-callable "^1.1.3" foreach@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" integrity sha1-C+4AUBiusmDQo6865ljdATbsG5k= fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= fsevents@~2.1.2: version "2.1.3" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== functional-red-black-tree@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= glob-parent@^5.0.0: version "5.1.1" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== dependencies: is-glob "^4.0.1" glob@^7.1.3, glob@^7.1.6: version "7.1.6" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" inherits "2" minimatch "^3.0.4" once "^1.3.0" path-is-absolute "^1.0.0" globals@^12.1.0: version "12.4.0" resolved "https://registry.yarnpkg.com/globals/-/globals-12.4.0.tgz#a18813576a41b00a24a97e7f815918c2e19925f8" integrity sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg== dependencies: type-fest "^0.8.1" has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= has-flag@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== has-symbols@^1.0.0, has-symbols@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== has@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== dependencies: function-bind "^1.1.1" ignore@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== import-fresh@^3.0.0: version "3.2.1" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.2.1.tgz#633ff618506e793af5ac91bf48b72677e15cbe66" integrity sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ== dependencies: parent-module "^1.0.0" resolve-from "^4.0.0" imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= dependencies: once "^1.3.0" wrappy "1" inherits@2, inherits@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== is-arguments@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.0.4.tgz#3faf966c7cba0ff437fb31f6250082fcf0448cf3" integrity sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA== is-bigint@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.0.tgz#73da8c33208d00f130e9b5e15d23eac9215601c4" integrity sha512-t5mGUXC/xRheCK431ylNiSkGGpBp8bHENBcENTkDT6ppwPzEVxNGZRvgvmOEfbWkFhA7D2GEuE2mmQTr78sl2g== is-boolean-object@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.0.1.tgz#10edc0900dd127697a92f6f9807c7617d68ac48e" integrity sha512-TqZuVwa/sppcrhUCAYkGBk7w0yxfQQnxq28fjkO53tnK9FQXmdwz2JS5+GjsWQ6RByES1K40nI+yDic5c9/aAQ== is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.0.tgz#83336560b54a38e35e3a2df7afd0454d691468bb" integrity sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw== is-date-object@^1.0.1, is-date-object@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.2.tgz#bda736f2cd8fd06d32844e7743bfa7494c3bfd7e" integrity sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g== is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= is-glob@^4.0.0, is-glob@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== dependencies: is-extglob "^2.1.1" is-map@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.1.tgz#520dafc4307bb8ebc33b813de5ce7c9400d644a1" integrity sha512-T/S49scO8plUiAOA2DBTBG3JHpn1yiw0kRp6dgiZ0v2/6twi5eiB0rHtHFH9ZIrvlWc6+4O+m4zg5+Z833aXgw== is-number-object@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.4.tgz#36ac95e741cf18b283fc1ddf5e83da798e3ec197" integrity sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw== is-regex@^1.0.5, is-regex@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.1.tgz#c6f98aacc546f6cec5468a07b7b153ab564a57b9" integrity sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg== dependencies: has-symbols "^1.0.1" is-set@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/is-set/-/is-set-2.0.1.tgz#d1604afdab1724986d30091575f54945da7e5f43" integrity sha512-eJEzOtVyenDs1TMzSQ3kU3K+E0GUS9sno+F0OBT97xsgcJsF9nXMBtkT9/kut5JEpM7oL7X/0qxR17K3mcwIAA== is-string@^1.0.4, is-string@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.5.tgz#40493ed198ef3ff477b8c7f92f644ec82a5cd3a6" integrity sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ== is-symbol@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.3.tgz#38e1014b9e6329be0de9d24a414fd7441ec61937" integrity sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ== dependencies: has-symbols "^1.0.1" is-typed-array@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.3.tgz#a4ff5a5e672e1a55f99c7f54e59597af5c1df04d" integrity sha512-BSYUBOK/HJibQ30wWkWold5txYwMUXQct9YHAQJr8fSwvZoiglcqB0pd7vEN23+Tsi9IUEjztdOSzl4qLVYGTQ== dependencies: available-typed-arrays "^1.0.0" es-abstract "^1.17.4" foreach "^2.0.5" has-symbols "^1.0.1" is-weakmap@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/is-weakmap/-/is-weakmap-2.0.1.tgz#5008b59bdc43b698201d18f62b37b2ca243e8cf2" integrity sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA== is-weakset@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/is-weakset/-/is-weakset-2.0.1.tgz#e9a0af88dbd751589f5e50d80f4c98b780884f83" integrity sha512-pi4vhbhVHGLxohUw7PhGsueT4vRGFoXhP7+RGN0jKIv9+8PWYCQTqtADngrxOm2g46hoH0+g8uZZBzMrvVGDmw== isarray@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= jest-worker@^26.2.1: version "26.3.0" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.3.0.tgz#7c8a97e4f4364b4f05ed8bca8ca0c24de091871f" integrity sha512-Vmpn2F6IASefL+DVBhPzI2J9/GJUsqzomdeN+P+dK8/jKxbh8R3BtFnx3FIta7wYlPU62cpJMJQo4kuOowcMnw== dependencies: "@types/node" "*" merge-stream "^2.0.0" supports-color "^7.0.0" js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== js-yaml@^3.13.1: version "3.14.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.0.tgz#a7a34170f26a21bb162424d8adacb4113a69e482" integrity sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A== dependencies: argparse "^1.0.7" esprima "^4.0.0" json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= levn@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== dependencies: prelude-ls "^1.2.1" type-check "~0.4.0" lodash@^4.17.14, lodash@^4.17.19: version "4.17.20" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== dependencies: brace-expansion "^1.1.7" minimist@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== mkdirp@^0.5.1: version "0.5.5" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== dependencies: minimist "^1.2.5" ms@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= object-inspect@^1.7.0: version "1.8.0" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.8.0.tgz#df807e5ecf53a609cc6bfe93eac3cc7be5b3a9d0" integrity sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA== object-is@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.2.tgz#c5d2e87ff9e119f78b7a088441519e2eec1573b6" integrity sha512-5lHCz+0uufF6wZ7CRFWJN3hp8Jqblpgve06U5CMQ3f//6iDjPr2PEo9MWCjEssDsa+UZEL4PkFpr+BMop6aKzQ== dependencies: define-properties "^1.1.3" es-abstract "^1.17.5" object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== object.assign@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== dependencies: define-properties "^1.1.2" function-bind "^1.1.1" has-symbols "^1.0.0" object-keys "^1.0.11" once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= dependencies: wrappy "1" optionator@^0.9.1: version "0.9.1" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== dependencies: deep-is "^0.1.3" fast-levenshtein "^2.0.6" levn "^0.4.1" prelude-ls "^1.2.1" type-check "^0.4.0" word-wrap "^1.2.3" parent-module@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== dependencies: callsites "^3.0.0" path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= path-key@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== path-parse@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== progress@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== punycode@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== dependencies: safe-buffer "^5.1.0" regexp.prototype.flags@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz#7aba89b3c13a64509dabcf3ca8d9fbb9bdf5cb75" integrity sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ== dependencies: define-properties "^1.1.3" es-abstract "^1.17.0-next.1" regexpp@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2" integrity sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q== resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== resolve@^1.17.0: version "1.17.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== dependencies: path-parse "^1.0.6" resumer@^0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/resumer/-/resumer-0.0.0.tgz#f1e8f461e4064ba39e82af3cdc2a8c893d076759" integrity sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k= dependencies: through "~2.3.4" rimraf@2.6.3: version "2.6.3" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== dependencies: glob "^7.1.3" rollup-plugin-terser@7: version "7.0.0" resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-7.0.0.tgz#26b38ada4f0b351cd7cd872ca04c0f8532d4864f" integrity sha512-p/N3lLiFusCjYTLfVkoaiRTOGr5AESEaljMPH12MhOtoMkmTBhIAfuadrcWy4am1U0vU4WTxO9fi0K09O4CboQ== dependencies: "@babel/code-frame" "^7.10.4" jest-worker "^26.2.1" serialize-javascript "^4.0.0" terser "^5.0.0" rollup@2: version "2.26.4" resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.26.4.tgz#a8350fd6bd56fce9873a7db2bd9547d40de3992b" integrity sha512-6+qsGuP0MXGd7vlYmk72utm1MrgZj5GfXibGL+cRkKQ9+ZL/BnFThDl0D5bcl7AqlzMjAQXRAwZX1HVm22M/4Q== optionalDependencies: fsevents "~2.1.2" safe-buffer@^5.1.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== semver@^7.2.1: version "7.3.2" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938" integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ== serialize-javascript@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-4.0.0.tgz#b525e1238489a5ecfc42afacc3fe99e666f4b1aa" integrity sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw== dependencies: randombytes "^2.1.0" shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== dependencies: shebang-regex "^3.0.0" shebang-regex@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== side-channel@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.2.tgz#df5d1abadb4e4bf4af1cd8852bf132d2f7876947" integrity sha512-7rL9YlPHg7Ancea1S96Pa8/QWb4BtXL/TZvS6B8XFetGBeuhAsfmUspK6DokBeZ64+Kj9TCNRD/30pVz1BvQNA== dependencies: es-abstract "^1.17.0-next.1" object-inspect "^1.7.0" slice-ansi@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== dependencies: ansi-styles "^3.2.0" astral-regex "^1.0.0" is-fullwidth-code-point "^2.0.0" source-map-support@~0.5.12: version "0.5.19" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" source-map@^0.6.0, source-map@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= string-width@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== dependencies: emoji-regex "^7.0.1" is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" string.prototype.trim@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.1.tgz#141233dff32c82bfad80684d7e5f0869ee0fb782" integrity sha512-MjGFEeqixw47dAMFMtgUro/I0+wNqZB5GKXGt1fFr24u3TzDXCPu7J9Buppzoe3r/LqkSDLDDJzE15RGWDGAVw== dependencies: define-properties "^1.1.3" es-abstract "^1.17.0-next.1" function-bind "^1.1.1" string.prototype.trimend@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz#85812a6b847ac002270f5808146064c995fb6913" integrity sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g== dependencies: define-properties "^1.1.3" es-abstract "^1.17.5" string.prototype.trimstart@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz#14af6d9f34b053f7cfc89b72f8f2ee14b9039a54" integrity sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw== dependencies: define-properties "^1.1.3" es-abstract "^1.17.5" strip-ansi@^5.1.0: version "5.2.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== dependencies: ansi-regex "^4.1.0" strip-ansi@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== dependencies: ansi-regex "^5.0.0" strip-json-comments@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== dependencies: has-flag "^3.0.0" supports-color@^7.0.0, supports-color@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.1.0.tgz#68e32591df73e25ad1c4b49108a2ec507962bfd1" integrity sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g== dependencies: has-flag "^4.0.0" table@^5.2.3: version "5.4.6" resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" integrity sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug== dependencies: ajv "^6.10.2" lodash "^4.17.14" slice-ansi "^2.1.0" string-width "^3.0.0" tape@5: version "5.0.1" resolved "https://registry.yarnpkg.com/tape/-/tape-5.0.1.tgz#0d70ce90a586387c4efda4393e72872672a416a3" integrity sha512-wVsOl2shKPcjdJdc8a+PwacvrOdJZJ57cLUXlxW4TQ2R6aihXwG0m0bKm4mA4wjtQNTaLMCrYNEb4f9fjHKUYQ== dependencies: deep-equal "^2.0.3" defined "^1.0.0" dotignore "^0.1.2" for-each "^0.3.3" function-bind "^1.1.1" glob "^7.1.6" has "^1.0.3" inherits "^2.0.4" is-regex "^1.0.5" minimist "^1.2.5" object-inspect "^1.7.0" object-is "^1.1.2" object.assign "^4.1.0" resolve "^1.17.0" resumer "^0.0.0" string.prototype.trim "^1.2.1" through "^2.3.8" terser@^5.0.0: version "5.2.0" resolved "https://registry.yarnpkg.com/terser/-/terser-5.2.0.tgz#e547d0b20926b321d3e524bf9e5bc1b10ba2f360" integrity sha512-nZ9TWhBznZdlww3borgJyfQDrxzpgd0RlRNoxR63tMVry01lIH/zKQDTTiaWRMGowydfvSHMgyiGyn6A9PSkCQ== dependencies: commander "^2.20.0" source-map "~0.6.1" source-map-support "~0.5.12" text-table@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= through@^2.3.8, through@~2.3.4: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== dependencies: prelude-ls "^1.2.1" type-fest@^0.8.1: version "0.8.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== uri-js@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== dependencies: punycode "^2.1.0" v8-compile-cache@^2.0.3: version "2.1.1" resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz#54bc3cdd43317bca91e35dcaf305b1a7237de745" integrity sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ== which-boxed-primitive@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.1.tgz#cbe8f838ebe91ba2471bb69e9edbda67ab5a5ec1" integrity sha512-7BT4TwISdDGBgaemWU0N0OU7FeAEJ9Oo2P1PHRm/FCWoEi2VLWC9b6xvxAA3C/NMpxg3HXVgi0sMmGbNUbNepQ== dependencies: is-bigint "^1.0.0" is-boolean-object "^1.0.0" is-number-object "^1.0.3" is-string "^1.0.4" is-symbol "^1.0.2" which-collection@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/which-collection/-/which-collection-1.0.1.tgz#70eab71ebbbd2aefaf32f917082fc62cdcb70906" integrity sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A== dependencies: is-map "^2.0.1" is-set "^2.0.1" is-weakmap "^2.0.1" is-weakset "^2.0.1" which-typed-array@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.2.tgz#e5f98e56bda93e3dac196b01d47c1156679c00b2" integrity sha512-KT6okrd1tE6JdZAy3o2VhMoYPh3+J6EMZLyrxBQsZflI1QCZIxMrIYLkosd8Twf+YfknVIHmYQPgJt238p8dnQ== dependencies: available-typed-arrays "^1.0.2" es-abstract "^1.17.5" foreach "^2.0.5" function-bind "^1.1.1" has-symbols "^1.0.1" is-typed-array "^1.1.3" which@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== dependencies: isexe "^2.0.0" word-wrap@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= write@1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== dependencies: mkdirp "^0.5.1"