new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J E F G A B BC"},B:{"2":"C K L H M N O","129":"P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t"},C:{"1":"CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB","2":"0 1 2 3 4 5 6 7 8 9 CC tB I u J E F G A B C K L H M N O v w x y z AB BB DC EC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB","129":"vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC","450":"HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB"},E:{"1":"3B 4B 5B sB 6B 7B 8B NC","2":"I u J E F G A B C K GC zB HC IC JC KC 0B qB rB 1B","578":"L H LC MC 2B"},F:{"2":"0 1 2 3 G B C H M N O v w x y z OC PC QC RC qB 9B SC rB","129":"OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d","450":"4 5 6 7 8 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB"},G:{"1":"3B 4B 5B sB 6B 7B 8B","2":"F zB TC AC UC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC","578":"lC mC 2B"},H:{"2":"nC"},I:{"1":"D","2":"tB I oC pC qC rC AC sC tC"},J:{"2":"E A"},K:{"1":"e","2":"A B C qB 9B rB"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"129":"uC"},P:{"1":"yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C","2":"I vC wC xC"},Q:{"129":"1B"},R:{"1":"8C"},S:{"2":"9C"}},B:5,C:"CSS Scroll-behavior"};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"1":"G A B","2":"J E F BC"},B:{"1":"C K L H M N O P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB","2":"CC","132":"tB DC EC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC","260":"I u J E F G A"},E:{"1":"u J E F G A B C K L H HC IC JC KC 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC","260":"I GC zB"},F:{"1":"0 1 2 3 4 5 6 7 8 9 B C H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d RC qB 9B SC rB","260":"G OC PC QC"},G:{"1":"F UC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC 2B 3B 4B 5B sB 6B 7B 8B","260":"zB TC AC"},H:{"260":"nC"},I:{"1":"I D rC AC sC tC","260":"tB oC pC qC"},J:{"1":"A","260":"E"},K:{"1":"B C e qB 9B rB","260":"A"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"uC"},P:{"1":"I vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C"},Q:{"1":"1B"},R:{"1":"8C"},S:{"1":"9C"}},B:2,C:"getComputedStyle"};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"delay.js","sources":["../../../src/internal/operators/delay.ts"],"names":[],"mappings":"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"}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
{"name":"mime-db","version":"1.47.0","files":{"LICENSE":{"checkedAt":1678887829688,"integrity":"sha512-UMHacIyP0mdeqn3RwddNQmJM+tRnkJ36atiCfecziXFoderaQYtNoFYpZyiyjcCVnPdjkihNzO1GiFfR8hhqmQ==","mode":438,"size":1099},"index.js":{"checkedAt":1678887829694,"integrity":"sha512-P7ZjIvyLa82ShMqIltVACEp4GKpXI52H7g3K8pup9SmpWJBmhbLGuwTa93j67YFYgRk05lbblo5d1e4xhOprMA==","mode":438,"size":136},"package.json":{"checkedAt":1678887829737,"integrity":"sha512-wn2wO4ckML9iv3oxOyBWeOKa6y33MRsLrDyyEDcy7BoAhpRX+nu0J++EGQoMMWLFpme7U4qawWJD3HVoStbKkw==","mode":438,"size":1596},"db.json":{"checkedAt":1678887829739,"integrity":"sha512-qG/JVh+gShma9pc2ElkJ2yqmGbw/7e19j2L5/VaUhRnwaXRn6W9rfE4UPKpxB6DN/NCZ/JZYCEJSO8h8kSkGHQ==","mode":438,"size":181592},"README.md":{"checkedAt":1678887829739,"integrity":"sha512-yQfBdzwXer+rcg2oLSzSo+Z9ctx9PXYhEDi33TmTcK+wHsJjxAHuzmrmxvieHDyyFwuMf093HJVpN2glU4KMaQ==","mode":438,"size":4062},"HISTORY.md":{"checkedAt":1678887829740,"integrity":"sha512-1+Ku2btRfWpO58WGmpeh7yLjzFmFUdMup4pdQsXM22K2Offm+sFZfPnwSB8i4AE3NPmzdaGwVhbobBNdPAdm/Q==","mode":438,"size":11768}}}
|
||||
@@ -0,0 +1,737 @@
|
||||
# Commander.js
|
||||
|
||||
[](http://travis-ci.org/tj/commander.js)
|
||||
[](https://www.npmjs.org/package/commander)
|
||||
[](https://npmcharts.com/compare/commander?minimal=true)
|
||||
[](https://packagephobia.now.sh/result?p=commander)
|
||||
|
||||
The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/commander-rb/commander).
|
||||
|
||||
Read this in other languages: English | [简体中文](./Readme_zh-CN.md)
|
||||
|
||||
- [Commander.js](#commanderjs)
|
||||
- [Installation](#installation)
|
||||
- [Declaring _program_ variable](#declaring-program-variable)
|
||||
- [Options](#options)
|
||||
- [Common option types, boolean and value](#common-option-types-boolean-and-value)
|
||||
- [Default option value](#default-option-value)
|
||||
- [Other option types, negatable boolean and flag|value](#other-option-types-negatable-boolean-and-flagvalue)
|
||||
- [Custom option processing](#custom-option-processing)
|
||||
- [Required option](#required-option)
|
||||
- [Version option](#version-option)
|
||||
- [Commands](#commands)
|
||||
- [Specify the argument syntax](#specify-the-argument-syntax)
|
||||
- [Action handler (sub)commands](#action-handler-subcommands)
|
||||
- [Stand-alone executable (sub)commands](#stand-alone-executable-subcommands)
|
||||
- [Automated help](#automated-help)
|
||||
- [Custom help](#custom-help)
|
||||
- [.usage and .name](#usage-and-name)
|
||||
- [.help(cb)](#helpcb)
|
||||
- [.outputHelp(cb)](#outputhelpcb)
|
||||
- [.helpInformation()](#helpinformation)
|
||||
- [.helpOption(flags, description)](#helpoptionflags-description)
|
||||
- [.addHelpCommand()](#addhelpcommand)
|
||||
- [Custom event listeners](#custom-event-listeners)
|
||||
- [Bits and pieces](#bits-and-pieces)
|
||||
- [.parse() and .parseAsync()](#parse-and-parseasync)
|
||||
- [Avoiding option name clashes](#avoiding-option-name-clashes)
|
||||
- [TypeScript](#typescript)
|
||||
- [createCommand()](#createcommand)
|
||||
- [Node options such as `--harmony`](#node-options-such-as---harmony)
|
||||
- [Debugging stand-alone executable subcommands](#debugging-stand-alone-executable-subcommands)
|
||||
- [Override exit handling](#override-exit-handling)
|
||||
- [Examples](#examples)
|
||||
- [License](#license)
|
||||
- [Support](#support)
|
||||
- [Commander for enterprise](#commander-for-enterprise)
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install commander
|
||||
```
|
||||
|
||||
## Declaring _program_ variable
|
||||
|
||||
Commander exports a global object which is convenient for quick programs.
|
||||
This is used in the examples in this README for brevity.
|
||||
|
||||
```js
|
||||
const { program } = require('commander');
|
||||
program.version('0.0.1');
|
||||
```
|
||||
|
||||
For larger programs which may use commander in multiple ways, including unit testing, it is better to create a local Command object to use.
|
||||
|
||||
```js
|
||||
const { Command } = require('commander');
|
||||
const program = new Command();
|
||||
program.version('0.0.1');
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
Options are defined with the `.option()` method, also serving as documentation for the options. Each option can have a short flag (single character) and a long name, separated by a comma or space or vertical bar ('|').
|
||||
|
||||
The options can be accessed as properties on the Command object. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc. See also optional new behaviour to [avoid name clashes](#avoiding-option-name-clashes).
|
||||
|
||||
Multiple short flags may optionally be combined in a single argument following the dash: boolean flags, the last flag may take a value, and the value.
|
||||
For example `-a -b -p 80` may be written as `-ab -p80` or even `-abp80`.
|
||||
|
||||
You can use `--` to indicate the end of the options, and any remaining arguments will be used without being interpreted.
|
||||
This is particularly useful for passing options through to another
|
||||
command, like: `do -- git --version`.
|
||||
|
||||
Options on the command line are not positional, and can be specified before or after other command arguments.
|
||||
|
||||
### Common option types, boolean and value
|
||||
|
||||
The two most used option types are a boolean flag, and an option which takes a value (declared using angle brackets). Both are `undefined` unless specified on command line.
|
||||
|
||||
```js
|
||||
const { program } = require('commander');
|
||||
|
||||
program
|
||||
.option('-d, --debug', 'output extra debugging')
|
||||
.option('-s, --small', 'small pizza size')
|
||||
.option('-p, --pizza-type <type>', 'flavour of pizza');
|
||||
|
||||
program.parse(process.argv);
|
||||
|
||||
if (program.debug) console.log(program.opts());
|
||||
console.log('pizza details:');
|
||||
if (program.small) console.log('- small pizza size');
|
||||
if (program.pizzaType) console.log(`- ${program.pizzaType}`);
|
||||
```
|
||||
|
||||
```bash
|
||||
$ pizza-options -d
|
||||
{ debug: true, small: undefined, pizzaType: undefined }
|
||||
pizza details:
|
||||
$ pizza-options -p
|
||||
error: option '-p, --pizza-type <type>' argument missing
|
||||
$ pizza-options -ds -p vegetarian
|
||||
{ debug: true, small: true, pizzaType: 'vegetarian' }
|
||||
pizza details:
|
||||
- small pizza size
|
||||
- vegetarian
|
||||
$ pizza-options --pizza-type=cheese
|
||||
pizza details:
|
||||
- cheese
|
||||
```
|
||||
|
||||
`program.parse(arguments)` processes the arguments, leaving any args not consumed by the program options in the `program.args` array.
|
||||
|
||||
### Default option value
|
||||
|
||||
You can specify a default value for an option which takes a value.
|
||||
|
||||
```js
|
||||
const { program } = require('commander');
|
||||
|
||||
program
|
||||
.option('-c, --cheese <type>', 'add the specified type of cheese', 'blue');
|
||||
|
||||
program.parse(process.argv);
|
||||
|
||||
console.log(`cheese: ${program.cheese}`);
|
||||
```
|
||||
|
||||
```bash
|
||||
$ pizza-options
|
||||
cheese: blue
|
||||
$ pizza-options --cheese stilton
|
||||
cheese: stilton
|
||||
```
|
||||
|
||||
### Other option types, negatable boolean and flag|value
|
||||
|
||||
You can specify a boolean option long name with a leading `no-` to set the option value to false when used.
|
||||
Defined alone this also makes the option true by default.
|
||||
|
||||
If you define `--foo` first, adding `--no-foo` does not change the default value from what it would
|
||||
otherwise be. You can specify a default boolean value for a boolean flag and it can be overridden on command line.
|
||||
|
||||
```js
|
||||
const { program } = require('commander');
|
||||
|
||||
program
|
||||
.option('--no-sauce', 'Remove sauce')
|
||||
.option('--cheese <flavour>', 'cheese flavour', 'mozzarella')
|
||||
.option('--no-cheese', 'plain with no cheese')
|
||||
.parse(process.argv);
|
||||
|
||||
const sauceStr = program.sauce ? 'sauce' : 'no sauce';
|
||||
const cheeseStr = (program.cheese === false) ? 'no cheese' : `${program.cheese} cheese`;
|
||||
console.log(`You ordered a pizza with ${sauceStr} and ${cheeseStr}`);
|
||||
```
|
||||
|
||||
```bash
|
||||
$ pizza-options
|
||||
You ordered a pizza with sauce and mozzarella cheese
|
||||
$ pizza-options --sauce
|
||||
error: unknown option '--sauce'
|
||||
$ pizza-options --cheese=blue
|
||||
You ordered a pizza with sauce and blue cheese
|
||||
$ pizza-options --no-sauce --no-cheese
|
||||
You ordered a pizza with no sauce and no cheese
|
||||
```
|
||||
|
||||
You can specify an option which functions as a flag but may also take a value (declared using square brackets).
|
||||
|
||||
```js
|
||||
const { program } = require('commander');
|
||||
|
||||
program
|
||||
.option('-c, --cheese [type]', 'Add cheese with optional type');
|
||||
|
||||
program.parse(process.argv);
|
||||
|
||||
if (program.cheese === undefined) console.log('no cheese');
|
||||
else if (program.cheese === true) console.log('add cheese');
|
||||
else console.log(`add cheese type ${program.cheese}`);
|
||||
```
|
||||
|
||||
```bash
|
||||
$ pizza-options
|
||||
no cheese
|
||||
$ pizza-options --cheese
|
||||
add cheese
|
||||
$ pizza-options --cheese mozzarella
|
||||
add cheese type mozzarella
|
||||
```
|
||||
|
||||
### Custom option processing
|
||||
|
||||
You may specify a function to do custom processing of option values. The callback function receives two parameters, the user specified value and the
|
||||
previous value for the option. It returns the new value for the option.
|
||||
|
||||
This allows you to coerce the option value to the desired type, or accumulate values, or do entirely custom processing.
|
||||
|
||||
You can optionally specify the default/starting value for the option after the function.
|
||||
|
||||
```js
|
||||
const { program } = require('commander');
|
||||
|
||||
function myParseInt(value, dummyPrevious) {
|
||||
// parseInt takes a string and an optional radix
|
||||
return parseInt(value);
|
||||
}
|
||||
|
||||
function increaseVerbosity(dummyValue, previous) {
|
||||
return previous + 1;
|
||||
}
|
||||
|
||||
function collect(value, previous) {
|
||||
return previous.concat([value]);
|
||||
}
|
||||
|
||||
function commaSeparatedList(value, dummyPrevious) {
|
||||
return value.split(',');
|
||||
}
|
||||
|
||||
program
|
||||
.option('-f, --float <number>', 'float argument', parseFloat)
|
||||
.option('-i, --integer <number>', 'integer argument', myParseInt)
|
||||
.option('-v, --verbose', 'verbosity that can be increased', increaseVerbosity, 0)
|
||||
.option('-c, --collect <value>', 'repeatable value', collect, [])
|
||||
.option('-l, --list <items>', 'comma separated list', commaSeparatedList)
|
||||
;
|
||||
|
||||
program.parse(process.argv);
|
||||
|
||||
if (program.float !== undefined) console.log(`float: ${program.float}`);
|
||||
if (program.integer !== undefined) console.log(`integer: ${program.integer}`);
|
||||
if (program.verbose > 0) console.log(`verbosity: ${program.verbose}`);
|
||||
if (program.collect.length > 0) console.log(program.collect);
|
||||
if (program.list !== undefined) console.log(program.list);
|
||||
```
|
||||
|
||||
```bash
|
||||
$ custom -f 1e2
|
||||
float: 100
|
||||
$ custom --integer 2
|
||||
integer: 2
|
||||
$ custom -v -v -v
|
||||
verbose: 3
|
||||
$ custom -c a -c b -c c
|
||||
[ 'a', 'b', 'c' ]
|
||||
$ custom --list x,y,z
|
||||
[ 'x', 'y', 'z' ]
|
||||
```
|
||||
|
||||
### Required option
|
||||
|
||||
You may specify a required (mandatory) option using `.requiredOption`. The option must have a value after parsing, usually specified on the command line, or perhaps from a default value (say from environment). The method is otherwise the same as `.option` in format, taking flags and description, and optional default value or custom processing.
|
||||
|
||||
```js
|
||||
const { program } = require('commander');
|
||||
|
||||
program
|
||||
.requiredOption('-c, --cheese <type>', 'pizza must have cheese');
|
||||
|
||||
program.parse(process.argv);
|
||||
```
|
||||
|
||||
```bash
|
||||
$ pizza
|
||||
error: required option '-c, --cheese <type>' not specified
|
||||
```
|
||||
|
||||
### Version option
|
||||
|
||||
The optional `version` method adds handling for displaying the command version. The default option flags are `-V` and `--version`, and when present the command prints the version number and exits.
|
||||
|
||||
```js
|
||||
program.version('0.0.1');
|
||||
```
|
||||
|
||||
```bash
|
||||
$ ./examples/pizza -V
|
||||
0.0.1
|
||||
```
|
||||
|
||||
You may change the flags and description by passing additional parameters to the `version` method, using
|
||||
the same syntax for flags as the `option` method. The version flags can be named anything, but a long name is required.
|
||||
|
||||
```js
|
||||
program.version('0.0.1', '-v, --vers', 'output the current version');
|
||||
```
|
||||
|
||||
## Commands
|
||||
|
||||
You can specify (sub)commands using `.command()` or `.addCommand()`. There are two ways these can be implemented: using an action handler attached to the command, or as a stand-alone executable file (described in more detail later). The subcommands may be nested ([example](./examples/nestedCommands.js)).
|
||||
|
||||
In the first parameter to `.command()` you specify the command name and any command arguments. The arguments may be `<required>` or `[optional]`, and the last argument may also be `variadic...`.
|
||||
|
||||
You can use `.addCommand()` to add an already configured subcommand to the program.
|
||||
|
||||
For example:
|
||||
|
||||
```js
|
||||
// Command implemented using action handler (description is supplied separately to `.command`)
|
||||
// Returns new command for configuring.
|
||||
program
|
||||
.command('clone <source> [destination]')
|
||||
.description('clone a repository into a newly created directory')
|
||||
.action((source, destination) => {
|
||||
console.log('clone command called');
|
||||
});
|
||||
|
||||
// Command implemented using stand-alone executable file (description is second parameter to `.command`)
|
||||
// Returns `this` for adding more commands.
|
||||
program
|
||||
.command('start <service>', 'start named service')
|
||||
.command('stop [service]', 'stop named service, or all if no name supplied');
|
||||
|
||||
// Command prepared separately.
|
||||
// Returns `this` for adding more commands.
|
||||
program
|
||||
.addCommand(build.makeBuildCommand());
|
||||
```
|
||||
|
||||
Configuration options can be passed with the call to `.command()` and `.addCommand()`. Specifying `true` for `opts.hidden` will remove the command from the generated help output. Specifying `true` for `opts.isDefault` will run the subcommand if no other subcommand is specified ([example](./examples/defaultCommand.js)).
|
||||
|
||||
### Specify the argument syntax
|
||||
|
||||
You use `.arguments` to specify the arguments for the top-level command, and for subcommands they are usually included in the `.command` call. Angled brackets (e.g. `<required>`) indicate required input. Square brackets (e.g. `[optional]`) indicate optional input.
|
||||
|
||||
```js
|
||||
const { program } = require('commander');
|
||||
|
||||
program
|
||||
.version('0.1.0')
|
||||
.arguments('<cmd> [env]')
|
||||
.action(function (cmd, env) {
|
||||
cmdValue = cmd;
|
||||
envValue = env;
|
||||
});
|
||||
|
||||
program.parse(process.argv);
|
||||
|
||||
if (typeof cmdValue === 'undefined') {
|
||||
console.error('no command given!');
|
||||
process.exit(1);
|
||||
}
|
||||
console.log('command:', cmdValue);
|
||||
console.log('environment:', envValue || "no environment given");
|
||||
```
|
||||
|
||||
The last argument of a command can be variadic, and only the last argument. To make an argument variadic you
|
||||
append `...` to the argument name. For example:
|
||||
|
||||
```js
|
||||
const { program } = require('commander');
|
||||
|
||||
program
|
||||
.version('0.1.0')
|
||||
.command('rmdir <dir> [otherDirs...]')
|
||||
.action(function (dir, otherDirs) {
|
||||
console.log('rmdir %s', dir);
|
||||
if (otherDirs) {
|
||||
otherDirs.forEach(function (oDir) {
|
||||
console.log('rmdir %s', oDir);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
program.parse(process.argv);
|
||||
```
|
||||
|
||||
The variadic argument is passed to the action handler as an array.
|
||||
|
||||
### Action handler (sub)commands
|
||||
|
||||
You can add options to a command that uses an action handler.
|
||||
The action handler gets passed a parameter for each argument you declared, and one additional argument which is the
|
||||
command object itself. This command argument has the values for the command-specific options added as properties.
|
||||
|
||||
```js
|
||||
const { program } = require('commander');
|
||||
|
||||
program
|
||||
.command('rm <dir>')
|
||||
.option('-r, --recursive', 'Remove recursively')
|
||||
.action(function (dir, cmdObj) {
|
||||
console.log('remove ' + dir + (cmdObj.recursive ? ' recursively' : ''))
|
||||
})
|
||||
|
||||
program.parse(process.argv)
|
||||
```
|
||||
|
||||
You may supply an `async` action handler, in which case you call `.parseAsync` rather than `.parse`.
|
||||
|
||||
```js
|
||||
async function run() { /* code goes here */ }
|
||||
|
||||
async function main() {
|
||||
program
|
||||
.command('run')
|
||||
.action(run);
|
||||
await program.parseAsync(process.argv);
|
||||
}
|
||||
```
|
||||
|
||||
A command's options on the command line are validated when the command is used. Any unknown options will be reported as an error.
|
||||
|
||||
### Stand-alone executable (sub)commands
|
||||
|
||||
When `.command()` is invoked with a description argument, this tells Commander that you're going to use stand-alone executables for subcommands.
|
||||
Commander will search the executables in the directory of the entry script (like `./examples/pm`) with the name `program-subcommand`, like `pm-install`, `pm-search`.
|
||||
You can specify a custom name with the `executableFile` configuration option.
|
||||
|
||||
You handle the options for an executable (sub)command in the executable, and don't declare them at the top-level.
|
||||
|
||||
```js
|
||||
// file: ./examples/pm
|
||||
const { program } = require('commander');
|
||||
|
||||
program
|
||||
.version('0.1.0')
|
||||
.command('install [name]', 'install one or more packages')
|
||||
.command('search [query]', 'search with optional query')
|
||||
.command('update', 'update installed packages', {executableFile: 'myUpdateSubCommand'})
|
||||
.command('list', 'list packages installed', {isDefault: true})
|
||||
.parse(process.argv);
|
||||
```
|
||||
|
||||
If the program is designed to be installed globally, make sure the executables have proper modes, like `755`.
|
||||
|
||||
## Automated help
|
||||
|
||||
The help information is auto-generated based on the information commander already knows about your program. The default
|
||||
help option is `-h,--help`. ([example](./examples/pizza))
|
||||
|
||||
```bash
|
||||
$ node ./examples/pizza --help
|
||||
Usage: pizza [options]
|
||||
|
||||
An application for pizzas ordering
|
||||
|
||||
Options:
|
||||
-V, --version output the version number
|
||||
-p, --peppers Add peppers
|
||||
-c, --cheese <type> Add the specified type of cheese (default: "marble")
|
||||
-C, --no-cheese You do not want any cheese
|
||||
-h, --help display help for command
|
||||
```
|
||||
|
||||
A `help` command is added by default if your command has subcommands. It can be used alone, or with a subcommand name to show
|
||||
further help for the subcommand. These are effectively the same if the `shell` program has implicit help:
|
||||
|
||||
```bash
|
||||
shell help
|
||||
shell --help
|
||||
|
||||
shell help spawn
|
||||
shell spawn --help
|
||||
```
|
||||
|
||||
### Custom help
|
||||
|
||||
You can display extra information by listening for "--help". ([example](./examples/custom-help))
|
||||
|
||||
```js
|
||||
program
|
||||
.option('-f, --foo', 'enable some foo');
|
||||
|
||||
// must be before .parse()
|
||||
program.on('--help', () => {
|
||||
console.log('');
|
||||
console.log('Example call:');
|
||||
console.log(' $ custom-help --help');
|
||||
});
|
||||
```
|
||||
|
||||
Yields the following help output:
|
||||
|
||||
```Text
|
||||
Usage: custom-help [options]
|
||||
|
||||
Options:
|
||||
-f, --foo enable some foo
|
||||
-h, --help display help for command
|
||||
|
||||
Example call:
|
||||
$ custom-help --help
|
||||
```
|
||||
|
||||
### .usage and .name
|
||||
|
||||
These allow you to customise the usage description in the first line of the help. The name is otherwise
|
||||
deduced from the (full) program arguments. Given:
|
||||
|
||||
```js
|
||||
program
|
||||
.name("my-command")
|
||||
.usage("[global options] command")
|
||||
```
|
||||
|
||||
The help will start with:
|
||||
|
||||
```Text
|
||||
Usage: my-command [global options] command
|
||||
```
|
||||
|
||||
### .help(cb)
|
||||
|
||||
Output help information and exit immediately. Optional callback cb allows post-processing of help text before it is displayed.
|
||||
|
||||
### .outputHelp(cb)
|
||||
|
||||
Output help information without exiting.
|
||||
Optional callback cb allows post-processing of help text before it is displayed.
|
||||
|
||||
### .helpInformation()
|
||||
|
||||
Get the command help information as a string for processing or displaying yourself. (The text does not include the custom help
|
||||
from `--help` listeners.)
|
||||
|
||||
### .helpOption(flags, description)
|
||||
|
||||
Override the default help flags and description.
|
||||
|
||||
```js
|
||||
program
|
||||
.helpOption('-e, --HELP', 'read more information');
|
||||
```
|
||||
|
||||
### .addHelpCommand()
|
||||
|
||||
You can explicitly turn on or off the implicit help command with `.addHelpCommand()` and `.addHelpCommand(false)`.
|
||||
|
||||
You can both turn on and customise the help command by supplying the name and description:
|
||||
|
||||
```js
|
||||
program.addHelpCommand('assist [command]', 'show assistance');
|
||||
```
|
||||
|
||||
## Custom event listeners
|
||||
|
||||
You can execute custom actions by listening to command and option events.
|
||||
|
||||
```js
|
||||
program.on('option:verbose', function () {
|
||||
process.env.VERBOSE = this.verbose;
|
||||
});
|
||||
|
||||
program.on('command:*', function (operands) {
|
||||
console.error(`error: unknown command '${operands[0]}'`);
|
||||
const availableCommands = program.commands.map(cmd => cmd.name());
|
||||
mySuggestBestMatch(operands[0], availableCommands);
|
||||
process.exitCode = 1;
|
||||
});
|
||||
```
|
||||
|
||||
## Bits and pieces
|
||||
|
||||
### .parse() and .parseAsync()
|
||||
|
||||
The first argument to `.parse` is the array of strings to parse. You may omit the parameter to implicitly use `process.argv`.
|
||||
|
||||
If the arguments follow different conventions than node you can pass a `from` option in the second parameter:
|
||||
|
||||
- 'node': default, `argv[0]` is the application and `argv[1]` is the script being run, with user parameters after that
|
||||
- 'electron': `argv[1]` varies depending on whether the electron application is packaged
|
||||
- 'user': all of the arguments from the user
|
||||
|
||||
For example:
|
||||
|
||||
```js
|
||||
program.parse(process.argv); // Explicit, node conventions
|
||||
program.parse(); // Implicit, and auto-detect electron
|
||||
program.parse(['-f', 'filename'], { from: 'user' });
|
||||
```
|
||||
|
||||
### Avoiding option name clashes
|
||||
|
||||
The original and default behaviour is that the option values are stored
|
||||
as properties on the program, and the action handler is passed a
|
||||
command object with the options values stored as properties.
|
||||
This is very convenient to code, but the downside is possible clashes with
|
||||
existing properties of Command.
|
||||
|
||||
There are two new routines to change the behaviour, and the default behaviour may change in the future:
|
||||
|
||||
- `storeOptionsAsProperties`: whether to store option values as properties on command object, or store separately (specify false) and access using `.opts()`
|
||||
- `passCommandToAction`: whether to pass command to action handler,
|
||||
or just the options (specify false)
|
||||
|
||||
([example](./examples/storeOptionsAsProperties-action.js))
|
||||
|
||||
```js
|
||||
program
|
||||
.storeOptionsAsProperties(false)
|
||||
.passCommandToAction(false);
|
||||
|
||||
program
|
||||
.name('my-program-name')
|
||||
.option('-n,--name <name>');
|
||||
|
||||
program
|
||||
.command('show')
|
||||
.option('-a,--action <action>')
|
||||
.action((options) => {
|
||||
console.log(options.action);
|
||||
});
|
||||
|
||||
program.parse(process.argv);
|
||||
|
||||
const programOptions = program.opts();
|
||||
console.log(programOptions.name);
|
||||
```
|
||||
|
||||
### TypeScript
|
||||
|
||||
The Commander package includes its TypeScript Definition file.
|
||||
|
||||
If you use `ts-node` and stand-alone executable subcommands written as `.ts` files, you need to call your program through node to get the subcommands called correctly. e.g.
|
||||
|
||||
```bash
|
||||
node -r ts-node/register pm.ts
|
||||
```
|
||||
|
||||
### createCommand()
|
||||
|
||||
This factory function creates a new command. It is exported and may be used instead of using `new`, like:
|
||||
|
||||
```js
|
||||
const { createCommand } = require('commander');
|
||||
const program = createCommand();
|
||||
```
|
||||
|
||||
`createCommand` is also a method of the Command object, and creates a new command rather than a subcommand. This gets used internally
|
||||
when creating subcommands using `.command()`, and you may override it to
|
||||
customise the new subcommand (examples using [subclass](./examples/custom-command-class.js) and [function](./examples/custom-command-function.js)).
|
||||
|
||||
### Node options such as `--harmony`
|
||||
|
||||
You can enable `--harmony` option in two ways:
|
||||
|
||||
- Use `#! /usr/bin/env node --harmony` in the subcommands scripts. (Note Windows does not support this pattern.)
|
||||
- Use the `--harmony` option when call the command, like `node --harmony examples/pm publish`. The `--harmony` option will be preserved when spawning subcommand process.
|
||||
|
||||
### Debugging stand-alone executable subcommands
|
||||
|
||||
An executable subcommand is launched as a separate child process.
|
||||
|
||||
If you are using the node inspector for [debugging](https://nodejs.org/en/docs/guides/debugging-getting-started/) executable subcommands using `node --inspect` et al,
|
||||
the inspector port is incremented by 1 for the spawned subcommand.
|
||||
|
||||
If you are using VSCode to debug executable subcommands you need to set the `"autoAttachChildProcesses": true` flag in your launch.json configuration.
|
||||
|
||||
### Override exit handling
|
||||
|
||||
By default Commander calls `process.exit` when it detects errors, or after displaying the help or version. You can override
|
||||
this behaviour and optionally supply a callback. The default override throws a `CommanderError`.
|
||||
|
||||
The override callback is passed a `CommanderError` with properties `exitCode` number, `code` string, and `message`. The default override behaviour is to throw the error, except for async handling of executable subcommand completion which carries on. The normal display of error messages or version or help
|
||||
is not affected by the override which is called after the display.
|
||||
|
||||
``` js
|
||||
program.exitOverride();
|
||||
|
||||
try {
|
||||
program.parse(process.argv);
|
||||
} catch (err) {
|
||||
// custom processing...
|
||||
}
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
```js
|
||||
const { program } = require('commander');
|
||||
|
||||
program
|
||||
.version('0.1.0')
|
||||
.option('-C, --chdir <path>', 'change the working directory')
|
||||
.option('-c, --config <path>', 'set config path. defaults to ./deploy.conf')
|
||||
.option('-T, --no-tests', 'ignore test hook');
|
||||
|
||||
program
|
||||
.command('setup [env]')
|
||||
.description('run setup commands for all envs')
|
||||
.option("-s, --setup_mode [mode]", "Which setup mode to use")
|
||||
.action(function(env, options){
|
||||
const mode = options.setup_mode || "normal";
|
||||
env = env || 'all';
|
||||
console.log('setup for %s env(s) with %s mode', env, mode);
|
||||
});
|
||||
|
||||
program
|
||||
.command('exec <cmd>')
|
||||
.alias('ex')
|
||||
.description('execute the given remote cmd')
|
||||
.option("-e, --exec_mode <mode>", "Which exec mode to use")
|
||||
.action(function(cmd, options){
|
||||
console.log('exec "%s" using %s mode', cmd, options.exec_mode);
|
||||
}).on('--help', function() {
|
||||
console.log('');
|
||||
console.log('Examples:');
|
||||
console.log('');
|
||||
console.log(' $ deploy exec sequential');
|
||||
console.log(' $ deploy exec async');
|
||||
});
|
||||
|
||||
program.parse(process.argv);
|
||||
```
|
||||
|
||||
More Demos can be found in the [examples](https://github.com/tj/commander.js/tree/master/examples) directory.
|
||||
|
||||
## License
|
||||
|
||||
[MIT](https://github.com/tj/commander.js/blob/master/LICENSE)
|
||||
|
||||
## Support
|
||||
|
||||
Commander 5.x is fully supported on Long Term Support versions of Node, and is likely to work with Node 6 but not tested.
|
||||
(For versions of Node below Node 6, use Commander 3.x or 2.x.)
|
||||
|
||||
The main forum for free and community support is the project [Issues](https://github.com/tj/commander.js/issues) on GitHub.
|
||||
|
||||
### Commander for enterprise
|
||||
|
||||
Available as part of the Tidelift Subscription
|
||||
|
||||
The maintainers of Commander and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-commander?utm_source=npm-commander&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
||||
@@ -0,0 +1,19 @@
|
||||
Copyright (c) 2011 Debuggable Limited <felix@debuggable.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -0,0 +1,816 @@
|
||||
#### 13.5.0
|
||||
|
||||
- **New features**:
|
||||
- `isVAT` [#1463](https://github.com/validatorjs/validator.js/pull/1463) @ CodingNagger
|
||||
- `isTaxID` [#1446](https://github.com/validatorjs/validator.js/pull/1446) @tplessas
|
||||
- `isBase58` [#1445](https://github.com/validatorjs/validator.js/pull/1445) @ezkemboi
|
||||
- `isStrongPassword` [#1348](https://github.com/validatorjs/validator.js/pull/1348) @door-bell
|
||||
|
||||
- **Fixes and Enhancements**:
|
||||
- [#1486](https://github.com/validatorjs/validator.js/pull/1486) `isISO8601`: add `strictSeparator` @brostone51
|
||||
- [#1474](https://github.com/validatorjs/validator.js/pull/1474) `isFQDN`: make more strict @CristhianMotoche
|
||||
- [#1469](https://github.com/validatorjs/validator.js/pull/1469) `isFQDN`: `allow_underscore` option @gibson042
|
||||
- [#1449](https://github.com/validatorjs/validator.js/pull/1449) `isEmail`: character blacklisting @rubiin
|
||||
- [#1436](https://github.com/validatorjs/validator.js/pull/1436) `isURL`: added `require_port` option @yshanli
|
||||
- [#1435](https://github.com/validatorjs/validator.js/pull/1435) `isEmail`: respect `ignore_max_length` option @evantahler
|
||||
- [#1402](https://github.com/validatorjs/validator.js/pull/1402) `isDate`: add strictMode and prevent mixed delimiters @tux-tn
|
||||
- [#1286](https://github.com/validatorjs/validator.js/pull/1286) `isAlpha`: support `ignore` option @mum-never-proud
|
||||
|
||||
- **New and Improved locales**:
|
||||
- `isAlpha`, `isAlphanumeric`:
|
||||
- [#1528](https://github.com/validatorjs/validator.js/pull/1528) multiple fixes @tux-tn @purell
|
||||
- [#1513](https://github.com/validatorjs/validator.js/pull/1513) `id-ID` and docs update @bekicot
|
||||
- [#1484](https://github.com/validatorjs/validator.js/pull/1484) [#1481](https://github.com/validatorjs/validator.js/pull/1481) `th-TH` @ipiranhaa
|
||||
- [#1455](https://github.com/validatorjs/validator.js/pull/1455) `fa-IR` @fakhrip
|
||||
- [#1447](https://github.com/validatorjs/validator.js/pull/1447) `az-AZ` @saidfagan
|
||||
- `isMobilePhone`:
|
||||
- [#1521](https://github.com/validatorjs/validator.js/pull/1521) `ar-MA` @artpumpkin
|
||||
- [#1492](https://github.com/validatorjs/validator.js/pull/1492) `de-LU`,`it-SM`, `sq-AL` and `ga-IE` @firlus
|
||||
- [#1487](https://github.com/validatorjs/validator.js/pull/1487) `en-HN` @jehielmartinez
|
||||
- [#1473](https://github.com/validatorjs/validator.js/pull/1473) `ar-LB`, `es-PE`, `ka-GE` @rubiin
|
||||
- [#1470](https://github.com/validatorjs/validator.js/pull/1444) `es-DO` @devrasec
|
||||
- [#1460](https://github.com/validatorjs/validator.js/pull/1444) `es-BO` @rubiin
|
||||
- [#1444](https://github.com/validatorjs/validator.js/pull/1444) `es-AR` @csrgt
|
||||
- [#1407](https://github.com/validatorjs/validator.js/pull/1407) `pt-BR` @viniciushvsilva
|
||||
- `isPostalCode`:
|
||||
- [#1534](https://github.com/validatorjs/validator.js/pull/1534) `CN` @httpsbao
|
||||
- [#1515](https://github.com/validatorjs/validator.js/pull/1515) `IR` @masoudDaliriyan
|
||||
- [#1502](https://github.com/validatorjs/validator.js/pull/1502) `SG`, `MY` @stranger26
|
||||
- [#1480](https://github.com/validatorjs/validator.js/pull/1480) `TH` @ipiranhaa
|
||||
- [#1459](https://github.com/validatorjs/validator.js/pull/1456) `BY` @rubiin
|
||||
- [#1456](https://github.com/validatorjs/validator.js/pull/1456) `DO` and `HT` @yomed
|
||||
- `isPassportNumber`:
|
||||
- [#1468](https://github.com/validatorjs/validator.js/pull/1468) `BY` @zenby
|
||||
- [#1467](https://github.com/validatorjs/validator.js/pull/1467) `RU` @dkochetkov
|
||||
|
||||
<sub>— this release is dedicated to @dbnandaa 🧒</sub>
|
||||
|
||||
#### 13.1.17
|
||||
|
||||
- **New features**:
|
||||
- None
|
||||
- **Fixes and chores**:
|
||||
- [#1425](https://github.com/validatorjs/validator.js/pull/1425) fix validation for _userinfo_ part for `isURL` @heanzyzabala
|
||||
- [#1419](https://github.com/validatorjs/validator.js/pull/1419) fix `isBase32` and `isBase64` to validate empty strings properly @AberDerBart
|
||||
- [#1408](https://github.com/validatorjs/validator.js/pull/1408) tests for `isTaxId` @dspinellis
|
||||
- [#1397](https://github.com/validatorjs/validator.js/pull/1397) added `validate_length` option for `isURL` @tomgrossman
|
||||
- [#1383](https://github.com/validatorjs/validator.js/pull/1383) [#1428](https://github.com/validatorjs/validator.js/pull/1428) doc typos @0xflotus @timgates42
|
||||
- [#1376](https://github.com/validatorjs/validator.js/pull/1376) add missing tests and switch to Coverall @tux-tn
|
||||
- [#1373](https://github.com/validatorjs/validator.js/pull/1373) improve code coverage @ezkemboi
|
||||
- [#1357](https://github.com/validatorjs/validator.js/pull/1357) add Node v6 on build pipeline @profnandaa
|
||||
|
||||
- **New and Improved locales**:
|
||||
- `isMobilePhone`:
|
||||
- [#1439](https://github.com/validatorjs/validator.js/pull/1439) `az-AZ` @saidfagan
|
||||
- [#1420](https://github.com/validatorjs/validator.js/pull/1420) `uz-Uz` @icyice0217
|
||||
- [#1391](https://github.com/validatorjs/validator.js/pull/1391) `de-DE` @heanzyzabala
|
||||
- [#1388](https://github.com/validatorjs/validator.js/pull/1388) `en-PH` @stinkymonkeyph
|
||||
- [#1370](https://github.com/validatorjs/validator.js/pull/1370) `es-ES` @rubiin
|
||||
- [#1356](https://github.com/validatorjs/validator.js/pull/1356) `bs-BA` @MladenZeljic
|
||||
- [#1303](https://github.com/validatorjs/validator.js/pull/1301) `zh-CN` @heathcliff-hu
|
||||
- `isPostalCode`:
|
||||
- [#1439](https://github.com/validatorjs/validator.js/pull/1439) `AZ` @saidfagan
|
||||
- [#1370](https://github.com/validatorjs/validator.js/pull/1370) `ES` @rubiin
|
||||
- [#1367](https://github.com/validatorjs/validator.js/pull/1367) `IL` @rubiin
|
||||
- `isAlpha`, `isAlphanumeric`:
|
||||
- [#1411](https://github.com/validatorjs/validator.js/pull/1411) `fa-AF`, `fa-IR` @stinkymonkeyph
|
||||
- [#1371](https://github.com/validatorjs/validator.js/pull/1371) `vi-VN` @rubiin
|
||||
- `isBAN`:
|
||||
- [#1394](https://github.com/validatorjs/validator.js/pull/1394) `EG`, `SV` @heanzyzabala
|
||||
- `isIdentityCard`:
|
||||
- [#1384](https://github.com/validatorjs/validator.js/pull/1384) `IT` @lorenzodb1
|
||||
|
||||
|
||||
#### 13.1.1
|
||||
|
||||
- Hotfix for a regex incompatibility in some browsers
|
||||
([#1355](https://github.com/chriso/validator.js/pull/1355)
|
||||
|
||||
#### 13.1.0
|
||||
|
||||
- Added an `isIMEI()` validator
|
||||
([#1346](https://github.com/chriso/validator.js/pull/1346))
|
||||
- Added an `isDate()` validator
|
||||
([#1270](https://github.com/chriso/validator.js/pull/1270))
|
||||
- Added an `isTaxID()` validator
|
||||
([#1336](https://github.com/chriso/validator.js/pull/1336))
|
||||
- Added DMS support to `isLatLong()`
|
||||
([#1340](https://github.com/chriso/validator.js/pull/1340))
|
||||
- Added support for URL-safe base64 validation
|
||||
([#1277](https://github.com/chriso/validator.js/pull/1277))
|
||||
- Added support for primitives in `isJSON()`
|
||||
([#1328](https://github.com/chriso/validator.js/pull/1328))
|
||||
- Added support for case-insensitive matching to `contains()`
|
||||
([#1334](https://github.com/chriso/validator.js/pull/1334))
|
||||
- Support additional cards in `isCreditCard()`
|
||||
([#1177](https://github.com/chriso/validator.js/pull/1177))
|
||||
- Support additional currencies in `isCurrency()`
|
||||
([#1306](https://github.com/chriso/validator.js/pull/1306))
|
||||
- Fixed `isFQDN()` handling of certain special chars
|
||||
([#1091](https://github.com/chriso/validator.js/pull/1091))
|
||||
- Fixed a bug in `isSlug()`
|
||||
([#1338](https://github.com/chriso/validator.js/pull/1338))
|
||||
- New and improved locales
|
||||
([#1112](https://github.com/chriso/validator.js/pull/1112),
|
||||
[#1167](https://github.com/chriso/validator.js/pull/1167),
|
||||
[#1198](https://github.com/chriso/validator.js/pull/1198),
|
||||
[#1199](https://github.com/chriso/validator.js/pull/1199),
|
||||
[#1273](https://github.com/chriso/validator.js/pull/1273),
|
||||
[#1279](https://github.com/chriso/validator.js/pull/1279),
|
||||
[#1281](https://github.com/chriso/validator.js/pull/1281),
|
||||
[#1293](https://github.com/chriso/validator.js/pull/1293),
|
||||
[#1294](https://github.com/chriso/validator.js/pull/1294),
|
||||
[#1311](https://github.com/chriso/validator.js/pull/1311),
|
||||
[#1312](https://github.com/chriso/validator.js/pull/1312),
|
||||
[#1313](https://github.com/chriso/validator.js/pull/1313),
|
||||
[#1314](https://github.com/chriso/validator.js/pull/1314),
|
||||
[#1315](https://github.com/chriso/validator.js/pull/1315),
|
||||
[#1317](https://github.com/chriso/validator.js/pull/1317),
|
||||
[#1322](https://github.com/chriso/validator.js/pull/1322),
|
||||
[#1324](https://github.com/chriso/validator.js/pull/1324),
|
||||
[#1330](https://github.com/chriso/validator.js/pull/1330),
|
||||
[#1337](https://github.com/chriso/validator.js/pull/1337))
|
||||
|
||||
#### 13.0.0
|
||||
|
||||
- Added `isEthereumAddress()` validator
|
||||
to validate [Ethereum addresses](https://en.wikipedia.org/wiki/Ethereum#Addresses)
|
||||
([#1117](https://github.com/chriso/validator.js/pull/1117))
|
||||
- Added `isBtcAddress()` validator
|
||||
to validate [Bitcoin addresses](https://en.bitcoin.it/wiki/Address)
|
||||
([#1163](https://github.com/chriso/validator.js/pull/1163))
|
||||
- Added `isIBAN()` validator
|
||||
to validate [International Bank Account Numbers](https://en.wikipedia.org/wiki/International_Bank_Account_Number)
|
||||
([#1243](https://github.com/chriso/validator.js/pull/1243))
|
||||
- Added `isEAN()` validator
|
||||
to validate [International Article Numbers](https://en.wikipedia.org/wiki/International_Article_Number)
|
||||
([#1244](https://github.com/chriso/validator.js/pull/1244))
|
||||
- Added `isSemVer()` validator
|
||||
to validate [Semantic Version Numbers](https://semver.org)
|
||||
([#1246](https://github.com/chriso/validator.js/pull/1246))
|
||||
- Added `isPassportNumber()` validator
|
||||
([#1250](https://github.com/chriso/validator.js/pull/1250))
|
||||
- Added `isRgbColor()` validator
|
||||
([#1141](https://github.com/chriso/validator.js/pull/1141))
|
||||
- Added `isHSL()` validator
|
||||
([#1159](https://github.com/chriso/validator.js/pull/1159))
|
||||
- Added `isLocale()` validator
|
||||
([#1072](https://github.com/chriso/validator.js/pull/1072))
|
||||
- Improved the `isIP()` validator
|
||||
([#1211](https://github.com/chriso/validator.js/pull/1211))
|
||||
- Improved the `isMACAddress()` validator
|
||||
([#1267](https://github.com/chriso/validator.js/pull/1267))
|
||||
- New and improved locales
|
||||
([#1238](https://github.com/chriso/validator.js/pull/1238),
|
||||
[#1265](https://github.com/chriso/validator.js/pull/1265))
|
||||
|
||||
#### 12.2.0
|
||||
|
||||
- Support CSS Colors Level 4 spec
|
||||
([#1233](https://github.com/chriso/validator.js/pull/1233))
|
||||
- Improve the `toFloat()` sanitizer
|
||||
([#1227](https://github.com/chriso/validator.js/pull/1227))
|
||||
- New and improved locales
|
||||
([#1200](https://github.com/chriso/validator.js/pull/1200),
|
||||
[#1207](https://github.com/chriso/validator.js/pull/1207),
|
||||
[#1213](https://github.com/chriso/validator.js/pull/1213),
|
||||
[#1217](https://github.com/chriso/validator.js/pull/1217),
|
||||
[#1234](https://github.com/chriso/validator.js/pull/1234))
|
||||
|
||||
#### 12.1.0
|
||||
|
||||
- ES module for webpack tree shaking
|
||||
([#1015](https://github.com/chriso/validator.js/pull/1015))
|
||||
- Updated `isIP()` to accept scoped IPv6 addresses
|
||||
([#1160](https://github.com/chriso/validator.js/pull/1160))
|
||||
- New and improved locales
|
||||
([#1162](https://github.com/chriso/validator.js/pull/1162),
|
||||
[#1183](https://github.com/chriso/validator.js/pull/1183),
|
||||
[#1187](https://github.com/chriso/validator.js/pull/1187),
|
||||
[#1191](https://github.com/chriso/validator.js/pull/1191))
|
||||
|
||||
#### 12.0.0
|
||||
|
||||
- Added `isOctal()` validator
|
||||
([#1153](https://github.com/chriso/validator.js/pull/1153))
|
||||
- Added `isSlug()` validator
|
||||
([#1096](https://github.com/chriso/validator.js/pull/1096))
|
||||
- Added `isBIC()` validator for bank identification codes
|
||||
([#1071](https://github.com/chriso/validator.js/pull/1071))
|
||||
- Allow uppercase chars in `isHash()`
|
||||
([#1062](https://github.com/chriso/validator.js/pull/1062))
|
||||
- Allow additional prefixes in `isHexadecimal()`
|
||||
([#1147](https://github.com/chriso/validator.js/pull/1147))
|
||||
- Allow additional separators in `isMACAddress()`
|
||||
([#1065](https://github.com/chriso/validator.js/pull/1065))
|
||||
- Better defaults for `isLength()`
|
||||
([#1070](https://github.com/chriso/validator.js/pull/1070))
|
||||
- Bug fixes
|
||||
([#1074](https://github.com/chriso/validator.js/pull/1074))
|
||||
- New and improved locales
|
||||
([#1059](https://github.com/chriso/validator.js/pull/1059),
|
||||
[#1060](https://github.com/chriso/validator.js/pull/1060),
|
||||
[#1069](https://github.com/chriso/validator.js/pull/1069),
|
||||
[#1073](https://github.com/chriso/validator.js/pull/1073),
|
||||
[#1082](https://github.com/chriso/validator.js/pull/1082),
|
||||
[#1092](https://github.com/chriso/validator.js/pull/1092),
|
||||
[#1121](https://github.com/chriso/validator.js/pull/1121),
|
||||
[#1125](https://github.com/chriso/validator.js/pull/1125),
|
||||
[#1132](https://github.com/chriso/validator.js/pull/1132),
|
||||
[#1152](https://github.com/chriso/validator.js/pull/1152),
|
||||
[#1165](https://github.com/chriso/validator.js/pull/1165),
|
||||
[#1166](https://github.com/chriso/validator.js/pull/1166),
|
||||
[#1174](https://github.com/chriso/validator.js/pull/1174))
|
||||
|
||||
#### 11.1.0
|
||||
|
||||
- Code coverage improvements
|
||||
([#1024](https://github.com/chriso/validator.js/pull/1024))
|
||||
- New and improved locales
|
||||
([#1035](https://github.com/chriso/validator.js/pull/1035),
|
||||
[#1040](https://github.com/chriso/validator.js/pull/1040),
|
||||
[#1041](https://github.com/chriso/validator.js/pull/1041),
|
||||
[#1048](https://github.com/chriso/validator.js/pull/1048),
|
||||
[#1049](https://github.com/chriso/validator.js/pull/1049),
|
||||
[#1052](https://github.com/chriso/validator.js/pull/1052),
|
||||
[#1054](https://github.com/chriso/validator.js/pull/1054),
|
||||
[#1055](https://github.com/chriso/validator.js/pull/1055),
|
||||
[#1056](https://github.com/chriso/validator.js/pull/1056),
|
||||
[#1057](https://github.com/chriso/validator.js/pull/1057))
|
||||
|
||||
#### 11.0.0
|
||||
|
||||
- Added a `isBase32()` validator
|
||||
([#1023](https://github.com/chriso/validator.js/pull/1023))
|
||||
- Updated `isEmail()` to validate display names according to RFC2822
|
||||
([#1004](https://github.com/chriso/validator.js/pull/1004))
|
||||
- Updated `isEmail()` to check total email length
|
||||
([#1007](https://github.com/chriso/validator.js/pull/1007))
|
||||
- The internal `toString()` util is no longer exported
|
||||
([0277eb](https://github.com/chriso/validator.js/commit/0277eb00d245a3479af52adf7d927d4036895650))
|
||||
- New and improved locales
|
||||
([#999](https://github.com/chriso/validator.js/pull/999),
|
||||
[#1010](https://github.com/chriso/validator.js/pull/1010),
|
||||
[#1017](https://github.com/chriso/validator.js/pull/1017),
|
||||
[#1022](https://github.com/chriso/validator.js/pull/1022),
|
||||
[#1031](https://github.com/chriso/validator.js/pull/1031),
|
||||
[#1032](https://github.com/chriso/validator.js/pull/1032))
|
||||
|
||||
#### 10.11.0
|
||||
|
||||
- Fix imports like `import .. from "validator/lib/.."`
|
||||
([#961](https://github.com/chriso/validator.js/pull/961))
|
||||
- New locale
|
||||
([#958](https://github.com/chriso/validator.js/pull/958))
|
||||
|
||||
#### 10.10.0
|
||||
|
||||
- `isISO8601()` strict mode now works in the browser
|
||||
([#932](https://github.com/chriso/validator.js/pull/932))
|
||||
- New and improved locales
|
||||
([#931](https://github.com/chriso/validator.js/pull/931),
|
||||
[#933](https://github.com/chriso/validator.js/pull/933),
|
||||
[#947](https://github.com/chriso/validator.js/pull/947),
|
||||
[#950](https://github.com/chriso/validator.js/pull/950))
|
||||
|
||||
#### 10.9.0
|
||||
|
||||
- Added an option to `isURL()` to reject email-like URLs
|
||||
([#901](https://github.com/chriso/validator.js/pull/901))
|
||||
- Added a `strict` option to `isISO8601()`
|
||||
([#910](https://github.com/chriso/validator.js/pull/910))
|
||||
- Relaxed `isJWT()` signature requirements
|
||||
([#906](https://github.com/chriso/validator.js/pull/906))
|
||||
- New and improved locales
|
||||
([#899](https://github.com/chriso/validator.js/pull/899),
|
||||
[#904](https://github.com/chriso/validator.js/pull/904),
|
||||
[#913](https://github.com/chriso/validator.js/pull/913),
|
||||
[#916](https://github.com/chriso/validator.js/pull/916),
|
||||
[#925](https://github.com/chriso/validator.js/pull/925),
|
||||
[#928](https://github.com/chriso/validator.js/pull/928))
|
||||
|
||||
#### 10.8.0
|
||||
|
||||
- Added `isIdentityCard()`
|
||||
([#846](https://github.com/chriso/validator.js/pull/846))
|
||||
- Better error when validators are passed an invalid type
|
||||
([#895](https://github.com/chriso/validator.js/pull/895))
|
||||
- Locales are now exported
|
||||
([#890](https://github.com/chriso/validator.js/pull/890),
|
||||
[#892](https://github.com/chriso/validator.js/pull/892))
|
||||
- New locale
|
||||
([#896](https://github.com/chriso/validator.js/pull/896))
|
||||
|
||||
#### 10.7.1
|
||||
|
||||
- Ignore case when checking URL protocol
|
||||
([#887](https://github.com/chriso/validator.js/issues/887))
|
||||
- Locale fix
|
||||
([#889](https://github.com/chriso/validator.js/pull/889))
|
||||
|
||||
#### 10.7.0
|
||||
|
||||
- Added `isMagnetURI()` to validate [magnet URIs](https://en.wikipedia.org/wiki/Magnet_URI_scheme)
|
||||
([#884](https://github.com/chriso/validator.js/pull/884))
|
||||
- Added `isJWT()` to validate [JSON web tokens](https://en.wikipedia.org/wiki/JSON_Web_Token)
|
||||
([#885](https://github.com/chriso/validator.js/pull/885))
|
||||
|
||||
#### 10.6.0
|
||||
|
||||
- Updated `isMobilePhone()` to match any locale's pattern by default
|
||||
([#874](https://github.com/chriso/validator.js/pull/874))
|
||||
- Added an option to ignore whitespace in `isEmpty()`
|
||||
([#880](https://github.com/chriso/validator.js/pull/880))
|
||||
- New and improved locales
|
||||
([#878](https://github.com/chriso/validator.js/pull/878),
|
||||
[#879](https://github.com/chriso/validator.js/pull/879))
|
||||
|
||||
#### 10.5.0
|
||||
|
||||
- Disabled domain-specific email validation
|
||||
([#873](https://github.com/chriso/validator.js/pull/873))
|
||||
- Added support for IP hostnames in `isEmail()`
|
||||
([#845](https://github.com/chriso/validator.js/pull/845))
|
||||
- Added a `no_symbols` option to `isNumeric()`
|
||||
([#848](https://github.com/chriso/validator.js/pull/848))
|
||||
- Added a `no_colons` option to `isMACAddress()`
|
||||
([#849](https://github.com/chriso/validator.js/pull/849))
|
||||
- Updated `isURL()` to reject protocol relative URLs unless a flag is set
|
||||
([#860](https://github.com/chriso/validator.js/issues/860))
|
||||
- New and improved locales
|
||||
([#801](https://github.com/chriso/validator.js/pull/801),
|
||||
[#856](https://github.com/chriso/validator.js/pull/856),
|
||||
[#859](https://github.com/chriso/validator.js/issues/859),
|
||||
[#861](https://github.com/chriso/validator.js/pull/861),
|
||||
[#862](https://github.com/chriso/validator.js/pull/862),
|
||||
[#863](https://github.com/chriso/validator.js/pull/863),
|
||||
[#864](https://github.com/chriso/validator.js/pull/864),
|
||||
[#870](https://github.com/chriso/validator.js/pull/870),
|
||||
[#872](https://github.com/chriso/validator.js/pull/872))
|
||||
|
||||
#### 10.4.0
|
||||
|
||||
- Added an `isIPRange()` validator
|
||||
([#842](https://github.com/chriso/validator.js/pull/842))
|
||||
- Accept an array of locales in `isMobilePhone()`
|
||||
([#742](https://github.com/chriso/validator.js/pull/742))
|
||||
- New locale
|
||||
([#843](https://github.com/chriso/validator.js/pull/843))
|
||||
|
||||
#### 10.3.0
|
||||
|
||||
- Strict Gmail validation in `isEmail()`
|
||||
([#832](https://github.com/chriso/validator.js/pull/832))
|
||||
- New locales
|
||||
([#831](https://github.com/chriso/validator.js/pull/831),
|
||||
[#835](https://github.com/chriso/validator.js/pull/835),
|
||||
[#836](https://github.com/chriso/validator.js/pull/836))
|
||||
|
||||
#### 10.2.0
|
||||
|
||||
- Export the list of supported locales in `isPostalCode()`
|
||||
([#830](https://github.com/chriso/validator.js/pull/830))
|
||||
|
||||
#### 10.1.0
|
||||
|
||||
- Added an `isISO31661Alpha3()` validator
|
||||
([#809](https://github.com/chriso/validator.js/pull/809))
|
||||
|
||||
#### 10.0.0
|
||||
|
||||
- Allow floating points in `isNumeric()`
|
||||
([#810](https://github.com/chriso/validator.js/pull/810))
|
||||
- Disallow GMail addresses with multiple consecutive dots, or leading/trailing dots
|
||||
([#820](https://github.com/chriso/validator.js/pull/820))
|
||||
- Added an `isRFC3339()` validator
|
||||
([#816](https://github.com/chriso/validator.js/pull/816))
|
||||
- Reject domain parts longer than 63 octets in `isFQDN()`, `isURL()` and `isEmail()`
|
||||
([bb3e542](https://github.com/chriso/validator.js/commit/bb3e542))
|
||||
- Added a new Amex prefix to `isCreditCard()`
|
||||
([#805](https://github.com/chriso/validator.js/pull/805))
|
||||
- Fixed `isFloat()` min/max/gt/lt filters when a locale with a comma decimal is used
|
||||
([2b70821](https://github.com/chriso/validator.js/commit/2b70821))
|
||||
- Normalize Yandex emails
|
||||
([#807](https://github.com/chriso/validator.js/pull/807))
|
||||
- New locales
|
||||
([#803](https://github.com/chriso/validator.js/pull/803))
|
||||
|
||||
#### 9.4.1
|
||||
|
||||
- Patched a [REDOS](https://en.wikipedia.org/wiki/ReDoS) vulnerability in `isDataURI`
|
||||
- New and improved locales
|
||||
([#788](https://github.com/chriso/validator.js/pull/788))
|
||||
|
||||
#### 9.4.0
|
||||
|
||||
- Added an option to `isMobilePhone` to require a country code
|
||||
([#769](https://github.com/chriso/validator.js/pull/769))
|
||||
- New and improved locales
|
||||
([#785](https://github.com/chriso/validator.js/pull/785))
|
||||
|
||||
#### 9.3.0
|
||||
|
||||
- New and improved locales
|
||||
([#763](https://github.com/chriso/validator.js/pull/763),
|
||||
[#768](https://github.com/chriso/validator.js/pull/768),
|
||||
[#774](https://github.com/chriso/validator.js/pull/774),
|
||||
[#777](https://github.com/chriso/validator.js/pull/777),
|
||||
[#779](https://github.com/chriso/validator.js/pull/779))
|
||||
|
||||
#### 9.2.0
|
||||
|
||||
- Added an `isMimeType()` validator
|
||||
([#760](https://github.com/chriso/validator.js/pull/760))
|
||||
- New and improved locales
|
||||
([#753](https://github.com/chriso/validator.js/pull/753),
|
||||
[#755](https://github.com/chriso/validator.js/pull/755),
|
||||
[#764](https://github.com/chriso/validator.js/pull/764))
|
||||
|
||||
#### 9.1.2
|
||||
|
||||
- Fixed a bug with the `isFloat` validator
|
||||
([#752](https://github.com/chriso/validator.js/pull/752))
|
||||
|
||||
#### 9.1.1
|
||||
|
||||
- Locale fixes
|
||||
([#738](https://github.com/chriso/validator.js/pull/738),
|
||||
[#739](https://github.com/chriso/validator.js/pull/739))
|
||||
|
||||
#### 9.1.0
|
||||
|
||||
- Added an `isISO31661Alpha2()` validator
|
||||
([#734](https://github.com/chriso/validator.js/pull/734))
|
||||
- New locales
|
||||
([#735](https://github.com/chriso/validator.js/pull/735),
|
||||
[#737](https://github.com/chriso/validator.js/pull/737))
|
||||
|
||||
#### 9.0.0
|
||||
|
||||
- `normalizeEmail()` no longer validates the email address
|
||||
([#725](https://github.com/chriso/validator.js/pull/725))
|
||||
- Added locale-aware validation to `isFloat()` and `isDecimal()`
|
||||
([#721](https://github.com/chriso/validator.js/pull/721))
|
||||
- Added an `isPort()` validator
|
||||
([#733](https://github.com/chriso/validator.js/pull/733))
|
||||
- New locales
|
||||
([#731](https://github.com/chriso/validator.js/pull/731))
|
||||
|
||||
#### 8.2.0
|
||||
|
||||
- Added an `isHash()` validator
|
||||
([#711](https://github.com/chriso/validator.js/pull/711))
|
||||
- Control decimal places in `isCurrency()`
|
||||
([#713](https://github.com/chriso/validator.js/pull/713))
|
||||
- New and improved locales
|
||||
([#700](https://github.com/chriso/validator.js/pull/700),
|
||||
[#701](https://github.com/chriso/validator.js/pull/701),
|
||||
[#714](https://github.com/chriso/validator.js/pull/714),
|
||||
[#715](https://github.com/chriso/validator.js/pull/715),
|
||||
[#718](https://github.com/chriso/validator.js/pull/718))
|
||||
|
||||
#### 8.1.0
|
||||
|
||||
- Fix `require('validator/lib/isIS8601')` calls
|
||||
([#688](https://github.com/chriso/validator.js/issues/688))
|
||||
- Added an `isLatLong()` and `isPostalCode()` validator
|
||||
([#684](https://github.com/chriso/validator.js/pull/684))
|
||||
- Allow comma in email display names
|
||||
([#692](https://github.com/chriso/validator.js/pull/692))
|
||||
- Add missing string to `unescape()`
|
||||
([#690](https://github.com/chriso/validator.js/pull/690))
|
||||
- Fix `isMobilePhone()` with Node <= 6.x
|
||||
([#681](https://github.com/chriso/validator.js/issues/681))
|
||||
- New locales
|
||||
([#695](https://github.com/chriso/validator.js/pull/695))
|
||||
|
||||
#### 8.0.0
|
||||
|
||||
- `isURL()` now requires the `require_tld: false` option to validate `localhost`
|
||||
([#675](https://github.com/chriso/validator.js/issues/675))
|
||||
- `isURL()` now rejects URLs that are protocol only
|
||||
([#642](https://github.com/chriso/validator.js/issues/642))
|
||||
- Fixed a bug where `isMobilePhone()` would silently return false if the locale was invalid or unsupported
|
||||
([#657](https://github.com/chriso/validator.js/issues/657))
|
||||
|
||||
#### 7.2.0
|
||||
|
||||
- Added an option to validate any phone locale
|
||||
([#663](https://github.com/chriso/validator.js/pull/663))
|
||||
- Fixed a bug in credit card validation
|
||||
([#672](https://github.com/chriso/validator.js/pull/672))
|
||||
- Disallow whitespace, including unicode whitespace, in TLDs
|
||||
([#677](https://github.com/chriso/validator.js/pull/677))
|
||||
- New locales
|
||||
([#673](https://github.com/chriso/validator.js/pull/673),
|
||||
[#676](https://github.com/chriso/validator.js/pull/676))
|
||||
|
||||
#### 7.1.0
|
||||
|
||||
- Added an `isISRC()` validator for [ISRC](https://en.wikipedia.org/wiki/International_Standard_Recording_Code)
|
||||
([#660](https://github.com/chriso/validator.js/pull/660))
|
||||
- Fixed a bug in credit card validation
|
||||
([#670](https://github.com/chriso/validator.js/pull/670))
|
||||
- Reduced the maximum allowed address in `isEmail()` based on
|
||||
[RFC3696 errata](http://www.rfc-editor.org/errata_search.php?rfc=3696&eid=1690)
|
||||
([#655](https://github.com/chriso/validator.js/issues/655))
|
||||
- New locales
|
||||
([#647](https://github.com/chriso/validator.js/pull/647),
|
||||
[#667](https://github.com/chriso/validator.js/pull/667),
|
||||
[#667](https://github.com/chriso/validator.js/pull/667),
|
||||
[#671](https://github.com/chriso/validator.js/pull/671))
|
||||
|
||||
#### 7.0.0
|
||||
|
||||
- Remove `isDate()`
|
||||
|
||||
#### 6.3.0
|
||||
|
||||
- Allow values like `-.01` in `isFloat()`
|
||||
([#618](https://github.com/chriso/validator.js/issues/618))
|
||||
- New locales
|
||||
([#616](https://github.com/chriso/validator.js/pull/616),
|
||||
[#622](https://github.com/chriso/validator.js/pull/622),
|
||||
[#627](https://github.com/chriso/validator.js/pull/627),
|
||||
[#630](https://github.com/chriso/validator.js/pull/630))
|
||||
|
||||
#### 6.2.1
|
||||
|
||||
- Disallow `<` and `>` in URLs
|
||||
([#613](https://github.com/chriso/validator.js/issues/613))
|
||||
- New locales
|
||||
([#610](https://github.com/chriso/validator.js/pull/610))
|
||||
|
||||
#### 6.2.0
|
||||
|
||||
- Added an option to require an email display name
|
||||
([#607](https://github.com/chriso/validator.js/pull/607))
|
||||
- Added support for `lt` and `gt` to `isInt()`
|
||||
([#588](https://github.com/chriso/validator.js/pull/588))
|
||||
- New locales
|
||||
([#601](https://github.com/chriso/validator.js/pull/601))
|
||||
|
||||
#### 6.1.0
|
||||
|
||||
- Added support for greater or less than in `isFloat()`
|
||||
([#544](https://github.com/chriso/validator.js/issues/544))
|
||||
- Added support for ISSN validation via `isISSN()`
|
||||
([#593](https://github.com/chriso/validator.js/pull/593))
|
||||
- Fixed a bug in `normalizeEmail()`
|
||||
([#594](https://github.com/chriso/validator.js/issues/594))
|
||||
- New locales
|
||||
([#585](https://github.com/chriso/validator.js/pull/585))
|
||||
|
||||
#### 6.0.0
|
||||
|
||||
- Renamed `isNull()` to `isEmpty()`
|
||||
([#574](https://github.com/chriso/validator.js/issues/574))
|
||||
- Backslash is now escaped in `escape()`
|
||||
([#516](https://github.com/chriso/validator.js/issues/516))
|
||||
- Improved `normalizeEmail()`
|
||||
([#583](https://github.com/chriso/validator.js/pull/583))
|
||||
- Allow leading zeroes by default in `isInt()`
|
||||
([#532](https://github.com/chriso/validator.js/pull/532))
|
||||
|
||||
#### 5.7.0
|
||||
|
||||
- Added support for IPv6 in `isURL()`
|
||||
([#564](https://github.com/chriso/validator.js/issues/564))
|
||||
- Added support for urls without a host (e.g. `file:///foo.txt`) in `isURL()`
|
||||
([#563](https://github.com/chriso/validator.js/issues/563))
|
||||
- Added support for regular expressions in the `isURL()` host whitelist and blacklist
|
||||
([#562](https://github.com/chriso/validator.js/issues/562))
|
||||
- Added support for MasterCard 2-Series BIN
|
||||
([#576](https://github.com/chriso/validator.js/pull/576))
|
||||
- New locales
|
||||
([#575](https://github.com/chriso/validator.js/pull/575),
|
||||
[#552](https://github.com/chriso/validator.js/issues/552))
|
||||
|
||||
#### 5.6.0
|
||||
|
||||
- Added an `isMD5()` validator
|
||||
([#557](https://github.com/chriso/validator.js/pull/557))
|
||||
- Fixed an exceptional case in `isDate()`
|
||||
([#566](https://github.com/chriso/validator.js/pull/566))
|
||||
- New locales
|
||||
([#559](https://github.com/chriso/validator.js/pull/559),
|
||||
[#568](https://github.com/chriso/validator.js/pull/568),
|
||||
[#571](https://github.com/chriso/validator.js/pull/571),
|
||||
[#573](https://github.com/chriso/validator.js/pull/573))
|
||||
|
||||
#### 5.5.0
|
||||
|
||||
- Fixed a regex denial of service in `trim()` and `rtrim()`
|
||||
([#556](https://github.com/chriso/validator.js/pull/556))
|
||||
- Added an Algerian locale to `isMobilePhone()`
|
||||
([#540](https://github.com/chriso/validator.js/pull/540))
|
||||
- Fixed the Hungarian locale in `isAlpha()` and `isAlphanumeric()`
|
||||
([#541](https://github.com/chriso/validator.js/pull/541))
|
||||
- Added a Polish locale to `isMobilePhone()`
|
||||
([#545](https://github.com/chriso/validator.js/pull/545))
|
||||
|
||||
#### 5.4.0
|
||||
|
||||
- Accept Union Pay credit cards in `isCreditCard()`
|
||||
([#539](https://github.com/chriso/validator.js/pull/539))
|
||||
- Added Danish locale to `isMobilePhone()`
|
||||
([#538](https://github.com/chriso/validator.js/pull/538))
|
||||
- Added Hungarian locales to `isAlpha()`, `isAlphanumeric()` and `isMobilePhone()`
|
||||
([#537](https://github.com/chriso/validator.js/pull/537))
|
||||
|
||||
#### 5.3.0
|
||||
|
||||
- Added an `allow_leading_zeroes` option to `isInt()`
|
||||
([#532](https://github.com/chriso/validator.js/pull/532))
|
||||
- Adjust Chinese mobile phone validation
|
||||
([#523](https://github.com/chriso/validator.js/pull/523))
|
||||
- Added a Canadian locale to `isMobilePhone()`
|
||||
([#524](https://github.com/chriso/validator.js/issues/524))
|
||||
|
||||
#### 5.2.0
|
||||
|
||||
- Added a `isDataURI()` validator
|
||||
([#521](https://github.com/chriso/validator.js/pull/521))
|
||||
- Added Czech locales
|
||||
([#522](https://github.com/chriso/validator.js/pull/522))
|
||||
- Fixed a bug with `isURL()` when protocol was missing and "://" appeared in the query
|
||||
([#518](https://github.com/chriso/validator.js/issues/518))
|
||||
|
||||
#### 5.1.0
|
||||
|
||||
- Added a `unescape()` HTML function
|
||||
([#509](https://github.com/chriso/validator.js/pull/509))
|
||||
- Added a Malaysian locale to `isMobilePhone()`
|
||||
([#507](https://github.com/chriso/validator.js/pull/507))
|
||||
- Added Polish locales to `isAlpha()` and `isAlphanumeric()`
|
||||
([#506](https://github.com/chriso/validator.js/pull/506))
|
||||
- Added Turkish locales to `isAlpha()`, `isAlphanumeric()` and `isMobilePhone()`
|
||||
([#512](https://github.com/chriso/validator.js/pull/512))
|
||||
- Allow >1 underscore in hostnames when using `allow_underscores`
|
||||
([#510](https://github.com/chriso/validator.js/issues/510))
|
||||
|
||||
#### 5.0.0
|
||||
|
||||
- Migrate to ES6
|
||||
([#496](https://github.com/chriso/validator.js/pull/496))
|
||||
- Break the library up so that individual functions can be imported
|
||||
([#496](https://github.com/chriso/validator.js/pull/496))
|
||||
- Remove auto-coercion of input to a string
|
||||
([#496](https://github.com/chriso/validator.js/pull/496))
|
||||
- Remove the `extend()` function
|
||||
([#496](https://github.com/chriso/validator.js/pull/496))
|
||||
- Added Arabic locales to `isAlpha()` and `isAlphanumeric()`
|
||||
([#496](https://github.com/chriso/validator.js/pull/496#issuecomment-184781730))
|
||||
- Fix validation of very large base64 strings
|
||||
([#503](https://github.com/chriso/validator.js/pull/503))
|
||||
|
||||
#### 4.9.0
|
||||
|
||||
- Added a Russian locale to `isAlpha()` and `isAlphanumeric()`
|
||||
([#499](https://github.com/chriso/validator.js/pull/499))
|
||||
- Remove the restriction on adjacent hyphens in hostnames
|
||||
([#500](https://github.com/chriso/validator.js/issues/500))
|
||||
|
||||
#### 4.8.0
|
||||
|
||||
- Added Spanish, French, Portuguese and Dutch support for `isAlpha()` and `isAlphanumeric()`
|
||||
([#492](https://github.com/chriso/validator.js/pull/492))
|
||||
- Added a Brazilian locale to `isMobilePhone()`
|
||||
([#489](https://github.com/chriso/validator.js/pull/489))
|
||||
- Reject IPv4 addresses with invalid zero padding
|
||||
([#490](https://github.com/chriso/validator.js/pull/490))
|
||||
- Fix the client-side version when used with RequireJS
|
||||
([#494](https://github.com/chriso/validator.js/issues/494))
|
||||
|
||||
#### 4.7.1
|
||||
|
||||
- Use [node-depd](https://github.com/dougwilson/nodejs-depd) to print deprecation notices
|
||||
([#487](https://github.com/chriso/validator.js/issues/487))
|
||||
|
||||
#### 4.7.0
|
||||
|
||||
- Print a deprecation warning if validator input is not a string
|
||||
([1f67e1e](https://github.com/chriso/validator.js/commit/1f67e1e15198c0ae735151290dc8dc2bf14da254)).
|
||||
Note that this will be an error in v5.
|
||||
- Added a German locale to `isMobilePhone()`, `isAlpha()` and `isAlphanumeric()`
|
||||
([#477](https://github.com/chriso/validator.js/pull/477))
|
||||
- Added a Finnish locale to `isMobilePhone()`
|
||||
([#455](https://github.com/chriso/validator.js/pull/455))
|
||||
|
||||
#### 4.6.1
|
||||
|
||||
- Fix coercion of objects: `Object.toString()` is `[object Object]` not `""`
|
||||
([a57f3c8](https://github.com/chriso/validator.js/commit/a57f3c843c715fba2664ee22ec80e9e28e88e0a6))
|
||||
|
||||
#### 4.6.0
|
||||
|
||||
- Added a Spanish locale to `isMobilePhone()`
|
||||
([#481](https://github.com/chriso/validator.js/pull/481))
|
||||
- Fix string coercion of objects created with `Object.create(null)`
|
||||
([#484](https://github.com/chriso/validator.js/issues/484))
|
||||
|
||||
#### 4.5.2
|
||||
|
||||
- Fix a timezone issue with short-form ISO 8601 dates, e.g.
|
||||
`validator.isDate('2011-12-21')`
|
||||
([#480](https://github.com/chriso/validator.js/issues/480))
|
||||
|
||||
#### 4.5.1
|
||||
|
||||
- Make `isLength()` / `isByteLength()` accept `{min, max}` as options object.
|
||||
([#474](https://github.com/chriso/validator.js/issues/474))
|
||||
|
||||
#### 4.5.0
|
||||
|
||||
- Add validation for Indian mobile phone numbers
|
||||
([#471](https://github.com/chriso/validator.js/pull/471))
|
||||
- Tweak Greek and Chinese mobile phone validation
|
||||
([#467](https://github.com/chriso/validator.js/pull/467),
|
||||
[#468](https://github.com/chriso/validator.js/pull/468))
|
||||
- Fixed a bug in `isDate()` when validating ISO 8601 dates without a timezone
|
||||
([#472](https://github.com/chriso/validator.js/issues/472))
|
||||
|
||||
#### 4.4.1
|
||||
|
||||
- Allow triple hyphens in IDNA hostnames
|
||||
([#466](https://github.com/chriso/validator.js/issues/466))
|
||||
|
||||
#### 4.4.0
|
||||
|
||||
- Added `isMACAddress()` validator
|
||||
([#458](https://github.com/chriso/validator.js/pull/458))
|
||||
- Added `isWhitelisted()` validator
|
||||
([#462](https://github.com/chriso/validator.js/pull/462))
|
||||
- Added a New Zealand locale to `isMobilePhone()`
|
||||
([#452](https://github.com/chriso/validator.js/pull/452))
|
||||
- Added options to control GMail address normalization
|
||||
([#460](https://github.com/chriso/validator.js/pull/460))
|
||||
|
||||
#### 4.3.0
|
||||
|
||||
- Support Ember CLI module definitions
|
||||
([#448](https://github.com/chriso/validator.js/pull/448))
|
||||
- Added a Vietnam locale to `isMobilePhone()`
|
||||
([#451](https://github.com/chriso/validator.js/pull/451))
|
||||
|
||||
#### 4.2.1
|
||||
|
||||
- Fix `isDate()` handling of RFC2822 timezones
|
||||
([#447](https://github.com/chriso/validator.js/pull/447))
|
||||
|
||||
#### 4.2.0
|
||||
|
||||
- Fix `isDate()` handling of ISO8601 timezones
|
||||
([#444](https://github.com/chriso/validator.js/pull/444))
|
||||
- Fix the incorrect `isFloat('.') === true`
|
||||
([#443](https://github.com/chriso/validator.js/pull/443))
|
||||
- Added a Norwegian locale to `isMobilePhone()`
|
||||
([#439](https://github.com/chriso/validator.js/pull/439))
|
||||
|
||||
#### 4.1.0
|
||||
|
||||
- General `isDate()` improvements
|
||||
([#431](https://github.com/chriso/validator.js/pull/431))
|
||||
- Tests now require node 4.0+
|
||||
([#438](https://github.com/chriso/validator.js/pull/438))
|
||||
|
||||
#### 4.0.6
|
||||
|
||||
- Added a Taiwan locale to `isMobilePhone()`
|
||||
([#432](https://github.com/chriso/validator.js/pull/432))
|
||||
- Fixed a bug in `isBefore()` where it would return `null`
|
||||
([#436](https://github.com/chriso/validator.js/pull/436))
|
||||
|
||||
#### 4.0.5
|
||||
|
||||
- Fixed a denial of service vulnerability in the `isEmail()` regex
|
||||
([#152](https://github.com/chriso/validator.js/issues/152#issuecomment-131874928))
|
||||
|
||||
#### 4.0.4
|
||||
|
||||
- Reverted the leap year validation in `isDate()` as it introduced some regressions
|
||||
([#422](https://github.com/chriso/validator.js/issues/422), [#423](https://github.com/chriso/validator.js/issues/423))
|
||||
|
||||
#### 4.0.3
|
||||
|
||||
- Added leap year validation to `isDate()`
|
||||
([#418](https://github.com/chriso/validator.js/pull/418))
|
||||
|
||||
#### 4.0.2
|
||||
|
||||
- Fixed `isDecimal()` with an empty string
|
||||
([#419](https://github.com/chriso/validator.js/issues/419))
|
||||
|
||||
#### 4.0.1
|
||||
|
||||
- Fixed `isByteLength()` with certain strings
|
||||
([09f0c6d](https://github.com/chriso/validator.js/commit/09f0c6d2321f0c78af6a7de42e91b63955e4c01e))
|
||||
- Put length restrictions on email parts
|
||||
([#258](https://github.com/chriso/validator.js/issues/258#issuecomment-127173612))
|
||||
|
||||
#### 4.0.0
|
||||
|
||||
- Simplified the `isEmail()` regex and fixed some edge cases
|
||||
([#258](https://github.com/chriso/validator.js/issues/258#issuecomment-127173612))
|
||||
- Added ISO 8601 date validation via `isISO8601()`
|
||||
([#373](https://github.com/chriso/validator.js/issues/373))
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J E F G A B BC"},B:{"1":"N O P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t","2":"C K L H M"},C:{"2":"CC","194":"0 1 2 3 4 5 6 7 8 9 tB I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB DC EC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC","16":"I u J E F G A B C K L"},E:{"1":"J E F G A B C K L H IC JC KC 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC","2":"I u GC zB HC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d","2":"G B C OC PC QC RC qB 9B SC rB"},G:{"1":"F UC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC 2B 3B 4B 5B sB 6B 7B 8B","2":"zB TC AC"},H:{"2":"nC"},I:{"1":"D sC tC","2":"tB I oC pC qC rC AC"},J:{"2":"E A"},K:{"1":"e","2":"A B C qB 9B rB"},L:{"1":"D"},M:{"194":"D"},N:{"2":"A B"},O:{"1":"uC"},P:{"1":"I vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C"},Q:{"1":"1B"},R:{"1":"8C"},S:{"194":"9C"}},B:1,C:"Ping attribute"};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"QueueScheduler.js","sources":["../../src/internal/scheduler/QueueScheduler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAkD;AAElD;IAAoC,kCAAc;IAAlD;;IACA,CAAC;IAAD,qBAAC;AAAD,CAAC,AADD,CAAoC,+BAAc,GACjD;AADY,wCAAc"}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"fromEvent.js","sources":["../../../src/internal/observable/fromEvent.ts"],"names":[],"mappings":"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"}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J E F G BC","164":"A B"},B:{"66":"P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t","164":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 CC tB I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB DC EC"},D:{"2":"0 1 2 3 4 I u J E F G A B C K L H M N O v w x y z","66":"5 6 7 8 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC"},E:{"2":"I u J E F G A B C K L H GC zB HC IC JC KC 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC"},F:{"2":"0 1 2 3 4 5 6 7 8 9 G B C H M N O v w x y z AB BB CB DB EB FB OC PC QC RC qB 9B SC rB","66":"GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d"},G:{"2":"F zB TC AC UC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC 2B 3B 4B 5B sB 6B 7B 8B"},H:{"292":"nC"},I:{"2":"tB I D oC pC qC rC AC sC tC"},J:{"2":"E A"},K:{"2":"A e","292":"B C qB 9B rB"},L:{"2":"D"},M:{"2":"D"},N:{"164":"A B"},O:{"2":"uC"},P:{"2":"I vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C"},Q:{"66":"1B"},R:{"2":"8C"},S:{"2":"9C"}},B:5,C:"CSS Device Adaptation"};
|
||||
@@ -0,0 +1,42 @@
|
||||
# to-readable-stream [](https://travis-ci.org/sindresorhus/to-readable-stream)
|
||||
|
||||
> Convert a string/Buffer/Uint8Array to a [readable stream](https://nodejs.org/api/stream.html#stream_readable_streams)
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install to-readable-stream
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const toReadableStream = require('to-readable-stream');
|
||||
|
||||
toReadableStream('🦄🌈').pipe(process.stdout);
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### toReadableStream(input)
|
||||
|
||||
Returns a [`stream.Readable`](https://nodejs.org/api/stream.html#stream_readable_streams).
|
||||
|
||||
#### input
|
||||
|
||||
Type: `string` `Buffer` `Uint8Array`
|
||||
|
||||
Value to convert to a stream.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [into-stream](https://github.com/sindresorhus/into-stream) - More advanced version of this module
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"take.js","sources":["../src/operators/take.ts"],"names":[],"mappings":";;;;;AAAA,gDAA2C"}
|
||||
@@ -0,0 +1,347 @@
|
||||
# js-codepage
|
||||
|
||||
[Codepages](https://en.wikipedia.org/wiki/Codepage) are character encodings. In
|
||||
many contexts, single- or double-byte character sets are used in lieu of Unicode
|
||||
encodings. The codepages map between characters and numbers.
|
||||
|
||||
## Setup
|
||||
|
||||
In node:
|
||||
|
||||
```js
|
||||
var cptable = require('codepage');
|
||||
```
|
||||
|
||||
In the browser:
|
||||
|
||||
```html
|
||||
<script src="cptable.js"></script>
|
||||
<script src="cputils.js"></script>
|
||||
```
|
||||
|
||||
Alternatively, use the full version in the dist folder:
|
||||
|
||||
```html
|
||||
<script src="cptable.full.js"></script>
|
||||
```
|
||||
|
||||
The complete set of codepages is large due to some Double Byte Character Set
|
||||
encodings. A much smaller file that just includes SBCS codepages is provided in
|
||||
this repo (`sbcs.js`), as well as a file for other projects (`cpexcel.js`)
|
||||
|
||||
If you know which codepages you need, you can include individual scripts for
|
||||
each codepage. The individual files are provided in the `bits/` directory.
|
||||
For example, to include only the Mac codepages:
|
||||
|
||||
```html
|
||||
<script src="bits/10000.js"></script>
|
||||
<script src="bits/10006.js"></script>
|
||||
<script src="bits/10007.js"></script>
|
||||
<script src="bits/10029.js"></script>
|
||||
<script src="bits/10079.js"></script>
|
||||
<script src="bits/10081.js"></script>
|
||||
```
|
||||
|
||||
All of the browser scripts define and append to the `cptable` object. To rename
|
||||
the object, edit the `JSVAR` shell variable in `make.sh` and run the script.
|
||||
|
||||
The utilities functions are contained in `cputils.js`, which assumes that the
|
||||
appropriate codepage scripts were loaded.
|
||||
|
||||
The script will manipulate `module.exports` if available . This is not always
|
||||
desirable. To prevent the behavior, define `DO_NOT_EXPORT_CODEPAGE`.
|
||||
|
||||
## Usage
|
||||
|
||||
Most codepages are indexed by number. To get the Unicode character for a given
|
||||
codepoint, use the `dec` property:
|
||||
|
||||
```js
|
||||
var unicode_cp10000_255 = cptable[10000].dec[255]; // ˇ
|
||||
```
|
||||
|
||||
To get the codepoint for a given character, use the `enc` property:
|
||||
|
||||
```js
|
||||
var cp10000_711 = cptable[10000].enc[String.fromCharCode(711)]; // 255
|
||||
```
|
||||
|
||||
There are a few utilities that deal with strings and buffers:
|
||||
|
||||
```js
|
||||
var 汇总 = cptable.utils.decode(936, [0xbb,0xe3,0xd7,0xdc]);
|
||||
var buf = cptable.utils.encode(936, 汇总);
|
||||
var sushi= cptable.utils.decode(65001, [0xf0,0x9f,0x8d,0xa3]); // 🍣
|
||||
var sbuf = cptable.utils.encode(65001, sushi);
|
||||
```
|
||||
|
||||
`cptable.utils.encode(CP, data, ofmt)` accepts a String or Array of characters
|
||||
and returns a representation controlled by `ofmt`:
|
||||
|
||||
- Default output is a Buffer (or Array) of bytes (integers between 0 and 255)
|
||||
- If `ofmt == 'str'`, return a binary String (byte `i` is `o.charCodeAt(i)`)
|
||||
- If `ofmt == 'arr'`, return an Array of bytes
|
||||
|
||||
`cptable.utils.decode(CP, data)` accepts a byte String or Array of numbers or
|
||||
Buffer and returns a JS string.
|
||||
|
||||
## Known Excel Codepages
|
||||
|
||||
A much smaller script, including only the codepages known to be used in Excel,
|
||||
is available under the name `cpexcel`. It exposes the same variable `cptable`
|
||||
and is suitable as a drop-in replacement when the full codepage tables are not
|
||||
needed.
|
||||
|
||||
In node:
|
||||
|
||||
```js
|
||||
var cptable = require('codepage/dist/cpexcel.full');
|
||||
```
|
||||
|
||||
## Rolling your own script
|
||||
|
||||
The `make.sh` script in the repo can take a manifest and generate JS source.
|
||||
|
||||
Usage:
|
||||
|
||||
```bash
|
||||
$ bash make.sh path_to_manifest output_file_name JSVAR
|
||||
```
|
||||
|
||||
where
|
||||
|
||||
- `JSVAR` is the name of the exported variable (generally `cptable`)
|
||||
- `output_file_name` is the output file (`cpexcel.js`, `cptable.js`, ...)
|
||||
- `path_to_manifest` is the path to the manifest file.
|
||||
|
||||
The manifest file is expected to be a CSV with 3 columns:
|
||||
|
||||
```
|
||||
<codepage number>,<source>,<size>
|
||||
```
|
||||
|
||||
If a source is specified, it will try to download the specified file and parse.
|
||||
The file format is expected to follow the format from the unicode.org site.
|
||||
The size should be `1` for a single-byte codepage and `2` for a double-byte
|
||||
codepage. For mixed codepages (which use some single- and some double-byte
|
||||
codes), the script assumes the mapping is a prefix code and generates efficient
|
||||
JS code.
|
||||
|
||||
Generated scripts only include the mapping. `cat` a mapping with `cputils.js`
|
||||
to produce a complete script like `cpexcel.full.js`.
|
||||
|
||||
## Building the complete script
|
||||
|
||||
This script uses [voc](npm.im/voc). The script to build the codepage tables and
|
||||
the JS source is `codepage.md`, so building is as simple as `voc codepage.md`.
|
||||
|
||||
## Generated Codepages
|
||||
|
||||
The complete list of codepages can be found in the file `pages.csv`.
|
||||
|
||||
Some codepages are easier to implement algorithmically. Since those character
|
||||
tables are not generated, there is no corresponding entry (they are "magic").
|
||||
|
||||
| CP# | Source | Description |
|
||||
|--------:|:-----------:|:-----------------------------------------------------|
|
||||
| ` 37` | unicode.org | IBM EBCDIC US-Canada |
|
||||
| ` 437` | unicode.org | OEM United States |
|
||||
| ` 500` | unicode.org | IBM EBCDIC International |
|
||||
| ` 620` | NLS | Mazovia (Polish) MS-DOS |
|
||||
| ` 708` | Windows 7 | Arabic (ASMO 708) |
|
||||
| ` 720` | Windows 7 | Arabic (Transparent ASMO); Arabic (DOS) |
|
||||
| ` 737` | unicode.org | OEM Greek (formerly 437G); Greek (DOS) |
|
||||
| ` 775` | unicode.org | OEM Baltic; Baltic (DOS) |
|
||||
| ` 808` | unicode.org | OEM Russian; Cyrillic + Euro symbol |
|
||||
| ` 850` | unicode.org | OEM Multilingual Latin 1; Western European (DOS) |
|
||||
| ` 852` | unicode.org | OEM Latin 2; Central European (DOS) |
|
||||
| ` 855` | unicode.org | OEM Cyrillic (primarily Russian) |
|
||||
| ` 857` | unicode.org | OEM Turkish; Turkish (DOS) |
|
||||
| ` 858` | Windows 7 | OEM Multilingual Latin 1 + Euro symbol |
|
||||
| ` 860` | unicode.org | OEM Portuguese; Portuguese (DOS) |
|
||||
| ` 861` | unicode.org | OEM Icelandic; Icelandic (DOS) |
|
||||
| ` 862` | unicode.org | OEM Hebrew; Hebrew (DOS) |
|
||||
| ` 863` | unicode.org | OEM French Canadian; French Canadian (DOS) |
|
||||
| ` 864` | unicode.org | OEM Arabic; Arabic (864) |
|
||||
| ` 865` | unicode.org | OEM Nordic; Nordic (DOS) |
|
||||
| ` 866` | unicode.org | OEM Russian; Cyrillic (DOS) |
|
||||
| ` 869` | unicode.org | OEM Modern Greek; Greek, Modern (DOS) |
|
||||
| ` 870` | Windows 7 | IBM EBCDIC Multilingual/ROECE (Latin 2) |
|
||||
| ` 872` | unicode.org | OEM Cyrillic (primarily Russian) + Euro Symbol |
|
||||
| ` 874` | unicode.org | Windows Thai |
|
||||
| ` 875` | unicode.org | IBM EBCDIC Greek Modern |
|
||||
| ` 895` | NLS | Kamenický (Czech) MS-DOS |
|
||||
| ` 932` | unicode.org | Japanese Shift-JIS |
|
||||
| ` 936` | unicode.org | Simplified Chinese GBK |
|
||||
| ` 949` | unicode.org | Korean |
|
||||
| ` 950` | unicode.org | Traditional Chinese Big5 |
|
||||
| ` 1010` | IBM | IBM EBCDIC French |
|
||||
| ` 1026` | unicode.org | IBM EBCDIC Turkish (Latin 5) |
|
||||
| ` 1047` | Windows 7 | IBM EBCDIC Latin 1/Open System |
|
||||
| ` 1132` | IBM | IBM EBCDIC Lao (1132 / 1133 / 1341) |
|
||||
| ` 1140` | Windows 7 | IBM EBCDIC US-Canada (037 + Euro symbol) |
|
||||
| ` 1141` | Windows 7 | IBM EBCDIC Germany (20273 + Euro symbol) |
|
||||
| ` 1142` | Windows 7 | IBM EBCDIC Denmark-Norway (20277 + Euro symbol) |
|
||||
| ` 1143` | Windows 7 | IBM EBCDIC Finland-Sweden (20278 + Euro symbol) |
|
||||
| ` 1144` | Windows 7 | IBM EBCDIC Italy (20280 + Euro symbol) |
|
||||
| ` 1145` | Windows 7 | IBM EBCDIC Latin America-Spain (20284 + Euro symbol) |
|
||||
| ` 1146` | Windows 7 | IBM EBCDIC United Kingdom (20285 + Euro symbol) |
|
||||
| ` 1147` | Windows 7 | IBM EBCDIC France (20297 + Euro symbol) |
|
||||
| ` 1148` | Windows 7 | IBM EBCDIC International (500 + Euro symbol) |
|
||||
| ` 1149` | Windows 7 | IBM EBCDIC Icelandic (20871 + Euro symbol) |
|
||||
| ` 1200` | magic | Unicode UTF-16, little endian (BMP of ISO 10646) |
|
||||
| ` 1201` | magic | Unicode UTF-16, big endian |
|
||||
| ` 1250` | unicode.org | Windows Central Europe |
|
||||
| ` 1251` | unicode.org | Windows Cyrillic |
|
||||
| ` 1252` | unicode.org | Windows Latin I |
|
||||
| ` 1253` | unicode.org | Windows Greek |
|
||||
| ` 1254` | unicode.org | Windows Turkish |
|
||||
| ` 1255` | unicode.org | Windows Hebrew |
|
||||
| ` 1256` | unicode.org | Windows Arabic |
|
||||
| ` 1257` | unicode.org | Windows Baltic |
|
||||
| ` 1258` | unicode.org | Windows Vietnam |
|
||||
| ` 1361` | Windows 7 | Korean (Johab) |
|
||||
| `10000` | unicode.org | MAC Roman |
|
||||
| `10001` | Windows 7 | Japanese (Mac) |
|
||||
| `10002` | Windows 7 | MAC Traditional Chinese (Big5) |
|
||||
| `10003` | Windows 7 | Korean (Mac) |
|
||||
| `10004` | Windows 7 | Arabic (Mac) |
|
||||
| `10005` | Windows 7 | Hebrew (Mac) |
|
||||
| `10006` | unicode.org | Greek (Mac) |
|
||||
| `10007` | unicode.org | Cyrillic (Mac) |
|
||||
| `10008` | Windows 7 | MAC Simplified Chinese (GB 2312) |
|
||||
| `10010` | Windows 7 | Romanian (Mac) |
|
||||
| `10017` | Windows 7 | Ukrainian (Mac) |
|
||||
| `10021` | Windows 7 | Thai (Mac) |
|
||||
| `10029` | unicode.org | MAC Latin 2 (Central European) |
|
||||
| `10079` | unicode.org | Icelandic (Mac) |
|
||||
| `10081` | unicode.org | Turkish (Mac) |
|
||||
| `10082` | Windows 7 | Croatian (Mac) |
|
||||
| `12000` | magic | Unicode UTF-32, little endian byte order |
|
||||
| `12001` | magic | Unicode UTF-32, big endian byte order |
|
||||
| `20000` | Windows 7 | CNS Taiwan (Chinese Traditional) |
|
||||
| `20001` | Windows 7 | TCA Taiwan |
|
||||
| `20002` | Windows 7 | ETEN Taiwan (Chinese Traditional) |
|
||||
| `20003` | Windows 7 | IBM5550 Taiwan |
|
||||
| `20004` | Windows 7 | TeleText Taiwan |
|
||||
| `20005` | Windows 7 | Wang Taiwan |
|
||||
| `20105` | Windows 7 | Western European IA5 (IRV International Alphabet 5) |
|
||||
| `20106` | Windows 7 | IA5 German (7-bit) |
|
||||
| `20107` | Windows 7 | IA5 Swedish (7-bit) |
|
||||
| `20108` | Windows 7 | IA5 Norwegian (7-bit) |
|
||||
| `20127` | magic | US-ASCII (7-bit) |
|
||||
| `20261` | Windows 7 | T.61 |
|
||||
| `20269` | Windows 7 | ISO 6937 Non-Spacing Accent |
|
||||
| `20273` | Windows 7 | IBM EBCDIC Germany |
|
||||
| `20277` | Windows 7 | IBM EBCDIC Denmark-Norway |
|
||||
| `20278` | Windows 7 | IBM EBCDIC Finland-Sweden |
|
||||
| `20280` | Windows 7 | IBM EBCDIC Italy |
|
||||
| `20284` | Windows 7 | IBM EBCDIC Latin America-Spain |
|
||||
| `20285` | Windows 7 | IBM EBCDIC United Kingdom |
|
||||
| `20290` | Windows 7 | IBM EBCDIC Japanese Katakana Extended |
|
||||
| `20297` | Windows 7 | IBM EBCDIC France |
|
||||
| `20420` | Windows 7 | IBM EBCDIC Arabic |
|
||||
| `20423` | Windows 7 | IBM EBCDIC Greek |
|
||||
| `20424` | Windows 7 | IBM EBCDIC Hebrew |
|
||||
| `20833` | Windows 7 | IBM EBCDIC Korean Extended |
|
||||
| `20838` | Windows 7 | IBM EBCDIC Thai |
|
||||
| `20866` | Windows 7 | Russian Cyrillic (KOI8-R) |
|
||||
| `20871` | Windows 7 | IBM EBCDIC Icelandic |
|
||||
| `20880` | Windows 7 | IBM EBCDIC Cyrillic Russian |
|
||||
| `20905` | Windows 7 | IBM EBCDIC Turkish |
|
||||
| `20924` | Windows 7 | IBM EBCDIC Latin 1/Open System (1047 + Euro symbol) |
|
||||
| `20932` | Windows 7 | Japanese (JIS 0208-1990 and 0212-1990) |
|
||||
| `20936` | Windows 7 | Simplified Chinese (GB2312-80) |
|
||||
| `20949` | Windows 7 | Korean Wansung |
|
||||
| `21025` | Windows 7 | IBM EBCDIC Cyrillic Serbian-Bulgarian |
|
||||
| `21027` | NLS | Extended/Ext Alpha Lowercase |
|
||||
| `21866` | Windows 7 | Ukrainian Cyrillic (KOI8-U) |
|
||||
| `28591` | unicode.org | ISO 8859-1 Latin 1 (Western European) |
|
||||
| `28592` | unicode.org | ISO 8859-2 Latin 2 (Central European) |
|
||||
| `28593` | unicode.org | ISO 8859-3 Latin 3 |
|
||||
| `28594` | unicode.org | ISO 8859-4 Baltic |
|
||||
| `28595` | unicode.org | ISO 8859-5 Cyrillic |
|
||||
| `28596` | unicode.org | ISO 8859-6 Arabic |
|
||||
| `28597` | unicode.org | ISO 8859-7 Greek |
|
||||
| `28598` | unicode.org | ISO 8859-8 Hebrew (ISO-Visual) |
|
||||
| `28599` | unicode.org | ISO 8859-9 Turkish |
|
||||
| `28600` | unicode.org | ISO 8859-10 Latin 6 |
|
||||
| `28601` | unicode.org | ISO 8859-11 Latin (Thai) |
|
||||
| `28603` | unicode.org | ISO 8859-13 Latin 7 (Estonian) |
|
||||
| `28604` | unicode.org | ISO 8859-14 Latin 8 (Celtic) |
|
||||
| `28605` | unicode.org | ISO 8859-15 Latin 9 |
|
||||
| `28606` | unicode.org | ISO 8859-15 Latin 10 |
|
||||
| `29001` | Windows 7 | Europa 3 |
|
||||
| `38598` | Windows 7 | ISO 8859-8 Hebrew (ISO-Logical) |
|
||||
| `47451` | unicode.org | Atari ST/TT |
|
||||
| `50220` | Windows 7 | ISO 2022 JIS Japanese with no halfwidth Katakana |
|
||||
| `50221` | Windows 7 | ISO 2022 JIS Japanese with halfwidth Katakana |
|
||||
| `50222` | Windows 7 | ISO 2022 Japanese JIS X 0201-1989 (1 byte Kana-SO/SI)|
|
||||
| `50225` | Windows 7 | ISO 2022 Korean |
|
||||
| `50227` | Windows 7 | ISO 2022 Simplified Chinese |
|
||||
| `51932` | Windows 7 | EUC Japanese |
|
||||
| `51936` | Windows 7 | EUC Simplified Chinese |
|
||||
| `51949` | Windows 7 | EUC Korean |
|
||||
| `52936` | Windows 7 | HZ-GB2312 Simplified Chinese |
|
||||
| `54936` | Windows 7 | GB18030 Simplified Chinese (4 byte) |
|
||||
| `57002` | Windows 7 | ISCII Devanagari |
|
||||
| `57003` | Windows 7 | ISCII Bengali |
|
||||
| `57004` | Windows 7 | ISCII Tamil |
|
||||
| `57005` | Windows 7 | ISCII Telugu |
|
||||
| `57006` | Windows 7 | ISCII Assamese |
|
||||
| `57007` | Windows 7 | ISCII Oriya |
|
||||
| `57008` | Windows 7 | ISCII Kannada |
|
||||
| `57009` | Windows 7 | ISCII Malayalam |
|
||||
| `57010` | Windows 7 | ISCII Gujarati |
|
||||
| `57011` | Windows 7 | ISCII Punjabi |
|
||||
| `65000` | magic | Unicode (UTF-7) |
|
||||
| `65001` | magic | Unicode (UTF-8) |
|
||||
|
||||
`unicode.org` refers to the Unicode Consortium Public Mappings, a database of
|
||||
various mappings between Unicode characters and respective character sets. The
|
||||
tables are processed by a few scripts in the build process.
|
||||
|
||||
`IBM` refers to the IBM coded character set database. Even though IBM uses a
|
||||
different numbering scheme from Windows, the IBM numbers are used when there is
|
||||
no conflict. The tables are manually generated from the symbol manifests.
|
||||
|
||||
`Windows 7` refers to direct inspection of Windows 7 machines using .NET class
|
||||
`System.Text.Encoding`. The enclosed `MakeEncoding.cs` C# program brute-forces
|
||||
code pages. `MakeEncoding.cs` deviates from unicode.org in some cases. When they
|
||||
map a given code to different characters, unicode.org value is used. When
|
||||
unicode.org does not prescribe a value, `MakeEncoding.cs` value is used.
|
||||
|
||||
`NLS` refers to the National Language Support files supplied in various versions
|
||||
of Windows. In older versions of Windows (like Windows 98) these files followed
|
||||
the name pattern `CP_#.NLS`, but newer versions use the name pattern `C_#.NLS`.
|
||||
|
||||
## Testing
|
||||
|
||||
`make test` will run the nodejs-based test.
|
||||
|
||||
To run the in-browser tests, run a local server and go to the `ctest` directory.
|
||||
`make ctestserv` will start a python `SimpleHTTPServer` server on port 8000.
|
||||
|
||||
To update the browser artifacts, run `make ctest`.
|
||||
|
||||
## Sources
|
||||
|
||||
- [Unicode Consortium Public Mappings](http://www.unicode.org/Public/MAPPINGS/)
|
||||
- [Windows Code Page Enumeration](http://msdn.microsoft.com/en-us/library/cc195051.aspx)
|
||||
- [Windows Code Page Identifiers](http://msdn.microsoft.com/en-us/library/windows/desktop/dd317756.aspx)
|
||||
- [IBM Coded Character Sets](https://www-01.ibm.com/software/globalization/ccsid/ccsid_registered.html)
|
||||
|
||||
## License
|
||||
|
||||
Please consult the attached LICENSE file for details. All rights not explicitly
|
||||
granted by the Apache 2.0 license are reserved by the Original Author.
|
||||
|
||||
## Badges
|
||||
|
||||
[](https://saucelabs.com/u/codepage)
|
||||
|
||||
[](https://travis-ci.org/SheetJS/js-codepage)
|
||||
|
||||
[](https://coveralls.io/r/SheetJS/js-codepage?branch=master)
|
||||
|
||||
[](https://github.com/SheetJS/js-codepage)
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"dot-prop","version":"5.3.0","files":{"license":{"checkedAt":1678887829653,"integrity":"sha512-nIst73auX/5NY2Fmv5Y116vWnNrEv4GaIUX3lpZG05rpXJY2S8EX+fpUS5hRjClCM0VdT2Za9DDHXXB5jdSrEw==","mode":420,"size":1109},"index.js":{"checkedAt":1678887830224,"integrity":"sha512-WJ86KCZTkdi3vnN/artKd/0IQndfxNgmmoPEGTER6XZkf9sFOm5HDFoaQ4bc7CESgnJSC2fKqs7iJGEQ1/7J/Q==","mode":420,"size":2770},"package.json":{"checkedAt":1678887830224,"integrity":"sha512-6D4Gj9S6Stw9Do91+nyUgkgAghDDKFQTupta4NbGbi4kqg40b9JUS203bK+r25HRp8LdQhwI3kS8mwoFRtJpyA==","mode":420,"size":746},"readme.md":{"checkedAt":1678887830224,"integrity":"sha512-skit2H8ZL8Yv2qFKkk4CpDgq3KUOcBeQXCdgYt/UmvZtBUlMFyHrY/z6nY9/aeQUPMepIl/9K2pSmMmA0Ad/kQ==","mode":420,"size":2439},"index.d.ts":{"checkedAt":1678887830224,"integrity":"sha512-i3WjvpStP0bo5xVO/StjnCLZZYq+0yti7hJyKmJhWouJOVCZqvwMFdQoZb4dU3cfok8+ZUim09TMOhJg60yR0g==","mode":420,"size":2543}}}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J E F G A B BC"},B:{"1":"P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t","2":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 CC tB I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB DC EC","129":"TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB"},D:{"1":"VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC","2":"0 1 2 3 4 5 6 7 8 9 I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB"},E:{"2":"I u J E F G A B C K L H GC zB HC IC JC KC 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC"},F:{"1":"IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d","2":"0 1 2 3 4 5 6 7 8 9 G B C H M N O v w x y z AB BB CB DB EB FB GB HB OC PC QC RC qB 9B SC rB"},G:{"2":"F zB TC AC UC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC 2B 3B 4B 5B sB 6B 7B 8B"},H:{"2":"nC"},I:{"1":"D","2":"tB I oC pC qC rC AC sC tC"},J:{"2":"E A"},K:{"1":"e","2":"A B C qB 9B rB"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"uC"},P:{"1":"vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C","2":"I"},Q:{"1":"1B"},R:{"1":"8C"},S:{"2":"9C"}},B:5,C:"Auxclick"};
|
||||
@@ -0,0 +1,4 @@
|
||||
import { ObservableInput } from '../types';
|
||||
import { Subscription } from '../Subscription';
|
||||
import { Subscriber } from '../Subscriber';
|
||||
export declare const subscribeTo: <T>(result: ObservableInput<T>) => (subscriber: Subscriber<T>) => void | Subscription;
|
||||
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=interfaces.js.map
|
||||
@@ -0,0 +1,4 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { MonoTypeOperatorFunction, OperatorFunction, SchedulerLike, ObservableInput, ObservedValueOf } from '../types';
|
||||
export declare function publishReplay<T>(bufferSize?: number, windowTime?: number, scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;
|
||||
export declare function publishReplay<T, O extends ObservableInput<any>>(bufferSize?: number, windowTime?: number, selector?: (shared: Observable<T>) => O, scheduler?: SchedulerLike): OperatorFunction<T, ObservedValueOf<O>>;
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"publishReplay.js","sources":["../src/operators/publishReplay.ts"],"names":[],"mappings":";;;;;AAAA,yDAAoD"}
|
||||
@@ -0,0 +1,261 @@
|
||||
|
||||
/**
|
||||
* This is the common logic for both the Node.js and web browser
|
||||
* implementations of `debug()`.
|
||||
*/
|
||||
|
||||
function setup(env) {
|
||||
createDebug.debug = createDebug;
|
||||
createDebug.default = createDebug;
|
||||
createDebug.coerce = coerce;
|
||||
createDebug.disable = disable;
|
||||
createDebug.enable = enable;
|
||||
createDebug.enabled = enabled;
|
||||
createDebug.humanize = require('ms');
|
||||
createDebug.destroy = destroy;
|
||||
|
||||
Object.keys(env).forEach(key => {
|
||||
createDebug[key] = env[key];
|
||||
});
|
||||
|
||||
/**
|
||||
* The currently active debug mode names, and names to skip.
|
||||
*/
|
||||
|
||||
createDebug.names = [];
|
||||
createDebug.skips = [];
|
||||
|
||||
/**
|
||||
* Map of special "%n" handling functions, for the debug "format" argument.
|
||||
*
|
||||
* Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
|
||||
*/
|
||||
createDebug.formatters = {};
|
||||
|
||||
/**
|
||||
* Selects a color for a debug namespace
|
||||
* @param {String} namespace The namespace string for the for the debug instance to be colored
|
||||
* @return {Number|String} An ANSI color code for the given namespace
|
||||
* @api private
|
||||
*/
|
||||
function selectColor(namespace) {
|
||||
let hash = 0;
|
||||
|
||||
for (let i = 0; i < namespace.length; i++) {
|
||||
hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
|
||||
hash |= 0; // Convert to 32bit integer
|
||||
}
|
||||
|
||||
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
||||
}
|
||||
createDebug.selectColor = selectColor;
|
||||
|
||||
/**
|
||||
* Create a debugger with the given `namespace`.
|
||||
*
|
||||
* @param {String} namespace
|
||||
* @return {Function}
|
||||
* @api public
|
||||
*/
|
||||
function createDebug(namespace) {
|
||||
let prevTime;
|
||||
let enableOverride = null;
|
||||
|
||||
function debug(...args) {
|
||||
// Disabled?
|
||||
if (!debug.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
const self = debug;
|
||||
|
||||
// Set `diff` timestamp
|
||||
const curr = Number(new Date());
|
||||
const ms = curr - (prevTime || curr);
|
||||
self.diff = ms;
|
||||
self.prev = prevTime;
|
||||
self.curr = curr;
|
||||
prevTime = curr;
|
||||
|
||||
args[0] = createDebug.coerce(args[0]);
|
||||
|
||||
if (typeof args[0] !== 'string') {
|
||||
// Anything else let's inspect with %O
|
||||
args.unshift('%O');
|
||||
}
|
||||
|
||||
// Apply any `formatters` transformations
|
||||
let index = 0;
|
||||
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
|
||||
// If we encounter an escaped % then don't increase the array index
|
||||
if (match === '%%') {
|
||||
return '%';
|
||||
}
|
||||
index++;
|
||||
const formatter = createDebug.formatters[format];
|
||||
if (typeof formatter === 'function') {
|
||||
const val = args[index];
|
||||
match = formatter.call(self, val);
|
||||
|
||||
// Now we need to remove `args[index]` since it's inlined in the `format`
|
||||
args.splice(index, 1);
|
||||
index--;
|
||||
}
|
||||
return match;
|
||||
});
|
||||
|
||||
// Apply env-specific formatting (colors, etc.)
|
||||
createDebug.formatArgs.call(self, args);
|
||||
|
||||
const logFn = self.log || createDebug.log;
|
||||
logFn.apply(self, args);
|
||||
}
|
||||
|
||||
debug.namespace = namespace;
|
||||
debug.useColors = createDebug.useColors();
|
||||
debug.color = createDebug.selectColor(namespace);
|
||||
debug.extend = extend;
|
||||
debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
|
||||
|
||||
Object.defineProperty(debug, 'enabled', {
|
||||
enumerable: true,
|
||||
configurable: false,
|
||||
get: () => enableOverride === null ? createDebug.enabled(namespace) : enableOverride,
|
||||
set: v => {
|
||||
enableOverride = v;
|
||||
}
|
||||
});
|
||||
|
||||
// Env-specific initialization logic for debug instances
|
||||
if (typeof createDebug.init === 'function') {
|
||||
createDebug.init(debug);
|
||||
}
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
function extend(namespace, delimiter) {
|
||||
const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
|
||||
newDebug.log = this.log;
|
||||
return newDebug;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables a debug mode by namespaces. This can include modes
|
||||
* separated by a colon and wildcards.
|
||||
*
|
||||
* @param {String} namespaces
|
||||
* @api public
|
||||
*/
|
||||
function enable(namespaces) {
|
||||
createDebug.save(namespaces);
|
||||
|
||||
createDebug.names = [];
|
||||
createDebug.skips = [];
|
||||
|
||||
let i;
|
||||
const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
|
||||
const len = split.length;
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
if (!split[i]) {
|
||||
// ignore empty strings
|
||||
continue;
|
||||
}
|
||||
|
||||
namespaces = split[i].replace(/\*/g, '.*?');
|
||||
|
||||
if (namespaces[0] === '-') {
|
||||
createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
|
||||
} else {
|
||||
createDebug.names.push(new RegExp('^' + namespaces + '$'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable debug output.
|
||||
*
|
||||
* @return {String} namespaces
|
||||
* @api public
|
||||
*/
|
||||
function disable() {
|
||||
const namespaces = [
|
||||
...createDebug.names.map(toNamespace),
|
||||
...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
|
||||
].join(',');
|
||||
createDebug.enable('');
|
||||
return namespaces;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the given mode name is enabled, false otherwise.
|
||||
*
|
||||
* @param {String} name
|
||||
* @return {Boolean}
|
||||
* @api public
|
||||
*/
|
||||
function enabled(name) {
|
||||
if (name[name.length - 1] === '*') {
|
||||
return true;
|
||||
}
|
||||
|
||||
let i;
|
||||
let len;
|
||||
|
||||
for (i = 0, len = createDebug.skips.length; i < len; i++) {
|
||||
if (createDebug.skips[i].test(name)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0, len = createDebug.names.length; i < len; i++) {
|
||||
if (createDebug.names[i].test(name)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert regexp to namespace
|
||||
*
|
||||
* @param {RegExp} regxep
|
||||
* @return {String} namespace
|
||||
* @api private
|
||||
*/
|
||||
function toNamespace(regexp) {
|
||||
return regexp.toString()
|
||||
.substring(2, regexp.toString().length - 2)
|
||||
.replace(/\.\*\?$/, '*');
|
||||
}
|
||||
|
||||
/**
|
||||
* Coerce `val`.
|
||||
*
|
||||
* @param {Mixed} val
|
||||
* @return {Mixed}
|
||||
* @api private
|
||||
*/
|
||||
function coerce(val) {
|
||||
if (val instanceof Error) {
|
||||
return val.stack || val.message;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
/**
|
||||
* XXX DO NOT USE. This is a temporary stub function.
|
||||
* XXX It WILL be removed in the next major release.
|
||||
*/
|
||||
function destroy() {
|
||||
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
||||
}
|
||||
|
||||
createDebug.enable(createDebug.load());
|
||||
|
||||
return createDebug;
|
||||
}
|
||||
|
||||
module.exports = setup;
|
||||
@@ -0,0 +1 @@
|
||||
export * from 'rxjs-compat/util/isArrayLike';
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.00358,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0.00717,"39":0,"40":0,"41":0,"42":0,"43":0.00358,"44":0.02509,"45":0.00717,"46":0,"47":0,"48":0,"49":0,"50":0.00358,"51":0,"52":0.00717,"53":0.00358,"54":0,"55":0,"56":0.00358,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0.01075,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0.00358,"85":0,"86":0,"87":0.01434,"88":0.00358,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0.00717,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0.00358,"102":0.01434,"103":0.00358,"104":0.00358,"105":0.00358,"106":0.01075,"107":0.01792,"108":0.41933,"109":0.23654,"110":0,"111":0.01075,"3.5":0,"3.6":0},D:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0.00358,"37":0,"38":0.00358,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0.01075,"48":0.06451,"49":0.02509,"50":0,"51":0,"52":0,"53":0.00358,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0.00358,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0.01434,"75":0,"76":0.00717,"77":0,"78":0.00358,"79":0.0215,"80":0.00358,"81":0.01075,"83":0.00358,"84":0.00717,"85":0.00717,"86":0.00358,"87":0.03226,"88":0.00358,"89":0.01075,"90":0.00358,"91":0.00717,"92":0.00717,"93":0.01075,"94":0.03226,"95":0.00358,"96":0.08243,"97":0.00358,"98":0.00358,"99":0.00358,"100":0.01434,"101":0.01792,"102":0.01075,"103":0.05376,"104":0.01792,"105":0.04659,"106":0.22221,"107":0.15053,"108":3.55533,"109":3.08224,"110":0.00358,"111":0.00358,"112":0},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0.00358,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0.00358,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"60":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0.00358,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0.00717,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0.11469,"94":0.11827,"9.5-9.6":0,"10.0-10.1":0,"10.5":0,"10.6":0,"11.1":0,"11.5":0,"11.6":0,"12.1":0},B:{"12":0.00358,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0.00358,"79":0,"80":0,"81":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0.18278,"101":0,"102":0,"103":0.00358,"104":0,"105":0.00358,"106":0.00358,"107":0.06093,"108":0.6953,"109":0.69888},E:{"4":0,"5":0,"6":0,"7":0,"8":0.00358,"9":0.01075,"10":0,"11":0,"12":0,"13":0.01075,"14":0.07526,"15":0.00717,_:"0","3.1":0,"3.2":0,"5.1":0,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0,"12.1":0.00717,"13.1":0.05376,"14.1":0.14694,"15.1":0.02867,"15.2-15.3":0.0215,"15.4":0.04659,"15.5":0.10394,"15.6":0.70246,"16.0":0.05018,"16.1":0.14336,"16.2":0.27955,"16.3":0.02509},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0,"6.0-6.1":0,"7.0-7.1":0.01984,"8.1-8.4":0.03175,"9.0-9.2":0.00397,"9.3":0.14288,"10.0-10.2":0,"10.3":0.12701,"11.0-11.2":0.00794,"11.3-11.4":0.08335,"12.0-12.1":0.01191,"12.2-12.5":1.04383,"13.0-13.1":0.01191,"13.2":0.00794,"13.3":0.04366,"13.4-13.7":0.1151,"14.0-14.4":0.47627,"14.5-14.8":1.47247,"15.0-15.1":0.31751,"15.2-15.3":0.48818,"15.4":0.50009,"15.5":1.26609,"15.6":5.86211,"16.0":4.72699,"16.1":13.25622,"16.2":7.17185,"16.3":0.40086},P:{"4":0.06231,"5.0-5.4":0,"6.2-6.4":0,"7.2-7.4":0.03115,"8.2":0,"9.2":0,"10.1":0,"11.1-11.2":0.03115,"12.0":0.01038,"13.0":0.04154,"14.0":0.05192,"15.0":0.02077,"16.0":0.08308,"17.0":0.05192,"18.0":0.17654,"19.0":3.68661},I:{"0":0,"3":0,"4":0.02058,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.07203,"4.4":0,"4.4.3-4.4.4":0.15434},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0.10394,"10":0,"11":0.03226,"5.5":0},J:{"7":0,"10":0.00642},N:{"10":0,"11":0},R:{_:"0"},M:{"0":0.47478},Q:{"13.1":0},O:{"0":0.02566},H:{"0":0.17008},L:{"0":43.11744},S:{"2.5":0}};
|
||||
@@ -0,0 +1,141 @@
|
||||
# configstore [](https://travis-ci.org/yeoman/configstore)
|
||||
|
||||
> Easily load and persist config without having to think about where and how
|
||||
|
||||
The config is stored in a JSON file located in `$XDG_CONFIG_HOME` or `~/.config`.<br>
|
||||
Example: `~/.config/configstore/some-id.json`
|
||||
|
||||
*If you need this for Electron, check out [`electron-store`](https://github.com/sindresorhus/electron-store) instead.*<br>
|
||||
*And check out [`conf`](https://github.com/sindresorhus/conf) for an updated approach to this concept.*
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install configstore
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const Configstore = require('configstore');
|
||||
const packageJson = require('./package.json');
|
||||
|
||||
// Create a Configstore instance
|
||||
const config = new Configstore(packageJson.name, {foo: 'bar'});
|
||||
|
||||
console.log(config.get('foo'));
|
||||
//=> 'bar'
|
||||
|
||||
config.set('awesome', true);
|
||||
console.log(config.get('awesome'));
|
||||
//=> true
|
||||
|
||||
// Use dot-notation to access nested properties
|
||||
config.set('bar.baz', true);
|
||||
console.log(config.get('bar'));
|
||||
//=> {baz: true}
|
||||
|
||||
config.delete('awesome');
|
||||
console.log(config.get('awesome'));
|
||||
//=> undefined
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### Configstore(packageName, defaults?, options?)
|
||||
|
||||
Returns a new instance.
|
||||
|
||||
#### packageName
|
||||
|
||||
Type: `string`
|
||||
|
||||
Name of your package.
|
||||
|
||||
#### defaults
|
||||
|
||||
Type: `object`
|
||||
|
||||
Default config.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
##### globalConfigPath
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `false`
|
||||
|
||||
Store the config at `$CONFIG/package-name/config.json` instead of the default `$CONFIG/configstore/package-name.json`. This is not recommended as you might end up conflicting with other tools, rendering the "without having to think" idea moot.
|
||||
|
||||
##### configPath
|
||||
|
||||
Type: `string`<br>
|
||||
Default: Automatic
|
||||
|
||||
**Please don't use this option unless absolutely necessary and you know what you're doing.**
|
||||
|
||||
Set the path of the config file. Overrides the `packageName` and `globalConfigPath` options.
|
||||
|
||||
### Instance
|
||||
|
||||
You can use [dot-notation](https://github.com/sindresorhus/dot-prop) in a `key` to access nested properties.
|
||||
|
||||
### .set(key, value)
|
||||
|
||||
Set an item.
|
||||
|
||||
### .set(object)
|
||||
|
||||
Set multiple items at once.
|
||||
|
||||
### .get(key)
|
||||
|
||||
Get an item.
|
||||
|
||||
### .has(key)
|
||||
|
||||
Check if an item exists.
|
||||
|
||||
### .delete(key)
|
||||
|
||||
Delete an item.
|
||||
|
||||
### .clear()
|
||||
|
||||
Delete all items.
|
||||
|
||||
### .size
|
||||
|
||||
Get the item count.
|
||||
|
||||
### .path
|
||||
|
||||
Get the path to the config file. Can be used to show the user where the config file is located or even better open it for them.
|
||||
|
||||
### .all
|
||||
|
||||
Get all the config as an object or replace the current config with an object:
|
||||
|
||||
```js
|
||||
config.all = {
|
||||
hello: 'world'
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-configstore?utm_source=npm-configstore&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
||||
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
Simple micro templating.
|
||||
|
||||
@param template - Text with placeholders for `data` properties.
|
||||
@param data - Data to interpolate into `template`.
|
||||
|
||||
@example
|
||||
```
|
||||
import pupa = require('pupa');
|
||||
|
||||
pupa('The mobile number of {name} is {phone.mobile}', {
|
||||
name: 'Sindre',
|
||||
phone: {
|
||||
mobile: '609 24 363'
|
||||
}
|
||||
});
|
||||
//=> 'The mobile number of Sindre is 609 24 363'
|
||||
|
||||
pupa('I like {0} and {1}', ['🦄', '🐮']);
|
||||
//=> 'I like 🦄 and 🐮'
|
||||
|
||||
// Double braces encodes the HTML entities to avoid code injection
|
||||
pupa('I like {{0}} and {{1}}', ['<br>🦄</br>', '<i>🐮</i>']);
|
||||
//=> 'I like <br>🦄</br> and <i>🐮</i>'
|
||||
```
|
||||
*/
|
||||
declare function pupa(
|
||||
template: string,
|
||||
data: unknown[] | {[key: string]: any}
|
||||
): string;
|
||||
|
||||
export = pupa;
|
||||
Reference in New Issue
Block a user