diff --git a/.eslintrc.yml b/.eslintrc.yml index a31998b0..fcb23c3d 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -15,15 +15,21 @@ env: rules: no-console: 0 + prefer-const: 0 + prefer-rest-params: 0 + no-redeclare: 0 + no-var: 0 + no-prototype-builtins: 0 + prefer-spread: 0 "@typescript-eslint/no-var-requires": 0 "@typescript-eslint/explicit-function-return-type": 0 "@typescript-eslint/no-explicit-any": 0 "@typescript-eslint/explicit-member-accessibility": 0 + "@typescript-eslint/no-this-alias": 0 "@typescript-eslint/no-parameter-properties": 0 "@typescript-eslint/no-use-before-define": 0 - "@typescript-eslint/array-type": - - error - - array-simple + "@typescript-eslint/ban-ts-ignore": 0 + "@typescript-eslint/no-empty-function": 0 "@typescript-eslint/no-unused-vars": - warn - args: none diff --git a/.travis.yml b/.travis.yml index 84376aca..8f77df1c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: node_js node_js: - - "6" - "8" - "9" - "10" @@ -14,7 +13,7 @@ services: script: - npm run lint - npm run build - - npm run test:cov || npm run test:cov || npm run test:cov + - travis_retry npm run test env: - CC_TEST_REPORTER_ID="4cee2f60edbf31acac6ddff823f0b93e2e9882c3e5c55130049e0fd878549f84" diff --git a/README.md b/README.md index 3a998b58..271cd8b7 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ [![ioredis](https://cdn.jsdelivr.net/gh/luin/ioredis@b5e8c74/logo.svg)](https://github.com/luin/ioredis) [![Build Status](https://travis-ci.org/luin/ioredis.svg?branch=master)](https://travis-ci.org/luin/ioredis) -[![Test Coverage](https://codeclimate.com/github/luin/ioredis/badges/coverage.svg)](https://codeclimate.com/github/luin/ioredis) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) [![Join the chat at https://gitter.im/luin/ioredis](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/luin/ioredis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) @@ -86,7 +85,7 @@ redis.set("foo", "bar"); // returns promise which resolves to string, "OK" // the js: ` redis.set("mykey", "Hello") ` is equivalent to the cli: ` redis> SET mykey "Hello" ` // ioredis supports the node.js callback style -redis.get("foo", function(err, result) { +redis.get("foo", function (err, result) { if (err) { console.error(err); } else { @@ -95,13 +94,13 @@ redis.get("foo", function(err, result) { }); // Or ioredis returns a promise if the last argument isn't a function -redis.get("foo").then(function(result) { +redis.get("foo").then(function (result) { console.log(result); // Prints "bar" }); // Most responses are strings, or arrays of strings -redis.zadd("sortedSet", 1, "one", 2, "dos", 4, "quatro", 3, "three") -redis.zrange("sortedSet", 0, 2, "WITHSCORES").then(res => console.log(res)); // Promise resolves to ["one", "1", "dos", "2", "three", "3"] as if the command was ` redis> ZRANGE sortedSet 0 2 WITHSCORES ` +redis.zadd("sortedSet", 1, "one", 2, "dos", 4, "quatro", 3, "three"); +redis.zrange("sortedSet", 0, 2, "WITHSCORES").then((res) => console.log(res)); // Promise resolves to ["one", "1", "dos", "2", "three", "3"] as if the command was ` redis> ZRANGE sortedSet 0 2 WITHSCORES ` // All arguments are passed directly to the redis server: redis.set("key", 100, "EX", 10); @@ -125,7 +124,7 @@ new Redis({ host: "127.0.0.1", // Redis host family: 4, // 4 (IPv4) or 6 (IPv6) password: "auth", - db: 0 + db: 0, }); ``` @@ -149,7 +148,7 @@ and publishes to that channel with the other: var Redis = require("ioredis"); var redis = new Redis(); var pub = new Redis(); -redis.subscribe("news", "music", function(err, count) { +redis.subscribe("news", "music", function (err, count) { // Now we are subscribed to both the 'news' and 'music' channels. // `count` represents the number of channels we are currently subscribed to. @@ -157,7 +156,7 @@ redis.subscribe("news", "music", function(err, count) { pub.publish("music", "Hello again!"); }); -redis.on("message", function(channel, message) { +redis.on("message", function (channel, message) { // Receive message Hello world! from channel news // Receive message Hello again! from channel music console.log("Receive message %s from channel %s", message, channel); @@ -165,7 +164,7 @@ redis.on("message", function(channel, message) { // There's also an event called 'messageBuffer', which is the same as 'message' except // it returns buffers instead of strings. -redis.on("messageBuffer", function(channel, message) { +redis.on("messageBuffer", function (channel, message) { // Both `channel` and `message` are buffers. }); ``` @@ -173,9 +172,9 @@ redis.on("messageBuffer", function(channel, message) { `PSUBSCRIBE` is also supported in a similar way: ```javascript -redis.psubscribe("pat?ern", function(err, count) {}); -redis.on("pmessage", function(pattern, channel, message) {}); -redis.on("pmessageBuffer", function(pattern, channel, message) {}); +redis.psubscribe("pat?ern", function (err, count) {}); +redis.on("pmessage", function (pattern, channel, message) {}); +redis.on("pmessageBuffer", function (pattern, channel, message) {}); ``` When a client issues a SUBSCRIBE or PSUBSCRIBE, that connection is put into a "subscriber" mode. @@ -196,7 +195,7 @@ And every command has a method that returns a Buffer (by adding a suffix of "Buf To get a buffer instead of a utf8 string: ```javascript -redis.getBuffer("foo", function(err, result) { +redis.getBuffer("foo", function (err, result) { // result is a buffer. }); ``` @@ -214,7 +213,7 @@ and flushed to Redis by calling the `exec` method: var pipeline = redis.pipeline(); pipeline.set("foo", "bar"); pipeline.del("cc"); -pipeline.exec(function(err, results) { +pipeline.exec(function (err, results) { // `err` is always null, and `results` is an array of responses // corresponding to the sequence of queued commands. // Each response follows the format `[err, result]`. @@ -225,15 +224,11 @@ redis .pipeline() .set("foo", "bar") .del("cc") - .exec(function(err, results) {}); + .exec(function (err, results) {}); // `exec` also returns a Promise: -var promise = redis - .pipeline() - .set("foo", "bar") - .get("foo") - .exec(); -promise.then(function(result) { +var promise = redis.pipeline().set("foo", "bar").get("foo").exec(); +promise.then(function (result) { // result === [[null, 'OK'], [null, 'bar']] }); ``` @@ -245,10 +240,10 @@ gets a reply: redis .pipeline() .set("foo", "bar") - .get("foo", function(err, result) { + .get("foo", function (err, result) { // result === 'bar' }) - .exec(function(err, result) { + .exec(function (err, result) { // result[1][1] === 'bar' }); ``` @@ -256,18 +251,20 @@ redis In addition to adding commands to the `pipeline` queue individually, you can also pass an array of commands and arguments to the constructor: ```javascript -redis.pipeline([["set", "foo", "bar"], ["get", "foo"]]).exec(function() { - /* ... */ -}); +redis + .pipeline([ + ["set", "foo", "bar"], + ["get", "foo"], + ]) + .exec(function () { + /* ... */ + }); ``` `#length` property shows how many commands in the pipeline: ```javascript -const length = redis - .pipeline() - .set("foo", "bar") - .get("foo").length; +const length = redis.pipeline().set("foo", "bar").get("foo").length; // length === 2 ``` @@ -282,7 +279,7 @@ redis .multi() .set("foo", "bar") .get("foo") - .exec(function(err, results) { + .exec(function (err, results) { // results === [[null, 'OK'], [null, 'bar']] }); ``` @@ -295,7 +292,7 @@ redis .multi() .set("foo") .set("foo", "new value") - .exec(function(err, results) { + .exec(function (err, results) { // err: // { [ReplyError: EXECABORT Transaction discarded because of previous errors.] // name: 'ReplyError', @@ -315,7 +312,7 @@ to each chained command, the queueing state is passed to the callback instead of ```javascript redis .multi() - .set("foo", "bar", function(err, result) { + .set("foo", "bar", function (err, result) { // result === 'QUEUED' }) .exec(/* ... */); @@ -328,7 +325,7 @@ and every command will be sent to Redis immediately without waiting for an `exec redis.multi({ pipeline: false }); redis.set("foo", "bar"); redis.get("foo"); -redis.exec(function(err, result) { +redis.exec(function (err, result) { // result === [[null, 'OK'], [null, 'bar']] }); ``` @@ -336,9 +333,14 @@ redis.exec(function(err, result) { The constructor of `multi` also accepts a batch of commands: ```javascript -redis.multi([["set", "foo", "bar"], ["get", "foo"]]).exec(function() { - /* ... */ -}); +redis + .multi([ + ["set", "foo", "bar"], + ["get", "foo"], + ]) + .exec(function () { + /* ... */ + }); ``` Inline transactions are supported by pipeline, which means you can group a subset of commands @@ -369,26 +371,22 @@ var redis = new Redis(); // This will define a command echo: redis.defineCommand("echo", { numberOfKeys: 2, - lua: "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}" + lua: "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}", }); // Now `echo` can be used just like any other ordinary command, // and ioredis will try to use `EVALSHA` internally when possible for better performance. -redis.echo("k1", "k2", "a1", "a2", function(err, result) { +redis.echo("k1", "k2", "a1", "a2", function (err, result) { // result === ['k1', 'k2', 'a1', 'a2'] }); // `echoBuffer` is also defined automatically to return buffers instead of strings: -redis.echoBuffer("k1", "k2", "a1", "a2", function(err, result) { +redis.echoBuffer("k1", "k2", "a1", "a2", function (err, result) { // result[0] equals to Buffer.from('k1'); }); // And of course it works with pipeline: -redis - .pipeline() - .set("foo", "bar") - .echo("k1", "k2", "a1", "a2") - .exec(); +redis.pipeline().set("foo", "bar").echo("k1", "k2", "a1", "a2").exec(); ``` If the number of keys can't be determined when defining a command, you can @@ -397,12 +395,12 @@ when you call the command: ```javascript redis.defineCommand("echoDynamicKeyNumber", { - lua: "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}" + lua: "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}", }); // Now you have to pass the number of keys as the first argument every time // you invoke the `echoDynamicKeyNumber` command: -redis.echoDynamicKeyNumber(2, "k1", "k2", "a1", "a2", function(err, result) { +redis.echoDynamicKeyNumber(2, "k1", "k2", "a1", "a2", function (err, result) { // result === ['k1', 'k2', 'a1', 'a2'] }); ``` @@ -422,7 +420,7 @@ fooRedis.set("bar", "baz"); // Actually sends SET foo:bar baz fooRedis.defineCommand("echo", { numberOfKeys: 2, - lua: "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}" + lua: "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}", }); // Works well with pipelining/transaction @@ -455,7 +453,7 @@ var Redis = require("ioredis"); // hmset('key', new Map([['k1', 'v1'], ['k2', 'v2']])) // into // hmset('key', 'k1', 'v1', 'k2', 'v2') -Redis.Command.setArgumentTransformer("hmset", function(args) { +Redis.Command.setArgumentTransformer("hmset", function (args) { if (args.length === 2) { if (typeof Map !== "undefined" && args[1] instanceof Map) { // utils is a internal module of ioredis @@ -472,7 +470,7 @@ Redis.Command.setArgumentTransformer("hmset", function(args) { // ['k1', 'v1', 'k2', 'v2'] // into // { k1: 'v1', 'k2': 'v2' } -Redis.Command.setReplyTransformer("hgetall", function(result) { +Redis.Command.setReplyTransformer("hgetall", function (result) { if (Array.isArray(result)) { var obj = {}; for (var i = 0; i < result.length; i += 2) { @@ -490,12 +488,17 @@ above, and the transformer for `mset` is similar to the one for `hmset`: ```javascript redis.mset({ k1: "v1", k2: "v2" }); -redis.get("k1", function(err, result) { +redis.get("k1", function (err, result) { // result === 'v1'; }); -redis.mset(new Map([["k3", "v3"], ["k4", "v4"]])); -redis.get("k3", function(err, result) { +redis.mset( + new Map([ + ["k3", "v3"], + ["k4", "v4"], + ]) +); +redis.get("k3", function (err, result) { // result === 'v3'; }); ``` @@ -503,7 +506,7 @@ redis.get("k3", function(err, result) { Another useful example of a reply transformer is one that changes `hgetall` to return array of arrays instead of objects which avoids a unwanted conversation of hash keys to strings when dealing with binary hash keys: ```javascript -Redis.Command.setReplyTransformer("hgetall", function(result) { +Redis.Command.setReplyTransformer("hgetall", function (result) { var arr = []; for (var i = 0; i < result.length; i += 2) { arr.push([result[i], result[i + 1]]); @@ -512,7 +515,7 @@ Redis.Command.setReplyTransformer("hgetall", function(result) { }); redis.hset("h1", Buffer.from([0x01]), Buffer.from([0x02])); redis.hset("h1", Buffer.from([0x03]), Buffer.from([0x04])); -redis.hgetallBuffer("h1", function(err, result) { +redis.hgetallBuffer("h1", function (err, result) { // result === [ [ , ], [ , ] ]; }); ``` @@ -530,19 +533,22 @@ The callback for the monitor event takes a timestamp from the Redis server and a Here is a simple example: ```javascript -redis.monitor(function(err, monitor) { - monitor.on("monitor", function(time, args, source, database) {}); +redis.monitor(function (err, monitor) { + monitor.on("monitor", function (time, args, source, database) {}); }); ``` + Here is another example illustrating an `async` function and `monitor.disconnect()`: + ```javascript async () => { - const monitor = await redis.monitor() - monitor.on('monitor', console.log) + const monitor = await redis.monitor(); + monitor.on("monitor", console.log); // Any other tasks - monitor.disconnect() -} + monitor.disconnect(); +}; ``` + ## Streamify Scanning Redis 2.8 added the `SCAN` command to incrementally iterate through the keys in the database. It's different from `KEYS` in that @@ -555,7 +561,7 @@ provides a streaming interface for the `SCAN` command to make things much easier var redis = new Redis(); // Create a readable stream (object mode) var stream = redis.scanStream(); -stream.on("data", function(resultKeys) { +stream.on("data", function (resultKeys) { // `resultKeys` is an array of strings representing key names. // Note that resultKeys may contain 0 keys, and that it will sometimes // contain duplicates due to SCAN's implementation in Redis. @@ -563,7 +569,7 @@ stream.on("data", function(resultKeys) { console.log(resultKeys[i]); } }); -stream.on("end", function() { +stream.on("end", function () { console.log("all keys have been visited"); }); ``` @@ -575,7 +581,7 @@ var stream = redis.scanStream({ // only returns keys following the pattern of `user:*` match: "user:*", // returns approximately 100 elements per call - count: 100 + count: 100, }); ``` @@ -587,7 +593,7 @@ similar to `scanStream` except the first argument is the key name: ```javascript var stream = redis.hscanStream("myhash", { - match: "age:??" + match: "age:??", }); ``` @@ -598,7 +604,7 @@ It's pretty common that doing an async task in the `data` handler. We'd like the ```javascript var stream = redis.scanStream(); -stream.on("data", function(resultKeys) { +stream.on("data", function (resultKeys) { // Pause the stream from scanning more keys until we've migrated the current keys. stream.pause(); @@ -608,7 +614,7 @@ stream.on("data", function(resultKeys) { }); }); -stream.on("end", function() { +stream.on("end", function () { console.log("done migration"); }); ``` @@ -624,10 +630,10 @@ using the `retryStrategy` option: ```javascript var redis = new Redis({ // This is the default value of `retryStrategy` - retryStrategy: function(times) { + retryStrategy: function (times) { var delay = Math.min(times * 50, 2000); return delay; - } + }, }); ``` @@ -647,7 +653,7 @@ By default, all pending commands will be flushed with an error every 20 retry at ```javascript var redis = new Redis({ - maxRetriesPerRequest: 1 + maxRetriesPerRequest: 1, }); ``` @@ -659,13 +665,13 @@ Besides auto-reconnect when the connection is closed, ioredis supports reconnect ```javascript var redis = new Redis({ - reconnectOnError: function(err) { + reconnectOnError: function (err) { var targetError = "READONLY"; if (err.message.slice(0, targetError.length) === targetError) { // Only reconnect when the error starts with "READONLY" return true; // or `return 1;` } - } + }, }); ``` @@ -715,8 +721,8 @@ var redis = new Redis({ // Refer to `tls.connect()` section in // https://nodejs.org/api/tls.html // for all supported options - ca: fs.readFileSync("cert.pem") - } + ca: fs.readFileSync("cert.pem"), + }, }); ``` @@ -739,9 +745,9 @@ To connect using Sentinel, use: var redis = new Redis({ sentinels: [ { host: "localhost", port: 26379 }, - { host: "localhost", port: 26380 } + { host: "localhost", port: 26380 }, ], - name: "mymaster" + name: "mymaster", }); redis.set("foo", "bar"); @@ -768,11 +774,11 @@ var availableSlaves = [{ ip: "127.0.0.1", port: "31231", flags: "slave" }]; // preferredSlaves array format var preferredSlaves = [ { ip: "127.0.0.1", port: "31231", prio: 1 }, - { ip: "127.0.0.1", port: "31232", prio: 2 } + { ip: "127.0.0.1", port: "31232", prio: 2 }, ]; // preferredSlaves function format -preferredSlaves = function(availableSlaves) { +preferredSlaves = function (availableSlaves) { for (var i = 0; i < availableSlaves.length; i++) { var slave = availableSlaves[i]; if (slave.ip === "127.0.0.1") { @@ -788,11 +794,11 @@ preferredSlaves = function(availableSlaves) { var redis = new Redis({ sentinels: [ { host: "127.0.0.1", port: 26379 }, - { host: "127.0.0.1", port: 26380 } + { host: "127.0.0.1", port: 26380 }, ], name: "mymaster", role: "slave", - preferredSlaves: preferredSlaves + preferredSlaves: preferredSlaves, }); ``` @@ -816,16 +822,16 @@ var Redis = require("ioredis"); var cluster = new Redis.Cluster([ { port: 6380, - host: "127.0.0.1" + host: "127.0.0.1", }, { port: 6381, - host: "127.0.0.1" - } + host: "127.0.0.1", + }, ]); cluster.set("foo", "bar"); -cluster.get("foo", function(err, res) { +cluster.get("foo", function (err, res) { // res === 'bar' }); ``` @@ -893,11 +899,11 @@ var cluster = new Redis.Cluster( /* nodes */ ], { - scaleReads: "slave" + scaleReads: "slave", } ); cluster.set("foo", "bar"); // This query will be sent to one of the masters. -cluster.get("foo", function(err, res) { +cluster.get("foo", function (err, res) { // This query will be sent to one of the slaves. }); ``` @@ -916,7 +922,7 @@ Sometimes you may want to send a command to multiple nodes (masters or slaves) o // Send `FLUSHDB` command to all slaves: var slaves = cluster.nodes("slave"); Promise.all( - slaves.map(function(node) { + slaves.map(function (node) { return node.flushdb(); }) ); @@ -924,10 +930,10 @@ Promise.all( // Get keys of all the masters: var masters = cluster.nodes("master"); Promise.all( - masters.map(function(node) { + masters.map(function (node) { return node.keys(); }) -).then(function(keys) { +).then(function (keys) { // keys: [['key1', 'key2'], ['key3', 'key4']] }); ``` @@ -943,15 +949,15 @@ const cluster = new Redis.Cluster( [ { host: "203.0.113.73", - port: 30001 - } + port: 30001, + }, ], { natMap: { "10.0.1.230:30001": { host: "203.0.113.73", port: 30001 }, "10.0.1.231:30001": { host: "203.0.113.73", port: 30002 }, - "10.0.1.232:30001": { host: "203.0.113.73", port: 30003 } - } + "10.0.1.232:30001": { host: "203.0.113.73", port: 30003 }, + }, } ); ``` @@ -982,11 +988,11 @@ var nodes = [ ]; var pub = new Redis.Cluster(nodes); var sub = new Redis.Cluster(nodes); -sub.on("message", function(channel, message) { +sub.on("message", function (channel, message) { console.log(channel, message); }); -sub.subscribe("news", function() { +sub.subscribe("news", function () { pub.publish("news", "highlights"); }); ``` @@ -1013,8 +1019,8 @@ Setting the `password` option to access password-protected clusters: var Redis = require("ioredis"); var cluster = new Redis.Cluster(nodes, { redisOptions: { - password: "your-cluster-password" - } + password: "your-cluster-password", + }, }); ``` @@ -1027,13 +1033,13 @@ var cluster = new Redis.Cluster( // Use password "password-for-30001" for 30001 { port: 30001, password: "password-for-30001" }, // Don't use password when accessing 30002 - { port: 30002, password: null } + { port: 30002, password: null }, // Other nodes will use "fallback-password" ], { redisOptions: { - password: "fallback-password" - } + password: "fallback-password", + }, } ); ``` @@ -1046,14 +1052,16 @@ issue, construct the `Cluster` with the `dnsLookup` option as follows: ```javascript var cluster = new Redis.Cluster( - [{ - host: 'clustercfg.myCluster.abcdefg.xyz.cache.amazonaws.com', - port: 6379 - }], + [ + { + host: "clustercfg.myCluster.abcdefg.xyz.cache.amazonaws.com", + port: 6379, + }, + ], { dnsLookup: (address, callback) => callback(null, address), redisOptions: { - tls: {} + tls: {}, }, } ); @@ -1069,7 +1077,7 @@ All the errors returned by the Redis server are instances of `ReplyError`, which var Redis = require("ioredis"); var redis = new Redis(); // This command causes a reply error since the SET command requires two arguments. -redis.set("foo", function(err) { +redis.set("foo", function (err) { err instanceof Redis.ReplyError; }); ``` diff --git a/benchmarks/single_node.ts b/benchmarks/single_node.ts index 84bfeffb..57355d96 100644 --- a/benchmarks/single_node.ts +++ b/benchmarks/single_node.ts @@ -4,16 +4,16 @@ import Redis from "../lib/redis"; console.log("=========================="); console.log("redis: " + require("../package.json").version); -var os = require("os"); +const os = require("os"); console.log("CPU: " + os.cpus().length); console.log("OS: " + os.platform() + " " + os.arch()); console.log("node version: " + process.version); console.log("current commit: " + execSync("git rev-parse --short HEAD")); console.log("=========================="); -var redisJD, redisJ; -var waitReady = function(next) { - var pending = 2; +let redisJD, redisJ; +const waitReady = function (next) { + let pending = 2; function check() { if (!--pending) { next(); @@ -25,57 +25,57 @@ var waitReady = function(next) { redisJ.on("ready", check); }; -var quit = function() { +const quit = function () { redisJD.quit(); redisJ.quit(); }; -suite("SET foo bar", function() { +suite("SET foo bar", function () { // @ts-ignore set("mintime", 5000); // @ts-ignore set("concurrency", 300); - before(function(start) { + before(function (start) { waitReady(start); }); // @ts-ignore - bench("javascript parser + dropBufferSupport: true", function(next) { + bench("javascript parser + dropBufferSupport: true", function (next) { redisJD.set("foo", "bar", next); }); // @ts-ignore - bench("javascript parser", function(next) { + bench("javascript parser", function (next) { redisJ.set("foo", "bar", next); }); after(quit); }); -suite("LRANGE foo 0 99", function() { +suite("LRANGE foo 0 99", function () { // @ts-ignore set("mintime", 5000); // @ts-ignore set("concurrency", 300); - before(function(start) { - var redis = new Redis(); - var item = []; - for (var i = 0; i < 100; ++i) { + before(function (start) { + const redis = new Redis(); + const item = []; + for (let i = 0; i < 100; ++i) { item.push(((Math.random() * 100000) | 0) + "str"); } redis.del("foo"); - redis.lpush("foo", item, function() { + redis.lpush("foo", item, function () { waitReady(start); }); }); // @ts-ignore - bench("javascript parser + dropBufferSupport: true", function(next) { + bench("javascript parser + dropBufferSupport: true", function (next) { redisJD.lrange("foo", 0, 99, next); }); // @ts-ignore - bench("javascript parser", function(next) { + bench("javascript parser", function (next) { redisJ.lrange("foo", 0, 99, next); }); diff --git a/examples/basic_operations.js b/examples/basic_operations.js index 72681293..939d64d6 100644 --- a/examples/basic_operations.js +++ b/examples/basic_operations.js @@ -2,7 +2,7 @@ const Redis = require("ioredis"); const redis = new Redis({ port: process.env.redisPort, host: process.env.redisEndpoint, - password: process.env.redisPW + password: process.env.redisPW, }); // ioredis supports all Redis commands: @@ -12,7 +12,7 @@ redis.set("foo", "bar"); // returns promise which resolves to string, "OK" // the js: ` redis.set("mykey", "Hello") ` is equivalent to the cli: ` redis> SET mykey "Hello" ` // ioredis supports the node.js callback style -redis.get("foo", function(err, result) { +redis.get("foo", function (err, result) { if (err) { console.error(err); } else { @@ -21,7 +21,7 @@ redis.get("foo", function(err, result) { }); // Or ioredis returns a promise if the last argument isn't a function -redis.get("foo").then(function(result) { +redis.get("foo").then(function (result) { console.log(result); }); @@ -34,11 +34,11 @@ redis.spop("set"); // Promise resolves to "5" or another item in the set // Most responses are strings, or arrays of strings redis.zadd("sortedSet", 1, "one", 2, "dos", 4, "quatro", 3, "three"); -redis.zrange("sortedSet", 0, 2, "WITHSCORES").then(res => console.log(res)); // Promise resolves to ["one", "1", "dos", "2", "three", "3"] as if the command was ` redis> ZRANGE sortedSet 0 2 WITHSCORES ` +redis.zrange("sortedSet", 0, 2, "WITHSCORES").then((res) => console.log(res)); // Promise resolves to ["one", "1", "dos", "2", "three", "3"] as if the command was ` redis> ZRANGE sortedSet 0 2 WITHSCORES ` // Some responses have transformers to JS values redis.hset("myhash", "field1", "Hello"); -redis.hgetall("myhash").then(res => console.log(res)); // Promise resolves to Object {field1: "Hello"} rather than a string, or array of strings +redis.hgetall("myhash").then((res) => console.log(res)); // Promise resolves to Object {field1: "Hello"} rather than a string, or array of strings // All arguments are passed directly to the redis server: redis.set("key", 100, "EX", 10); // set's key to value 100 and expires it after 10 seconds diff --git a/examples/custom_connector.js b/examples/custom_connector.js index aaea691b..6660c9ba 100644 --- a/examples/custom_connector.js +++ b/examples/custom_connector.js @@ -8,7 +8,7 @@ class AsyncSentinelConnector extends Redis.SentinelConnector { constructor(options = {}) { // Placeholder options.sentinels = options.sentinels || [ - { host: "localhost", port: 6379 } + { host: "localhost", port: 6379 }, ]; // SentinelConnector saves options as its property @@ -16,7 +16,7 @@ class AsyncSentinelConnector extends Redis.SentinelConnector { } connect(eventEmitter) { - return MyService.getSentinels().then(sentinels => { + return MyService.getSentinels().then((sentinels) => { this.options.sentinels = sentinels; this.sentinelIterator = new Redis.SentinelIterator(sentinels); return Redis.SentinelConnector.prototype.connect.call(this, eventEmitter); @@ -25,12 +25,12 @@ class AsyncSentinelConnector extends Redis.SentinelConnector { } const redis = new Redis({ - Connector: AsyncSentinelConnector + Connector: AsyncSentinelConnector, }); // ioredis supports all Redis commands: redis.set("foo", "bar"); -redis.get("foo", function(err, result) { +redis.get("foo", function (err, result) { if (err) { console.error(err); } else { @@ -40,7 +40,7 @@ redis.get("foo", function(err, result) { redis.del("foo"); // Or using a promise if the last argument isn't a function -redis.get("foo").then(function(result) { +redis.get("foo").then(function (result) { console.log(result); }); diff --git a/lib/DataHandler.ts b/lib/DataHandler.ts index 45be6d39..eb062ae3 100644 --- a/lib/DataHandler.ts +++ b/lib/DataHandler.ts @@ -50,10 +50,10 @@ export default class DataHandler { }, returnReply: (reply: any) => { this.returnReply(reply); - } + }, }); - redis.stream.on("data", data => { + redis.stream.on("data", (data) => { parser.execute(data); }); } @@ -71,7 +71,7 @@ export default class DataHandler { (err as any).command = { name: item.command.name, - args: item.command.args + args: item.command.args, }; this.redis.handleReconnection(err, item); @@ -202,7 +202,7 @@ export default class DataHandler { const args = replyStr .slice(argindex + 1, -1) .split('" "') - .map(elem => elem.replace(/\\"/g, '"')); + .map((elem) => elem.replace(/\\"/g, '"')); const dbAndSource = replyStr.slice(len + 2, argindex - 2).split(" "); this.redis.emit("monitor", timestamp, args, dbAndSource[1], dbAndSource[0]); return true; diff --git a/lib/SubscriptionSet.ts b/lib/SubscriptionSet.ts index 7eb841a1..658b5e2c 100644 --- a/lib/SubscriptionSet.ts +++ b/lib/SubscriptionSet.ts @@ -12,7 +12,7 @@ type DelSet = ICommandNameFlags["EXIT_SUBSCRIBER_MODE"][number]; export default class SubscriptionSet { private set: { [key: string]: { [channel: string]: boolean } } = { subscribe: {}, - psubscribe: {} + psubscribe: {}, }; add(set: AddSet, channel: string) { diff --git a/lib/cluster/ClusterOptions.ts b/lib/cluster/ClusterOptions.ts index 739569c2..b34c19ba 100644 --- a/lib/cluster/ClusterOptions.ts +++ b/lib/cluster/ClusterOptions.ts @@ -133,7 +133,7 @@ export interface IClusterOptions { } export const DEFAULT_CLUSTER_OPTIONS: IClusterOptions = { - clusterRetryStrategy: times => Math.min(100 + times * 2, 2000), + clusterRetryStrategy: (times) => Math.min(100 + times * 2, 2000), enableOfflineQueue: true, enableReadyCheck: true, scaleReads: "master", @@ -143,5 +143,5 @@ export const DEFAULT_CLUSTER_OPTIONS: IClusterOptions = { retryDelayOnTryAgain: 100, slotsRefreshTimeout: 1000, slotsRefreshInterval: 5000, - dnsLookup: lookup + dnsLookup: lookup, }; diff --git a/lib/cluster/ClusterSubscriber.ts b/lib/cluster/ClusterSubscriber.ts index c4a6f802..bb5ea48f 100644 --- a/lib/cluster/ClusterSubscriber.ts +++ b/lib/cluster/ClusterSubscriber.ts @@ -9,7 +9,7 @@ const debug = Debug("cluster:subscriber"); const SUBSCRIBER_CONNECTION_NAME = "ioredisClusterSubscriber"; export default class ClusterSubscriber { - private started: boolean = false; + private started = false; private subscriber: any = null; private lastActiveSubscriber: any; @@ -78,14 +78,14 @@ export default class ClusterSubscriber { enableReadyCheck: true, connectionName: SUBSCRIBER_CONNECTION_NAME, lazyConnect: true, - tls: options.tls + tls: options.tls, }); // Ignore the errors since they're handled in the connection pool. this.subscriber.on("error", noop); // Re-subscribe previous channels - var previousChannels = { subscribe: [], psubscribe: [] }; + const previousChannels = { subscribe: [], psubscribe: [] }; if (lastActiveSubscriber) { const condition = lastActiveSubscriber.condition || lastActiveSubscriber.prevCondition; @@ -100,9 +100,9 @@ export default class ClusterSubscriber { previousChannels.subscribe.length || previousChannels.psubscribe.length ) { - var pending = 0; + let pending = 0; for (const type of ["subscribe", "psubscribe"]) { - var channels = previousChannels[type]; + const channels = previousChannels[type]; if (channels.length) { pending += 1; debug("%s %d channels", type, channels.length); diff --git a/lib/cluster/ConnectionPool.ts b/lib/cluster/ConnectionPool.ts index 18282bb5..eade0737 100644 --- a/lib/cluster/ConnectionPool.ts +++ b/lib/cluster/ConnectionPool.ts @@ -12,7 +12,7 @@ export default class ConnectionPool extends EventEmitter { private nodes: { [key in NODE_TYPE]: { [key: string]: any } } = { all: {}, master: {}, - slave: {} + slave: {}, }; private specifiedOptions: { [key: string]: any } = {}; @@ -23,7 +23,7 @@ export default class ConnectionPool extends EventEmitter { public getNodes(role: NodeRole = "all"): any[] { const nodes = this.nodes[role]; - return Object.keys(nodes).map(key => nodes[key]); + return Object.keys(nodes).map((key) => nodes[key]); } public getInstanceByKey(key: NodeKey): any { @@ -44,7 +44,7 @@ export default class ConnectionPool extends EventEmitter { * @returns {*} * @memberof ConnectionPool */ - public findOrCreate(node: IRedisOptions, readOnly: boolean = false): any { + public findOrCreate(node: IRedisOptions, readOnly = false): any { const key = getNodeKey(node); readOnly = Boolean(readOnly); @@ -82,7 +82,7 @@ export default class ConnectionPool extends EventEmitter { // we don't need to wait for the `ready` event // before sending commands to the node. enableOfflineQueue: true, - readOnly: readOnly + readOnly: readOnly, }, node, this.redisOptions, @@ -102,7 +102,7 @@ export default class ConnectionPool extends EventEmitter { this.emit("+node", redis, key); - redis.on("error", function(error) { + redis.on("error", function (error) { this.emit("nodeError", error, key); }); } @@ -133,7 +133,7 @@ export default class ConnectionPool extends EventEmitter { public reset(nodes: IRedisOptions[]): void { debug("Reset with %O", nodes); const newNodes = {}; - nodes.forEach(node => { + nodes.forEach((node) => { const key = getNodeKey(node); // Don't override the existing (master) node @@ -143,14 +143,14 @@ export default class ConnectionPool extends EventEmitter { } }); - Object.keys(this.nodes.all).forEach(key => { + Object.keys(this.nodes.all).forEach((key) => { if (!newNodes[key]) { debug("Disconnect %s because the node does not hold any slot", key); this.nodes.all[key].disconnect(); this.removeNode(key); } }); - Object.keys(newNodes).forEach(key => { + Object.keys(newNodes).forEach((key) => { const node = newNodes[key]; this.findOrCreate(node, node.readOnly); }); diff --git a/lib/cluster/index.ts b/lib/cluster/index.ts index 7636eb66..0129ee46 100644 --- a/lib/cluster/index.ts +++ b/lib/cluster/index.ts @@ -8,7 +8,7 @@ import { normalizeNodeOptions, NodeRole, getUniqueHostnamesFromOptions, - nodeKeyToRedisOptions + nodeKeyToRedisOptions, } from "./util"; import ClusterSubscriber from "./ClusterSubscriber"; import DelayQueue from "./DelayQueue"; @@ -23,7 +23,7 @@ import { CONNECTION_CLOSED_ERROR_MSG, shuffle, timeout, - zipMap + zipMap, } from "../utils"; import * as commands from "redis-commands"; import Command from "../command"; @@ -51,18 +51,18 @@ type ClusterStatus = */ class Cluster extends EventEmitter { private options: IClusterOptions; - private startupNodes: Array; + private startupNodes: (string | number | object)[]; private connectionPool: ConnectionPool; private slots: NodeKey[][] = []; private manuallyClosing: boolean; - private retryAttempts: number = 0; + private retryAttempts = 0; private delayQueue: DelayQueue = new DelayQueue(); private offlineQueue = new Deque(); private subscriber: ClusterSubscriber; private slotsTimer: NodeJS.Timer; private reconnectTimeout: NodeJS.Timer; private status: ClusterStatus; - private isRefreshing: boolean = false; + private isRefreshing = false; /** * Every time Cluster#connect() is called, this value will be @@ -74,17 +74,17 @@ class Cluster extends EventEmitter { * @type {number} * @memberof Cluster */ - private connectionEpoch: number = 0; + private connectionEpoch = 0; /** * Creates an instance of Cluster. * - * @param {(Array)} startupNodes + * @param {((string | number | object)[])} startupNodes * @param {IClusterOptions} [options={}] * @memberof Cluster */ constructor( - startupNodes: Array, + startupNodes: (string | number | object)[], options: IClusterOptions = {} ) { super(); @@ -110,7 +110,7 @@ class Cluster extends EventEmitter { this.connectionPool.on("-node", (redis, key) => { this.emit("-node", redis); }); - this.connectionPool.on("+node", redis => { + this.connectionPool.on("+node", (redis) => { this.emit("+node", redis); }); this.connectionPool.on("drain", () => { @@ -125,7 +125,7 @@ class Cluster extends EventEmitter { if (this.options.lazyConnect) { this.setStatus("wait"); } else { - this.connect().catch(err => { + this.connect().catch((err) => { debug("connecting failed: %s", err); }); } @@ -181,7 +181,7 @@ class Cluster extends EventEmitter { this.setStatus("connecting"); this.resolveStartupNodeHostnames() - .then(nodes => { + .then((nodes) => { if (this.connectionEpoch !== epoch) { debug( "discard connecting after resolving startup nodes because epoch not match: %d != %d", @@ -213,7 +213,7 @@ class Cluster extends EventEmitter { resolve(); } - let closeListener: () => void; + let closeListener: () => void = undefined; const refreshListener = () => { this.removeListener("close", closeListener); this.manuallyClosing = false; @@ -237,7 +237,7 @@ class Cluster extends EventEmitter { } }; - closeListener = function() { + closeListener = function () { this.removeListener("refresh", refreshListener); reject(new Error("None of startup nodes is available")); }; @@ -247,7 +247,7 @@ class Cluster extends EventEmitter { this.once("close", this.handleCloseEvent.bind(this)); this.refreshSlotsCache( - function(err) { + function (err) { if (err && err.message === "Failed to refresh slots cache.") { Redis.prototype.silentEmit.call(this, "error", err); this.connectionPool.reset([]); @@ -256,7 +256,7 @@ class Cluster extends EventEmitter { ); this.subscriber.start(); }) - .catch(err => { + .catch((err) => { this.setStatus("close"); this.handleCloseEvent(err); reject(err); @@ -288,10 +288,10 @@ class Cluster extends EventEmitter { if (typeof retryDelay === "number") { this.setStatus("reconnecting"); this.reconnectTimeout = setTimeout( - function() { + function () { this.reconnectTimeout = null; debug("Cluster is disconnected. Retrying after %dms", retryDelay); - this.connect().catch(function(err) { + this.connect().catch(function (err) { debug("Got error %s when reconnecting. Ignoring...", err); }); }.bind(this), @@ -309,7 +309,7 @@ class Cluster extends EventEmitter { * @param {boolean} [reconnect=false] * @memberof Cluster */ - public disconnect(reconnect: boolean = false) { + public disconnect(reconnect = false) { const status = this.status; this.setStatus("disconnecting"); @@ -360,7 +360,7 @@ class Cluster extends EventEmitter { // use setImmediate to make sure "close" event // being emitted after quit() is returned setImmediate( - function() { + function () { this.setStatus("close"); this.handleCloseEvent(); }.bind(this) @@ -370,8 +370,8 @@ class Cluster extends EventEmitter { } return asCallback( Promise.all( - this.nodes().map(node => - node.quit().catch(err => { + this.nodes().map((node) => + node.quit().catch((err) => { // Ignore the error caused by disconnecting since // we're disconnecting... if (err.message === CONNECTION_CLOSED_ERROR_MSG) { @@ -395,7 +395,7 @@ class Cluster extends EventEmitter { * ``` * * @public - * @param {(Array)} [overrideStartupNodes=[]] + * @param {((string | number | object)[])} [overrideStartupNodes=[]] * @param {IClusterOptions} [overrideOptions={}] * @memberof Cluster */ @@ -456,7 +456,7 @@ class Cluster extends EventEmitter { this.isRefreshing = true; const _this = this; - const wrapper = function(error?: Error) { + const wrapper = function (error?: Error) { _this.isRefreshing = false; if (typeof callback === "function") { callback(error); @@ -478,7 +478,7 @@ class Cluster extends EventEmitter { const node = nodes[index]; const key = `${node.options.host}:${node.options.port}`; debug("getting slot cache from %s", key); - _this.getInfoFromNode(node, function(err) { + _this.getInfoFromNode(node, function (err) { switch (_this.status) { case "close": case "end": @@ -569,10 +569,10 @@ class Cluster extends EventEmitter { // eslint-disable-next-line @typescript-eslint/camelcase command.__is_reject_overwritten = true; const reject = command.reject; - command.reject = function(err) { + command.reject = function (err) { const partialTry = tryConnection.bind(null, true); _this.handleError(err, ttl, { - moved: function(slot, key) { + moved: function (slot, key) { debug("command %s is moved to %s", command.name, key); targetSlot = Number(slot); if (_this.slots[slot]) { @@ -585,7 +585,7 @@ class Cluster extends EventEmitter { debug("refreshing slot caches... (triggered by MOVED error)"); _this.refreshSlotsCache(); }, - ask: function(slot, key) { + ask: function (slot, key) { debug("command %s is required to ask %s:%s", command.name, key); const mapped = _this.natMapper(key); _this.connectionPool.findOrCreate(mapped); @@ -594,12 +594,12 @@ class Cluster extends EventEmitter { tryagain: partialTry, clusterDown: partialTry, connectionClosed: partialTry, - maxRedirections: function(redirectionError) { + maxRedirections: function (redirectionError) { reject.call(command, redirectionError); }, - defaults: function() { + defaults: function () { reject.call(command, err); - } + }, }); }; } @@ -628,7 +628,7 @@ class Cluster extends EventEmitter { if (typeof targetSlot === "number" && _this.slots[targetSlot]) { const nodeKeys = _this.slots[targetSlot]; if (typeof to === "function") { - const nodes = nodeKeys.map(function(key) { + const nodes = nodeKeys.map(function (key) { return _this.connectionPool.getInstanceByKey(key); }); redis = to(nodes, command); @@ -673,7 +673,7 @@ class Cluster extends EventEmitter { _this.offlineQueue.push({ command: command, stream: stream, - node: node + node: node, }); } else { command.reject( @@ -703,7 +703,7 @@ class Cluster extends EventEmitter { handlers[errv[0] === "MOVED" ? "moved" : "ask"](errv[1], errv[2]); } else if (errv[0] === "TRYAGAIN") { this.delayQueue.push("tryagain", handlers.tryagain, { - timeout: this.options.retryDelayOnTryAgain + timeout: this.options.retryDelayOnTryAgain, }); } else if ( errv[0] === "CLUSTERDOWN" && @@ -711,7 +711,7 @@ class Cluster extends EventEmitter { ) { this.delayQueue.push("clusterdown", handlers.connectionClosed, { timeout: this.options.retryDelayOnClusterDown, - callback: this.refreshSlotsCache.bind(this) + callback: this.refreshSlotsCache.bind(this), }); } else if ( error.message === CONNECTION_CLOSED_ERROR_MSG && @@ -720,7 +720,7 @@ class Cluster extends EventEmitter { ) { this.delayQueue.push("failover", handlers.connectionClosed, { timeout: this.options.retryDelayOnFailover, - callback: this.refreshSlotsCache.bind(this) + callback: this.refreshSlotsCache.bind(this), }); } else { handlers.defaults(); @@ -739,7 +739,7 @@ class Cluster extends EventEmitter { enableOfflineQueue: true, enableReadyCheck: false, retryStrategy: null, - connectionName: "ioredisClusterRefresher" + connectionName: "ioredisClusterRefresher", }); // Ignore error events since we will handle @@ -812,7 +812,7 @@ class Cluster extends EventEmitter { * @private */ private readyCheck(callback: CallbackFunction): void { - (this as any).cluster("info", function(err, res) { + (this as any).cluster("info", function (err, res) { if (err) { return callback(err); } @@ -880,11 +880,11 @@ class Cluster extends EventEmitter { } return Promise.all( - hostnames.map(hostname => this.dnsLookup(hostname)) - ).then(ips => { + hostnames.map((hostname) => this.dnsLookup(hostname)) + ).then((ips) => { const hostnameToIP = zipMap(hostnames, ips); - return startupNodes.map(node => + return startupNodes.map((node) => hostnameToIP.has(node.host) ? Object.assign({}, node, { host: hostnameToIP.get(node.host) }) : node @@ -893,7 +893,7 @@ class Cluster extends EventEmitter { } } -Object.getOwnPropertyNames(Commander.prototype).forEach(name => { +Object.getOwnPropertyNames(Commander.prototype).forEach((name) => { if (!Cluster.prototype.hasOwnProperty(name)) { Cluster.prototype[name] = Commander.prototype[name]; } @@ -905,17 +905,17 @@ const scanCommands = [ "zscan", "sscanBuffer", "hscanBuffer", - "zscanBuffer" + "zscanBuffer", ]; -scanCommands.forEach(command => { - Cluster.prototype[command + "Stream"] = function(key, options) { +scanCommands.forEach((command) => { + Cluster.prototype[command + "Stream"] = function (key, options) { return new ScanStream( defaults( { objectMode: true, key: key, redis: this, - command: command + command: command, }, options ) diff --git a/lib/cluster/util.ts b/lib/cluster/util.ts index 94c226a5..f5e64cff 100644 --- a/lib/cluster/util.ts +++ b/lib/cluster/util.ts @@ -24,14 +24,14 @@ export function nodeKeyToRedisOptions(nodeKey: NodeKey): IRedisOptions { } return { host: nodeKey.slice(0, portIndex), - port: Number(nodeKey.slice(portIndex + 1)) + port: Number(nodeKey.slice(portIndex + 1)), }; } export function normalizeNodeOptions( nodes: Array ): IRedisOptions[] { - return nodes.map(node => { + return nodes.map((node) => { const options: any = {}; if (typeof node === "object") { Object.assign(options, node); @@ -64,9 +64,9 @@ export function getUniqueHostnamesFromOptions( nodes: IRedisOptions[] ): string[] { const uniqueHostsMap = {}; - nodes.forEach(node => { + nodes.forEach((node) => { uniqueHostsMap[node.host] = true; }); - return Object.keys(uniqueHostsMap).filter(host => !isIP(host)); + return Object.keys(uniqueHostsMap).filter((host) => !isIP(host)); } diff --git a/lib/command.ts b/lib/command.ts index 66a7d96f..c9b28b30 100644 --- a/lib/command.ts +++ b/lib/command.ts @@ -6,7 +6,7 @@ import { optimizeErrorStack, toArg, convertMapToArray, - convertObjectToArray + convertObjectToArray, } from "./utils"; import { flatten } from "./utils/lodash"; import { get as getPromise } from "./promiseContainer"; @@ -89,12 +89,12 @@ export default class Command implements ICommand { "unsubscribe", "punsubscribe", "ping", - "quit" + "quit", ], VALID_IN_MONITOR_MODE: ["monitor", "auth"], ENTER_SUBSCRIBER_MODE: ["subscribe", "psubscribe"], EXIT_SUBSCRIBER_MODE: ["unsubscribe", "punsubscribe"], - WILL_DISCONNECT: ["quit"] + WILL_DISCONNECT: ["quit"], }; private static flagMap?: IFlagMap; @@ -103,7 +103,7 @@ export default class Command implements ICommand { if (!this.flagMap) { this.flagMap = Object.keys(Command.FLAGS).reduce((map, flagName) => { map[flagName] = {}; - Command.FLAGS[flagName].forEach(commandName => { + Command.FLAGS[flagName].forEach((commandName) => { map[flagName][commandName] = true; }); return map; @@ -131,7 +131,7 @@ export default class Command implements ICommand { reply: { [command: string]: ReplyTransformer }; } = { argument: {}, - reply: {} + reply: {}, }; public static setArgumentTransformer( @@ -152,9 +152,9 @@ export default class Command implements ICommand { private errorStack: string; public args: CommandParameter[]; private callback: CallbackFunction; - private transformed: boolean = false; - public isCustomCommand: boolean = false; - public inTransaction: boolean = false; + private transformed = false; + public isCustomCommand = false; + public inTransaction = false; public pipelineIndex?: number; private slot?: number | null; @@ -190,7 +190,7 @@ export default class Command implements ICommand { this.initPromise(); if (options.keyPrefix) { - this._iterateKeys(key => options.keyPrefix + key); + this._iterateKeys((key) => options.keyPrefix + key); } if (options.readOnly) { @@ -212,7 +212,7 @@ export default class Command implements ICommand { this.resolve = this._convertValue(resolve); if (this.errorStack) { - this.reject = err => { + this.reject = (err) => { reject(optimizeErrorStack(err, this.errorStack, __dirname)); }; } else { @@ -244,7 +244,7 @@ export default class Command implements ICommand { * @memberof Command */ private _iterateKeys( - transform: Function = key => key + transform: Function = (key) => key ): Array { if (typeof this.keys === "undefined") { this.keys = []; @@ -276,7 +276,7 @@ export default class Command implements ICommand { } let result; - let commandStr = + const commandStr = "*" + (this.args.length + 1) + "\r\n$" + @@ -339,7 +339,7 @@ export default class Command implements ICommand { * @memberof Command */ private _convertValue(resolve: Function): (result: any) => void { - return value => { + return (value) => { try { resolve(this.transformReply(value)); } catch (err) { @@ -370,7 +370,7 @@ export default class Command implements ICommand { } } -const msetArgumentTransformer = function(args) { +const msetArgumentTransformer = function (args) { if (args.length === 1) { if (typeof Map !== "undefined" && args[0] instanceof Map) { return convertMapToArray(args[0]); @@ -385,7 +385,7 @@ const msetArgumentTransformer = function(args) { Command.setArgumentTransformer("mset", msetArgumentTransformer); Command.setArgumentTransformer("msetnx", msetArgumentTransformer); -Command.setArgumentTransformer("hmset", function(args) { +Command.setArgumentTransformer("hmset", function (args) { if (args.length === 2) { if (typeof Map !== "undefined" && args[1] instanceof Map) { return [args[0]].concat(convertMapToArray(args[1])); @@ -397,10 +397,10 @@ Command.setArgumentTransformer("hmset", function(args) { return args; }); -Command.setReplyTransformer("hgetall", function(result) { +Command.setReplyTransformer("hgetall", function (result) { if (Array.isArray(result)) { - var obj = {}; - for (var i = 0; i < result.length; i += 2) { + const obj = {}; + for (let i = 0; i < result.length; i += 2) { obj[result[i]] = result[i + 1]; } return obj; @@ -408,7 +408,7 @@ Command.setReplyTransformer("hgetall", function(result) { return result; }); -Command.setArgumentTransformer("hset", function(args) { +Command.setArgumentTransformer("hset", function (args) { if (args.length === 2) { if (typeof Map !== "undefined" && args[1] instanceof Map) { return [args[0]].concat(convertMapToArray(args[1])); diff --git a/lib/commander.ts b/lib/commander.ts index f499e1e0..60f82b5b 100644 --- a/lib/commander.ts +++ b/lib/commander.ts @@ -8,7 +8,7 @@ export interface ICommanderOptions { showFriendlyErrorStack?: boolean; } -var DROP_BUFFER_SUPPORT_ERROR = +const DROP_BUFFER_SUPPORT_ERROR = "*Buffer methods are not available " + 'because "dropBufferSupport" option is enabled.' + "Refer to https://github.com/luin/ioredis/wiki/Improve-Performance for more details."; @@ -24,12 +24,12 @@ var DROP_BUFFER_SUPPORT_ERROR = */ export default function Commander() { this.options = defaults({}, this.options || {}, { - showFriendlyErrorStack: false + showFriendlyErrorStack: false, }); this.scriptsSet = {}; } -var commands = require("redis-commands").list.filter(function(command) { +const commands = require("redis-commands").list.filter(function (command) { return command !== "monitor"; }); commands.push("sentinel"); @@ -40,7 +40,7 @@ commands.push("sentinel"); * @return {string[]} command list * @public */ -Commander.prototype.getBuiltinCommands = function() { +Commander.prototype.getBuiltinCommands = function () { return commands.slice(0); }; @@ -51,14 +51,14 @@ Commander.prototype.getBuiltinCommands = function() { * @return {object} functions * @public */ -Commander.prototype.createBuiltinCommand = function(commandName) { +Commander.prototype.createBuiltinCommand = function (commandName) { return { string: generateFunction(commandName, "utf8"), - buffer: generateFunction(commandName, null) + buffer: generateFunction(commandName, null), }; }; -commands.forEach(function(commandName) { +commands.forEach(function (commandName) { Commander.prototype[commandName] = generateFunction(commandName, "utf8"); Commander.prototype[commandName + "Buffer"] = generateFunction( commandName, @@ -81,8 +81,8 @@ Commander.prototype.send_command = Commander.prototype.call; * @param {boolean} [definition.readOnly=false] - force this script to be readonly so it executes on slaves as well. * If omit, you have to pass the number of keys as the first argument every time you invoke the command */ -Commander.prototype.defineCommand = function(name, definition) { - var script = new Script( +Commander.prototype.defineCommand = function (name, definition) { + const script = new Script( definition.lua, definition.numberOfKeys, this.options.keyPrefix, @@ -99,7 +99,7 @@ Commander.prototype.defineCommand = function(name, definition) { * @abstract * @public */ -Commander.prototype.sendCommand = function() {}; +Commander.prototype.sendCommand = function () {}; function generateFunction(_encoding: string); function generateFunction(_commandName: string | void, _encoding: string); @@ -108,27 +108,27 @@ function generateFunction(_commandName?: string, _encoding?: string) { _encoding = _commandName; _commandName = null; } - return function() { - var firstArgIndex = 0; - var commandName = _commandName; + return function () { + let firstArgIndex = 0; + let commandName = _commandName; if (commandName === null) { commandName = arguments[0]; firstArgIndex = 1; } - var length = arguments.length; - var lastArgIndex = length - 1; - var callback = arguments[lastArgIndex]; + let length = arguments.length; + const lastArgIndex = length - 1; + let callback = arguments[lastArgIndex]; if (typeof callback !== "function") { callback = undefined; } else { length = lastArgIndex; } - var args = new Array(length - firstArgIndex); - for (var i = firstArgIndex; i < length; ++i) { + const args = new Array(length - firstArgIndex); + for (let i = firstArgIndex; i < length; ++i) { args[i - firstArgIndex] = arguments[i]; } - var options; + let options; if (this.options.dropBufferSupport) { if (!_encoding) { return asCallback( @@ -153,21 +153,21 @@ function generateFunction(_commandName?: string, _encoding?: string) { } function generateScriptingFunction(_script, _encoding) { - return function() { - var length = arguments.length; - var lastArgIndex = length - 1; - var callback = arguments[lastArgIndex]; + return function () { + let length = arguments.length; + const lastArgIndex = length - 1; + let callback = arguments[lastArgIndex]; if (typeof callback !== "function") { callback = undefined; } else { length = lastArgIndex; } - var args = new Array(length); - for (var i = 0; i < length; i++) { + const args = new Array(length); + for (let i = 0; i < length; i++) { args[i] = arguments[i]; } - var options; + let options; if (this.options.dropBufferSupport) { if (!_encoding) { return asCallback( diff --git a/lib/connectors/AbstractConnector.ts b/lib/connectors/AbstractConnector.ts index 2ef0c4c4..1d9b2022 100644 --- a/lib/connectors/AbstractConnector.ts +++ b/lib/connectors/AbstractConnector.ts @@ -3,7 +3,7 @@ import { NetStream } from "../types"; export type ErrorEmitter = (type: string, err: Error) => void; export default abstract class AbstractConnector { - protected connecting: boolean = false; + protected connecting = false; protected stream: NetStream; public check(info: any): boolean { diff --git a/lib/connectors/SentinelConnector/SentinelIterator.ts b/lib/connectors/SentinelConnector/SentinelIterator.ts index a91cd728..34c2cfc4 100644 --- a/lib/connectors/SentinelConnector/SentinelIterator.ts +++ b/lib/connectors/SentinelConnector/SentinelIterator.ts @@ -12,7 +12,7 @@ function isSentinelEql( export default class SentinelIterator implements Iterator> { - private cursor: number = 0; + private cursor = 0; private sentinels: Array>; constructor(sentinels: Array>) { diff --git a/lib/connectors/SentinelConnector/index.ts b/lib/connectors/SentinelConnector/index.ts index d6cb12bb..b968cd83 100644 --- a/lib/connectors/SentinelConnector/index.ts +++ b/lib/connectors/SentinelConnector/index.ts @@ -4,12 +4,12 @@ import { CONNECTION_CLOSED_ERROR_MSG, packObject, sample, - Debug + Debug, } from "../../utils"; import { connect as createTLSConnection, SecureContextOptions } from "tls"; import { ITcpConnectionOptions, - isIIpcConnectionOptions + isIIpcConnectionOptions, } from "../StandaloneConnector"; import SentinelIterator from "./SentinelIterator"; import { ISentinelAddress } from "./types"; @@ -179,10 +179,10 @@ export default class SentinelConnector extends AbstractConnector { } result - .map(packObject as ( - value: any - ) => IAddressFromResponse) - .forEach(sentinel => { + .map( + packObject as (value: any) => IAddressFromResponse + ) + .forEach((sentinel) => { const flags = sentinel.flags ? sentinel.flags.split(",") : []; if ( flags.indexOf("disconnected") === -1 && @@ -214,7 +214,7 @@ export default class SentinelConnector extends AbstractConnector { client.disconnect(); return callback(err); } - this.updateSentinels(client, err => { + this.updateSentinels(client, (err) => { client.disconnect(); if (err) { return callback(err); @@ -248,11 +248,11 @@ export default class SentinelConnector extends AbstractConnector { } const availableSlaves = result - .map(packObject as ( - value: any - ) => IAddressFromResponse) + .map( + packObject as (value: any) => IAddressFromResponse + ) .filter( - slave => + (slave) => slave.flags && !slave.flags.match(/(disconnected|s_down|o_down)/) ); @@ -275,7 +275,7 @@ export default class SentinelConnector extends AbstractConnector { endpoint, callback: CallbackFunction ): void { - var client = new Redis({ + const client = new Redis({ port: endpoint.port || 26379, host: endpoint.host, password: this.options.sentinelPassword || null, @@ -288,7 +288,7 @@ export default class SentinelConnector extends AbstractConnector { retryStrategy: null, enableReadyCheck: false, connectTimeout: this.options.connectTimeout, - dropBufferSupport: true + dropBufferSupport: true, }); // ignore the errors since resolve* methods will handle them diff --git a/lib/connectors/StandaloneConnector.ts b/lib/connectors/StandaloneConnector.ts index 6285b64a..71a36fdd 100644 --- a/lib/connectors/StandaloneConnector.ts +++ b/lib/connectors/StandaloneConnector.ts @@ -32,7 +32,7 @@ export default class StandaloneConnector extends AbstractConnector { let connectionOptions: any; if (isIIpcConnectionOptions(options)) { connectionOptions = { - path: options.path + path: options.path, }; } else { connectionOptions = {}; diff --git a/lib/index.ts b/lib/index.ts index 11049a03..8302ac13 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -8,7 +8,7 @@ export { default as Pipeline } from "./pipeline"; export { default as AbstractConnector } from "./connectors/AbstractConnector"; export { default as SentinelConnector, - SentinelIterator + SentinelIterator, } from "./connectors/SentinelConnector"; // Type Exports @@ -25,7 +25,7 @@ Object.defineProperty(exports, "Promise", { }, set(lib) { PromiseContainer.set(lib); - } + }, }); export function print(err: Error | null, reply?: any) { diff --git a/lib/pipeline.ts b/lib/pipeline.ts index b9278049..8d94cd90 100644 --- a/lib/pipeline.ts +++ b/lib/pipeline.ts @@ -18,7 +18,7 @@ export default function Pipeline(redis) { this._transactions = 0; this._shaToScript = {}; - Object.keys(redis.scriptsSet).forEach(name => { + Object.keys(redis.scriptsSet).forEach((name) => { const script = redis.scriptsSet[name]; this._shaToScript[script.sha] = script; this[name] = redis[name]; @@ -33,17 +33,17 @@ export default function Pipeline(redis) { const _this = this; Object.defineProperty(this, "length", { - get: function() { + get: function () { return _this._queue.length; - } + }, }); } Object.assign(Pipeline.prototype, Commander.prototype); -Pipeline.prototype.fillResult = function(value, position) { +Pipeline.prototype.fillResult = function (value, position) { if (this._queue[position].name === "exec" && Array.isArray(value[1])) { - var execLength = value[1].length; + const execLength = value[1].length; for (let i = 0; i < execLength; i++) { if (value[1][i] instanceof Error) { continue; @@ -66,8 +66,8 @@ Pipeline.prototype.fillResult = function(value, position) { let retriable = true; let commonError: { name: string; message: string }; for (let i = 0; i < this._result.length; ++i) { - var error = this._result[i][0]; - var command = this._queue[i]; + const error = this._result[i][0]; + const command = this._queue[i]; if (error) { if ( command.name === "exec" && @@ -79,7 +79,7 @@ Pipeline.prototype.fillResult = function(value, position) { if (!commonError) { commonError = { name: error.name, - message: error.message + message: error.message, }; } else if ( commonError.name !== error.name || @@ -89,7 +89,7 @@ Pipeline.prototype.fillResult = function(value, position) { break; } } else if (!command.inTransaction) { - var isReadOnly = + const isReadOnly = exists(command.name) && hasFlag(command.name, "readonly"); if (!isReadOnly) { retriable = false; @@ -98,9 +98,9 @@ Pipeline.prototype.fillResult = function(value, position) { } } if (commonError && retriable) { - var _this = this; - var errv = commonError.message.split(" "); - var queue = this._queue; + const _this = this; + const errv = commonError.message.split(" "); + const queue = this._queue; let inTransaction = false; this._queue = []; for (let i = 0; i < queue.length; ++i) { @@ -110,7 +110,7 @@ Pipeline.prototype.fillResult = function(value, position) { queue[i].name !== "asking" && (!queue[i - 1] || queue[i - 1].name !== "asking") ) { - var asking = new Command("asking"); + const asking = new Command("asking"); asking.ignore = true; this.sendCommand(asking); } @@ -123,17 +123,17 @@ Pipeline.prototype.fillResult = function(value, position) { if (typeof this.leftRedirections === "undefined") { this.leftRedirections = {}; } - const exec = function() { + const exec = function () { _this.exec(); }; this.redis.handleError(commonError, this.leftRedirections, { - moved: function(slot, key) { + moved: function (slot, key) { _this.preferKey = key; _this.redis.slots[errv[1]] = [key]; _this.redis.refreshSlotsCache(); _this.exec(); }, - ask: function(slot, key) { + ask: function (slot, key) { _this.preferKey = key; _this.exec(); }, @@ -145,7 +145,7 @@ Pipeline.prototype.fillResult = function(value, position) { }, defaults: () => { matched = false; - } + }, }); if (matched) { return; @@ -163,7 +163,7 @@ Pipeline.prototype.fillResult = function(value, position) { this.resolve(this._result.slice(0, this._result.length - ignoredCount)); }; -Pipeline.prototype.sendCommand = function(command) { +Pipeline.prototype.sendCommand = function (command) { if (this._transactions > 0) { command.inTransaction = true; } @@ -172,10 +172,10 @@ Pipeline.prototype.sendCommand = function(command) { command.pipelineIndex = position; command.promise - .then(result => { + .then((result) => { this.fillResult([null, result], position); }) - .catch(error => { + .catch((error) => { this.fillResult([error], position); }); @@ -184,7 +184,7 @@ Pipeline.prototype.sendCommand = function(command) { return this; }; -Pipeline.prototype.addBatch = function(commands) { +Pipeline.prototype.addBatch = function (commands) { let command, commandName, args; for (let i = 0; i < commands.length; ++i) { command = commands[i]; @@ -197,21 +197,21 @@ Pipeline.prototype.addBatch = function(commands) { }; const multi = Pipeline.prototype.multi; -Pipeline.prototype.multi = function() { +Pipeline.prototype.multi = function () { this._transactions += 1; return multi.apply(this, arguments); }; const execBuffer = Pipeline.prototype.execBuffer; const exec = Pipeline.prototype.exec; -Pipeline.prototype.execBuffer = deprecate(function() { +Pipeline.prototype.execBuffer = deprecate(function () { if (this._transactions > 0) { this._transactions -= 1; } return execBuffer.apply(this, arguments); }, "Pipeline#execBuffer: Use Pipeline#exec instead"); -Pipeline.prototype.exec = function(callback: CallbackFunction) { +Pipeline.prototype.exec = function (callback: CallbackFunction) { if (this._transactions > 0) { this._transactions -= 1; return (this.options.dropBufferSupport ? exec : execBuffer).apply( @@ -231,7 +231,7 @@ Pipeline.prototype.exec = function(callback: CallbackFunction) { // List of the first key for each command const sampleKeys: string[] = []; for (let i = 0; i < this._queue.length; i++) { - var keys = this._queue[i].getKeys(); + const keys = this._queue[i].getKeys(); if (keys.length) { sampleKeys.push(keys[0]); } @@ -254,7 +254,7 @@ Pipeline.prototype.exec = function(callback: CallbackFunction) { // Check whether scripts exists const scripts = []; for (let i = 0; i < this._queue.length; ++i) { - var item = this._queue[i]; + const item = this._queue[i]; if (this.isCluster && item.isCustomCommand) { this.reject( new Error( @@ -273,23 +273,23 @@ Pipeline.prototype.exec = function(callback: CallbackFunction) { scripts.push(script); } - var _this = this; + const _this = this; if (!scripts.length) { return execPipeline(); } return this.redis .script("exists", Array.from(new Set(scripts.map(({ sha }) => sha)))) - .then(function(results) { - var pending = []; - for (var i = 0; i < results.length; ++i) { + .then(function (results) { + const pending = []; + for (let i = 0; i < results.length; ++i) { if (!results[i]) { pending.push(scripts[i]); } } - var Promise = PromiseContainer.get(); + const Promise = PromiseContainer.get(); return Promise.all( - pending.map(function(script) { + pending.map(function (script) { return _this.redis.script("load", script.lua); }) ); @@ -305,12 +305,12 @@ Pipeline.prototype.exec = function(callback: CallbackFunction) { if (_this.isCluster) { node = { slot: pipelineSlot, - redis: _this.redis.connectionPool.nodes.all[_this.preferKey] + redis: _this.redis.connectionPool.nodes.all[_this.preferKey], }; } let bufferMode = false; const stream = { - write: function(writable) { + write: function (writable) { if (writable instanceof Buffer) { bufferMode = true; } @@ -349,7 +349,7 @@ Pipeline.prototype.exec = function(callback: CallbackFunction) { buffers = undefined; bufferMode = false; } - } + }, }; for (let i = 0; i < _this._queue.length; ++i) { diff --git a/lib/redis/RedisOptions.ts b/lib/redis/RedisOptions.ts index 9149fb8e..da59aa21 100644 --- a/lib/redis/RedisOptions.ts +++ b/lib/redis/RedisOptions.ts @@ -33,7 +33,7 @@ export const DEFAULT_REDIS_OPTIONS: IRedisOptions = { host: "localhost", family: 4, connectTimeout: 10000, - retryStrategy: function(times) { + retryStrategy: function (times) { return Math.min(times * 50, 2000); }, keepAlive: 0, @@ -43,7 +43,7 @@ export const DEFAULT_REDIS_OPTIONS: IRedisOptions = { sentinels: null, name: null, role: "master", - sentinelRetryStrategy: function(times) { + sentinelRetryStrategy: function (times) { return Math.min(times * 10, 1000); }, natMap: null, @@ -64,5 +64,5 @@ export const DEFAULT_REDIS_OPTIONS: IRedisOptions = { readOnly: false, stringNumbers: false, maxRetriesPerRequest: 20, - maxLoadingRetryTime: 10000 + maxLoadingRetryTime: 10000, }; diff --git a/lib/redis/event_handler.ts b/lib/redis/event_handler.ts index 709c9f30..dcda3d00 100644 --- a/lib/redis/event_handler.ts +++ b/lib/redis/event_handler.ts @@ -11,7 +11,7 @@ import DataHandler from "../DataHandler"; const debug = Debug("connection"); export function connectHandler(self) { - return function() { + return function () { self.setStatus("connect"); self.resetCommandQueue(); @@ -20,7 +20,7 @@ export function connectHandler(self) { let flushed = false; const { connectionEpoch } = self; if (self.condition.auth) { - self.auth(self.condition.auth, function(err) { + self.auth(self.condition.auth, function (err) { if (connectionEpoch !== self.connectionEpoch) { return; } @@ -52,11 +52,11 @@ export function connectHandler(self) { */ new DataHandler(self, { stringNumbers: self.options.stringNumbers, - dropBufferSupport: self.options.dropBufferSupport + dropBufferSupport: self.options.dropBufferSupport, }); if (self.options.enableReadyCheck) { - self._readyCheck(function(err, info) { + self._readyCheck(function (err, info) { if (connectionEpoch !== self.connectionEpoch) { return; } @@ -84,7 +84,7 @@ function abortError(command: ICommand) { const err = new AbortError("Command aborted due to connection close"); (err as any).command = { name: command.name, - args: command.args + args: command.args, }; return err; } @@ -136,7 +136,7 @@ function abortTransactionFragments(commandQueue: Deque) { } export function closeHandler(self) { - return function() { + return function () { self.setStatus("close"); if (!self.prevCondition) { @@ -172,7 +172,7 @@ export function closeHandler(self) { debug("reconnect in %sms", retryDelay); self.setStatus("reconnecting", retryDelay); - self.reconnectTimeout = setTimeout(function() { + self.reconnectTimeout = setTimeout(function () { self.reconnectTimeout = null; self.connect().catch(noop); }, retryDelay); @@ -200,21 +200,21 @@ export function closeHandler(self) { } export function errorHandler(self) { - return function(error) { + return function (error) { debug("error: %s", error); self.silentEmit("error", error); }; } export function readyHandler(self) { - return function() { + return function () { self.setStatus("ready"); self.retryAttempts = 0; if (self.options.monitor) { self.call("monitor"); const { sendCommand } = self; - self.sendCommand = function(command) { + self.sendCommand = function (command) { if (Command.checkFlag("VALID_IN_MONITOR_MODE", command.name)) { return sendCommand.call(self, command); } @@ -223,7 +223,7 @@ export function readyHandler(self) { ); return command.promise; }; - self.once("close", function() { + self.once("close", function () { delete self.sendCommand; }); self.setStatus("monitoring"); diff --git a/lib/redis/index.ts b/lib/redis/index.ts index 1c7c865f..1cf12325 100644 --- a/lib/redis/index.ts +++ b/lib/redis/index.ts @@ -15,10 +15,10 @@ import { addTransactionSupport } from "../transaction"; import { IRedisOptions, ReconnectOnError, - DEFAULT_REDIS_OPTIONS + DEFAULT_REDIS_OPTIONS, } from "./RedisOptions"; -var debug = Debug("redis"); +const debug = Debug("redis"); /** * Creates a Redis instance @@ -170,7 +170,7 @@ Object.assign(Redis.prototype, Commander.prototype); * @deprecated */ // @ts-ignore -Redis.createClient = function(...args): Redis { +Redis.createClient = function (...args): Redis { // @ts-ignore return new Redis(...args); }; @@ -183,19 +183,19 @@ Redis.createClient = function(...args): Redis { */ Redis.defaultOptions = DEFAULT_REDIS_OPTIONS; -Redis.prototype.resetCommandQueue = function() { +Redis.prototype.resetCommandQueue = function () { this.commandQueue = new Deque(); }; -Redis.prototype.resetOfflineQueue = function() { +Redis.prototype.resetOfflineQueue = function () { this.offlineQueue = new Deque(); }; -Redis.prototype.parseOptions = function() { +Redis.prototype.parseOptions = function () { this.options = {}; let isTls = false; - for (var i = 0; i < arguments.length; ++i) { - var arg = arguments[i]; + for (let i = 0; i < arguments.length; ++i) { + const arg = arguments[i]; if (arg === null || typeof arg === "undefined") { continue; } @@ -234,7 +234,7 @@ Redis.prototype.parseOptions = function() { * Change instance's status * @private */ -Redis.prototype.setStatus = function(status, arg) { +Redis.prototype.setStatus = function (status, arg) { // @ts-ignore if (debug.enabled) { debug( @@ -259,9 +259,9 @@ Redis.prototype.setStatus = function(status, arg) { * @return {Promise} * @public */ -Redis.prototype.connect = function(callback) { - var _Promise = PromiseContainer.get(); - var promise = new _Promise((resolve, reject) => { +Redis.prototype.connect = function (callback) { + const _Promise = PromiseContainer.get(); + const promise = new _Promise((resolve, reject) => { if ( this.status === "connecting" || this.status === "connect" || @@ -278,15 +278,15 @@ Redis.prototype.connect = function(callback) { this.condition = { select: options.db, auth: options.password, - subscriber: false + subscriber: false, }; - var _this = this; + const _this = this; asCallback( - this.connector.connect(function(type, err) { + this.connector.connect(function (type, err) { _this.silentEmit(type, err); }), - function(err, stream) { + function (err, stream) { if (err) { _this.flushQueue(err); _this.silentEmit("error", err); @@ -294,7 +294,7 @@ Redis.prototype.connect = function(callback) { _this.setStatus("end"); return; } - var CONNECT_EVENT = options.tls ? "secureConnect" : "connect"; + let CONNECT_EVENT = options.tls ? "secureConnect" : "connect"; if (options.sentinels && !options.enableTLSForSentinelMode) { CONNECT_EVENT = "connect"; } @@ -316,15 +316,15 @@ Redis.prototype.connect = function(callback) { * * See https://github.com/electron/electron/issues/14915 */ - var connectTimeoutCleared = false; - stream.setTimeout(options.connectTimeout, function() { + let connectTimeoutCleared = false; + stream.setTimeout(options.connectTimeout, function () { if (connectTimeoutCleared) { return; } stream.setTimeout(0); stream.destroy(); - var err = new Error("connect ETIMEDOUT"); + const err = new Error("connect ETIMEDOUT"); // @ts-ignore err.errorno = "ETIMEDOUT"; // @ts-ignore @@ -333,7 +333,7 @@ Redis.prototype.connect = function(callback) { err.syscall = "connect"; eventHandler.errorHandler(_this)(err); }); - stream.once(CONNECT_EVENT, function() { + stream.once(CONNECT_EVENT, function () { connectTimeoutCleared = true; stream.setTimeout(0); }); @@ -343,11 +343,11 @@ Redis.prototype.connect = function(callback) { stream.setNoDelay(true); } - var connectionReadyHandler = function() { + const connectionReadyHandler = function () { _this.removeListener("close", connectionCloseHandler); resolve(); }; - var connectionCloseHandler = function() { + var connectionCloseHandler = function () { _this.removeListener("ready", connectionReadyHandler); reject(new Error(CONNECTION_CLOSED_ERROR_MSG)); }; @@ -368,7 +368,7 @@ Redis.prototype.connect = function(callback) { * If you want to wait for the pending replies, use Redis#quit instead. * @public */ -Redis.prototype.disconnect = function(reconnect) { +Redis.prototype.disconnect = function (reconnect) { if (!reconnect) { this.manuallyClosing = true; } @@ -388,7 +388,7 @@ Redis.prototype.disconnect = function(reconnect) { * * @deprecated */ -Redis.prototype.end = function() { +Redis.prototype.end = function () { this.disconnect(); }; @@ -403,18 +403,18 @@ Redis.prototype.end = function() { * * @public */ -Redis.prototype.duplicate = function(override) { +Redis.prototype.duplicate = function (override) { return new Redis(Object.assign({}, this.options, override || {})); }; -Redis.prototype.recoverFromFatalError = function(commandError, err, options) { +Redis.prototype.recoverFromFatalError = function (commandError, err, options) { this.flushQueue(err, options); this.silentEmit("error", err); this.disconnect(true); }; Redis.prototype.handleReconnection = function handleReconnection(err, item) { - var needReconnect: ReturnType = false; + let needReconnect: ReturnType = false; if (this.options.reconnectOnError) { needReconnect = this.options.reconnectOnError(err); } @@ -451,13 +451,13 @@ Redis.prototype.handleReconnection = function handleReconnection(err, item) { * @param {object} options * @private */ -Redis.prototype.flushQueue = function(error, options) { +Redis.prototype.flushQueue = function (error, options) { options = defaults({}, options, { offlineQueue: true, - commandQueue: true + commandQueue: true, }); - var item; + let item; if (options.offlineQueue) { while (this.offlineQueue.length > 0) { item = this.offlineQueue.shift(); @@ -485,9 +485,9 @@ Redis.prototype.flushQueue = function(error, options) { * @param {Function} callback * @private */ -Redis.prototype._readyCheck = function(callback) { - var _this = this; - this.info(function(err, res) { +Redis.prototype._readyCheck = function (callback) { + const _this = this; + this.info(function (err, res) { if (err) { return callback(err); } @@ -495,11 +495,11 @@ Redis.prototype._readyCheck = function(callback) { return callback(null, res); } - var info: { [key: string]: any } = {}; + const info: { [key: string]: any } = {}; - var lines = res.split("\r\n"); - for (var i = 0; i < lines.length; ++i) { - var parts = lines[i].split(":"); + const lines = res.split("\r\n"); + for (let i = 0; i < lines.length; ++i) { + const parts = lines[i].split(":"); if (parts[1]) { info[parts[0]] = parts[1]; } @@ -508,14 +508,14 @@ Redis.prototype._readyCheck = function(callback) { if (!info.loading || info.loading === "0") { callback(null, info); } else { - var loadingEtaMs = (info.loading_eta_seconds || 1) * 1000; - var retryTime = + const loadingEtaMs = (info.loading_eta_seconds || 1) * 1000; + const retryTime = _this.options.maxLoadingRetryTime && _this.options.maxLoadingRetryTime < loadingEtaMs ? _this.options.maxLoadingRetryTime : loadingEtaMs; debug("Redis server still loading, trying again in " + retryTime + "ms"); - setTimeout(function() { + setTimeout(function () { _this._readyCheck(callback); }, retryTime); } @@ -530,8 +530,8 @@ Redis.prototype._readyCheck = function(callback) { * @return {boolean} Returns true if event had listeners, false otherwise. * @private */ -Redis.prototype.silentEmit = function(eventName) { - var error; +Redis.prototype.silentEmit = function (eventName) { + let error; if (eventName === "error") { error = arguments[1]; @@ -589,16 +589,16 @@ Redis.prototype.silentEmit = function(eventName) { * ``` * @public */ -Redis.prototype.monitor = function(callback) { - var monitorInstance = this.duplicate({ +Redis.prototype.monitor = function (callback) { + const monitorInstance = this.duplicate({ monitor: true, - lazyConnect: false + lazyConnect: false, }); - var Promise = PromiseContainer.get(); + const Promise = PromiseContainer.get(); return asCallback( - new Promise(function(resolve) { - monitorInstance.once("monitoring", function() { + new Promise(function (resolve) { + monitorInstance.once("monitoring", function () { resolve(monitorInstance); }); }), @@ -639,7 +639,7 @@ addTransactionSupport(Redis.prototype); * ``` * @private */ -Redis.prototype.sendCommand = function(command, stream) { +Redis.prototype.sendCommand = function (command, stream) { if (this.status === "wait") { this.connect().catch(noop); } @@ -659,7 +659,7 @@ Redis.prototype.sendCommand = function(command, stream) { return command.promise; } - var writable = + let writable = this.status === "ready" || (!stream && this.status === "connect" && @@ -705,7 +705,7 @@ Redis.prototype.sendCommand = function(command, stream) { this.commandQueue.push({ command: command, stream: stream, - select: this.condition.select + select: this.condition.select, }); if (Command.checkFlag("WILL_DISCONNECT", command.name)) { @@ -725,12 +725,12 @@ Redis.prototype.sendCommand = function(command, stream) { this.offlineQueue.push({ command: command, stream: stream, - select: this.condition.select + select: this.condition.select, }); } if (command.name === "select" && isInt(command.args[0])) { - var db = parseInt(command.args[0], 10); + const db = parseInt(command.args[0], 10); if (this.condition.select !== db) { this.condition.select = db; this.emit("select", db); @@ -745,7 +745,7 @@ Redis.prototype.sendCommand = function(command, stream) { * Get description of the connection. Used for debugging. * @private */ -Redis.prototype._getDescription = function() { +Redis.prototype._getDescription = function () { let description; if (this.options.path) { description = this.options.path; @@ -772,9 +772,9 @@ Redis.prototype._getDescription = function() { "scanBuffer", "sscanBuffer", "hscanBuffer", - "zscanBuffer" -].forEach(function(command) { - Redis.prototype[command + "Stream"] = function(key, options) { + "zscanBuffer", +].forEach(function (command) { + Redis.prototype[command + "Stream"] = function (key, options) { if (command === "scan" || command === "scanBuffer") { options = key; key = null; @@ -785,7 +785,7 @@ Redis.prototype._getDescription = function() { objectMode: true, key: key, redis: this, - command: command + command: command, }, options ) diff --git a/lib/script.ts b/lib/script.ts index fa32092a..15800448 100644 --- a/lib/script.ts +++ b/lib/script.ts @@ -13,9 +13,7 @@ export default class Script { private keyPrefix: string = "", private readOnly: boolean = false ) { - this.sha = createHash("sha1") - .update(lua) - .digest("hex"); + this.sha = createHash("sha1").update(lua).digest("hex"); } execute( @@ -40,7 +38,7 @@ export default class Script { const result = container.sendCommand(evalsha); if (isPromise(result)) { return asCallback( - result.catch(err => { + result.catch((err) => { if (err.toString().indexOf("NOSCRIPT") === -1) { throw err; } diff --git a/lib/transaction.ts b/lib/transaction.ts index 8ea51687..31b01dca 100644 --- a/lib/transaction.ts +++ b/lib/transaction.ts @@ -4,7 +4,7 @@ import Pipeline from "./pipeline"; import { CallbackFunction } from "./types"; export function addTransactionSupport(redis) { - redis.pipeline = function(commands) { + redis.pipeline = function (commands) { const pipeline = new Pipeline(this); if (Array.isArray(commands)) { pipeline.addBatch(commands); @@ -13,7 +13,7 @@ export function addTransactionSupport(redis) { }; const { multi } = redis; - redis.multi = function(commands, options) { + redis.multi = function (commands, options) { if (typeof options === "undefined" && !Array.isArray(commands)) { options = commands; commands = null; @@ -27,7 +27,7 @@ export function addTransactionSupport(redis) { pipeline.addBatch(commands); } const exec = pipeline.exec; - pipeline.exec = function(callback: CallbackFunction) { + pipeline.exec = function (callback: CallbackFunction) { if (this._transactions > 0) { exec.call(pipeline); } @@ -39,7 +39,7 @@ export function addTransactionSupport(redis) { } const promise = exec.call(pipeline); return asCallback( - promise.then(function(result) { + promise.then(function (result) { const execResult = result[result.length - 1]; if (typeof execResult === "undefined") { throw new Error( @@ -62,7 +62,7 @@ export function addTransactionSupport(redis) { }; const { execBuffer } = pipeline; - pipeline.execBuffer = function(callback) { + pipeline.execBuffer = function (callback) { if (this._transactions > 0) { execBuffer.call(pipeline); } @@ -72,9 +72,9 @@ export function addTransactionSupport(redis) { }; const { exec } = redis; - redis.exec = function(callback: CallbackFunction) { + redis.exec = function (callback: CallbackFunction) { return asCallback( - exec.call(this).then(function(results) { + exec.call(this).then(function (results) { if (Array.isArray(results)) { results = wrapMultiResult(results); } diff --git a/lib/utils/debug.ts b/lib/utils/debug.ts index 29fbc287..7523e119 100644 --- a/lib/utils/debug.ts +++ b/lib/utils/debug.ts @@ -77,17 +77,17 @@ export default function genDebugFunction( namespace: { get() { return fn.namespace; - } + }, }, enabled: { get() { return fn.enabled; - } + }, }, destroy: { get() { return fn.destroy; - } + }, }, log: { get() { @@ -95,8 +95,8 @@ export default function genDebugFunction( }, set(l) { fn.log = l; - } - } + }, + }, }); return wrappedDebug; } diff --git a/lib/utils/index.ts b/lib/utils/index.ts index fb37c791..039c9032 100644 --- a/lib/utils/index.ts +++ b/lib/utils/index.ts @@ -19,7 +19,7 @@ export function bufferEqual(a: Buffer, b: Buffer): boolean { return false; } - for (var i = 0; i < a.length; ++i) { + for (let i = 0; i < a.length; ++i) { if (a[i] !== b[i]) { return false; } @@ -46,9 +46,9 @@ export function convertBufferToString(value: any, encoding?: string) { return value.toString(encoding); } if (Array.isArray(value)) { - var length = value.length; - var res = Array(length); - for (var i = 0; i < length; ++i) { + const length = value.length; + const res = Array(length); + for (let i = 0; i < length; ++i) { res[i] = value[i] instanceof Buffer && encoding === "utf8" ? value[i].toString() @@ -78,10 +78,10 @@ export function wrapMultiResult(arr) { if (!arr) { return null; } - var result = []; - var length = arr.length; - for (var i = 0; i < length; ++i) { - var item = arr[i]; + const result = []; + const length = arr.length; + for (let i = 0; i < length; ++i) { + const item = arr[i]; if (item instanceof Error) { result.push([item]); } else { @@ -112,7 +112,7 @@ export function wrapMultiResult(arr) { * @private */ export function isInt(value) { - var x = parseFloat(value); + const x = parseFloat(value); return !isNaN(value) && (x | 0) === x; } @@ -128,10 +128,10 @@ export function isInt(value) { * ``` */ export function packObject(array) { - var result = {}; - var length = array.length; + const result = {}; + const length = array.length; - for (var i = 1; i < length; i += 2) { + for (let i = 1; i < length; i += 2) { result[array[i - 1]] = array[i]; } @@ -146,8 +146,8 @@ export function packObject(array) { * @return {function} */ export function timeout(callback, timeout) { - var timer; - var run = function() { + let timer; + const run = function () { if (timer) { clearTimeout(timer); timer = null; @@ -170,10 +170,10 @@ export function timeout(callback, timeout) { * ``` */ export function convertObjectToArray(obj) { - var result = []; - var keys = Object.keys(obj); + const result = []; + const keys = Object.keys(obj); - for (var i = 0, l = keys.length; i < l; i++) { + for (let i = 0, l = keys.length; i < l; i++) { result.push(keys[i], obj[keys[i]]); } return result; @@ -193,7 +193,7 @@ export function convertObjectToArray(obj) { export function convertMapToArray(map: Map): Array { const result = []; let pos = 0; - map.forEach(function(value, key) { + map.forEach(function (value, key) { result[pos] = key; result[pos + 1] = value; pos += 2; @@ -222,18 +222,18 @@ export function toArg(arg) { * @param {string} filterPath - only show stacks with the specified path */ export function optimizeErrorStack(error, friendlyStack, filterPath) { - var stacks = friendlyStack.split("\n"); - var lines = ""; - var i; + const stacks = friendlyStack.split("\n"); + let lines = ""; + let i; for (i = 1; i < stacks.length; ++i) { if (stacks[i].indexOf(filterPath) === -1) { break; } } - for (var j = i; j < stacks.length; ++j) { + for (let j = i; j < stacks.length; ++j) { lines += "\n" + stacks[j]; } - var pos = error.stack.indexOf("\n"); + const pos = error.stack.indexOf("\n"); error.stack = error.stack.slice(0, pos) + lines; return error; } @@ -248,14 +248,14 @@ export function parseURL(url) { if (isInt(url)) { return { port: url }; } - var parsed = urllibParse(url, true, true); + let parsed = urllibParse(url, true, true); if (!parsed.slashes && url[0] !== "/") { url = "//" + url; parsed = urllibParse(url, true, true); } - var result: any = {}; + const result: any = {}; if (parsed.auth) { result.password = parsed.auth.split(":")[1]; } @@ -288,7 +288,7 @@ export function parseURL(url) { * @param {number} [from=0] start index * @returns {T} */ -export function sample(array: T[], from: number = 0): T { +export function sample(array: T[], from = 0): T { const length = array.length; if (from >= length) { return; diff --git a/package-lock.json b/package-lock.json index 9e2ba123..667f83c3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,31 +24,108 @@ "js-tokens": "^4.0.0" } }, - "@mrmlnc/readdir-enhanced": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", - "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==", + "@babel/runtime": { + "version": "7.9.2", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.2.tgz", + "integrity": "sha512-NE2DtOdufG7R5vnfQUTehdTfNycfUANEtCa9PssN9O/xmTzP4E08UI797ixaei6hBEVL9BI/PsdJS5x7mWoB9Q==", "dev": true, "requires": { - "call-me-maybe": "^1.0.1", - "glob-to-regexp": "^0.3.0" + "regenerator-runtime": "^0.13.4" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.4.tgz", + "integrity": "sha512-plpwicqEzfEyTQohIKktWigcLzmNStMGwbOUbykx51/29Z3JOGYldaaNGK7ngNXV+UcoqvIMmloZ48Sr74sd+g==", + "dev": true + } } }, - "@nodelib/fs.stat": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", - "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==", - "dev": true + "@commitlint/execute-rule": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-8.3.4.tgz", + "integrity": "sha512-f4HigYjeIBn9f7OuNv5zh2y5vWaAhNFrfeul8CRJDy82l3Y+09lxOTGxfF3uMXKrZq4LmuK6qvvRCZ8mUrVvzQ==", + "dev": true, + "optional": true + }, + "@commitlint/load": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-8.3.4.tgz", + "integrity": "sha512-B4MylKvT02UE3VHC5098OHxsrgkADUy5AD4Cdkiy7oX/edWypEmvK7Wuns3B9dwluWP/iFM6daoWtpkCVZoRwQ==", + "dev": true, + "optional": true, + "requires": { + "@commitlint/execute-rule": "^8.3.4", + "@commitlint/resolve-extends": "^8.3.4", + "babel-runtime": "^6.23.0", + "chalk": "2.4.2", + "cosmiconfig": "^5.2.0", + "lodash": "4.17.15", + "resolve-from": "^5.0.0" + }, + "dependencies": { + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true, + "optional": true + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "optional": true + } + } + }, + "@commitlint/resolve-extends": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-8.3.4.tgz", + "integrity": "sha512-M34RLaAW1eGWgtkVtotHfPaJa+cZIARe8twKItd7RhWs7n/1W2py9GTFIiIEq95LBN1uah5vm1WQHsfLqPZYHA==", + "dev": true, + "optional": true, + "requires": { + "@types/node": "^12.0.2", + "import-fresh": "^3.0.0", + "lodash": "4.17.15", + "resolve-from": "^5.0.0", + "resolve-global": "^1.0.0" + }, + "dependencies": { + "@types/node": { + "version": "12.12.34", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.34.tgz", + "integrity": "sha512-BneGN0J9ke24lBRn44hVHNeDlrXRYF+VRp0HbSUNnEZahXGAysHZIqnf/hER6aabdBgzM4YOV4jrR8gj4Zfi0g==", + "dev": true, + "optional": true + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true, + "optional": true + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "optional": true + } + } }, "@semantic-release/changelog": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@semantic-release/changelog/-/changelog-3.0.4.tgz", - "integrity": "sha512-UqEPahcZSW0IKtzOglyjeEZCN99ku6Wb/yH/iOKEBJ7Vkw0/+Fc3VRiGoXTkMfHSFUJk+4UkoQKTlYuwf61C2w==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@semantic-release/changelog/-/changelog-5.0.1.tgz", + "integrity": "sha512-unvqHo5jk4dvAf2nZ3aw4imrlwQ2I50eVVvq9D47Qc3R+keNqepx1vDYwkjF8guFXnOYaYcR28yrZWno1hFbiw==", "dev": true, "requires": { "@semantic-release/error": "^2.1.0", "aggregate-error": "^3.0.0", - "fs-extra": "^8.0.0", + "fs-extra": "^9.0.0", "lodash": "^4.17.4" } }, @@ -59,51 +136,58 @@ "dev": true }, "@semantic-release/git": { - "version": "7.0.12", - "resolved": "https://registry.npmjs.org/@semantic-release/git/-/git-7.0.12.tgz", - "integrity": "sha512-LG+sTU0dxwf5TCRtbDB4seXtdTU8OOmVhvHtambgTp2Xu6zaVMmZcVMbRIhuZd/u+LIYHsNI23v6W+xS4BgtNQ==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@semantic-release/git/-/git-9.0.0.tgz", + "integrity": "sha512-AZ4Zha5NAPAciIJH3ipzw/WU9qLAn8ENaoVAhD6srRPxTpTzuV3NhNh14rcAo8Paj9dO+5u4rTKcpetOBluYVw==", "dev": true, "requires": { "@semantic-release/error": "^2.1.0", "aggregate-error": "^3.0.0", "debug": "^4.0.0", - "dir-glob": "^2.0.0", - "execa": "^1.0.0", - "fs-extra": "^8.0.0", - "globby": "^9.0.0", + "dir-glob": "^3.0.0", + "execa": "^4.0.0", "lodash": "^4.17.4", "micromatch": "^4.0.0", "p-reduce": "^2.0.0" } }, "@sinonjs/commons": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.4.0.tgz", - "integrity": "sha512-9jHK3YF/8HtJ9wCAbG+j8cD0i0+ATS9A7gXFqS36TblLPNy6rEEc+SB0imo91eCboGaBYGV/MT1/br/J+EE7Tw==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.7.1.tgz", + "integrity": "sha512-Debi3Baff1Qu1Unc3mjJ96MgpbwTn43S1+9yJ0llWygPwDNu2aaWBD6yc9y/Z8XDRNhx7U+u2UDg2OGQXkclUQ==", "dev": true, "requires": { "type-detect": "4.0.8" } }, + "@sinonjs/fake-timers": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz", + "integrity": "sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.7.0" + } + }, "@sinonjs/formatio": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-3.2.1.tgz", - "integrity": "sha512-tsHvOB24rvyvV2+zKMmPkZ7dXX6LSLKZ7aOtXY6Edklp0uRcgGpOsQTTGTcWViFyx4uhWc6GV8QdnALbIbIdeQ==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-5.0.1.tgz", + "integrity": "sha512-KaiQ5pBf1MpS09MuA0kp6KBQt2JUOQycqVG1NZXvzeaXe5LGFqAKueIS0bw4w0P9r7KuBSVdUk5QjXsUdu2CxQ==", "dev": true, "requires": { "@sinonjs/commons": "^1", - "@sinonjs/samsam": "^3.1.0" + "@sinonjs/samsam": "^5.0.2" } }, "@sinonjs/samsam": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-3.3.1.tgz", - "integrity": "sha512-wRSfmyd81swH0hA1bxJZJ57xr22kC07a1N4zuIL47yTS04bDk6AoCkczcqHEjcRPmJ+FruGJ9WBQiJwMtIElFw==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-5.0.3.tgz", + "integrity": "sha512-QucHkc2uMJ0pFGjJUDP3F9dq5dx8QIaqISl9QgwLOh6P9yv877uONPGXh/OH/0zmM3tW1JjuJltAZV2l7zU+uQ==", "dev": true, "requires": { - "@sinonjs/commons": "^1.0.2", - "array-from": "^2.1.1", - "lodash": "^4.17.11" + "@sinonjs/commons": "^1.6.0", + "lodash.get": "^4.4.2", + "type-detect": "^4.0.8" } }, "@sinonjs/text-encoding": { @@ -113,46 +197,41 @@ "dev": true }, "@types/bluebird": { - "version": "3.5.27", - "resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.27.tgz", - "integrity": "sha512-6BmYWSBea18+tSjjSC3QIyV93ZKAeNWGM7R6aYt1ryTZXrlHF+QLV0G2yV0viEGVyRkyQsWfMoJ0k/YghBX5sQ==", + "version": "3.5.30", + "resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.30.tgz", + "integrity": "sha512-8LhzvcjIoqoi1TghEkRMkbbmM+jhHnBokPGkJWjclMK+Ks0MxEBow3/p2/iFTZ+OIbJHQDSfpgdZEb+af3gfVw==", "dev": true }, "@types/chai": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.1.7.tgz", - "integrity": "sha512-2Y8uPt0/jwjhQ6EiluT0XCri1Dbplr0ZxfFXUz+ye13gaqE8u5gL5ppao1JrUYr9cIip5S6MvQzBS7Kke7U9VA==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.11.tgz", + "integrity": "sha512-t7uW6eFafjO+qJ3BIV2gGUyZs27egcNRkUdalkud+Qa3+kg//f129iuOFivHDXQ+vnU3fDXuwgv0cqMCbcE8sw==", + "dev": true + }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", "dev": true }, "@types/debug": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.4.tgz", - "integrity": "sha512-D9MyoQFI7iP5VdpEyPZyjjqIJ8Y8EDNQFIFVLOmeg1rI1xiHOChyUPMPRUVfqFCerxfE+yS3vMyj37F6IdtOoQ==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.5.tgz", + "integrity": "sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ==", "dev": true }, "@types/eslint-visitor-keys": { "version": "1.0.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", - "integrity": "sha1-HuMNeVRMqE1o1LPNsK9PIFZj3S0=", + "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==", "dev": true }, - "@types/events": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", - "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", + "@types/json-schema": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.4.tgz", + "integrity": "sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA==", "dev": true }, - "@types/glob": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", - "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", - "dev": true, - "requires": { - "@types/events": "*", - "@types/minimatch": "*", - "@types/node": "*" - } - }, "@types/lodash": { "version": "4.14.134", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.134.tgz", @@ -184,21 +263,21 @@ "dev": true }, "@types/mocha": { - "version": "5.2.7", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", - "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-7.0.2.tgz", + "integrity": "sha512-ZvO2tAcjmMi8V/5Z3JsyofMe3hasRcaw88cto5etSVMwVQfeivGAlEYmaQgceUSVYFofVjT+ioHsATjdWcFt1w==", "dev": true }, "@types/node": { - "version": "12.0.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.7.tgz", - "integrity": "sha512-1YKeT4JitGgE4SOzyB9eMwO0nGVNkNEsm9qlIt1Lqm/tG2QEiSMTD4kS3aO6L+w5SClLVxALmIBESK6Mk5wX0A==", + "version": "13.11.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.11.0.tgz", + "integrity": "sha512-uM4mnmsIIPK/yeO+42F2RQhGUIs39K2RFmugcJANppXe6J1nvH87PvzPZYpza7Xhhs8Yn9yIAVdLZ84z61+0xQ==", "dev": true }, - "@types/normalize-package-data": { - "version": "2.4.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha1-5IbQ2XOW15vu3QpuM/RTT/a0lz4=", + "@types/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, "@types/redis-errors": { @@ -208,116 +287,174 @@ "dev": true }, "@types/sinon": { - "version": "7.0.13", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-7.0.13.tgz", - "integrity": "sha512-d7c/C/+H/knZ3L8/cxhicHUiTDxdgap0b/aNJfsmLwFu/iOP17mdgbQsbHA3SJmrzsjD0l3UEE5SN4xxuz5ung==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-9.0.0.tgz", + "integrity": "sha512-v2TkYHkts4VXshMkcmot/H+ERZ2SevKa10saGaJPGCJ8vh3lKrC4u663zYEeRZxep+VbG6YRDtQ6gVqw9dYzPA==", + "dev": true, + "requires": { + "@types/sinonjs__fake-timers": "*" + } + }, + "@types/sinonjs__fake-timers": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-6.0.1.tgz", + "integrity": "sha512-yYezQwGWty8ziyYLdZjwxyMb0CZR49h8JALHGrxjQHWlqGgc8kLdHEgWrgL0uZ29DMvEVBDnHU2Wg36zKSIUtA==", "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "1.11.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.11.0.tgz", - "integrity": "sha1-hw91LFINsE2202aK90eQJqby+5o=", + "version": "2.26.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.26.0.tgz", + "integrity": "sha512-4yUnLv40bzfzsXcTAtZyTjbiGUXMrcIJcIMioI22tSOyAxpdXiZ4r7YQUU8Jj6XXrLz9d5aMHPQf5JFR7h27Nw==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "1.11.0", - "eslint-utils": "^1.3.1", + "@typescript-eslint/experimental-utils": "2.26.0", "functional-red-black-tree": "^1.0.1", - "regexpp": "^2.0.1", - "tsutils": "^3.7.0" + "regexpp": "^3.0.0", + "tsutils": "^3.17.1" + }, + "dependencies": { + "regexpp": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.0.0.tgz", + "integrity": "sha512-Z+hNr7RAVWxznLPuA7DIh8UNX1j9CDrUQxskw9IrBE1Dxue2lyXT+shqEIeLUjrokxIP8CMy1WkjgG3rTsd5/g==", + "dev": true + } } }, "@typescript-eslint/experimental-utils": { - "version": "1.11.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/@typescript-eslint/experimental-utils/-/experimental-utils-1.11.0.tgz", - "integrity": "sha1-WUq+RwkcvqusHW+c/tBtCtmet+M=", + "version": "2.26.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.26.0.tgz", + "integrity": "sha512-RELVoH5EYd+JlGprEyojUv9HeKcZqF7nZUGSblyAw1FwOGNnmQIU8kxJ69fttQvEwCsX5D6ECJT8GTozxrDKVQ==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "1.11.0", - "eslint-scope": "^4.0.0" + "@types/json-schema": "^7.0.3", + "@typescript-eslint/typescript-estree": "2.26.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + }, + "dependencies": { + "eslint-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.0.0.tgz", + "integrity": "sha512-0HCPuJv+7Wv1bACm8y5/ECVfYdfsAm9xmVb7saeFlxjPYALefjhbYoCkBjPdPzGH8wWyTpAez82Fh3VKYEZ8OA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + } } }, "@typescript-eslint/parser": { - "version": "1.11.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/@typescript-eslint/parser/-/parser-1.11.0.tgz", - "integrity": "sha1-L21PfmTusefCW0IvjfFNDJ5QjjY=", + "version": "2.26.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.26.0.tgz", + "integrity": "sha512-+Xj5fucDtdKEVGSh9353wcnseMRkPpEAOY96EEenN7kJVrLqy/EVwtIh3mxcUz8lsFXW1mT5nN5vvEam/a5HiQ==", "dev": true, "requires": { "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "1.11.0", - "@typescript-eslint/typescript-estree": "1.11.0", - "eslint-visitor-keys": "^1.0.0" + "@typescript-eslint/experimental-utils": "2.26.0", + "@typescript-eslint/typescript-estree": "2.26.0", + "eslint-visitor-keys": "^1.1.0" } }, "@typescript-eslint/typescript-estree": { - "version": "1.11.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/@typescript-eslint/typescript-estree/-/typescript-estree-1.11.0.tgz", - "integrity": "sha1-t7V4Kqsi5LO22EYzZSyfQeYtN9U=", - "dev": true, - "requires": { - "lodash.unescape": "4.0.1", - "semver": "5.5.0" + "version": "2.26.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.26.0.tgz", + "integrity": "sha512-3x4SyZCLB4zsKsjuhxDLeVJN6W29VwBnYpCsZ7vIdPel9ZqLfIZJgJXO47MNUkurGpQuIBALdPQKtsSnWpE1Yg==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "eslint-visitor-keys": "^1.1.0", + "glob": "^7.1.6", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^6.3.0", + "tsutils": "^3.17.1" }, "dependencies": { + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, "semver": { - "version": "5.5.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/semver/-/semver-5.5.0.tgz", - "integrity": "sha1-3Eu8emyp2Rbe5dQ1FvAJK1j3uKs=", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true } } }, - "abbrev": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", - "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", - "dev": true - }, "acorn": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", - "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", + "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", "dev": true }, "acorn-jsx": { - "version": "5.0.1", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/acorn-jsx/-/acorn-jsx-5.0.1.tgz", - "integrity": "sha1-MqBk/ZJUKSFqCbFBECv90YX65A4=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", + "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", "dev": true }, "aggregate-error": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.0.tgz", - "integrity": "sha512-yKD9kEoJIR+2IFqhMwayIBgheLYbB3PS2OBhWae1L/ODTd/JF/30cW0bc9TqzRL3k4U41Dieu3BF4I29p8xesA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", + "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", "dev": true, "requires": { "clean-stack": "^2.0.0", - "indent-string": "^3.2.0" + "indent-string": "^4.0.0" } }, "ajv": { - "version": "6.10.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/ajv/-/ajv-6.10.0.tgz", - "integrity": "sha1-kNDVRDnaWHzX6EO/twRfUL0ivfE=", + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.0.tgz", + "integrity": "sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw==", "dev": true, "requires": { - "fast-deep-equal": "^2.0.1", + "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" } }, - "amdefine": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", - "dev": true, - "optional": true + "ansi-colors": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", + "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", + "dev": true }, "ansi-escapes": { - "version": "3.2.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/ansi-escapes/-/ansi-escapes-3.2.0.tgz", - "integrity": "sha1-h4C5j/nb9WOBUtHx/lwde0RCl2s=", - "dev": true + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", + "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", + "dev": true, + "requires": { + "type-fest": "^0.11.0" + }, + "dependencies": { + "type-fest": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", + "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", + "dev": true + } + } }, "ansi-regex": { "version": "3.0.0", @@ -334,10 +471,20 @@ "color-convert": "^1.9.0" } }, + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, "arg": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.0.tgz", - "integrity": "sha512-ZWc51jO3qegGkVh8Hwpv636EkbesNV5ZNQPCtRa+0qytRYPEs9IYT9qITY9buezqUH5uqyzlWLcufrzU2rffdg==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", "dev": true }, "argparse": { @@ -368,30 +515,15 @@ "dev": true }, "array-differ": { - "version": "2.1.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/array-differ/-/array-differ-2.1.0.tgz", - "integrity": "sha1-S5wcPxS5BnVwgpJXaeirkE9IAbE=", - "dev": true - }, - "array-from": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz", - "integrity": "sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", + "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", "dev": true }, "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", - "dev": true, - "requires": { - "array-uniq": "^1.0.1" - } - }, - "array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true }, "array-unique": { @@ -401,9 +533,9 @@ "dev": true }, "arrify": { - "version": "1.0.1", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", "dev": true }, "assertion-error": { @@ -420,14 +552,14 @@ }, "astral-regex": { "version": "1.0.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha1-bIw/uCfdQ+45GPJ7gngqt2WKb9k=", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", "dev": true }, - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", "dev": true }, "atob": { @@ -436,6 +568,17 @@ "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", "dev": true }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "dev": true, + "optional": true, + "requires": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + } + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -497,10 +640,16 @@ } } }, + "binary-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", + "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==", + "dev": true + }, "bluebird": { - "version": "3.5.5", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz", - "integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w==", + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", "dev": true }, "brace-expansion": { @@ -514,32 +663,12 @@ } }, "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } + "fill-range": "^7.0.1" } }, "browser-stdout": { @@ -571,10 +700,10 @@ "unset-value": "^1.0.0" } }, - "call-me-maybe": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", - "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=", + "cachedir": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cachedir/-/cachedir-2.2.0.tgz", + "integrity": "sha512-VvxA0xhNqIIfg0V9AmJkDg91DaJwryutH5rVEZAhcNi4iJFj9f+QxmAjgK1LT9I8OgToX27fypX6/MeCXVbBjQ==", "dev": true }, "caller-callsite": { @@ -582,6 +711,7 @@ "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/caller-callsite/-/caller-callsite-2.0.0.tgz", "integrity": "sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=", "dev": true, + "optional": true, "requires": { "callsites": "^2.0.0" }, @@ -590,7 +720,8 @@ "version": "2.0.0", "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/callsites/-/callsites-2.0.0.tgz", "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", - "dev": true + "dev": true, + "optional": true } } }, @@ -599,14 +730,21 @@ "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/caller-path/-/caller-path-2.0.0.tgz", "integrity": "sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=", "dev": true, + "optional": true, "requires": { "caller-callsite": "^2.0.0" } }, "callsites": { "version": "3.1.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha1-s2MKvYlDQy9Us/BRkjjjPNffL3M=", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, "chai": { @@ -636,8 +774,8 @@ }, "chardet": { "version": "0.7.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha1-kAlISfCTfy7twkJdDSip5fDLrZ4=", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, "check-error": { @@ -646,10 +784,26 @@ "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", "dev": true }, + "chokidar": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz", + "integrity": "sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A==", + "dev": true, + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.1", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.2.0" + } + }, "ci-info": { "version": "2.0.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha1-Z6npZL4xpR4V5QENWObxKDQAL0Y=", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", "dev": true }, "class-utils": { @@ -676,18 +830,18 @@ } }, "clean-stack": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.1.0.tgz", - "integrity": "sha512-uQWrpRm+iZZUCAp7ZZJQbd4Za9I3AjR/3YTjmcnAtkauaIm/T5CT6U8zVI6e60T6OANqBFAzuR9/HB3NzuZCRA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", "dev": true }, "cli-cursor": { - "version": "2.1.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "dev": true, "requires": { - "restore-cursor": "^2.0.0" + "restore-cursor": "^3.1.0" } }, "cli-width": { @@ -696,6 +850,45 @@ "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", "dev": true }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, "cluster-key-slot": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.0.tgz", @@ -726,65 +919,256 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, - "commander": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", - "dev": true - }, - "component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "conventional-commit-types": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/conventional-commit-types/-/conventional-commit-types-2.2.0.tgz", - "integrity": "sha1-XblXOdbCEqy+e29lahG5QLqmiUY=", - "dev": true - }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true - }, - "cosmiconfig": { - "version": "5.2.1", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/cosmiconfig/-/cosmiconfig-5.2.1.tgz", - "integrity": "sha1-BA9yaAnFked6F8CjYmykW08Wixo=", - "dev": true, - "requires": { - "import-fresh": "^2.0.0", - "is-directory": "^0.3.1", - "js-yaml": "^3.13.1", - "parse-json": "^4.0.0" + "commitizen": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/commitizen/-/commitizen-4.0.3.tgz", + "integrity": "sha512-lxu0F/Iq4dudoFeIl5pY3h3CQJzkmQuh3ygnaOvqhAD8Wu2pYBI17ofqSuPHNsBTEOh1r1AVa9kR4Hp0FAHKcQ==", + "dev": true, + "requires": { + "cachedir": "2.2.0", + "cz-conventional-changelog": "3.0.1", + "dedent": "0.7.0", + "detect-indent": "6.0.0", + "find-node-modules": "2.0.0", + "find-root": "1.1.0", + "fs-extra": "8.1.0", + "glob": "7.1.4", + "inquirer": "6.5.0", + "is-utf8": "^0.2.1", + "lodash": "4.17.15", + "minimist": "1.2.0", + "shelljs": "0.7.6", + "strip-bom": "4.0.0", + "strip-json-comments": "3.0.1" }, "dependencies": { - "import-fresh": { - "version": "2.0.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/import-fresh/-/import-fresh-2.0.0.tgz", - "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=", + "ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "dev": true + }, + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", "dev": true, "requires": { - "caller-path": "^2.0.0", - "resolve-from": "^3.0.0" + "restore-cursor": "^2.0.0" } }, - "resolve-from": { - "version": "3.0.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "conventional-commit-types": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/conventional-commit-types/-/conventional-commit-types-2.3.0.tgz", + "integrity": "sha512-6iB39PrcGYdz0n3z31kj6/Km6mK9hm9oMRhwcLnKxE7WNoeRKZbTAobliKrbYZ5jqyCvtcVEfjCiaEzhL3AVmQ==", "dev": true - } - } + }, + "cz-conventional-changelog": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/cz-conventional-changelog/-/cz-conventional-changelog-3.0.1.tgz", + "integrity": "sha512-7KASIwB8/ClEyCRvQrCPbN7WkQnUSjSSVNyPM+gDJ0jskLi8h8N2hrdpyeCk7fIqKMRzziqVSOBTB8yyLTMHGQ==", + "dev": true, + "requires": { + "@commitlint/load": ">6.1.1", + "chalk": "^2.4.1", + "conventional-commit-types": "^2.0.0", + "lodash.map": "^4.5.1", + "longest": "^2.0.1", + "right-pad": "^1.0.1", + "word-wrap": "^1.0.3" + } + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "inquirer": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.0.tgz", + "integrity": "sha512-scfHejeG/lVZSpvCXpsB4j/wQNPM5JC8kiElOI0OUTwmc1RTpXr4H32/HOlQHcZiYl2z2VElwuCVDRG8vFmbnA==", + "dev": true, + "requires": { + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^2.0.0", + "lodash": "^4.17.12", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.4.0", + "string-width": "^2.1.0", + "strip-ansi": "^5.1.0", + "through": "^2.3.6" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "strip-json-comments": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", + "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==", + "dev": true + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + } + } + }, + "compare-versions": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", + "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", + "dev": true + }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "conventional-commit-types": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/conventional-commit-types/-/conventional-commit-types-3.0.0.tgz", + "integrity": "sha512-SmmCYnOniSsAa9GqWOeLqc179lfr5TRu5b4QFDkbsrJ5TZjPJx85wtOr3zn+1dbeNiXDKGPbZ72IKbPhLXh/Lg==", + "dev": true + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, + "core-js": { + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz", + "integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==", + "dev": true, + "optional": true + }, + "cosmiconfig": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", + "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", + "dev": true, + "optional": true, + "requires": { + "import-fresh": "^2.0.0", + "is-directory": "^0.3.1", + "js-yaml": "^3.13.1", + "parse-json": "^4.0.0" + }, + "dependencies": { + "import-fresh": { + "version": "2.0.0", + "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/import-fresh/-/import-fresh-2.0.0.tgz", + "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=", + "dev": true, + "optional": true, + "requires": { + "caller-path": "^2.0.0", + "resolve-from": "^3.0.0" + } + }, + "resolve-from": { + "version": "3.0.0", + "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true, + "optional": true + } + } }, "cross-spawn": { "version": "6.0.5", @@ -800,14 +1184,17 @@ } }, "cz-conventional-changelog": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cz-conventional-changelog/-/cz-conventional-changelog-2.1.0.tgz", - "integrity": "sha1-L0vHOQ4yROTfKT5ro1Hkx0Cnx2Q=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cz-conventional-changelog/-/cz-conventional-changelog-3.1.0.tgz", + "integrity": "sha512-SCwPPOF+7qMh1DZkJhrwaxCvZzPaz2E9BwQzcZwBuHlpcJj9zzz7K5vADQRhHuxStaHZFSLbDlZEdcls4bKu7Q==", "dev": true, "requires": { - "conventional-commit-types": "^2.0.0", + "@commitlint/load": ">6.1.1", + "chalk": "^2.4.1", + "commitizen": "^4.0.3", + "conventional-commit-types": "^3.0.0", "lodash.map": "^4.5.1", - "longest": "^1.0.1", + "longest": "^2.0.1", "right-pad": "^1.0.1", "word-wrap": "^1.0.3" } @@ -820,12 +1207,24 @@ "ms": "^2.1.1" } }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, "decode-uri-component": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", "dev": true }, + "dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", + "dev": true + }, "deep-eql": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", @@ -841,6 +1240,15 @@ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, "define-property": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", @@ -887,6 +1295,18 @@ "resolved": "https://registry.npmjs.org/denque/-/denque-1.4.1.tgz", "integrity": "sha512-OfzPuSZKGcgr96rf1oODnfjqBFmr1DVoc/TrItj3Ohe0Ah1C5WX5Baquw/9U9KovnQ88EqmJbD66rKYUQYN1tQ==" }, + "detect-file": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", + "dev": true + }, + "detect-indent": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.0.0.tgz", + "integrity": "sha512-oSyFlqaTHCItVRGK5RmrmjB+CmaMOW7IaNA/kdxqhoa6d17j/5ce9O9eWXmV/KEdRwqpQA+Vqe8a8Bsybu4YnA==", + "dev": true + }, "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", @@ -894,18 +1314,18 @@ "dev": true }, "dir-glob": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz", - "integrity": "sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "dev": true, "requires": { - "path-type": "^3.0.0" + "path-type": "^4.0.0" } }, "doctrine": { "version": "3.0.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha1-rd6+rXKmV023g2OdyHoSF3OXOWE=", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, "requires": { "esutils": "^2.0.2" @@ -928,101 +1348,172 @@ }, "error-ex": { "version": "1.3.2", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha1-tKxAZIEH/c3PriQvQovqihTU8b8=", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, "requires": { "is-arrayish": "^0.2.1" } }, + "es-abstract": { + "version": "1.17.0-next.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.0-next.1.tgz", + "integrity": "sha512-7MmGr03N7Rnuid6+wyhD9sHNE2n4tFSwExnU2lQl3lIo2ShXWGePY80zYaoMOmILWv57H0amMjZGHNzzGG70Rw==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.4", + "is-regex": "^1.0.4", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.0", + "string.prototype.trimright": "^2.1.0" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, - "escodegen": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", - "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", - "dev": true, - "requires": { - "esprima": "^2.7.1", - "estraverse": "^1.9.1", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.2.0" - }, - "dependencies": { - "source-map": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", - "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", - "dev": true, - "optional": true, - "requires": { - "amdefine": ">=0.0.4" - } - } - } - }, "eslint": { - "version": "5.16.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/eslint/-/eslint-5.16.0.tgz", - "integrity": "sha1-oeOsGq5KP72Clvz496tzFMu2q+o=", + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", + "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "ajv": "^6.9.1", + "ajv": "^6.10.0", "chalk": "^2.1.0", "cross-spawn": "^6.0.5", "debug": "^4.0.1", "doctrine": "^3.0.0", - "eslint-scope": "^4.0.3", - "eslint-utils": "^1.3.1", - "eslint-visitor-keys": "^1.0.0", - "espree": "^5.0.1", + "eslint-scope": "^5.0.0", + "eslint-utils": "^1.4.3", + "eslint-visitor-keys": "^1.1.0", + "espree": "^6.1.2", "esquery": "^1.0.1", "esutils": "^2.0.2", "file-entry-cache": "^5.0.1", "functional-red-black-tree": "^1.0.1", - "glob": "^7.1.2", - "globals": "^11.7.0", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", "ignore": "^4.0.6", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", - "inquirer": "^6.2.2", - "js-yaml": "^3.13.0", + "inquirer": "^7.0.0", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.3.0", - "lodash": "^4.17.11", + "lodash": "^4.17.14", "minimatch": "^3.0.4", "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", - "optionator": "^0.8.2", - "path-is-inside": "^1.0.2", + "optionator": "^0.8.3", "progress": "^2.0.0", "regexpp": "^2.0.1", - "semver": "^5.5.1", - "strip-ansi": "^4.0.0", - "strip-json-comments": "^2.0.1", + "semver": "^6.1.2", + "strip-ansi": "^5.2.0", + "strip-json-comments": "^3.0.1", "table": "^5.2.3", - "text-table": "^0.2.0" + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "eslint-scope": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", + "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-visitor-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", + "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", + "dev": true + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "strip-json-comments": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", + "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==", + "dev": true + } } }, "eslint-config-prettier": { - "version": "5.1.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/eslint-config-prettier/-/eslint-config-prettier-5.1.0.tgz", - "integrity": "sha1-vylELnyBgjanes/iJB7JkSmfm/E=", + "version": "6.10.1", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.10.1.tgz", + "integrity": "sha512-svTy6zh1ecQojvpbJSgH3aei/Rt7C6i090l5f2WQ4aB05lYHeZIR1qL4wZyyILTbtmnbHP5Yn8MrsOJMGa8RkQ==", "dev": true, "requires": { "get-stdin": "^6.0.0" } }, "eslint-scope": { - "version": "4.0.3", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/eslint-scope/-/eslint-scope-4.0.3.tgz", - "integrity": "sha1-ygODMxD2iJoyZHgaqC5j65z+eEg=", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", + "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", "dev": true, "requires": { "esrecurse": "^4.1.0", @@ -1030,9 +1521,9 @@ }, "dependencies": { "estraverse": { - "version": "4.2.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true } } @@ -1055,41 +1546,43 @@ } }, "eslint-visitor-keys": { - "version": "1.0.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", - "integrity": "sha1-PzGA+y4pEBdxastMnW1bXDSmqB0=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", + "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", "dev": true }, "espree": { - "version": "5.0.1", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/espree/-/espree-5.0.1.tgz", - "integrity": "sha1-XWUm+k/H8HiKXPdbFfMDI+L4H3o=", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", + "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", "dev": true, "requires": { - "acorn": "^6.0.7", - "acorn-jsx": "^5.0.0", - "eslint-visitor-keys": "^1.0.0" + "acorn": "^7.1.1", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", + "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", + "dev": true + } } }, - "esprima": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", - "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", - "dev": true - }, "esquery": { - "version": "1.0.1", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/esquery/-/esquery-1.0.1.tgz", - "integrity": "sha1-QGxRZYsfWZGl+bYrHcJbAOPlxwg=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.2.0.tgz", + "integrity": "sha512-weltsSqdeWIX9G2qQZz7KlTRJdkkOCTPgLYJUz1Hacf48R4YOwGPHO3+ORfWedqJKbq5WQmsgK90n+pFLIKt/Q==", "dev": true, "requires": { - "estraverse": "^4.0.0" + "estraverse": "^5.0.0" }, "dependencies": { "estraverse": { - "version": "4.2.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.0.0.tgz", + "integrity": "sha512-j3acdrMzqrxmJTNj5dbr1YbjacrYgAxVMeF0gK16E3j494mOe7xygM/ZLIguEQ0ETwAg2hlJCtHRGav+y0Ny5A==", "dev": true } } @@ -1111,12 +1604,6 @@ } } }, - "estraverse": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", - "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", - "dev": true - }, "esutils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", @@ -1124,18 +1611,63 @@ "dev": true }, "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "dev": true, - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.0.0.tgz", + "integrity": "sha512-JbDUxwV3BoT5ZVXQrSVbAiaXhXUkIwvbhPIwZ0N13kX+5yCzOhUNdocxB/UQRuYOHRYYwAxKYwJYc0T4D12pDA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.1.tgz", + "integrity": "sha512-u7v4o84SwFpD32Z8IIcPZ6z1/ie24O6RU3RbtL5Y316l3KuHVPx9ItBgWQ6VlfAFnRnTtMUrsQ9MUUTuEZjogg==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } } }, "expand-brackets": { @@ -1188,6 +1720,15 @@ } } }, + "expand-tilde": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "dev": true, + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, "extend-shallow": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", @@ -1210,9 +1751,9 @@ } }, "external-editor": { - "version": "3.0.3", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/external-editor/-/external-editor-3.0.3.tgz", - "integrity": "sha1-WGbbKal4Jtvkvzr9JAcOrZ6kOic=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", "dev": true, "requires": { "chardet": "^0.7.0", @@ -1286,52 +1827,15 @@ } }, "fast-deep-equal": { - "version": "2.0.1", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", + "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", "dev": true }, - "fast-glob": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz", - "integrity": "sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw==", - "dev": true, - "requires": { - "@mrmlnc/readdir-enhanced": "^2.2.1", - "@nodelib/fs.stat": "^1.1.2", - "glob-parent": "^3.1.0", - "is-glob": "^4.0.0", - "merge2": "^1.2.3", - "micromatch": "^3.1.10" - }, - "dependencies": { - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - } - } - }, "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, "fast-levenshtein": { @@ -1341,9 +1845,9 @@ "dev": true }, "figures": { - "version": "2.0.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/figures/-/figures-2.0.0.tgz", - "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "dev": true, "requires": { "escape-string-regexp": "^1.0.5" @@ -1351,50 +1855,192 @@ }, "file-entry-cache": { "version": "5.0.1", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/file-entry-cache/-/file-entry-cache-5.0.1.tgz", - "integrity": "sha1-yg9u+m3T1WEzP7FFFQZcL6/fQ5w=", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", "dev": true, "requires": { "flat-cache": "^2.0.1" } }, "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" + "to-regex-range": "^5.0.1" + } + }, + "find-node-modules": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/find-node-modules/-/find-node-modules-2.0.0.tgz", + "integrity": "sha512-8MWIBRgJi/WpjjfVXumjPKCtmQ10B+fjx6zmSA+770GMJirLhWIzg8l763rhjl9xaeaHbnxPNRQKq2mgMhr+aw==", + "dev": true, + "requires": { + "findup-sync": "^3.0.0", + "merge": "^1.2.1" + } + }, + "find-root": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", + "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==", + "dev": true + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "find-versions": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-3.2.0.tgz", + "integrity": "sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww==", + "dev": true, + "requires": { + "semver-regex": "^2.0.0" + } + }, + "findup-sync": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", + "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", + "dev": true, + "requires": { + "detect-file": "^1.0.0", + "is-glob": "^4.0.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" }, "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "dev": true, "requires": { - "is-extendable": "^0.1.0" + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" } } } }, - "find-up": { + "flat": { "version": "4.1.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha1-l6/n1s3AvFkoWEt8jXsW6KmqXRk=", + "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", + "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==", "dev": true, "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" + "is-buffer": "~2.0.3" } }, "flat-cache": { "version": "2.0.1", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/flat-cache/-/flat-cache-2.0.1.tgz", - "integrity": "sha1-XSltbwS9pEpGMKMBQTvbwuwIXsA=", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", "dev": true, "requires": { "flatted": "^2.0.0", @@ -1403,9 +2049,9 @@ } }, "flatted": { - "version": "2.0.1", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/flatted/-/flatted-2.0.1.tgz", - "integrity": "sha1-aeV8qo8OrLwoHS4stFjUb9tEngg=", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", "dev": true }, "for-in": { @@ -1424,14 +2070,15 @@ } }, "fs-extra": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.0.1.tgz", - "integrity": "sha512-W+XLrggcDzlle47X/XnS7FXrXu9sDo+Ze9zpndeBxdgv88FHLm1HtmkhEwavruS6koanBjp098rUpHs65EmG7A==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.0.tgz", + "integrity": "sha512-pmEYSk3vYsG/bF651KPUXZ+hvjpgWYw/Gc7W9NFUe3ZVLczKKWIij3IKpOrQcdw4TILtibFslZ0UmR8Vvzig4g==", "dev": true, "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^1.0.0" } }, "fs.realpath": { @@ -1440,12 +2087,31 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, + "fsevents": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.2.tgz", + "integrity": "sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==", + "dev": true, + "optional": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, "functional-red-black-tree": { "version": "1.0.1", "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, "get-func-name": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", @@ -1454,14 +2120,14 @@ }, "get-stdin": { "version": "6.0.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/get-stdin/-/get-stdin-6.0.0.tgz", - "integrity": "sha1-ngm/cSs2CrkiXoEgSPcf3pyJZXs=", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", "dev": true }, "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz", + "integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==", "dev": true, "requires": { "pump": "^3.0.0" @@ -1488,66 +2154,69 @@ } }, "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", "dev": true, "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "^2.1.0" - } - } + "is-glob": "^4.0.1" } }, - "glob-to-regexp": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", - "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=", - "dev": true + "global-dirs": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", + "integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=", + "dev": true, + "optional": true, + "requires": { + "ini": "^1.3.4" + } }, - "globals": { - "version": "11.12.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/globals/-/globals-11.12.0.tgz", - "integrity": "sha1-q4eVM4hooLq9hSV1gBjCp+uVxC4=", - "dev": true + "global-modules": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "dev": true, + "requires": { + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" + } + }, + "global-prefix": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", + "dev": true, + "requires": { + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" + } }, - "globby": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-9.2.0.tgz", - "integrity": "sha512-ollPHROa5mcxDEkwg6bPt3QbEf4pDQSNtd6JPL1YvOvAo/7/0VAm9TccUeoTmarjPw4pfUthSCqcyfNB1I3ZSg==", + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", "dev": true, "requires": { - "@types/glob": "^7.1.1", - "array-union": "^1.0.2", - "dir-glob": "^2.2.2", - "fast-glob": "^2.2.6", - "glob": "^7.1.3", - "ignore": "^4.0.3", - "pify": "^4.0.1", - "slash": "^2.0.0" + "type-fest": "^0.8.1" }, "dependencies": { - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true } } }, "graceful-fs": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", + "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", "dev": true }, "growl": { @@ -1556,24 +2225,13 @@ "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", "dev": true }, - "handlebars": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz", - "integrity": "sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==", + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, "requires": { - "neo-async": "^2.6.0", - "optimist": "^0.6.1", - "source-map": "^0.6.1", - "uglify-js": "^3.1.4" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } + "function-bind": "^1.1.1" } }, "has-flag": { @@ -1582,6 +2240,12 @@ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, "has-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", @@ -1603,6 +2267,32 @@ "kind-of": "^4.0.0" }, "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, "kind-of": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", @@ -1615,52 +2305,125 @@ } }, "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true }, - "hosted-git-info": { - "version": "2.7.1", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/hosted-git-info/-/hosted-git-info-2.7.1.tgz", - "integrity": "sha1-l/I2l3vW4SVAiTD/bePuxigewEc=", + "homedir-polyfill": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "dev": true, + "requires": { + "parse-passwd": "^1.0.0" + } + }, + "human-signals": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", + "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", "dev": true }, "husky": { - "version": "2.5.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/husky/-/husky-2.5.0.tgz", - "integrity": "sha1-/pg54Rjl2I4/HXEh1SVkdFYVgV4=", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/husky/-/husky-4.2.3.tgz", + "integrity": "sha512-VxTsSTRwYveKXN4SaH1/FefRJYCtx+wx04sSVcOpD7N2zjoHxa+cEJ07Qg5NmV3HAK+IRKOyNVpi2YBIVccIfQ==", "dev": true, "requires": { - "cosmiconfig": "^5.2.1", - "execa": "^1.0.0", - "get-stdin": "^7.0.0", - "is-ci": "^2.0.0", + "chalk": "^3.0.0", + "ci-info": "^2.0.0", + "compare-versions": "^3.5.1", + "cosmiconfig": "^6.0.0", + "find-versions": "^3.2.0", + "opencollective-postinstall": "^2.0.2", "pkg-dir": "^4.2.0", - "please-upgrade-node": "^3.1.1", - "read-pkg": "^5.1.1", - "run-node": "^1.0.0", - "slash": "^3.0.0" + "please-upgrade-node": "^3.2.0", + "slash": "^3.0.0", + "which-pm-runs": "^1.0.0" }, "dependencies": { - "get-stdin": { - "version": "7.0.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/get-stdin/-/get-stdin-7.0.0.tgz", - "integrity": "sha1-jV3pjxUXGhJcXlFmQ8em0OqKlvY=", - "dev": true + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } }, - "slash": { + "chalk": { "version": "3.0.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/slash/-/slash-3.0.0.tgz", - "integrity": "sha1-ZTm+hwwWWtvVJAIg2+Nh8bxNRjQ=", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true + }, + "cosmiconfig": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", + "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", + "dev": true, + "requires": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.1.0", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.7.2" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "parse-json": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.0.tgz", + "integrity": "sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1", + "lines-and-columns": "^1.1.6" + } + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } } } }, "iconv-lite": { "version": "0.4.24", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha1-ICK0sl+93CHS9SSXSkdKr+czkIs=", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, "requires": { "safer-buffer": ">= 2.1.2 < 3" @@ -1673,9 +2436,9 @@ "dev": true }, "import-fresh": { - "version": "3.0.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/import-fresh/-/import-fresh-3.0.0.tgz", - "integrity": "sha1-o9iX9CDKsOZxI2iX91vBS0iFw5A=", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", "dev": true, "requires": { "parent-module": "^1.0.0", @@ -1689,9 +2452,9 @@ "dev": true }, "indent-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true }, "inflight": { @@ -1710,44 +2473,135 @@ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true + }, "inquirer": { - "version": "6.4.1", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/inquirer/-/inquirer-6.4.1.tgz", - "integrity": "sha1-e9nlqwVnzSO0GwGAto4M+oL8PAs=", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.1.0.tgz", + "integrity": "sha512-5fJMWEmikSYu0nv/flMc475MhGbB7TSPd/2IpFV4I4rMklboCH2rQjYY5kKiYGHqUF9gvaambupcJFFG9dvReg==", "dev": true, "requires": { - "ansi-escapes": "^3.2.0", - "chalk": "^2.4.2", - "cli-cursor": "^2.1.0", + "ansi-escapes": "^4.2.1", + "chalk": "^3.0.0", + "cli-cursor": "^3.1.0", "cli-width": "^2.0.0", "external-editor": "^3.0.3", - "figures": "^2.0.0", - "lodash": "^4.17.11", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rxjs": "^6.4.0", - "string-width": "^2.1.0", - "strip-ansi": "^5.1.0", + "figures": "^3.0.0", + "lodash": "^4.17.15", + "mute-stream": "0.0.8", + "run-async": "^2.4.0", + "rxjs": "^6.5.3", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", "through": "^2.3.6" }, "dependencies": { "ansi-regex": { - "version": "4.1.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha1-i5+PCM8ay4Q3Vqg5yox+MWjFGZc=", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", "dev": true }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, "strip-ansi": { - "version": "5.2.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha1-jJpTb+tq/JYr36WxBKUJHBrZwK4=", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", "dev": true, "requires": { - "ansi-regex": "^4.1.0" + "ansi-regex": "^5.0.0" + } + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" } } } }, + "interpret": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz", + "integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==", + "dev": true + }, "is-accessor-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", @@ -1757,6 +2611,12 @@ "kind-of": "^3.0.2" }, "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", @@ -1774,21 +2634,27 @@ "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "is-ci": { - "version": "2.0.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha1-a8YzQYGBDgS1wis9WJ/cpVAmQEw=", + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, "requires": { - "ci-info": "^2.0.0" + "binary-extensions": "^2.0.0" } }, + "is-buffer": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", + "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==", + "dev": true + }, + "is-callable": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", + "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", + "dev": true + }, "is-data-descriptor": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", @@ -1798,6 +2664,12 @@ "kind-of": "^3.0.2" }, "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", @@ -1809,6 +2681,12 @@ } } }, + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", + "dev": true + }, "is-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", @@ -1832,7 +2710,8 @@ "version": "0.3.1", "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/is-directory/-/is-directory-0.3.1.tgz", "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", - "dev": true + "dev": true, + "optional": true }, "is-extendable": { "version": "0.1.1", @@ -1862,24 +2741,10 @@ } }, "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true }, "is-plain-object": { "version": "2.0.4", @@ -1896,10 +2761,34 @@ "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", "dev": true }, + "is-regex": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", "dev": true }, "is-windows": { @@ -1926,58 +2815,6 @@ "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", "dev": true }, - "istanbul": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.4.5.tgz", - "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", - "dev": true, - "requires": { - "abbrev": "1.0.x", - "async": "1.x", - "escodegen": "1.8.x", - "esprima": "2.7.x", - "glob": "^5.0.15", - "handlebars": "^4.0.1", - "js-yaml": "3.x", - "mkdirp": "0.5.x", - "nopt": "3.x", - "once": "1.x", - "resolve": "1.1.x", - "supports-color": "^3.1.0", - "which": "^1.1.1", - "wordwrap": "^1.0.0" - }, - "dependencies": { - "glob": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", - "dev": true, - "requires": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, "js-tokens": { "version": "4.0.0", "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/js-tokens/-/js-tokens-4.0.0.tgz", @@ -2004,14 +2841,14 @@ }, "json-parse-better-errors": { "version": "1.0.2", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha1-u4Z8+zRQ5pEHwTHRxRS6s9yLyqk=", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true }, "json-schema-traverse": { "version": "0.4.1", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha1-afaofZUTq4u4/mO9sJecRI5oRmA=", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, "json-stable-stringify-without-jsonify": { @@ -2021,18 +2858,19 @@ "dev": true }, "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz", + "integrity": "sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==", "dev": true, "requires": { - "graceful-fs": "^4.1.6" + "graceful-fs": "^4.1.6", + "universalify": "^1.0.0" } }, "just-extend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.0.2.tgz", - "integrity": "sha512-FrLwOgm+iXrPV+5zDU6Jqu4gCRXbWEQg2O3SKONsWE4w7AXFRkryS53bpWdaL9cNol+AmR3AEYz6kn+o0fCPnw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.1.0.tgz", + "integrity": "sha512-ApcjaOdVTJ7y4r08xI5wIqpvwS48Q0PBG4DJROcEkH1f8MdAiNFyFxz3xoL0LWAVwjrwPYZdVHHxhRHcx/uGLA==", "dev": true }, "kind-of": { @@ -2051,13 +2889,20 @@ "type-check": "~0.3.2" } }, + "lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "dev": true + }, "locate-path": { - "version": "5.0.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha1-Gvujlq/WdqbUJQTQpno6frn2KqA=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", "dev": true, "requires": { - "p-locate": "^4.1.0" + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" } }, "lodash": { @@ -2076,44 +2921,37 @@ "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=" }, + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", + "dev": true + }, "lodash.map": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz", "integrity": "sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=", "dev": true }, - "lodash.unescape": { - "version": "4.0.1", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/lodash.unescape/-/lodash.unescape-4.0.1.tgz", - "integrity": "sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw=", - "dev": true - }, - "lolex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-4.1.0.tgz", - "integrity": "sha512-BYxIEXiVq5lGIXeVHnsFzqa1TxN5acnKnPCdlZSpzm8viNEOhiigupA4vTQ9HEFQ6nLTQ9wQOgBknJgzUYQ9Aw==", - "dev": true - }, - "longest": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", - "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", - "dev": true - }, - "lru-cache": { - "version": "4.1.5", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha1-i75Q6oW+1ZvJ4z3KuCNe6bz0Q80=", + "log-symbols": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", + "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", "dev": true, "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" + "chalk": "^2.4.2" } }, + "longest": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-2.0.1.tgz", + "integrity": "sha1-eB4YMpaqlPbU2RbcM10NF676I/g=", + "dev": true + }, "make-error": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz", - "integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==", + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, "map-cache": { @@ -2131,10 +2969,16 @@ "object-visit": "^1.0.0" } }, - "merge2": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.2.3.tgz", - "integrity": "sha512-gdUU1Fwj5ep4kplwcmftruWofEFt6lfpkkr3h860CXbAB9c3hGb55EOL2ali0Td5oebvW0E1+3Sr+Ur7XfKpRA==", + "merge": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/merge/-/merge-1.2.1.tgz", + "integrity": "sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ==", + "dev": true + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, "micromatch": { @@ -2145,47 +2989,12 @@ "requires": { "braces": "^3.0.1", "picomatch": "^2.0.5" - }, - "dependencies": { - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - } } }, "mimic-fn": { - "version": "1.2.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha1-ggyGo5M0ZA6ZUWkovQP8qIBX0CI=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true }, "minimatch": { @@ -2197,12 +3006,6 @@ "brace-expansion": "^1.1.7" } }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - }, "mixin-deep": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", @@ -2225,46 +3028,67 @@ } }, "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, "requires": { - "minimist": "0.0.8" + "minimist": "^1.2.5" + }, + "dependencies": { + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + } } }, "mocha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", - "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.1.1.tgz", + "integrity": "sha512-3qQsu3ijNS3GkWcccT5Zw0hf/rWvu1fTN9sPvEd81hlwsr30GX2GcDSSoBxo24IR8FelmrAydGC6/1J5QQP4WA==", "dev": true, "requires": { + "ansi-colors": "3.2.3", "browser-stdout": "1.3.1", - "commander": "2.15.1", - "debug": "3.1.0", + "chokidar": "3.3.0", + "debug": "3.2.6", "diff": "3.5.0", "escape-string-regexp": "1.0.5", - "glob": "7.1.2", + "find-up": "3.0.0", + "glob": "7.1.3", "growl": "1.10.5", - "he": "1.1.1", + "he": "1.2.0", + "js-yaml": "3.13.1", + "log-symbols": "3.0.0", "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "supports-color": "5.4.0" + "mkdirp": "0.5.3", + "ms": "2.1.1", + "node-environment-flags": "1.0.6", + "object.assign": "4.1.0", + "strip-json-comments": "2.0.1", + "supports-color": "6.0.0", + "which": "1.3.1", + "wide-align": "1.1.3", + "yargs": "13.3.2", + "yargs-parser": "13.1.2", + "yargs-unparser": "1.6.0" }, "dependencies": { "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -2275,18 +3099,42 @@ "path-is-absolute": "^1.0.0" } }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "mkdirp": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.3.tgz", + "integrity": "sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true + }, + "supports-color": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", + "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } } } }, "mri": { - "version": "1.1.4", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/mri/-/mri-1.1.4.tgz", - "integrity": "sha1-fLHdG5tAkF8frAU6viW2cg9EdEo=", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.5.tgz", + "integrity": "sha512-d2RKzMD4JNyHMbnbWnznPaa8vbdlq/4pNZ3IgdaGrVbBhebBsGUUE/6qorTMYNS6TwuH3ilfOlD2bf4Igh8CKg==", "dev": true }, "ms": { @@ -2295,21 +3143,22 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "multimatch": { - "version": "3.0.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/multimatch/-/multimatch-3.0.0.tgz", - "integrity": "sha1-DiU0zGvCONmrZ+G5zV/Nhabb9ws=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz", + "integrity": "sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==", "dev": true, "requires": { - "array-differ": "^2.0.3", - "array-union": "^1.0.2", - "arrify": "^1.0.1", + "@types/minimatch": "^3.0.3", + "array-differ": "^3.0.0", + "array-union": "^2.1.0", + "arrify": "^2.0.1", "minimatch": "^3.0.4" } }, "mute-stream": { - "version": "0.0.7", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", "dev": true }, "nanomatch": { @@ -2337,12 +3186,6 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, - "neo-async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", - "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", - "dev": true - }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -2350,59 +3193,51 @@ "dev": true }, "nise": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/nise/-/nise-1.5.0.tgz", - "integrity": "sha512-Z3sfYEkLFzFmL8KY6xnSJLRxwQwYBjOXi/24lb62ZnZiGA0JUzGGTI6TBIgfCSMIDl9Jlu8SRmHNACLTemDHww==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/nise/-/nise-4.0.3.tgz", + "integrity": "sha512-EGlhjm7/4KvmmE6B/UFsKh7eHykRl9VH+au8dduHLCyWUO/hr7+N+WtTvDUwc9zHuM1IaIJs/0lQ6Ag1jDkQSg==", "dev": true, "requires": { - "@sinonjs/formatio": "^3.1.0", + "@sinonjs/commons": "^1.7.0", + "@sinonjs/fake-timers": "^6.0.0", "@sinonjs/text-encoding": "^0.7.1", "just-extend": "^4.0.2", - "lolex": "^4.1.0", "path-to-regexp": "^1.7.0" } }, - "nopt": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "node-environment-flags": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.6.tgz", + "integrity": "sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw==", "dev": true, "requires": { - "abbrev": "1" + "object.getownpropertydescriptors": "^2.0.3", + "semver": "^5.7.0" } }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha1-5m2xg4sgDB38IzIl0SyzZSDiNKg=", + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" + "path-key": "^3.0.0" }, "dependencies": { - "resolve": { - "version": "1.11.1", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/resolve/-/resolve-1.11.1.tgz", - "integrity": "sha1-6hDYEQN2mC/vV434/DC5rDCgej4=", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true } } }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "dev": true, - "requires": { - "path-key": "^2.0.0" - } - }, "object-copy": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", @@ -2423,6 +3258,12 @@ "is-descriptor": "^0.1.0" } }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", @@ -2434,6 +3275,18 @@ } } }, + "object-inspect": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==", + "dev": true + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, "object-visit": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", @@ -2443,6 +3296,28 @@ "isobject": "^3.0.0" } }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, + "object.getownpropertydescriptors": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", + "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" + } + }, "object.pick": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", @@ -2462,45 +3337,19 @@ } }, "onetime": { - "version": "2.0.1", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", - "dev": true, - "requires": { - "mimic-fn": "^1.0.0" - } - }, - "optimist": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", + "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", "dev": true, "requires": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" - }, - "dependencies": { - "wordwrap": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", - "dev": true - } + "mimic-fn": "^2.1.0" } }, - "optionator": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", - "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", - "dev": true, - "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.4", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "wordwrap": "~1.0.0" - } + "opencollective-postinstall": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz", + "integrity": "sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw==", + "dev": true }, "os-tmpdir": { "version": "1.0.2", @@ -2508,28 +3357,22 @@ "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true - }, "p-limit": { - "version": "2.2.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/p-limit/-/p-limit-2.2.0.tgz", - "integrity": "sha1-QXyZQeYCepq8ulCS3SkE4lW1+8I=", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.2.tgz", + "integrity": "sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ==", "dev": true, "requires": { "p-try": "^2.0.0" } }, "p-locate": { - "version": "4.1.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha1-o0KLtwiLOmApL2aRkni3wpetTwc=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", "dev": true, "requires": { - "p-limit": "^2.2.0" + "p-limit": "^2.0.0" } }, "p-reduce": { @@ -2540,14 +3383,14 @@ }, "p-try": { "version": "2.2.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha1-yyhoVA4xPWHeWPr741zpAE1VQOY=", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, "parent-module": { "version": "1.0.1", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha1-aR0nCeeMefrjoVZiJFLQB2LKqqI=", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, "requires": { "callsites": "^3.0.0" @@ -2558,27 +3401,28 @@ "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/parse-json/-/parse-json-4.0.0.tgz", "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", "dev": true, + "optional": true, "requires": { "error-ex": "^1.3.1", "json-parse-better-errors": "^1.0.1" } }, + "parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "dev": true + }, "pascalcase": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", "dev": true }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", - "dev": true - }, "path-exists": { - "version": "4.0.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha1-UTvb4tO5XXdi6METfvoZXGxhtbM=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", "dev": true }, "path-is-absolute": { @@ -2587,28 +3431,16 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, - "path-is-inside": { - "version": "1.0.2", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", - "dev": true - }, "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", "dev": true }, - "path-parse": { - "version": "1.0.6", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha1-1i27VnlAXXLEc37FhgDp3c8G0kw=", - "dev": true - }, "path-to-regexp": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", - "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", + "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", "dev": true, "requires": { "isarray": "0.0.1" @@ -2623,13 +3455,10 @@ } }, "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, - "requires": { - "pify": "^3.0.0" - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true }, "pathval": { "version": "1.1.0", @@ -2638,30 +3467,60 @@ "dev": true }, "picomatch": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.0.7.tgz", - "integrity": "sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA==", - "dev": true - }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", "dev": true }, "pkg-dir": { "version": "4.2.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha1-8JkTPfft5CLoHR2ESCcO6z5CYfM=", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, "requires": { "find-up": "^4.0.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + } } }, "please-upgrade-node": { - "version": "3.1.1", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/please-upgrade-node/-/please-upgrade-node-3.1.1.tgz", - "integrity": "sha1-7TIAUd/MUCT65pZxLIKImTWV6Kw=", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", + "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", "dev": true, "requires": { "semver-compare": "^1.0.0" @@ -2680,124 +3539,165 @@ "dev": true }, "prettier": { - "version": "1.18.2", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/prettier/-/prettier-1.18.2.tgz", - "integrity": "sha1-aCPnxZAAF7S9Os9G/prEtNe9qeo=", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.2.tgz", + "integrity": "sha512-5xJQIPT8BraI7ZnaDwSbu5zLrB6vvi8hVV58yHQ+QK64qrY40dULy0HSRlQ2/2IdzeBpjhDkqdcFBnFeDEMVdg==", "dev": true }, "pretty-quick": { - "version": "1.11.1", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/pretty-quick/-/pretty-quick-1.11.1.tgz", - "integrity": "sha1-Ri/6K5PSTAW3oMOgAeCGAaDFXuQ=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pretty-quick/-/pretty-quick-2.0.1.tgz", + "integrity": "sha512-y7bJt77XadjUr+P1uKqZxFWLddvj3SKY6EU4BuQtMxmmEFSMpbN132pUWdSG1g1mtUfO0noBvn7wBf0BVeomHg==", "dev": true, "requires": { - "chalk": "^2.3.0", - "execa": "^0.8.0", - "find-up": "^2.1.0", - "ignore": "^3.3.7", - "mri": "^1.1.0", - "multimatch": "^3.0.0" + "chalk": "^2.4.2", + "execa": "^2.1.0", + "find-up": "^4.1.0", + "ignore": "^5.1.4", + "mri": "^1.1.4", + "multimatch": "^4.0.0" }, "dependencies": { "cross-spawn": { - "version": "5.1.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.1.tgz", + "integrity": "sha512-u7v4o84SwFpD32Z8IIcPZ6z1/ie24O6RU3RbtL5Y316l3KuHVPx9ItBgWQ6VlfAFnRnTtMUrsQ9MUUTuEZjogg==", "dev": true, "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" } }, "execa": { - "version": "0.8.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/execa/-/execa-0.8.0.tgz", - "integrity": "sha1-2NdrvBtVIX7RkP1t1J08d07PyNo=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-2.1.0.tgz", + "integrity": "sha512-Y/URAVapfbYy2Xp/gb6A0E7iR8xeqOCXsuuaoMn7A5PzrXUK84E1gyiEfq0wQd/GHA6GsoHWwhNq8anb0mleIw==", "dev": true, "requires": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^3.0.0", + "onetime": "^5.1.0", + "p-finally": "^2.0.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" } }, "find-up": { - "version": "2.1.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "requires": { - "locate-path": "^2.0.0" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" } }, "get-stream": { - "version": "3.0.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "dev": true + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz", + "integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } }, "ignore": { - "version": "3.3.10", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/ignore/-/ignore-3.3.10.tgz", - "integrity": "sha1-Cpf7h2mG6AgcYxFg+PnziRV/AEM=", + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.4.tgz", + "integrity": "sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A==", "dev": true }, - "locate-path": { + "is-stream": { "version": "2.0.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" + "p-locate": "^4.1.0" } }, - "p-limit": { - "version": "1.3.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha1-uGvV8MJWkJEcdZD8v8IBDVSzzLg=", + "npm-run-path": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-3.1.0.tgz", + "integrity": "sha512-Dbl4A/VfiVGLgQv29URL9xshU8XDY1GeLy+fsaZ1AA8JDSfjvr5P5+pzRbWqRSBxk6/DW7MIh8lTM/PaGnP2kg==", "dev": true, "requires": { - "p-try": "^1.0.0" + "path-key": "^3.0.0" } }, + "p-finally": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-2.0.1.tgz", + "integrity": "sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw==", + "dev": true + }, "p-locate": { - "version": "2.0.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "requires": { - "p-limit": "^1.1.0" + "p-limit": "^2.2.0" } }, - "p-try": { - "version": "1.0.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true }, - "path-exists": { + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { "version": "3.0.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } } } }, "progress": { "version": "2.0.3", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/progress/-/progress-2.0.3.tgz", - "integrity": "sha1-foz42PW48jnBvGi+tOt4Vn1XLvg=", - "dev": true - }, - "pseudomap": { - "version": "1.0.2", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, "pump": { @@ -2812,20 +3712,26 @@ }, "punycode": { "version": "2.1.1", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha1-tYsBCsQMIsVldhbI0sLALHv0eew=", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, - "read-pkg": { - "version": "5.1.1", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/read-pkg/-/read-pkg-5.1.1.tgz", - "integrity": "sha1-XPI03eekBckMiKUZq3PEZ+nLg/U=", + "readdirp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", + "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", + "dev": true, + "requires": { + "picomatch": "^2.0.4" + } + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", "dev": true, "requires": { - "@types/normalize-package-data": "^2.4.0", - "normalize-package-data": "^2.5.0", - "parse-json": "^4.0.0", - "type-fest": "^0.4.1" + "resolve": "^1.1.6" } }, "redis-commands": { @@ -2846,6 +3752,13 @@ "redis-errors": "^1.0.0" } }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true, + "optional": true + }, "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", @@ -2874,18 +3787,50 @@ "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", "dev": true }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, "resolve": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", "dev": true }, + "resolve-dir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", + "dev": true, + "requires": { + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" + } + }, "resolve-from": { "version": "4.0.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha1-SrzYUq0y3Xuqv+m0DgCjbbXzkuY=", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, + "resolve-global": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-global/-/resolve-global-1.0.0.tgz", + "integrity": "sha512-zFa12V4OLtT5XUX/Q4VLvTfBf+Ok0SPc1FNGM/z9ctUdiU618qwKpWnd0CHs3+RqROfyEg/DhuHbMWYqcgljEw==", + "dev": true, + "optional": true, + "requires": { + "global-dirs": "^0.1.1" + } + }, "resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", @@ -2893,19 +3838,19 @@ "dev": true }, "restore-cursor": { - "version": "2.0.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "dev": true, "requires": { - "onetime": "^2.0.0", + "onetime": "^5.1.0", "signal-exit": "^3.0.2" }, "dependencies": { "signal-exit": { - "version": "3.0.2", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", "dev": true } } @@ -2924,32 +3869,26 @@ }, "rimraf": { "version": "2.6.3", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha1-stEE/g2Psnz54KHNqCYt04M8bKs=", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "dev": true, "requires": { "glob": "^7.1.3" } }, "run-async": { - "version": "2.3.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/run-async/-/run-async-2.3.0.tgz", - "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.0.tgz", + "integrity": "sha512-xJTbh/d7Lm7SBhc1tNvTpeCHaEzoyxPrqNlvSdMfBTYwaY++UJFyXUOxAtsRUXjlqOfj8luNaR9vjCh4KeV+pg==", "dev": true, "requires": { "is-promise": "^2.1.0" } }, - "run-node": { - "version": "1.0.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/run-node/-/run-node-1.0.0.tgz", - "integrity": "sha1-RrULlGoqotSUeuHYhumFb9nKvl4=", - "dev": true - }, "rxjs": { - "version": "6.5.2", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/rxjs/-/rxjs-6.5.2.tgz", - "integrity": "sha1-LjXOgVzUbYTQKiCftOWSHgUdvsc=", + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.5.tgz", + "integrity": "sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ==", "dev": true, "requires": { "tslib": "^1.9.0" @@ -2966,8 +3905,8 @@ }, "safer-buffer": { "version": "2.1.2", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo=", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, "semver": { @@ -2982,12 +3921,24 @@ "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", "dev": true }, + "semver-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-2.0.0.tgz", + "integrity": "sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw==", + "dev": true + }, "server-destroy": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/server-destroy/-/server-destroy-1.0.1.tgz", "integrity": "sha1-8Tv5KOQrnD55OD5hzDmYtdFObN0=", "dev": true }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, "set-value": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", @@ -3026,48 +3977,71 @@ "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, + "shelljs": { + "version": "0.7.6", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.6.tgz", + "integrity": "sha1-N5zM+1a5HIYB5HkzVutTgpJN6a0=", + "dev": true, + "requires": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + } + }, "signal-exit": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.1.tgz", - "integrity": "sha1-WkyISZK2OnrNm623iUw+6c/MrYE=", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", "dev": true }, "sinon": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-7.3.2.tgz", - "integrity": "sha512-thErC1z64BeyGiPvF8aoSg0LEnptSaWE7YhdWWbWXgelOyThent7uKOnnEh9zBxDbKixtr5dEko+ws1sZMuFMA==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.4.0", - "@sinonjs/formatio": "^3.2.1", - "@sinonjs/samsam": "^3.3.1", - "diff": "^3.5.0", - "lolex": "^4.0.1", - "nise": "^1.4.10", - "supports-color": "^5.5.0" + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-9.0.1.tgz", + "integrity": "sha512-iTTyiQo5T94jrOx7X7QLBZyucUJ2WvL9J13+96HMfm2CGoJYbIPqRfl6wgNcqmzk0DI28jeGx5bUTXizkrqBmg==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.7.0", + "@sinonjs/fake-timers": "^6.0.0", + "@sinonjs/formatio": "^5.0.1", + "@sinonjs/samsam": "^5.0.3", + "diff": "^4.0.2", + "nise": "^4.0.1", + "supports-color": "^7.1.0" }, "dependencies": { + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" } } } }, "slash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", - "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true }, "slice-ansi": { "version": "2.1.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/slice-ansi/-/slice-ansi-2.1.0.tgz", - "integrity": "sha1-ys12k0YaY3pXiNkqfdT7oGjoFjY=", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", "dev": true, "requires": { "ansi-styles": "^3.2.0", @@ -3123,6 +4097,12 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true } } }, @@ -3186,6 +4166,12 @@ "kind-of": "^3.2.0" }, "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", @@ -3198,18 +4184,18 @@ } }, "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true }, "source-map-resolve": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", - "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", "dev": true, "requires": { - "atob": "^2.1.1", + "atob": "^2.1.2", "decode-uri-component": "^0.2.0", "resolve-url": "^0.2.1", "source-map-url": "^0.4.0", @@ -3217,21 +4203,13 @@ } }, "source-map-support": { - "version": "0.5.12", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", - "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz", + "integrity": "sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==", "dev": true, "requires": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } } }, "source-map-url": { @@ -3240,38 +4218,6 @@ "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", "dev": true }, - "spdx-correct": { - "version": "3.1.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha1-+4PlBERSaPFUsHTiGMh8ADzTHfQ=", - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.2.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha1-LqRQrudPKom/uUUZwH/Nb0EyKXc=", - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha1-meEZt6XaAOBUkcn6M4t5BII7QdA=", - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.4", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz", - "integrity": "sha1-dezRqI3owYTvAV6vtRtbSL/RG7E=", - "dev": true - }, "split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", @@ -3323,6 +4269,132 @@ "strip-ansi": "^4.0.0" } }, + "string.prototype.trimend": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.0.tgz", + "integrity": "sha512-EEJnGqa/xNfIg05SxiPSqRS7S9qwDhYts1TSLR1BQfYUfPe1stofgGKvwERK9+9yf+PpfBMlpBaCHucXGPQfUA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", + "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" + } + } + } + }, + "string.prototype.trimleft": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz", + "integrity": "sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5", + "string.prototype.trimstart": "^1.0.0" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", + "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" + } + } + } + }, + "string.prototype.trimright": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz", + "integrity": "sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5", + "string.prototype.trimend": "^1.0.0" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", + "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" + } + } + } + }, + "string.prototype.trimstart": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.0.tgz", + "integrity": "sha512-iCP8g01NFYiiBOnwG1Xc3WZLyoo+RuBymwIlWncShXDDJYWN6DbnM3odslBJdgCdRlq94B5s63NWAZlcn2CS4w==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", + "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" + } + } + } + }, "strip-ansi": { "version": "4.0.0", "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/strip-ansi/-/strip-ansi-4.0.0.tgz", @@ -3332,10 +4404,16 @@ "ansi-regex": "^3.0.0" } }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true + }, + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "dev": true }, "strip-json-comments": { @@ -3354,27 +4432,27 @@ } }, "table": { - "version": "5.4.1", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/table/-/table-5.4.1.tgz", - "integrity": "sha1-BpGuLr6CWYWO+2PlULbV+TABceg=", + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", "dev": true, "requires": { - "ajv": "^6.9.1", - "lodash": "^4.17.11", + "ajv": "^6.10.2", + "lodash": "^4.17.14", "slice-ansi": "^2.1.0", "string-width": "^3.0.0" }, "dependencies": { "ansi-regex": { "version": "4.1.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha1-i5+PCM8ay4Q3Vqg5yox+MWjFGZc=", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, "string-width": { "version": "3.1.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha1-InZ74htirxCBV0MG9prFG2IgOWE=", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, "requires": { "emoji-regex": "^7.0.1", @@ -3384,8 +4462,8 @@ }, "strip-ansi": { "version": "5.2.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha1-jJpTb+tq/JYr36WxBKUJHBrZwK4=", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { "ansi-regex": "^4.1.0" @@ -3407,8 +4485,8 @@ }, "tmp": { "version": "0.0.33", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha1-bTQzWIl2jSGyvNoKonfO07G/rfk=", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "dev": true, "requires": { "os-tmpdir": "~1.0.2" @@ -3423,6 +4501,12 @@ "kind-of": "^3.0.2" }, "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", @@ -3447,32 +4531,31 @@ } }, "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" + "is-number": "^7.0.0" } }, "ts-node": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.2.0.tgz", - "integrity": "sha512-m8XQwUurkbYqXrKqr3WHCW310utRNvV5OnRVeISeea7LoCWVcdfeB/Ntl8JYWFh+WRoUAdBgESrzKochQt7sMw==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.8.1.tgz", + "integrity": "sha512-10DE9ONho06QORKAaCBpPiFCdW+tZJuY/84tyypGtl6r+/C7Asq0dhqbRZURuUlLQtZxxDvT8eoj8cGW0ha6Bg==", "dev": true, "requires": { "arg": "^4.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", "source-map-support": "^0.5.6", - "yn": "^3.0.0" + "yn": "3.1.1" }, "dependencies": { "diff": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz", - "integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true } } @@ -3484,9 +4567,9 @@ "dev": true }, "tsutils": { - "version": "3.14.0", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/tsutils/-/tsutils-3.14.0.tgz", - "integrity": "sha1-v41ae65TaTMfoPKwpaEL1/c5bHc=", + "version": "3.17.1", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.17.1.tgz", + "integrity": "sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==", "dev": true, "requires": { "tslib": "^1.8.1" @@ -3507,45 +4590,12 @@ "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true }, - "type-fest": { - "version": "0.4.1", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/type-fest/-/type-fest-0.4.1.tgz", - "integrity": "sha1-i993dDOF2KTxO6lfYQ9czWjHKPg=", - "dev": true - }, "typescript": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.1.tgz", - "integrity": "sha512-64HkdiRv1yYZsSe4xC1WVgamNigVYjlssIoaH2HcZF0+ijsk5YK2g0G34w9wJkze8+5ow4STd22AynfO6ZYYLw==", + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", + "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", "dev": true }, - "uglify-js": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz", - "integrity": "sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==", - "dev": true, - "optional": true, - "requires": { - "commander": "~2.20.0", - "source-map": "~0.6.1" - }, - "dependencies": { - "commander": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", - "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", - "dev": true, - "optional": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "optional": true - } - } - }, "union-value": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", @@ -3559,9 +4609,9 @@ } }, "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", + "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==", "dev": true }, "unset-value": { @@ -3606,8 +4656,8 @@ }, "uri-js": { "version": "4.2.2", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha1-lMVA4f93KVbiKZUHwBCupsiDjrA=", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", "dev": true, "requires": { "punycode": "^2.1.0" @@ -3625,15 +4675,11 @@ "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", "dev": true }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha1-/JH2uce6FchX9MssXe/uw51PQQo=", - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } + "v8-compile-cache": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz", + "integrity": "sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==", + "dev": true }, "which": { "version": "1.3.1", @@ -3644,17 +4690,71 @@ "isexe": "^2.0.0" } }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "which-pm-runs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", + "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", + "dev": true + }, + "wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "dev": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true }, - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", - "dev": true + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } }, "wrappy": { "version": "1.0.2", @@ -3664,23 +4764,107 @@ }, "write": { "version": "1.0.3", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/write/-/write-1.0.3.tgz", - "integrity": "sha1-CADhRSO5I6OH5BUSPIZWFqrg9cM=", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", "dev": true, "requires": { "mkdirp": "^0.5.1" } }, - "yallist": { - "version": "2.1.2", - "resolved": "http://artprod.dev.bloomberg.com/artifactory/api/npm/npm-repos/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "dev": true }, + "yaml": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.8.3.tgz", + "integrity": "sha512-X/v7VDnK+sxbQ2Imq4Jt2PRUsRsP7UcpSl3Llg6+NRRqWLIvxkMFYtH1FmvwNGYRKKPa+EPA4qDBlI9WVG1UKw==", + "dev": true, + "requires": { + "@babel/runtime": "^7.8.7" + } + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + }, + "yargs-unparser": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", + "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", + "dev": true, + "requires": { + "flat": "^4.1.0", + "lodash": "^4.17.15", + "yargs": "^13.3.0" + }, + "dependencies": { + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + } + } + }, "yn": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.0.tgz", - "integrity": "sha512-kKfnnYkbTfrAdd0xICNFw7Atm8nKpLcLv9AZGEt+kczL/WQVai4e2V6ZN8U/O+iI6WrNuJjNNOyu4zfhl9D3Hg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", "dev": true } } diff --git a/package.json b/package.json index 32017ab8..b01963b9 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,6 @@ ], "scripts": { "test": "TS_NODE_TRANSPILE_ONLY=true TS_NODE_LOG_ERROR=true NODE_ENV=test mocha \"test/**/*.ts\"", - "test:cov": "TS_NODE_TRANSPILE_ONLY=true TS_NODE_LOG_ERROR=true NODE_ENV=test node ./node_modules/istanbul/lib/cli.js cover --preserve-comments ./node_modules/mocha/bin/_mocha -- -r ts-node/register -R spec --exit \"test/**/*.ts\"", "lint": "eslint --ext .js,.ts .", "format": "prettier --write \"{,!(node_modules)/**/}*.{js,ts}\"", "format-check": "prettier --check \"{,!(node_modules)/**/}*.{js,ts}\"", @@ -45,33 +44,32 @@ "standard-as-callback": "^2.0.1" }, "devDependencies": { - "@semantic-release/changelog": "^3.0.4", - "@semantic-release/git": "^7.0.12", - "@types/bluebird": "^3.5.27", - "@types/chai": "^4.1.7", - "@types/debug": "^4.1.4", + "@semantic-release/changelog": "^5.0.1", + "@semantic-release/git": "^9.0.0", + "@types/bluebird": "^3.5.30", + "@types/chai": "^4.2.11", + "@types/debug": "^4.1.5", "@types/lodash.defaults": "^4.2.6", "@types/lodash.flatten": "^4.4.6", - "@types/mocha": "^5.2.7", - "@types/node": "^12.0.2", + "@types/mocha": "^7.0.2", + "@types/node": "^13.11.0", "@types/redis-errors": "1.2.0", - "@types/sinon": "^7.0.13", - "@typescript-eslint/eslint-plugin": "^1.11.0", - "@typescript-eslint/parser": "^1.11.0", - "bluebird": "^3.5.4", + "@types/sinon": "^9.0.0", + "@typescript-eslint/eslint-plugin": "^2.26.0", + "@typescript-eslint/parser": "^2.26.0", + "bluebird": "^3.7.2", "chai": "^4.2.0", - "cz-conventional-changelog": "^2.0.0", - "eslint": "^5.16.0", - "eslint-config-prettier": "^5.1.0", - "husky": "^2.5.0", - "istanbul": "^0.4.5", - "mocha": "^5.0.0", - "prettier": "^1.18.2", - "pretty-quick": "^1.11.1", + "cz-conventional-changelog": "^3.1.0", + "eslint": "^6.8.0", + "eslint-config-prettier": "^6.10.1", + "husky": "^4.2.3", + "mocha": "^7.1.1", + "prettier": "^2.0.2", + "pretty-quick": "^2.0.1", "server-destroy": "^1.0.1", - "sinon": "^7.3.2", - "ts-node": "^8.1.0", - "typescript": "^3.5.1" + "sinon": "^9.0.1", + "ts-node": "^8.8.1", + "typescript": "^3.8.3" }, "engines": { "node": ">=6" @@ -85,5 +83,11 @@ "hooks": { "pre-commit": "pretty-quick --staged" } + }, + "mocha": { + "exit": true, + "timeout": 8000, + "recursive": true, + "require": "ts-node/register" } } diff --git a/test/functional/auth.ts b/test/functional/auth.ts index a67862bb..92c7d065 100644 --- a/test/functional/auth.ts +++ b/test/functional/auth.ts @@ -3,10 +3,10 @@ import { expect } from "chai"; import Redis from "../../lib/redis"; import * as sinon from "sinon"; -describe("auth", function() { - it("should send auth before other commands", function(done) { - var authed = false; - new MockServer(17379, argv => { +describe("auth", function () { + it("should send auth before other commands", function (done) { + let authed = false; + new MockServer(17379, (argv) => { if (argv[0] === "auth" && argv[1] === "pass") { authed = true; } else if (argv[0] === "get" && argv[1] === "foo") { @@ -16,13 +16,13 @@ describe("auth", function() { } }); var redis = new Redis({ port: 17379, password: "pass" }); - redis.get("foo").catch(function() {}); + redis.get("foo").catch(function () {}); }); - it("should resend auth after reconnect", function(done) { - var begin = false; - var authed = false; - new MockServer(17379, function(argv) { + it("should resend auth after reconnect", function (done) { + let begin = false; + let authed = false; + new MockServer(17379, function (argv) { if (!begin) { return; } @@ -35,28 +35,28 @@ describe("auth", function() { } }); var redis = new Redis({ port: 17379, password: "pass" }); - redis.once("ready", function() { + redis.once("ready", function () { begin = true; redis.disconnect({ reconnect: true }); - redis.get("foo").catch(function() {}); + redis.get("foo").catch(function () {}); }); }); - it('should not emit "error" when the server doesn\'t need auth', function(done) { - new MockServer(17379, function(argv) { + it('should not emit "error" when the server doesn\'t need auth', function (done) { + new MockServer(17379, function (argv) { if (argv[0] === "auth" && argv[1] === "pass") { return new Error("ERR Client sent AUTH, but no password is set"); } }); - var errorEmited = false; - var redis = new Redis({ port: 17379, password: "pass" }); - redis.on("error", function() { + let errorEmited = false; + const redis = new Redis({ port: 17379, password: "pass" }); + redis.on("error", function () { errorEmited = true; }); - const stub = sinon.stub(console, "warn").callsFake(warn => { + const stub = sinon.stub(console, "warn").callsFake((warn) => { if (warn.indexOf("but a password was supplied") !== -1) { stub.restore(); - setTimeout(function() { + setTimeout(function () { expect(errorEmited).to.eql(false); redis.disconnect(); done(); @@ -65,38 +65,38 @@ describe("auth", function() { }); }); - it('should emit "error" when the password is wrong', function(done) { - new MockServer(17379, function(argv) { + it('should emit "error" when the password is wrong', function (done) { + new MockServer(17379, function (argv) { if (argv[0] === "auth" && argv[1] === "pass") { return new Error("ERR invalid password"); } }); - var redis = new Redis({ port: 17379, password: "pass" }); - var pending = 2; + const redis = new Redis({ port: 17379, password: "pass" }); + let pending = 2; function check() { if (!--pending) { redis.disconnect(); done(); } } - redis.on("error", function(error) { + redis.on("error", function (error) { expect(error).to.have.property("message", "ERR invalid password"); check(); }); - redis.get("foo", function(err, res) { + redis.get("foo", function (err, res) { expect(err.message).to.eql("ERR invalid password"); check(); }); }); - it('should emit "error" when password is not provided', function(done) { - new MockServer(17379, function(argv) { + it('should emit "error" when password is not provided', function (done) { + new MockServer(17379, function (argv) { if (argv[0] === "info") { return new Error("NOAUTH Authentication required."); } }); - var redis = new Redis({ port: 17379 }); - redis.on("error", function(error) { + const redis = new Redis({ port: 17379 }); + redis.on("error", function (error) { expect(error).to.have.property( "message", "NOAUTH Authentication required." diff --git a/test/functional/cluster/ask.ts b/test/functional/cluster/ask.ts index 7ab313b5..7fdd00ef 100644 --- a/test/functional/cluster/ask.ts +++ b/test/functional/cluster/ask.ts @@ -3,15 +3,15 @@ import * as calculateSlot from "cluster-key-slot"; import { expect } from "chai"; import { Cluster } from "../../../lib"; -describe("cluster:ASK", function() { - it("should support ASK", function(done) { - var asked = false; - var times = 0; - var slotTable = [ +describe("cluster:ASK", function () { + it("should support ASK", function (done) { + let asked = false; + let times = 0; + const slotTable = [ [0, 1, ["127.0.0.1", 30001]], - [2, 16383, ["127.0.0.1", 30002]] + [2, 16383, ["127.0.0.1", 30002]], ]; - new MockServer(30001, function(argv) { + new MockServer(30001, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } @@ -21,13 +21,13 @@ describe("cluster:ASK", function() { asked = true; } }); - new MockServer(30002, function(argv) { + new MockServer(30002, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } if (argv[0] === "get" && argv[1] === "foo") { if (++times === 2) { - process.nextTick(function() { + process.nextTick(function () { cluster.disconnect(); done(); }); @@ -38,17 +38,17 @@ describe("cluster:ASK", function() { }); var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { - lazyConnect: false + lazyConnect: false, }); - cluster.get("foo", function() { + cluster.get("foo", function () { cluster.get("foo"); }); }); - it("should be able to redirect a command to a unknown node", function(done) { - var asked = false; - var slotTable = [[0, 16383, ["127.0.0.1", 30002]]]; - new MockServer(30001, function(argv) { + it("should be able to redirect a command to a unknown node", function (done) { + let asked = false; + const slotTable = [[0, 16383, ["127.0.0.1", 30002]]]; + new MockServer(30001, function (argv) { if (argv[0] === "get" && argv[1] === "foo") { expect(asked).to.eql(true); return "bar"; @@ -56,7 +56,7 @@ describe("cluster:ASK", function() { asked = true; } }); - new MockServer(30002, function(argv) { + new MockServer(30002, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } @@ -65,8 +65,8 @@ describe("cluster:ASK", function() { } }); - var cluster = new Cluster([{ host: "127.0.0.1", port: "30002" }]); - cluster.get("foo", function(err, res) { + const cluster = new Cluster([{ host: "127.0.0.1", port: "30002" }]); + cluster.get("foo", function (err, res) { expect(res).to.eql("bar"); cluster.disconnect(); done(); diff --git a/test/functional/cluster/clusterdown.ts b/test/functional/cluster/clusterdown.ts index 44187c0b..ee0b8ad5 100644 --- a/test/functional/cluster/clusterdown.ts +++ b/test/functional/cluster/clusterdown.ts @@ -2,13 +2,13 @@ import MockServer from "../../helpers/mock_server"; import { expect } from "chai"; import { Cluster } from "../../../lib"; -describe("cluster:CLUSTERDOWN", function() { - it("should redirect the command to a random node", function(done) { - var slotTable = [ +describe("cluster:CLUSTERDOWN", function () { + it("should redirect the command to a random node", function (done) { + const slotTable = [ [0, 1, ["127.0.0.1", 30001]], - [2, 16383, ["127.0.0.1", 30002]] + [2, 16383, ["127.0.0.1", 30002]], ]; - new MockServer(30001, function(argv) { + new MockServer(30001, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } @@ -16,7 +16,7 @@ describe("cluster:CLUSTERDOWN", function() { return "bar"; } }); - new MockServer(30002, function(argv) { + new MockServer(30002, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } @@ -25,11 +25,11 @@ describe("cluster:CLUSTERDOWN", function() { } }); - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { lazyConnect: false, - retryDelayOnClusterDown: 1 + retryDelayOnClusterDown: 1, }); - cluster.get("foo", function(_, res) { + cluster.get("foo", function (_, res) { expect(res).to.eql("bar"); cluster.disconnect(); done(); diff --git a/test/functional/cluster/connect.ts b/test/functional/cluster/connect.ts index 99c4d2a1..f3bc9fc6 100644 --- a/test/functional/cluster/connect.ts +++ b/test/functional/cluster/connect.ts @@ -3,38 +3,38 @@ import { expect } from "chai"; import { Cluster } from "../../../lib"; import * as sinon from "sinon"; -describe("cluster:connect", function() { - it("should flush the queue when all startup nodes are unreachable", function(done) { - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { - clusterRetryStrategy: null +describe("cluster:connect", function () { + it("should flush the queue when all startup nodes are unreachable", function (done) { + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { + clusterRetryStrategy: null, }); - cluster.get("foo", function(err) { + cluster.get("foo", function (err) { expect(err.message).to.match(/None of startup nodes is available/); cluster.disconnect(); done(); }); }); - it("should invoke clusterRetryStrategy when all startup nodes are unreachable", function(done) { - var t = 0; - var cluster = new Cluster( + it("should invoke clusterRetryStrategy when all startup nodes are unreachable", function (done) { + let t = 0; + const cluster = new Cluster( [ { host: "127.0.0.1", port: "30001" }, - { host: "127.0.0.1", port: "30002" } + { host: "127.0.0.1", port: "30002" }, ], { - clusterRetryStrategy: function(times) { + clusterRetryStrategy: function (times) { expect(times).to.eql(++t); if (times === 3) { return; } return 0; - } + }, } ); - cluster.get("foo", function(err) { + cluster.get("foo", function (err) { expect(t).to.eql(3); expect(err.message).to.match(/None of startup nodes is available/); cluster.disconnect(); @@ -42,8 +42,8 @@ describe("cluster:connect", function() { }); }); - it("should invoke clusterRetryStrategy when none nodes are ready", function(done) { - var argvHandler = function(argv) { + it("should invoke clusterRetryStrategy when none nodes are ready", function (done) { + const argvHandler = function (argv) { if (argv[0] === "cluster") { return new Error("CLUSTERDOWN"); } @@ -51,14 +51,14 @@ describe("cluster:connect", function() { new MockServer(30001, argvHandler); new MockServer(30002, argvHandler); - var t = 0; + let t = 0; var cluster = new Cluster( [ { host: "127.0.0.1", port: "30001" }, - { host: "127.0.0.1", port: "30002" } + { host: "127.0.0.1", port: "30002" }, ], { - clusterRetryStrategy: function(times) { + clusterRetryStrategy: function (times) { expect(times).to.eql(++t); if (times === 3) { cluster.disconnect(); @@ -66,25 +66,25 @@ describe("cluster:connect", function() { return; } return 0; - } + }, } ); }); - it("should connect to cluster successfully", function(done) { - var node = new MockServer(30001); + it("should connect to cluster successfully", function (done) { + const node = new MockServer(30001); - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }]); + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }]); - node.once("connect", function() { + node.once("connect", function () { cluster.disconnect(); done(); }); }); - it("should wait for ready state before resolving", function(done) { - var slotTable = [[0, 16383, ["127.0.0.1", 30001]]]; - var argvHandler = function(argv) { + it("should wait for ready state before resolving", function (done) { + const slotTable = [[0, 16383, ["127.0.0.1", 30001]]]; + const argvHandler = function (argv) { if (argv[0] === "info") { // return 'role:master' } @@ -97,46 +97,46 @@ describe("cluster:connect", function() { }; new MockServer(30001, argvHandler); - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { - lazyConnect: true + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { + lazyConnect: true, }); - cluster.connect().then(function() { + cluster.connect().then(function () { expect(cluster.status).to.eql("ready"); cluster.disconnect(); done(); }); }); - it("should support url schema", function(done) { - var node = new MockServer(30001); + it("should support url schema", function (done) { + const node = new MockServer(30001); - var cluster = new Cluster(["redis://127.0.0.1:30001"]); + const cluster = new Cluster(["redis://127.0.0.1:30001"]); - node.once("connect", function() { + node.once("connect", function () { cluster.disconnect(); done(); }); }); - it("should support a single port", function(done) { - var node = new MockServer(30001); + it("should support a single port", function (done) { + const node = new MockServer(30001); - var cluster = new Cluster([30001]); + const cluster = new Cluster([30001]); - node.once("connect", function() { + node.once("connect", function () { cluster.disconnect(); done(); }); }); - it("should return a promise to be resolved when connected", function(done) { - var slotTable = [ + it("should return a promise to be resolved when connected", function (done) { + const slotTable = [ [0, 5460, ["127.0.0.1", 30001]], [5461, 10922, ["127.0.0.1", 30002]], - [10923, 16383, ["127.0.0.1", 30003]] + [10923, 16383, ["127.0.0.1", 30003]], ]; - var argvHandler = function(argv) { + const argvHandler = function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } @@ -146,71 +146,71 @@ describe("cluster:connect", function() { new MockServer(30003, argvHandler); sinon.stub(Cluster.prototype, "connect").callsFake(() => Promise.resolve()); - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { - lazyConnect: false + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { + lazyConnect: false, }); Cluster.prototype.connect.restore(); - cluster.connect().then(function() { + cluster.connect().then(function () { cluster.disconnect(); done(); }); }); - it("should return a promise to be rejected when closed", function(done) { + it("should return a promise to be rejected when closed", function (done) { sinon.stub(Cluster.prototype, "connect").callsFake(() => Promise.resolve()); - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { - lazyConnect: false + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { + lazyConnect: false, }); Cluster.prototype.connect.restore(); - cluster.connect().catch(function() { + cluster.connect().catch(function () { cluster.disconnect(); done(); }); }); - it("should stop reconnecting when disconnected", function(done) { - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { - clusterRetryStrategy: function() { + it("should stop reconnecting when disconnected", function (done) { + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { + clusterRetryStrategy: function () { return 0; - } + }, }); - cluster.on("close", function() { + cluster.on("close", function () { cluster.disconnect(); const stub = sinon .stub(Cluster.prototype, "connect") .throws(new Error("`connect` should not be called")); - setTimeout(function() { + setTimeout(function () { stub.restore(); done(); }, 1); }); }); - it("should discover other nodes automatically", function(done) { - var slotTable = [ + it("should discover other nodes automatically", function (done) { + const slotTable = [ [0, 5460, ["127.0.0.1", 30001]], [5461, 10922, ["127.0.0.1", 30002]], - [10923, 16383, ["127.0.0.1", 30003]] + [10923, 16383, ["127.0.0.1", 30003]], ]; - var argvHandler = function(argv) { + const argvHandler = function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } }; - var node1 = new MockServer(30001, argvHandler); - var node2 = new MockServer(30002, argvHandler); - var node3 = new MockServer(30003, argvHandler); + const node1 = new MockServer(30001, argvHandler); + const node2 = new MockServer(30002, argvHandler); + const node3 = new MockServer(30003, argvHandler); - var pending = 3; + let pending = 3; node1.once("connect", check); node2.once("connect", check); node3.once("connect", check); - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { - redisOptions: { lazyConnect: false } + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { + redisOptions: { lazyConnect: false }, }); function check() { @@ -221,15 +221,18 @@ describe("cluster:connect", function() { } }); - it("should send command to the correct node", function(done) { - new MockServer(30001, function(argv) { + it("should send command to the correct node", function (done) { + new MockServer(30001, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { - return [[0, 1, ["127.0.0.1", 30001]], [2, 16383, ["127.0.0.1", 30002]]]; + return [ + [0, 1, ["127.0.0.1", 30001]], + [2, 16383, ["127.0.0.1", 30002]], + ]; } }); - new MockServer(30002, function(argv) { + new MockServer(30002, function (argv) { if (argv[0] === "get" && argv[1] === "foo") { - process.nextTick(function() { + process.nextTick(function () { cluster.disconnect(); done(); }); @@ -237,14 +240,14 @@ describe("cluster:connect", function() { }); var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { - lazyConnect: false + lazyConnect: false, }); cluster.get("foo"); }); - it("should emit errors when cluster cannot be connected", function(done) { - var errorMessage = "ERR This instance has cluster support disabled"; - var argvHandler = function(argv) { + it("should emit errors when cluster cannot be connected", function (done) { + const errorMessage = "ERR This instance has cluster support disabled"; + const argvHandler = function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return new Error(errorMessage); } @@ -252,27 +255,27 @@ describe("cluster:connect", function() { new MockServer(30001, argvHandler); new MockServer(30002, argvHandler); - var pending = 2; - var retry: number | false = 0; + let pending = 2; + let retry: number | false = 0; var cluster = new Cluster( [ { host: "127.0.0.1", port: "30001" }, - { host: "127.0.0.1", port: "30002" } + { host: "127.0.0.1", port: "30002" }, ], { - clusterRetryStrategy: function() { - cluster.once("error", function(err) { + clusterRetryStrategy: function () { + cluster.once("error", function (err) { retry = false; expect(err.message).to.eql("Failed to refresh slots cache."); expect(err.lastNodeError.message).to.eql(errorMessage); checkDone(); }); return retry; - } + }, } ); - cluster.once("node error", function(err, key) { + cluster.once("node error", function (err, key) { expect(err.message).to.eql(errorMessage); expect(["127.0.0.1:30001", "127.0.0.1:30002"]).to.include(key); checkDone(); @@ -286,19 +289,19 @@ describe("cluster:connect", function() { } }); - it("should using the specified password", function(done) { - var cluster; - var slotTable = [ + it("should using the specified password", function (done) { + let cluster; + const slotTable = [ [0, 5460, ["127.0.0.1", 30001]], [5461, 10922, ["127.0.0.1", 30002]], - [10923, 16383, ["127.0.0.1", 30003]] + [10923, 16383, ["127.0.0.1", 30003]], ]; - var argvHandler = function(port, argv) { + const argvHandler = function (port, argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } if (argv[0] === "auth") { - var password = argv[1]; + const password = argv[1]; if (port === 30001) { expect(password).to.eql("other password"); } else if (port === 30002) { @@ -317,38 +320,38 @@ describe("cluster:connect", function() { cluster = new Cluster( [ { host: "127.0.0.1", port: "30001", password: "other password" }, - { host: "127.0.0.1", port: "30002", password: null } + { host: "127.0.0.1", port: "30002", password: null }, ], { redisOptions: { lazyConnect: false, password: "default password" } } ); }); - it("should discover other nodes automatically every slotsRefreshInterval", function(done) { - var times = 0; - var cluster; - var argvHandler = function(argv) { + it("should discover other nodes automatically every slotsRefreshInterval", function (done) { + let times = 0; + let cluster; + const argvHandler = function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { times++; if (times === 1) { return [ [0, 5460, ["127.0.0.1", 30001]], [5461, 10922, ["127.0.0.1", 30001]], - [10923, 16383, ["127.0.0.1", 30001]] + [10923, 16383, ["127.0.0.1", 30001]], ]; } return [ [0, 5460, ["127.0.0.1", 30001]], [5461, 10922, ["127.0.0.1", 30001]], - [10923, 16383, ["127.0.0.1", 30002]] + [10923, 16383, ["127.0.0.1", 30002]], ]; } }; - var node1 = new MockServer(30001, argvHandler); - var node2 = new MockServer(30002, argvHandler); + const node1 = new MockServer(30001, argvHandler); + const node2 = new MockServer(30002, argvHandler); - node1.once("connect", function() { - node2.once("connect", function() { + node1.once("connect", function () { + node2.once("connect", function () { cluster.disconnect(); done(); }); @@ -356,11 +359,11 @@ describe("cluster:connect", function() { cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { slotsRefreshInterval: 100, - redisOptions: { lazyConnect: false } + redisOptions: { lazyConnect: false }, }); }); - it("throws when startupNodes is empty", done => { + it("throws when startupNodes is empty", (done) => { const message = "`startupNodes` should contain at least one node."; let pending = 2; const cluster = new Cluster(null, { @@ -371,9 +374,9 @@ describe("cluster:connect", function() { done(); } return false; - } + }, }); - cluster.connect().catch(err => { + cluster.connect().catch((err) => { expect(err.message).to.eql(message); cluster.disconnect(); if (!--pending) { diff --git a/test/functional/cluster/dnsLookup.ts b/test/functional/cluster/dnsLookup.ts index 596df9f5..3dd22295 100644 --- a/test/functional/cluster/dnsLookup.ts +++ b/test/functional/cluster/dnsLookup.ts @@ -3,10 +3,10 @@ import { Cluster } from "../../../lib"; import { expect } from "chai"; describe("cluster:dnsLookup", () => { - it("resolve hostnames to IPs", done => { + it("resolve hostnames to IPs", (done) => { const slotTable = [ [0, 1000, ["127.0.0.1", 30001]], - [1001, 16383, ["127.0.0.1", 30002]] + [1001, 16383, ["127.0.0.1", 30002]], ]; new MockServer(30001, (argv, c) => {}, slotTable); new MockServer(30002, (argv, c) => {}, slotTable); @@ -22,11 +22,11 @@ describe("cluster:dnsLookup", () => { }); }); - it("support customize dnsLookup function", done => { + it("support customize dnsLookup function", (done) => { let dnsLookupCalledCount = 0; const slotTable = [ [0, 1000, ["127.0.0.1", 30001]], - [1001, 16383, ["127.0.0.1", 30002]] + [1001, 16383, ["127.0.0.1", 30002]], ]; new MockServer(30001, (argv, c) => {}, slotTable); new MockServer(30002, (argv, c) => {}, slotTable); @@ -39,7 +39,7 @@ describe("cluster:dnsLookup", () => { } else { callback(new Error("Unknown hostname")); } - } + }, }); cluster.on("ready", () => { const nodes = cluster.nodes("master"); @@ -52,10 +52,10 @@ describe("cluster:dnsLookup", () => { }); }); - it("reconnects when dns lookup fails", done => { + it("reconnects when dns lookup fails", (done) => { const slotTable = [ [0, 1000, ["127.0.0.1", 30001]], - [1001, 16383, ["127.0.0.1", 30002]] + [1001, 16383, ["127.0.0.1", 30002]], ]; new MockServer(30001, (argv, c) => {}, slotTable); new MockServer(30002, (argv, c) => {}, slotTable); @@ -69,12 +69,12 @@ describe("cluster:dnsLookup", () => { callback(new Error("Random Exception")); } }, - clusterRetryStrategy: function(_, reason) { + clusterRetryStrategy: function (_, reason) { expect(reason.message).to.eql("Random Exception"); expect(retried).to.eql(false); retried = true; return 0; - } + }, }); cluster.on("ready", () => { cluster.disconnect(); @@ -82,10 +82,10 @@ describe("cluster:dnsLookup", () => { }); }); - it("reconnects when dns lookup thrown an error", done => { + it("reconnects when dns lookup thrown an error", (done) => { const slotTable = [ [0, 1000, ["127.0.0.1", 30001]], - [1001, 16383, ["127.0.0.1", 30002]] + [1001, 16383, ["127.0.0.1", 30002]], ]; new MockServer(30001, (argv, c) => {}, slotTable); new MockServer(30002, (argv, c) => {}, slotTable); @@ -99,12 +99,12 @@ describe("cluster:dnsLookup", () => { throw new Error("Random Exception"); } }, - clusterRetryStrategy: function(_, reason) { + clusterRetryStrategy: function (_, reason) { expect(reason.message).to.eql("Random Exception"); expect(retried).to.eql(false); retried = true; return 0; - } + }, }); cluster.on("ready", () => { cluster.disconnect(); diff --git a/test/functional/cluster/duplicate.ts b/test/functional/cluster/duplicate.ts index be28e5cd..557a8f6b 100644 --- a/test/functional/cluster/duplicate.ts +++ b/test/functional/cluster/duplicate.ts @@ -3,14 +3,14 @@ import { Cluster } from "../../../lib"; import { expect } from "chai"; describe("cluster:duplicate", () => { - it("clone the options", done => { - var node = new MockServer(30001); - var cluster = new Cluster([]); - var duplicatedCluster = cluster.duplicate([ - { host: "127.0.0.1", port: "30001" } + it("clone the options", (done) => { + const node = new MockServer(30001); + const cluster = new Cluster([]); + const duplicatedCluster = cluster.duplicate([ + { host: "127.0.0.1", port: "30001" }, ]); - node.once("connect", function() { + node.once("connect", function () { expect(duplicatedCluster.nodes()).to.have.lengthOf(1); expect(duplicatedCluster.nodes()[0].options.port).to.eql(30001); cluster.disconnect(); diff --git a/test/functional/cluster/index.ts b/test/functional/cluster/index.ts index 0b2e4f91..3c12fbb4 100644 --- a/test/functional/cluster/index.ts +++ b/test/functional/cluster/index.ts @@ -4,10 +4,10 @@ import { Cluster, default as Redis } from "../../../lib"; import * as utils from "../../../lib/utils"; import * as sinon from "sinon"; -describe("cluster", function() { - it("should return the error successfully", function(done) { - var called = false; - new MockServer(30001, function(argv) { +describe("cluster", function () { + it("should return the error successfully", function (done) { + let called = false; + new MockServer(30001, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return [[0, 16383, ["127.0.0.1", 30001]]]; } @@ -17,8 +17,8 @@ describe("cluster", function() { } }); - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }]); - cluster.get("foo", "bar", function(err) { + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }]); + cluster.get("foo", "bar", function (err) { expect(called).to.eql(true); expect(err.message).to.match(/Wrong arguments count/); cluster.disconnect(); @@ -26,64 +26,67 @@ describe("cluster", function() { }); }); - it("should get value successfully", function(done) { - new MockServer(30001, function(argv) { + it("should get value successfully", function (done) { + new MockServer(30001, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { - return [[0, 1, ["127.0.0.1", 30001]], [2, 16383, ["127.0.0.1", 30002]]]; + return [ + [0, 1, ["127.0.0.1", 30001]], + [2, 16383, ["127.0.0.1", 30002]], + ]; } }); - new MockServer(30002, function(argv) { + new MockServer(30002, function (argv) { if (argv[0] === "get" && argv[1] === "foo") { return "bar"; } }); - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }]); - cluster.get("foo", function(err, result) { + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }]); + cluster.get("foo", function (err, result) { expect(result).to.eql("bar"); cluster.disconnect(); done(); }); }); - describe("enableReadyCheck", function() { - it("should reconnect when cluster state is not ok", function(done) { - var state = "fail"; - new MockServer(30001, function(argv) { + describe("enableReadyCheck", function () { + it("should reconnect when cluster state is not ok", function (done) { + let state = "fail"; + new MockServer(30001, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return [[0, 16383, ["127.0.0.1", 30001]]]; } else if (argv[0] === "cluster" && argv[1] === "info") { return "cluster_state:" + state; } }); - var count = 0; - var client = new Cluster( + let count = 0; + const client = new Cluster( [ { host: "127.0.0.1", - port: "30001" - } + port: "30001", + }, ], { - clusterRetryStrategy: function(times) { + clusterRetryStrategy: function (times) { expect(++count).to.eql(times); if (count === 3) { state = "ok"; } return 0; - } + }, } ); - client.on("ready", function() { + client.on("ready", function () { client.disconnect(); done(); }); }); }); - describe("startupNodes", function() { - it("should allow updating startupNodes", function(done) { - new MockServer(30001, function(argv) { + describe("startupNodes", function () { + it("should allow updating startupNodes", function (done) { + new MockServer(30001, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return [[0, 16383, ["127.0.0.1", 30001]]]; } @@ -91,22 +94,22 @@ describe("cluster", function() { return "cluster_state:fail"; } }); - var client = new Cluster( + const client = new Cluster( [ { host: "127.0.0.1", - port: "30001" - } + port: "30001", + }, ], { - clusterRetryStrategy: function() { + clusterRetryStrategy: function () { this.startupNodes = [{ port: 30002 }]; return 0; - } + }, } ); let hasDone = false; - new MockServer(30002, function() { + new MockServer(30002, function () { if (hasDone) { return; } @@ -117,8 +120,8 @@ describe("cluster", function() { }); }); - describe("scaleReads", function() { - beforeEach(function() { + describe("scaleReads", function () { + beforeEach(function () { function handler(port, argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return [ @@ -127,9 +130,9 @@ describe("cluster", function() { 16381, ["127.0.0.1", 30001], ["127.0.0.1", 30003], - ["127.0.0.1", 30004] + ["127.0.0.1", 30004], ], - [16382, 16383, ["127.0.0.1", 30002]] + [16382, 16383, ["127.0.0.1", 30002]], ]; } return port; @@ -140,12 +143,12 @@ describe("cluster", function() { this.node4 = new MockServer(30004, handler.bind(null, 30004)); }); - context("master", function() { - it("should only send reads to master", function(done) { - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }]); - cluster.on("ready", function() { + context("master", function () { + it("should only send reads to master", function (done) { + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }]); + cluster.on("ready", function () { const stub = sinon.stub(utils, "sample").throws("sample is called"); - cluster.get("foo", function(err, res) { + cluster.get("foo", function (err, res) { stub.restore(); expect(res).to.eql(30001); cluster.disconnect(); @@ -155,22 +158,22 @@ describe("cluster", function() { }); }); - context("slave", function() { - it("should only send reads to slave", function(done) { - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { - scaleReads: "slave" + context("slave", function () { + it("should only send reads to slave", function (done) { + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { + scaleReads: "slave", }); - cluster.on("ready", function() { + cluster.on("ready", function () { const stub = sinon.stub(utils, "sample").callsFake((array, from) => { expect(array).to.eql([ "127.0.0.1:30001", "127.0.0.1:30003", - "127.0.0.1:30004" + "127.0.0.1:30004", ]); expect(from).to.eql(1); return "127.0.0.1:30003"; }); - cluster.get("foo", function(err, res) { + cluster.get("foo", function (err, res) { stub.restore(); expect(res).to.eql(30003); cluster.disconnect(); @@ -179,13 +182,13 @@ describe("cluster", function() { }); }); - it("should send writes to masters", function(done) { - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { - scaleReads: "slave" + it("should send writes to masters", function (done) { + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { + scaleReads: "slave", }); - cluster.on("ready", function() { + cluster.on("ready", function () { const stub = sinon.stub(utils, "sample").throws("sample is called"); - cluster.set("foo", "bar", function(err, res) { + cluster.set("foo", "bar", function (err, res) { stub.restore(); expect(res).to.eql(30001); cluster.disconnect(); @@ -194,20 +197,20 @@ describe("cluster", function() { }); }); - it("should send custom readOnly scripts to a slave", function(done) { - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { - scaleReads: "slave" + it("should send custom readOnly scripts to a slave", function (done) { + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { + scaleReads: "slave", }); - cluster.on("ready", function() { + cluster.on("ready", function () { const redis: Redis = cluster; redis.defineCommand("test", { numberOfKeys: 1, lua: "return {KEYS[1],ARGV[1],ARGV[2]}", - readOnly: true + readOnly: true, }); const stub = sinon.stub(utils, "sample").returns("127.0.0.1:30003"); - redis.test("k1", "a1", "a2", function(err, result) { + redis.test("k1", "a1", "a2", function (err, result) { stub.restore(); expect(stub.callCount).to.eql(1); // because of the beforeEach handler this will be the port of the slave called @@ -219,27 +222,27 @@ describe("cluster", function() { }); }); - context("custom", function() { - it("should send to selected slave", function(done) { - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { - scaleReads: function(node, command) { + context("custom", function () { + it("should send to selected slave", function (done) { + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { + scaleReads: function (node, command) { if (command.name === "get") { return node[1]; } return node[2]; - } + }, }); - cluster.on("ready", function() { + cluster.on("ready", function () { const stub = sinon.stub(utils, "sample").callsFake((array, from) => { expect(array).to.eql([ "127.0.0.1:30001", "127.0.0.1:30003", - "127.0.0.1:30004" + "127.0.0.1:30004", ]); expect(from).to.eql(1); return "127.0.0.1:30003"; }); - cluster.hgetall("foo", function(err, res) { + cluster.hgetall("foo", function (err, res) { stub.restore(); expect(res).to.eql(30004); cluster.disconnect(); @@ -248,18 +251,18 @@ describe("cluster", function() { }); }); - it("should send writes to masters", function(done) { - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { - scaleReads: function(node, command) { + it("should send writes to masters", function (done) { + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { + scaleReads: function (node, command) { if (command.name === "get") { return node[1]; } return node[2]; - } + }, }); - cluster.on("ready", function() { + cluster.on("ready", function () { const stub = sinon.stub(utils, "sample").throws("sample is called"); - cluster.set("foo", "bar", function(err, res) { + cluster.set("foo", "bar", function (err, res) { stub.restore(); expect(res).to.eql(30001); cluster.disconnect(); @@ -269,22 +272,22 @@ describe("cluster", function() { }); }); - context("all", function() { - it("should send reads to all nodes randomly", function(done) { - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { - scaleReads: "all" + context("all", function () { + it("should send reads to all nodes randomly", function (done) { + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { + scaleReads: "all", }); - cluster.on("ready", function() { + cluster.on("ready", function () { const stub = sinon.stub(utils, "sample").callsFake((array, from) => { expect(array).to.eql([ "127.0.0.1:30001", "127.0.0.1:30003", - "127.0.0.1:30004" + "127.0.0.1:30004", ]); expect(from).to.eql(undefined); return "127.0.0.1:30003"; }); - cluster.get("foo", function(err, res) { + cluster.get("foo", function (err, res) { stub.restore(); expect(res).to.eql(30003); cluster.disconnect(); @@ -295,38 +298,38 @@ describe("cluster", function() { }); }); - describe("#nodes()", function() { - it("should return the corrent nodes", function(done) { - var slotTable = [ + describe("#nodes()", function () { + it("should return the corrent nodes", function (done) { + const slotTable = [ [0, 16381, ["127.0.0.1", 30001], ["127.0.0.1", 30003]], - [16382, 16383, ["127.0.0.1", 30002]] + [16382, 16383, ["127.0.0.1", 30002]], ]; - var node = new MockServer(30001, function(argv) { + const node = new MockServer(30001, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } }); - new MockServer(30002, function(argv) { + new MockServer(30002, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } }); - new MockServer(30003, function(argv) { + new MockServer(30003, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } }); - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }]); + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }]); // Make sure 30001 has been connected - cluster.get("foo", function() { + cluster.get("foo", function () { expect(cluster.nodes()).to.have.lengthOf(3); expect(cluster.nodes("all")).to.have.lengthOf(3); expect(cluster.nodes("master")).to.have.lengthOf(2); expect(cluster.nodes("slave")).to.have.lengthOf(1); - cluster.once("-node", function() { + cluster.once("-node", function () { expect(cluster.nodes()).to.have.lengthOf(2); expect(cluster.nodes("all")).to.have.lengthOf(2); expect(cluster.nodes("master")).to.have.lengthOf(1); @@ -339,49 +342,49 @@ describe("cluster", function() { }); }); - describe("#getInfoFromNode", function() { - it("should refresh master nodes", function(done) { - var slotTable = [ + describe("#getInfoFromNode", function () { + it("should refresh master nodes", function (done) { + let slotTable = [ [0, 5460, ["127.0.0.1", 30001], ["127.0.0.1", 30003]], - [5461, 10922, ["127.0.0.1", 30002]] + [5461, 10922, ["127.0.0.1", 30002]], ]; - new MockServer(30001, function(argv) { + new MockServer(30001, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } }); - new MockServer(30002, function(argv) { + new MockServer(30002, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } }); - new MockServer(30003, function(argv) { + new MockServer(30003, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } }); - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { - redisOptions: { showFriendlyErrorStack: true } + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { + redisOptions: { showFriendlyErrorStack: true }, }); - cluster.on("ready", function() { + cluster.on("ready", function () { expect(cluster.nodes("master")).to.have.lengthOf(2); slotTable = [ [0, 5460, ["127.0.0.1", 30003]], - [5461, 10922, ["127.0.0.1", 30002]] + [5461, 10922, ["127.0.0.1", 30002]], ]; - cluster.refreshSlotsCache(function() { - cluster.once("-node", function(removed) { + cluster.refreshSlotsCache(function () { + cluster.once("-node", function (removed) { expect(removed.options.port).to.eql(30001); expect(cluster.nodes("master")).to.have.lengthOf(2); expect( [ cluster.nodes("master")[0].options.port, - cluster.nodes("master")[1].options.port + cluster.nodes("master")[1].options.port, ].sort() ).to.eql([30002, 30003]); - cluster.nodes("master").forEach(function(node) { + cluster.nodes("master").forEach(function (node) { expect(node.options).to.have.property("readOnly", false); }); cluster.disconnect(); @@ -392,13 +395,13 @@ describe("cluster", function() { }); }); - describe("#quit()", function() { - it("should quit the connection gracefully", function(done) { - var slotTable = [ + describe("#quit()", function () { + it("should quit the connection gracefully", function (done) { + const slotTable = [ [0, 1, ["127.0.0.1", 30001]], - [2, 16383, ["127.0.0.1", 30002], ["127.0.0.1", 30003]] + [2, 16383, ["127.0.0.1", 30002], ["127.0.0.1", 30003]], ]; - var argvHandler = function(argv) { + const argvHandler = function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } @@ -407,14 +410,14 @@ describe("cluster", function() { new MockServer(30002, argvHandler); new MockServer(30003, argvHandler); - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }]); + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }]); - var setCommandHandled = false; - cluster.on("ready", function() { - cluster.set("foo", "bar", function() { + let setCommandHandled = false; + cluster.on("ready", function () { + cluster.set("foo", "bar", function () { setCommandHandled = true; }); - cluster.quit(function(err, state) { + cluster.quit(function (err, state) { expect(setCommandHandled).to.eql(true); expect(state).to.eql("OK"); cluster.disconnect(); diff --git a/test/functional/cluster/maxRedirections.ts b/test/functional/cluster/maxRedirections.ts index 2b6fbc6f..348de675 100644 --- a/test/functional/cluster/maxRedirections.ts +++ b/test/functional/cluster/maxRedirections.ts @@ -3,12 +3,15 @@ import MockServer from "../../helpers/mock_server"; import { expect } from "chai"; import { Cluster } from "../../../lib"; -describe("cluster:maxRedirections", function() { - it("should return error when reached max redirection", function(done) { - var redirectTimes = 0; - var argvHandler = function(argv) { +describe("cluster:maxRedirections", function () { + it("should return error when reached max redirection", function (done) { + let redirectTimes = 0; + const argvHandler = function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { - return [[0, 1, ["127.0.0.1", 30001]], [2, 16383, ["127.0.0.1", 30002]]]; + return [ + [0, 1, ["127.0.0.1", 30001]], + [2, 16383, ["127.0.0.1", 30002]], + ]; } else if (argv[0] === "get" && argv[1] === "foo") { redirectTimes += 1; return new Error("ASK " + calculateSlot("foo") + " 127.0.0.1:30001"); @@ -17,10 +20,10 @@ describe("cluster:maxRedirections", function() { new MockServer(30001, argvHandler); new MockServer(30002, argvHandler); - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { - maxRedirections: 5 + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { + maxRedirections: 5, }); - cluster.get("foo", function(err) { + cluster.get("foo", function (err) { expect(redirectTimes).to.eql(6); expect(err.message).to.match(/Too many Cluster redirections/); cluster.disconnect(); diff --git a/test/functional/cluster/moved.ts b/test/functional/cluster/moved.ts index 28e90d71..276bd8b2 100644 --- a/test/functional/cluster/moved.ts +++ b/test/functional/cluster/moved.ts @@ -3,30 +3,30 @@ import MockServer from "../../helpers/mock_server"; import { expect } from "chai"; import { Cluster } from "../../../lib"; -describe("cluster:MOVED", function() { - it("should auto redirect the command to the correct nodes", function(done) { - var cluster; - var moved = false; - var times = 0; - var slotTable = [ +describe("cluster:MOVED", function () { + it("should auto redirect the command to the correct nodes", function (done) { + let cluster = undefined; + let moved = false; + let times = 0; + const slotTable = [ [0, 1, ["127.0.0.1", 30001]], - [2, 16383, ["127.0.0.1", 30002]] + [2, 16383, ["127.0.0.1", 30002]], ]; - new MockServer(30001, function(argv) { + new MockServer(30001, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } if (argv[0] === "get" && argv[1] === "foo") { if (times++ === 1) { expect(moved).to.eql(true); - process.nextTick(function() { + process.nextTick(function () { cluster.disconnect(); done(); }); } } }); - new MockServer(30002, function(argv) { + new MockServer(30002, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } @@ -40,13 +40,13 @@ describe("cluster:MOVED", function() { }); cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }]); - cluster.get("foo", function() { + cluster.get("foo", function () { cluster.get("foo"); }); }); - it("should be able to redirect a command to a unknown node", function(done) { - new MockServer(30001, function(argv) { + it("should be able to redirect a command to a unknown node", function (done) { + new MockServer(30001, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return [[0, 16383, ["127.0.0.1", 30001]]]; } @@ -54,50 +54,50 @@ describe("cluster:MOVED", function() { return new Error("MOVED " + calculateSlot("foo") + " 127.0.0.1:30002"); } }); - new MockServer(30002, function(argv) { + new MockServer(30002, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return [ [0, 16381, ["127.0.0.1", 30001]], - [16382, 16383, ["127.0.0.1", 30002]] + [16382, 16383, ["127.0.0.1", 30002]], ]; } if (argv[0] === "get" && argv[1] === "foo") { return "bar"; } }); - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { - retryDelayOnFailover: 1 + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { + retryDelayOnFailover: 1, }); - cluster.get("foo", function(err, res) { + cluster.get("foo", function (err, res) { expect(res).to.eql("bar"); cluster.disconnect(); done(); }); }); - it("should auto redirect the command within a pipeline", function(done) { - var cluster; - var moved = false; - var times = 0; - var slotTable = [ + it("should auto redirect the command within a pipeline", function (done) { + let cluster = undefined; + let moved = false; + let times = 0; + const slotTable = [ [0, 1, ["127.0.0.1", 30001]], - [2, 16383, ["127.0.0.1", 30002]] + [2, 16383, ["127.0.0.1", 30002]], ]; - new MockServer(30001, function(argv) { + new MockServer(30001, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } if (argv[0] === "get" && argv[1] === "foo") { if (times++ === 1) { expect(moved).to.eql(true); - process.nextTick(function() { + process.nextTick(function () { cluster.disconnect(); done(); }); } } }); - new MockServer(30002, function(argv) { + new MockServer(30002, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } @@ -111,9 +111,9 @@ describe("cluster:MOVED", function() { }); cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { - lazyConnect: false + lazyConnect: false, }); - cluster.get("foo", function() { + cluster.get("foo", function () { cluster.get("foo"); }); }); diff --git a/test/functional/cluster/nat.ts b/test/functional/cluster/nat.ts index 71fea6b4..504de35a 100644 --- a/test/functional/cluster/nat.ts +++ b/test/functional/cluster/nat.ts @@ -5,10 +5,10 @@ import { Cluster } from "../../../lib"; import * as sinon from "sinon"; describe("NAT", () => { - it("works for normal case", done => { + it("works for normal case", (done) => { const slotTable = [ [0, 1, ["192.168.1.1", 30001]], - [2, 16383, ["192.168.1.2", 30001]] + [2, 16383, ["192.168.1.2", 30001]], ]; let cluster; @@ -28,24 +28,24 @@ describe("NAT", () => { [ { host: "127.0.0.1", - port: 30001 - } + port: 30001, + }, ], { natMap: { "192.168.1.1:30001": { host: "127.0.0.1", port: 30001 }, - "192.168.1.2:30001": { host: "127.0.0.1", port: 30002 } - } + "192.168.1.2:30001": { host: "127.0.0.1", port: 30002 }, + }, } ); cluster.get("foo"); }); - it("works if natMap does not match all the cases", done => { + it("works if natMap does not match all the cases", (done) => { const slotTable = [ [0, 1, ["192.168.1.1", 30001]], - [2, 16383, ["127.0.0.1", 30002]] + [2, 16383, ["127.0.0.1", 30002]], ]; let cluster; @@ -65,20 +65,20 @@ describe("NAT", () => { [ { host: "127.0.0.1", - port: 30001 - } + port: 30001, + }, ], { natMap: { - "192.168.1.1:30001": { host: "127.0.0.1", port: 30001 } - } + "192.168.1.1:30001": { host: "127.0.0.1", port: 30001 }, + }, } ); cluster.get("foo"); }); - it("works for moved", done => { + it("works for moved", (done) => { const slotTable = [[0, 16383, ["192.168.1.1", 30001]]]; let cluster; @@ -108,21 +108,21 @@ describe("NAT", () => { [ { host: "127.0.0.1", - port: 30001 - } + port: 30001, + }, ], { natMap: { "192.168.1.1:30001": { host: "127.0.0.1", port: 30001 }, - "192.168.1.2:30001": { host: "127.0.0.1", port: 30002 } - } + "192.168.1.2:30001": { host: "127.0.0.1", port: 30002 }, + }, } ); cluster.get("foo"); }); - it("works for ask", done => { + it("works for ask", (done) => { const slotTable = [[0, 16383, ["192.168.1.1", 30001]]]; let cluster; @@ -159,21 +159,21 @@ describe("NAT", () => { [ { host: "127.0.0.1", - port: 30001 - } + port: 30001, + }, ], { natMap: { "192.168.1.1:30001": { host: "127.0.0.1", port: 30001 }, - "192.168.1.2:30001": { host: "127.0.0.1", port: 30002 } - } + "192.168.1.2:30001": { host: "127.0.0.1", port: 30002 }, + }, } ); cluster.get("foo"); }); - it("keeps options immutable", done => { + it("keeps options immutable", (done) => { const slotTable = [[0, 16383, ["192.168.1.1", 30001]]]; new MockServer(30001, null, slotTable); @@ -182,13 +182,16 @@ describe("NAT", () => { [ { host: "127.0.0.1", - port: 30001 - } + port: 30001, + }, ], Object.freeze({ natMap: Object.freeze({ - "192.168.1.1:30001": Object.freeze({ host: "127.0.0.1", port: 30001 }) - }) + "192.168.1.1:30001": Object.freeze({ + host: "127.0.0.1", + port: 30001, + }), + }), }) ); @@ -196,7 +199,7 @@ describe("NAT", () => { cluster.on("ready", () => { expect(reset.secondCall.args[0]).to.deep.equal([ - { host: "127.0.0.1", port: 30001, readOnly: false } + { host: "127.0.0.1", port: 30001, readOnly: false }, ]); cluster.disconnect(); done(); diff --git a/test/functional/cluster/pipeline.ts b/test/functional/cluster/pipeline.ts index 29a171a5..8a8905f3 100644 --- a/test/functional/cluster/pipeline.ts +++ b/test/functional/cluster/pipeline.ts @@ -4,31 +4,31 @@ import { expect } from "chai"; import { Cluster } from "../../../lib"; import * as sinon from "sinon"; -describe("cluster:pipeline", function() { - it("should throw when not all keys belong to the same slot", function(done) { - var slotTable = [ +describe("cluster:pipeline", function () { + it("should throw when not all keys belong to the same slot", function (done) { + const slotTable = [ [0, 12181, ["127.0.0.1", 30001]], [12182, 12183, ["127.0.0.1", 30002]], - [12184, 16383, ["127.0.0.1", 30001]] + [12184, 16383, ["127.0.0.1", 30001]], ]; - new MockServer(30001, function(argv) { + new MockServer(30001, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } }); - new MockServer(30002, function(argv) { + new MockServer(30002, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } }); - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }]); + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }]); cluster .pipeline() .set("foo", "bar") .get("foo2") .exec() - .catch(function(err) { + .catch(function (err) { expect(err.message).to.match( /All keys in the pipeline should belong to the same slot/ ); @@ -37,14 +37,14 @@ describe("cluster:pipeline", function() { }); }); - it("should auto redirect commands on MOVED", function(done) { - var moved = false; - var slotTable = [ + it("should auto redirect commands on MOVED", function (done) { + let moved = false; + const slotTable = [ [0, 12181, ["127.0.0.1", 30001]], [12182, 12183, ["127.0.0.1", 30002]], - [12184, 16383, ["127.0.0.1", 30001]] + [12184, 16383, ["127.0.0.1", 30001]], ]; - new MockServer(30001, function(argv) { + new MockServer(30001, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } @@ -52,7 +52,7 @@ describe("cluster:pipeline", function() { return "bar"; } }); - new MockServer(30002, function(argv) { + new MockServer(30002, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } @@ -65,12 +65,12 @@ describe("cluster:pipeline", function() { } }); - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }]); + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }]); cluster .pipeline() .get("foo") .set("foo", "bar") - .exec(function(err, result) { + .exec(function (err, result) { expect(err).to.eql(null); expect(result[0]).to.eql([null, "bar"]); expect(result[1]).to.eql([null, "OK"]); @@ -79,14 +79,14 @@ describe("cluster:pipeline", function() { }); }); - it("should auto redirect commands on ASK", function(done) { - var asked = false; - var slotTable = [ + it("should auto redirect commands on ASK", function (done) { + let asked = false; + const slotTable = [ [0, 12181, ["127.0.0.1", 30001]], [12182, 12183, ["127.0.0.1", 30002]], - [12184, 16383, ["127.0.0.1", 30001]] + [12184, 16383, ["127.0.0.1", 30001]], ]; - new MockServer(30001, function(argv) { + new MockServer(30001, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } @@ -101,7 +101,7 @@ describe("cluster:pipeline", function() { asked = false; } }); - new MockServer(30002, function(argv) { + new MockServer(30002, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } @@ -110,12 +110,12 @@ describe("cluster:pipeline", function() { } }); - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }]); + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }]); cluster .pipeline() .get("foo") .set("foo", "bar") - .exec(function(err, result) { + .exec(function (err, result) { expect(err).to.eql(null); expect(result[0]).to.eql([null, "bar"]); expect(result[1]).to.eql([null, "OK"]); @@ -124,10 +124,10 @@ describe("cluster:pipeline", function() { }); }); - it("should retry the command on TRYAGAIN", function(done) { - var times = 0; - var slotTable = [[0, 16383, ["127.0.0.1", 30001]]]; - new MockServer(30001, function(argv) { + it("should retry the command on TRYAGAIN", function (done) { + let times = 0; + const slotTable = [[0, 16383, ["127.0.0.1", 30001]]]; + new MockServer(30001, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } @@ -140,14 +140,14 @@ describe("cluster:pipeline", function() { } }); - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { - retryDelayOnTryAgain: 1 + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { + retryDelayOnTryAgain: 1, }); cluster .pipeline() .get("foo") .set("foo", "bar") - .exec(function(err, result) { + .exec(function (err, result) { expect(result[0][1]).to.eql("OK"); expect(result[1][1]).to.eql("OK"); cluster.disconnect(); @@ -155,13 +155,13 @@ describe("cluster:pipeline", function() { }); }); - it("should not redirect commands on a non-readonly command is successful", function(done) { - var slotTable = [ + it("should not redirect commands on a non-readonly command is successful", function (done) { + const slotTable = [ [0, 12181, ["127.0.0.1", 30001]], [12182, 12183, ["127.0.0.1", 30002]], - [12184, 16383, ["127.0.0.1", 30001]] + [12184, 16383, ["127.0.0.1", 30001]], ]; - new MockServer(30001, function(argv) { + new MockServer(30001, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } @@ -169,7 +169,7 @@ describe("cluster:pipeline", function() { return "bar"; } }); - new MockServer(30002, function(argv) { + new MockServer(30002, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } @@ -178,12 +178,12 @@ describe("cluster:pipeline", function() { } }); - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }]); + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }]); cluster .pipeline() .get("foo") .set("foo", "bar") - .exec(function(err, result) { + .exec(function (err, result) { expect(err).to.eql(null); expect(result[0][0].message).to.match(/MOVED/); expect(result[1]).to.eql([null, "OK"]); @@ -192,18 +192,18 @@ describe("cluster:pipeline", function() { }); }); - it("should retry when redis is down", function(done) { - var slotTable = [ + it("should retry when redis is down", function (done) { + const slotTable = [ [0, 12181, ["127.0.0.1", 30001]], [12182, 12183, ["127.0.0.1", 30002]], - [12184, 16383, ["127.0.0.1", 30001]] + [12184, 16383, ["127.0.0.1", 30001]], ]; - new MockServer(30001, function(argv) { + new MockServer(30001, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } }); - var node2 = new MockServer(30002, function(argv) { + const node2 = new MockServer(30002, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } @@ -212,8 +212,8 @@ describe("cluster:pipeline", function() { } }); - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { - retryDelayOnFailover: 1 + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { + retryDelayOnFailover: 1, }); const stub = sinon .stub(cluster, "refreshSlotsCache") @@ -227,7 +227,7 @@ describe("cluster:pipeline", function() { .pipeline() .get("foo") .set("foo", "bar") - .exec(function(err, result) { + .exec(function (err, result) { expect(err).to.eql(null); expect(result[0]).to.eql([null, "bar"]); expect(result[1]).to.eql([null, "OK"]); diff --git a/test/functional/cluster/pub_sub.ts b/test/functional/cluster/pub_sub.ts index 4b56474c..08b561b8 100644 --- a/test/functional/cluster/pub_sub.ts +++ b/test/functional/cluster/pub_sub.ts @@ -4,27 +4,30 @@ import { Cluster } from "../../../lib"; import * as sinon from "sinon"; import Redis from "../../../lib/redis"; -describe("cluster:pub/sub", function() { - it("should receive messages", function(done) { - var handler = function(argv) { +describe("cluster:pub/sub", function () { + it("should receive messages", function (done) { + const handler = function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { - return [[0, 1, ["127.0.0.1", 30001]], [2, 16383, ["127.0.0.1", 30002]]]; + return [ + [0, 1, ["127.0.0.1", 30001]], + [2, 16383, ["127.0.0.1", 30002]], + ]; } }; - var node1 = new MockServer(30001, handler); + const node1 = new MockServer(30001, handler); new MockServer(30002, handler); - var options = [{ host: "127.0.0.1", port: "30001" }]; - var sub = new Cluster(options); + const options = [{ host: "127.0.0.1", port: "30001" }]; + const sub = new Cluster(options); - sub.subscribe("test cluster", function() { + sub.subscribe("test cluster", function () { node1.write(node1.findClientByName("ioredisClusterSubscriber"), [ "message", "test channel", - "hi" + "hi", ]); }); - sub.on("message", function(channel, message) { + sub.on("message", function (channel, message) { expect(channel).to.eql("test channel"); expect(message).to.eql("hi"); sub.disconnect(); @@ -32,26 +35,26 @@ describe("cluster:pub/sub", function() { }); }); - it("should works when sending regular commands", function(done) { - var handler = function(argv) { + it("should works when sending regular commands", function (done) { + const handler = function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return [[0, 16383, ["127.0.0.1", 30001]]]; } }; new MockServer(30001, handler); - var sub = new Cluster([{ port: "30001" }]); + const sub = new Cluster([{ port: "30001" }]); - sub.subscribe("test cluster", function() { - sub.set("foo", "bar").then(res => { + sub.subscribe("test cluster", function () { + sub.set("foo", "bar").then((res) => { expect(res).to.eql("OK"); done(); }); }); }); - it("supports password", function(done) { - const handler = function(argv, c) { + it("supports password", function (done) { + const handler = function (argv, c) { if (argv[0] === "auth") { c.password = argv[1]; return; @@ -66,61 +69,61 @@ describe("cluster:pub/sub", function() { }; new MockServer(30001, handler); - var sub = new Cluster([{ port: "30001", password: "abc" }]); + const sub = new Cluster([{ port: "30001", password: "abc" }]); - sub.subscribe("test cluster", function() { + sub.subscribe("test cluster", function () { done(); }); }); - it("should re-subscribe after reconnection", function(done) { - new MockServer(30001, function(argv) { + it("should re-subscribe after reconnection", function (done) { + new MockServer(30001, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return [[0, 16383, ["127.0.0.1", 30001]]]; } else if (argv[0] === "subscribe" || argv[0] === "psubscribe") { return [argv[0], argv[1]]; } }); - var client = new Cluster([{ host: "127.0.0.1", port: "30001" }]); + const client = new Cluster([{ host: "127.0.0.1", port: "30001" }]); - client.subscribe("test cluster", function() { + client.subscribe("test cluster", function () { const stub = sinon .stub(Redis.prototype, "subscribe") - .callsFake(channels => { + .callsFake((channels) => { expect(channels).to.eql(["test cluster"]); stub.restore(); client.disconnect(); done(); return Redis.prototype.subscribe.apply(this, arguments); }); - client.once("end", function() { + client.once("end", function () { client.connect(); }); client.disconnect(); }); }); - it("should re-psubscribe after reconnection", function(done) { - new MockServer(30001, function(argv) { + it("should re-psubscribe after reconnection", function (done) { + new MockServer(30001, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return [[0, 16383, ["127.0.0.1", 30001]]]; } else if (argv[0] === "subscribe" || argv[0] === "psubscribe") { return [argv[0], argv[1]]; } }); - var client = new Cluster([{ host: "127.0.0.1", port: "30001" }]); + const client = new Cluster([{ host: "127.0.0.1", port: "30001" }]); - client.psubscribe("test?", function() { + client.psubscribe("test?", function () { const stub = sinon .stub(Redis.prototype, "psubscribe") - .callsFake(channels => { + .callsFake((channels) => { expect(channels).to.eql(["test?"]); stub.restore(); client.disconnect(); done(); return Redis.prototype.psubscribe.apply(this, arguments); }); - client.once("end", function() { + client.once("end", function () { client.connect(); }); client.disconnect(); diff --git a/test/functional/cluster/quit.ts b/test/functional/cluster/quit.ts index 8bae0bcc..1e9fc567 100644 --- a/test/functional/cluster/quit.ts +++ b/test/functional/cluster/quit.ts @@ -3,10 +3,10 @@ import { expect } from "chai"; import { Cluster } from "../../../lib"; describe("cluster:quit", () => { - it("quit successfully when server is disconnecting", done => { + it("quit successfully when server is disconnecting", (done) => { const slotTable = [ [0, 1000, ["127.0.0.1", 30001]], - [1001, 16383, ["127.0.0.1", 30002]] + [1001, 16383, ["127.0.0.1", 30002]], ]; const server = new MockServer( 30001, @@ -39,15 +39,15 @@ describe("cluster:quit", () => { }); }); - it("failed when quit returns error", function(done) { + it("failed when quit returns error", function (done) { const ERROR_MESSAGE = "quit random error"; const slotTable = [ [0, 16381, ["127.0.0.1", 30001]], - [16382, 16383, ["127.0.0.1", 30002]] + [16382, 16383, ["127.0.0.1", 30002]], ]; new MockServer( 30001, - function(argv, c) { + function (argv, c) { if (argv[0] === "quit") { return new Error(ERROR_MESSAGE); } @@ -56,7 +56,7 @@ describe("cluster:quit", () => { ); new MockServer( 30002, - function(argv, c) { + function (argv, c) { if (argv[0] === "quit") { c.destroy(); } @@ -66,7 +66,7 @@ describe("cluster:quit", () => { const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }]); cluster.get("foo", () => { - cluster.quit(err => { + cluster.quit((err) => { expect(err.message).to.eql(ERROR_MESSAGE); cluster.disconnect(); done(); diff --git a/test/functional/cluster/tls.ts b/test/functional/cluster/tls.ts index d98c7bc4..e3ec7178 100644 --- a/test/functional/cluster/tls.ts +++ b/test/functional/cluster/tls.ts @@ -6,13 +6,13 @@ import * as tls from "tls"; import * as net from "net"; describe("cluster:tls option", () => { - it("supports tls", done => { - var slotTable = [ + it("supports tls", (done) => { + const slotTable = [ [0, 5460, ["127.0.0.1", 30001]], [5461, 10922, ["127.0.0.1", 30002]], - [10923, 16383, ["127.0.0.1", 30003]] + [10923, 16383, ["127.0.0.1", 30003]], ]; - var argvHandler = function(argv) { + const argvHandler = function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } @@ -23,32 +23,32 @@ describe("cluster:tls option", () => { new MockServer(30003, argvHandler); // @ts-ignore - const stub = sinon.stub(tls, "connect").callsFake(op => { + const stub = sinon.stub(tls, "connect").callsFake((op) => { // @ts-ignore expect(op.ca).to.eql("123"); // @ts-ignore expect(op.port).to.be.oneOf([30001, 30003, 30003]); const stream = net.createConnection(op); - stream.on("connect", data => { + stream.on("connect", (data) => { stream.emit("secureConnect", data); }); return stream; }); - var cluster = new Cluster( + const cluster = new Cluster( [ { host: "127.0.0.1", port: "30001" }, { host: "127.0.0.1", port: "30002" }, - { host: "127.0.0.1", port: "30003" } + { host: "127.0.0.1", port: "30003" }, ], { - redisOptions: { tls: { ca: "123" } } + redisOptions: { tls: { ca: "123" } }, } ); cluster.on("ready", () => { expect(cluster.subscriber.subscriber.options.tls).to.deep.equal({ - ca: "123" + ca: "123", }); cluster.disconnect(); diff --git a/test/functional/cluster/transaction.ts b/test/functional/cluster/transaction.ts index 77d1d31e..944b38f3 100644 --- a/test/functional/cluster/transaction.ts +++ b/test/functional/cluster/transaction.ts @@ -3,15 +3,15 @@ import MockServer from "../../helpers/mock_server"; import { expect } from "chai"; import { Cluster } from "../../../lib"; -describe("cluster:transaction", function() { - it("should auto redirect commands on MOVED", function(done) { - var moved = false; - var slotTable = [ +describe("cluster:transaction", function () { + it("should auto redirect commands on MOVED", function (done) { + let moved = false; + const slotTable = [ [0, 12181, ["127.0.0.1", 30001]], [12182, 12183, ["127.0.0.1", 30002]], - [12184, 16383, ["127.0.0.1", 30001]] + [12184, 16383, ["127.0.0.1", 30001]], ]; - new MockServer(30001, function(argv) { + new MockServer(30001, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } @@ -23,7 +23,7 @@ describe("cluster:transaction", function() { return ["bar", "OK"]; } }); - new MockServer(30002, function(argv) { + new MockServer(30002, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } @@ -38,13 +38,13 @@ describe("cluster:transaction", function() { } }); - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }]); + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }]); cluster .multi() .get("foo") .set("foo", "bar") - .exec(function(err, result) { + .exec(function (err, result) { expect(err).to.eql(null); expect(result[0]).to.eql([null, "bar"]); expect(result[1]).to.eql([null, "OK"]); @@ -53,14 +53,14 @@ describe("cluster:transaction", function() { }); }); - it("should auto redirect commands on ASK", function(done) { - var asked = false; - var slotTable = [ + it("should auto redirect commands on ASK", function (done) { + let asked = false; + const slotTable = [ [0, 12181, ["127.0.0.1", 30001]], [12182, 12183, ["127.0.0.1", 30002]], - [12184, 16383, ["127.0.0.1", 30001]] + [12184, 16383, ["127.0.0.1", 30001]], ]; - new MockServer(30001, function(argv) { + new MockServer(30001, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } @@ -82,7 +82,7 @@ describe("cluster:transaction", function() { asked = false; } }); - new MockServer(30002, function(argv) { + new MockServer(30002, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } @@ -96,12 +96,12 @@ describe("cluster:transaction", function() { } }); - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }]); + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }]); cluster .multi() .get("foo") .set("foo", "bar") - .exec(function(err, result) { + .exec(function (err, result) { expect(err).to.eql(null); expect(result[0]).to.eql([null, "bar"]); expect(result[1]).to.eql([null, "OK"]); @@ -110,12 +110,12 @@ describe("cluster:transaction", function() { }); }); - it("should not print unhandled warnings", function(done) { + it("should not print unhandled warnings", function (done) { const errorMessage = "Connection is closed."; - var slotTable = [[0, 16383, ["127.0.0.1", 30001]]]; + const slotTable = [[0, 16383, ["127.0.0.1", 30001]]]; new MockServer( 30001, - function(argv) { + function (argv) { if (argv[0] === "exec" || argv[1] === "foo") { return new Error(errorMessage); } @@ -123,12 +123,12 @@ describe("cluster:transaction", function() { slotTable ); - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { - maxRedirections: 3 + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { + maxRedirections: 3, }); let isDoneCalled = false; - const wrapDone = function(error?: Error) { + const wrapDone = function (error?: Error) { if (isDoneCalled) { return; } @@ -137,16 +137,16 @@ describe("cluster:transaction", function() { done(error); }; - process.on("unhandledRejection", err => { + process.on("unhandledRejection", (err) => { wrapDone(new Error("got unhandledRejection: " + (err as Error).message)); }); cluster .multi() .get("foo") .set("foo", "bar") - .exec(function(err) { + .exec(function (err) { expect(err).to.have.property("message", errorMessage); - cluster.on("end", function() { + cluster.on("end", function () { // Wait for the end event to ensure the transaction // promise has been resolved. wrapDone(); diff --git a/test/functional/cluster/tryagain.ts b/test/functional/cluster/tryagain.ts index e15df937..f6823abe 100644 --- a/test/functional/cluster/tryagain.ts +++ b/test/functional/cluster/tryagain.ts @@ -1,18 +1,18 @@ import MockServer from "../../helpers/mock_server"; import { Cluster } from "../../../lib"; -describe("cluster:TRYAGAIN", function() { - it("should retry the command", function(done) { - var cluster; - var times = 0; - var slotTable = [[0, 16383, ["127.0.0.1", 30001]]]; - new MockServer(30001, function(argv) { +describe("cluster:TRYAGAIN", function () { + it("should retry the command", function (done) { + let cluster; + let times = 0; + const slotTable = [[0, 16383, ["127.0.0.1", 30001]]]; + new MockServer(30001, function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } if (argv[0] === "get" && argv[1] === "foo") { if (times++ === 1) { - process.nextTick(function() { + process.nextTick(function () { cluster.disconnect(); done(); }); @@ -25,7 +25,7 @@ describe("cluster:TRYAGAIN", function() { }); cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }], { - retryDelayOnTryAgain: 1 + retryDelayOnTryAgain: 1, }); cluster.get("foo"); }); diff --git a/test/functional/connection.ts b/test/functional/connection.ts index 342c38b9..c8edf79f 100644 --- a/test/functional/connection.ts +++ b/test/functional/connection.ts @@ -5,28 +5,28 @@ import { expect } from "chai"; import MockServer from "../helpers/mock_server"; import * as Bluebird from "bluebird"; -describe("connection", function() { - it('should emit "connect" when connected', function(done) { - var redis = new Redis(); - redis.on("connect", function() { +describe("connection", function () { + it('should emit "connect" when connected', function (done) { + const redis = new Redis(); + redis.on("connect", function () { redis.disconnect(); done(); }); }); - it('should emit "close" when disconnected', function(done) { - var redis = new Redis(); + it('should emit "close" when disconnected', function (done) { + const redis = new Redis(); redis.once("end", done); - redis.once("connect", function() { + redis.once("connect", function () { redis.disconnect(); }); }); - it("should send AUTH command before any other commands", function(done) { - var redis = new Redis({ password: "123" }); + it("should send AUTH command before any other commands", function (done) { + const redis = new Redis({ password: "123" }); redis.get("foo"); - var times = 0; - sinon.stub(redis, "sendCommand").callsFake(command => { + let times = 0; + sinon.stub(redis, "sendCommand").callsFake((command) => { times += 1; if (times === 1) { expect(command.name).to.eql("auth"); @@ -38,19 +38,19 @@ describe("connection", function() { }); }); - it("should receive replies after connection is disconnected", function(done) { - var redis = new Redis(); - redis.set("foo", "bar", function() { + it("should receive replies after connection is disconnected", function (done) { + const redis = new Redis(); + redis.set("foo", "bar", function () { redis.stream.end(); }); - redis.get("foo", function(err, res) { + redis.get("foo", function (err, res) { expect(res).to.eql("bar"); redis.disconnect(); done(); }); }); - it("connects successfully immediately after end", done => { + it("connects successfully immediately after end", (done) => { const redis = new Redis(); redis.once("end", async () => { await redis.connect(); @@ -60,7 +60,7 @@ describe("connection", function() { redis.quit(); }); - it("connects successfully immediately after quit", done => { + it("connects successfully immediately after quit", (done) => { const redis = new Redis(); redis.once("end", async () => { await redis.connect(); @@ -74,19 +74,19 @@ describe("connection", function() { }); describe("connectTimeout", () => { - it("should close the connection when timeout", function(done) { - var redis = new Redis(6379, "192.0.0.0", { + it("should close the connection when timeout", function (done) { + const redis = new Redis(6379, "192.0.0.0", { connectTimeout: 1, - retryStrategy: null + retryStrategy: null, }); - var pending = 2; - redis.on("error", function(err) { + let pending = 2; + redis.on("error", function (err) { expect(err.message).to.eql("connect ETIMEDOUT"); if (!--pending) { done(); } }); - redis.get("foo", function(err) { + redis.get("foo", function (err) { expect(err.message).to.match(/Connection is closed/); if (!--pending) { redis.disconnect(); @@ -95,16 +95,16 @@ describe("connection", function() { }); }); - it("should clear the timeout when connected", function(done) { + it("should clear the timeout when connected", function (done) { const connectTimeout = 10000; - var redis = new Redis({ connectTimeout }); - var set = false; + const redis = new Redis({ connectTimeout }); + let set = false; // TODO: use spy const stub = sinon .stub(net.Socket.prototype, "setTimeout") // @ts-ignore - .callsFake(timeout => { + .callsFake((timeout) => { if (timeout === connectTimeout) { set = true; return; @@ -117,11 +117,11 @@ describe("connection", function() { }); }); - it("should ignore timeout if connect", function(done) { - var redis = new Redis({ + it("should ignore timeout if connect", function (done) { + const redis = new Redis({ port: 6379, connectTimeout: 500, - retryStrategy: null + retryStrategy: null, }); let isReady = false; let timedoutCalled = false; @@ -150,19 +150,22 @@ describe("connection", function() { }); }); - describe("#connect", function() { - it("should return a promise", function(done) { - var pending = 2; - var redis = new Redis({ lazyConnect: true }); - redis.connect().then(function() { + describe("#connect", function () { + it("should return a promise", function (done) { + let pending = 2; + const redis = new Redis({ lazyConnect: true }); + redis.connect().then(function () { redis.disconnect(); if (!--pending) { done(); } }); - var redis2 = new Redis(6390, { lazyConnect: true, retryStrategy: null }); - redis2.connect().catch(function() { + const redis2 = new Redis(6390, { + lazyConnect: true, + retryStrategy: null, + }); + redis2.connect().catch(function () { if (!--pending) { redis2.disconnect(); done(); @@ -170,67 +173,67 @@ describe("connection", function() { }); }); - it("should stop reconnecting when disconnected", function(done) { - var redis = new Redis(8999, { - retryStrategy: function() { + it("should stop reconnecting when disconnected", function (done) { + const redis = new Redis(8999, { + retryStrategy: function () { return 0; - } + }, }); - redis.on("close", function() { + redis.on("close", function () { redis.disconnect(); sinon .stub(Redis.prototype, "connect") .throws(new Error("`connect` should not be called")); - setTimeout(function() { + setTimeout(function () { Redis.prototype.connect.restore(); done(); }, 1); }); }); - it("should reject when connected", function(done) { - var redis = new Redis(); - redis.connect().catch(function(err) { + it("should reject when connected", function (done) { + const redis = new Redis(); + redis.connect().catch(function (err) { expect(err.message).to.match(/Redis is already connecting/); redis.disconnect(); done(); }); }); - it("should resolve when the status become ready", function(done) { - var redis = new Redis({ lazyConnect: true }); - redis.connect().then(function() { + it("should resolve when the status become ready", function (done) { + const redis = new Redis({ lazyConnect: true }); + redis.connect().then(function () { expect(redis.status).to.eql("ready"); redis.disconnect(); done(); }); }); - it("should reject when closed (reconnecting)", function(done) { - var redis = new Redis({ + it("should reject when closed (reconnecting)", function (done) { + const redis = new Redis({ port: 8989, lazyConnect: true, - retryStrategy: function() { + retryStrategy: function () { return 0; - } + }, }); - redis.connect().catch(function() { + redis.connect().catch(function () { expect(redis.status).to.eql("reconnecting"); redis.disconnect(); done(); }); }); - it("should reject when closed (end)", function(done) { - var redis = new Redis({ + it("should reject when closed (end)", function (done) { + const redis = new Redis({ port: 8989, lazyConnect: true, - retryStrategy: null + retryStrategy: null, }); - redis.connect().catch(function() { + redis.connect().catch(function () { expect(redis.status).to.eql("end"); redis.disconnect(); done(); @@ -238,46 +241,46 @@ describe("connection", function() { }); }); - describe("retryStrategy", function() { - it("should pass the correct retry times", function(done) { - var t = 0; + describe("retryStrategy", function () { + it("should pass the correct retry times", function (done) { + let t = 0; new Redis({ port: 1, - retryStrategy: function(times) { + retryStrategy: function (times) { expect(times).to.eql(++t); if (times === 3) { done(); return; } return 0; - } + }, }); }); - it("should skip reconnecting when retryStrategy doesn't return a number", function(done) { + it("should skip reconnecting when retryStrategy doesn't return a number", function (done) { var redis = new Redis({ port: 1, - retryStrategy: function() { - process.nextTick(function() { + retryStrategy: function () { + process.nextTick(function () { expect(redis.status).to.eql("end"); redis.disconnect(); done(); }); return null; - } + }, }); }); - it("should skip reconnecting if quitting before connecting", function(done) { - var count = 0; - var redis = new Redis({ + it("should skip reconnecting if quitting before connecting", function (done) { + let count = 0; + const redis = new Redis({ port: 8999, - retryStrategy: function() { + retryStrategy: function () { count++; - } + }, }); - redis.quit().then(function(result) { + redis.quit().then(function (result) { expect(result).to.eql("OK"); expect(count).to.eql(0); redis.disconnect(); @@ -285,15 +288,15 @@ describe("connection", function() { }); }); - it("should skip reconnecting if quitting before connecting (buffer)", function(done) { - var redis = new Redis({ + it("should skip reconnecting if quitting before connecting (buffer)", function (done) { + const redis = new Redis({ port: 8999, - retryStrategy: function() { + retryStrategy: function () { throw new Error("should not reconnect"); - } + }, }); - redis.quitBuffer().then(function(result) { + redis.quitBuffer().then(function (result) { expect(result).to.be.instanceof(Buffer); expect(result.toString()).to.eql("OK"); redis.disconnect(); @@ -302,11 +305,11 @@ describe("connection", function() { }); }); - describe("connectionName", function() { - it("should name the connection if options.connectionName is not null", function(done) { - var redis = new Redis({ connectionName: "niceName" }); - redis.once("ready", function() { - redis.client("getname", function(err, res) { + describe("connectionName", function () { + it("should name the connection if options.connectionName is not null", function (done) { + const redis = new Redis({ connectionName: "niceName" }); + redis.once("ready", function () { + redis.client("getname", function (err, res) { expect(res).to.eql("niceName"); redis.disconnect(); done(); @@ -315,13 +318,13 @@ describe("connection", function() { redis.set("foo", 1); }); - it("should set the name before any subscribe command if reconnected", function(done) { - var redis = new Redis({ connectionName: "niceName" }); - redis.once("ready", function() { - redis.subscribe("l", function() { + it("should set the name before any subscribe command if reconnected", function (done) { + const redis = new Redis({ connectionName: "niceName" }); + redis.once("ready", function () { + redis.subscribe("l", function () { redis.disconnect(true); - redis.unsubscribe("l", function() { - redis.client("getname", function(err, res) { + redis.unsubscribe("l", function () { + redis.client("getname", function (err, res) { expect(res).to.eql("niceName"); redis.disconnect(); done(); @@ -332,36 +335,36 @@ describe("connection", function() { }); }); - describe("readOnly", function() { - it("should send readonly command before other commands", function(done) { - var called = false; - var redis = new Redis({ + describe("readOnly", function () { + it("should send readonly command before other commands", function (done) { + let called = false; + const redis = new Redis({ port: 30001, readOnly: true, - showFriendlyErrorStack: true + showFriendlyErrorStack: true, }); - var node = new MockServer(30001, function(argv) { + var node = new MockServer(30001, function (argv) { if (argv[0] === "readonly") { called = true; } else if (argv[0] === "get" && argv[1] === "foo") { expect(called).to.eql(true); redis.disconnect(); - node.disconnect(function() { + node.disconnect(function () { done(); }); } }); - redis.get("foo").catch(function() {}); + redis.get("foo").catch(function () {}); }); }); - describe("autoResendUnfulfilledCommands", function() { - it("should resend unfulfilled commands to the correct db when reconnected", function(done) { - var redis = new Redis({ db: 3 }); - var pub = new Redis({ db: 3 }); - redis.once("ready", function() { - var pending = 2; - redis.blpop("l", 0, function(err, res) { + describe("autoResendUnfulfilledCommands", function () { + it("should resend unfulfilled commands to the correct db when reconnected", function (done) { + const redis = new Redis({ db: 3 }); + const pub = new Redis({ db: 3 }); + redis.once("ready", function () { + let pending = 2; + redis.blpop("l", 0, function (err, res) { expect(res[0]).to.eql("l"); expect(res[1]).to.eql("1"); if (!--pending) { @@ -373,30 +376,30 @@ describe("connection", function() { redis .pipeline() .incr("foo") - .exec(function(err, res) { + .exec(function (err, res) { expect(res[0][1]).to.eql(2); if (!--pending) { done(); } }); - setTimeout(function() { + setTimeout(function () { redis.stream.end(); }, 0); }); - redis.once("close", function() { + redis.once("close", function () { pub.lpush("l", 1); }); }); - it("should resend previous subscribes before sending unfulfilled commands", function(done) { - var redis = new Redis({ db: 4 }); - var pub = new Redis({ db: 4 }); - redis.once("ready", function() { - pub.pubsub("channels", function(err, channelsBefore) { - redis.subscribe("l", function() { + it("should resend previous subscribes before sending unfulfilled commands", function (done) { + const redis = new Redis({ db: 4 }); + const pub = new Redis({ db: 4 }); + redis.once("ready", function () { + pub.pubsub("channels", function (err, channelsBefore) { + redis.subscribe("l", function () { redis.disconnect(true); - redis.unsubscribe("l", function() { - pub.pubsub("channels", function(err, channels) { + redis.unsubscribe("l", function () { + pub.pubsub("channels", function (err, channels) { expect(channels.length).to.eql(channelsBefore.length); redis.disconnect(); done(); @@ -409,7 +412,7 @@ describe("connection", function() { }); describe("sync connection", () => { - it("works with synchronous connection", done => { + it("works with synchronous connection", (done) => { // @ts-ignore Redis.Promise = Bluebird; const redis = new Redis("/data"); diff --git a/test/functional/drop_buffer_support.ts b/test/functional/drop_buffer_support.ts index 62c65152..990910b1 100644 --- a/test/functional/drop_buffer_support.ts +++ b/test/functional/drop_buffer_support.ts @@ -1,18 +1,18 @@ import Redis from "../../lib/redis"; import { expect } from "chai"; -describe("dropBufferSupport", function() { - it("should be disabled by default", function() { - var redis = new Redis({ lazyConnect: true }); +describe("dropBufferSupport", function () { + it("should be disabled by default", function () { + const redis = new Redis({ lazyConnect: true }); expect(redis.options).to.have.property("dropBufferSupport", false); }); - it("should return strings correctly", function(done) { - var redis = new Redis({ dropBufferSupport: false }); - redis.set("foo", Buffer.from("bar"), function(err, res) { + it("should return strings correctly", function (done) { + const redis = new Redis({ dropBufferSupport: false }); + redis.set("foo", Buffer.from("bar"), function (err, res) { expect(err).to.eql(null); expect(res).to.eql("OK"); - redis.get("foo", function(err, res) { + redis.get("foo", function (err, res) { expect(err).to.eql(null); expect(res).to.eql("bar"); redis.disconnect(); @@ -21,13 +21,13 @@ describe("dropBufferSupport", function() { }); }); - context("enabled", function() { - it("should reject the buffer commands", function(done) { - var redis = new Redis({ dropBufferSupport: true }); - redis.getBuffer("foo", function(err) { + context("enabled", function () { + it("should reject the buffer commands", function (done) { + const redis = new Redis({ dropBufferSupport: true }); + redis.getBuffer("foo", function (err) { expect(err.message).to.match(/Buffer methods are not available/); - redis.callBuffer("get", "foo", function(err) { + redis.callBuffer("get", "foo", function (err) { expect(err.message).to.match(/Buffer methods are not available/); redis.disconnect(); done(); @@ -35,25 +35,25 @@ describe("dropBufferSupport", function() { }); }); - it("should reject the custom buffer commands", function(done) { - var redis = new Redis({ dropBufferSupport: true }); + it("should reject the custom buffer commands", function (done) { + const redis = new Redis({ dropBufferSupport: true }); redis.defineCommand("geteval", { numberOfKeys: 0, - lua: 'return "string"' + lua: 'return "string"', }); - redis.getevalBuffer(function(err) { + redis.getevalBuffer(function (err) { expect(err.message).to.match(/Buffer methods are not available/); redis.disconnect(); done(); }); }); - it("should return strings correctly", function(done) { - var redis = new Redis({ dropBufferSupport: true }); - redis.set("foo", Buffer.from("bar"), function(err, res) { + it("should return strings correctly", function (done) { + const redis = new Redis({ dropBufferSupport: true }); + redis.set("foo", Buffer.from("bar"), function (err, res) { expect(err).to.eql(null); expect(res).to.eql("OK"); - redis.get("foo", function(err, res) { + redis.get("foo", function (err, res) { expect(err).to.eql(null); expect(res).to.eql("bar"); redis.disconnect(); @@ -62,13 +62,13 @@ describe("dropBufferSupport", function() { }); }); - it("should return strings for custom commands", function(done) { - var redis = new Redis({ dropBufferSupport: true }); + it("should return strings for custom commands", function (done) { + const redis = new Redis({ dropBufferSupport: true }); redis.defineCommand("geteval", { numberOfKeys: 0, - lua: 'return "string"' + lua: 'return "string"', }); - redis.geteval(function(err, res) { + redis.geteval(function (err, res) { expect(err).to.eql(null); expect(res).to.eql("string"); redis.disconnect(); @@ -76,12 +76,12 @@ describe("dropBufferSupport", function() { }); }); - it("should work with pipeline", function(done) { - var redis = new Redis({ dropBufferSupport: true }); - var pipeline = redis.pipeline(); + it("should work with pipeline", function (done) { + const redis = new Redis({ dropBufferSupport: true }); + const pipeline = redis.pipeline(); pipeline.set("foo", "bar"); pipeline.get(Buffer.from("foo")); - pipeline.exec(function(err, res) { + pipeline.exec(function (err, res) { expect(err).to.eql(null); expect(res[0][1]).to.eql("OK"); expect(res[1][1]).to.eql("bar"); @@ -90,13 +90,13 @@ describe("dropBufferSupport", function() { }); }); - it("should work with transaction", function(done) { - var redis = new Redis({ dropBufferSupport: true }); + it("should work with transaction", function (done) { + const redis = new Redis({ dropBufferSupport: true }); redis .multi() .set("foo", "bar") .get("foo") - .exec(function(err, res) { + .exec(function (err, res) { expect(err).to.eql(null); expect(res[0][1]).to.eql("OK"); expect(res[1][1]).to.eql("bar"); @@ -105,23 +105,23 @@ describe("dropBufferSupport", function() { }); }); - it("should fail early with Buffer transaction", function(done) { - var redis = new Redis({ dropBufferSupport: true }); + it("should fail early with Buffer transaction", function (done) { + const redis = new Redis({ dropBufferSupport: true }); redis .multi() .set("foo", "bar") - .getBuffer(Buffer.from("foo"), function(err) { + .getBuffer(Buffer.from("foo"), function (err) { expect(err.message).to.match(/Buffer methods are not available/); redis.disconnect(); done(); }); }); - it("should work with internal select command", function(done) { - var redis = new Redis({ dropBufferSupport: true, db: 1 }); - var check = new Redis({ db: 1 }); - redis.set("foo", "bar", function() { - check.get("foo", function(err, res) { + it("should work with internal select command", function (done) { + const redis = new Redis({ dropBufferSupport: true, db: 1 }); + const check = new Redis({ db: 1 }); + redis.set("foo", "bar", function () { + check.get("foo", function (err, res) { expect(res).to.eql("bar"); redis.disconnect(); check.disconnect(); diff --git a/test/functional/duplicate.ts b/test/functional/duplicate.ts index 3b877d1f..e5702aaa 100644 --- a/test/functional/duplicate.ts +++ b/test/functional/duplicate.ts @@ -3,8 +3,8 @@ import { expect } from "chai"; describe("duplicate", () => { it("clone the options", () => { - var redis = new Redis(); - var duplicatedRedis = redis.duplicate(); + const redis = new Redis(); + const duplicatedRedis = redis.duplicate(); redis.options.port = 1234; expect(duplicatedRedis.options.port).to.eql(6379); }); diff --git a/test/functional/elasticache.ts b/test/functional/elasticache.ts index 2af3bb1f..c355e04f 100644 --- a/test/functional/elasticache.ts +++ b/test/functional/elasticache.ts @@ -31,7 +31,7 @@ function simulateElasticache(options: { // bring the mock server back up mockServer.connect(); return options.reconnectOnErrorValue; - } + }, }); } @@ -46,30 +46,30 @@ function expectAbortError(err) { expect(err.message).to.eql("Command aborted due to connection close"); } -describe("elasticache", function() { - it("should abort a failed transaction when connection is lost", function(done) { +describe("elasticache", function () { + it("should abort a failed transaction when connection is lost", function (done) { const redis = simulateElasticache({ reconnectOnErrorValue: true }); redis .multi() .del("foo") .del("bar") - .exec(err => { + .exec((err) => { expectAbortError(err); expect(err.command).to.eql({ name: "exec", - args: [] + args: [], }); expect(err.previousErrors).to.have.lengthOf(2); expectReplyError(err.previousErrors[0]); expect(err.previousErrors[0].command).to.eql({ name: "del", - args: ["foo"] + args: ["foo"], }); expectAbortError(err.previousErrors[1]); expect(err.previousErrors[1].command).to.eql({ name: "del", - args: ["bar"] + args: ["bar"], }); // ensure we've recovered into a healthy state @@ -80,28 +80,28 @@ describe("elasticache", function() { }); }); - it("should not resend failed transaction commands", function(done) { + it("should not resend failed transaction commands", function (done) { const redis = simulateElasticache({ reconnectOnErrorValue: 2 }); redis .multi() .del("foo") .get("bar") - .exec(err => { + .exec((err) => { expectAbortError(err); expect(err.command).to.eql({ name: "exec", - args: [] + args: [], }); expect(err.previousErrors).to.have.lengthOf(2); expectAbortError(err.previousErrors[0]); expect(err.previousErrors[0].command).to.eql({ name: "del", - args: ["foo"] + args: ["foo"], }); expectAbortError(err.previousErrors[1]); expect(err.previousErrors[1].command).to.eql({ name: "get", - args: ["bar"] + args: ["bar"], }); // ensure we've recovered into a healthy state @@ -112,7 +112,7 @@ describe("elasticache", function() { }); }); - it("should resend intact pipelines", function(done) { + it("should resend intact pipelines", function (done) { const redis = simulateElasticache({ reconnectOnErrorValue: true }); let p1Result; @@ -134,12 +134,12 @@ describe("elasticache", function() { expectReplyError(p1Result[0][0]); expect(p1Result[0][0].command).to.eql({ name: "del", - args: ["foo"] + args: ["foo"], }); expectAbortError(p1Result[1][0]); expect(p1Result[1][0].command).to.eql({ name: "get", - args: ["bar"] + args: ["bar"], }); // Second pipeline was intact and should have been retried successfully diff --git a/test/functional/exports.ts b/test/functional/exports.ts index 7418ca45..420d76a7 100644 --- a/test/functional/exports.ts +++ b/test/functional/exports.ts @@ -1,21 +1,21 @@ import { Command, Cluster, ReplyError } from "../../lib"; import { expect } from "chai"; -describe("exports", function() { - describe(".Command", function() { - it("should be `Command`", function() { +describe("exports", function () { + describe(".Command", function () { + it("should be `Command`", function () { expect(Command).to.eql(require("../../lib/command").default); }); }); - describe(".Cluster", function() { - it("should be `Cluster`", function() { + describe(".Cluster", function () { + it("should be `Cluster`", function () { expect(Cluster).to.eql(require("../../lib/cluster").default); }); }); - describe(".ReplyError", function() { - it("should be `ReplyError`", function() { + describe(".ReplyError", function () { + it("should be `ReplyError`", function () { expect(ReplyError).to.eql(require("redis-errors").ReplyError); }); }); diff --git a/test/functional/fatal_error.ts b/test/functional/fatal_error.ts index 7b5f6889..30e101ad 100644 --- a/test/functional/fatal_error.ts +++ b/test/functional/fatal_error.ts @@ -2,10 +2,10 @@ import Redis from "../../lib/redis"; import { expect } from "chai"; import MockServer from "../helpers/mock_server"; -describe("fatal_error", function() { - it("should handle fatal error of parser", function(done) { - var recovered = false; - new MockServer(30000, argv => { +describe("fatal_error", function () { + it("should handle fatal error of parser", function (done) { + let recovered = false; + new MockServer(30000, (argv) => { if (recovered) { return; } @@ -13,12 +13,12 @@ describe("fatal_error", function() { return MockServer.raw("&"); } }); - var redis = new Redis(30000); - redis.get("foo", function(err) { + const redis = new Redis(30000); + redis.get("foo", function (err) { expect(err.message).to.match(/Protocol error/); recovered = true; - redis.get("bar", function(err) { + redis.get("bar", function (err) { expect(err).to.eql(null); done(); }); diff --git a/test/functional/lazy_connect.ts b/test/functional/lazy_connect.ts index df608c77..b31aae66 100644 --- a/test/functional/lazy_connect.ts +++ b/test/functional/lazy_connect.ts @@ -3,8 +3,8 @@ import { expect } from "chai"; import * as sinon from "sinon"; import { Cluster } from "../../lib"; -describe("lazy connect", function() { - it("should not call `connect` when init", function() { +describe("lazy connect", function () { + it("should not call `connect` when init", function () { // TODO: use spy const stub = sinon .stub(Redis.prototype, "connect") @@ -14,36 +14,36 @@ describe("lazy connect", function() { stub.restore(); }); - it("should connect when calling a command", function(done) { - var redis = new Redis({ lazyConnect: true }); + it("should connect when calling a command", function (done) { + const redis = new Redis({ lazyConnect: true }); redis.set("foo", "bar"); - redis.get("foo", function(err, result) { + redis.get("foo", function (err, result) { expect(result).to.eql("bar"); done(); }); }); - it("should not try to reconnect when disconnected manually", function(done) { - var redis = new Redis({ lazyConnect: true }); - redis.get("foo", function() { + it("should not try to reconnect when disconnected manually", function (done) { + const redis = new Redis({ lazyConnect: true }); + redis.get("foo", function () { redis.disconnect(); - redis.get("foo", function(err) { + redis.get("foo", function (err) { expect(err.message).to.match(/Connection is closed/); done(); }); }); }); - it("should be able to disconnect", function(done) { - var redis = new Redis({ lazyConnect: true }); - redis.on("end", function() { + it("should be able to disconnect", function (done) { + const redis = new Redis({ lazyConnect: true }); + redis.on("end", function () { done(); }); redis.disconnect(); }); - describe("Cluster", function() { - it("should not call `connect` when init", function() { + describe("Cluster", function () { + it("should not call `connect` when init", function () { const stub = sinon .stub(Cluster.prototype, "connect") .throws(new Error("`connect` should not be called")); @@ -51,14 +51,14 @@ describe("lazy connect", function() { stub.restore(); }); - it('should quit before "close" being emited', function(done) { + it('should quit before "close" being emited', function (done) { const stub = sinon .stub(Cluster.prototype, "connect") .throws(new Error("`connect` should not be called")); - var cluster = new Cluster([], { lazyConnect: true }); - cluster.quit(function() { - cluster.once("close", function() { - cluster.once("end", function() { + const cluster = new Cluster([], { lazyConnect: true }); + cluster.quit(function () { + cluster.once("close", function () { + cluster.once("end", function () { stub.restore(); done(); }); @@ -66,32 +66,32 @@ describe("lazy connect", function() { }); }); - it('should disconnect before "close" being emited', function(done) { + it('should disconnect before "close" being emited', function (done) { const stub = sinon .stub(Cluster.prototype, "connect") .throws(new Error("`connect` should not be called")); - var cluster = new Cluster([], { lazyConnect: true }); + const cluster = new Cluster([], { lazyConnect: true }); cluster.disconnect(); - cluster.once("close", function() { - cluster.once("end", function() { + cluster.once("close", function () { + cluster.once("end", function () { stub.restore(); done(); }); }); }); - it("should support disconnecting with reconnect", function(done) { + it("should support disconnecting with reconnect", function (done) { let stub = sinon .stub(Cluster.prototype, "connect") .throws(new Error("`connect` should not be called")); - var cluster = new Cluster([], { + const cluster = new Cluster([], { lazyConnect: true, - clusterRetryStrategy: function() { + clusterRetryStrategy: function () { return 1; - } + }, }); cluster.disconnect(true); - cluster.once("close", function() { + cluster.once("close", function () { stub.restore(); stub = sinon.stub(Cluster.prototype, "connect").callsFake(() => { stub.restore(); diff --git a/test/functional/maxRetriesPerRequest.ts b/test/functional/maxRetriesPerRequest.ts index 3c73a71d..eb397a35 100644 --- a/test/functional/maxRetriesPerRequest.ts +++ b/test/functional/maxRetriesPerRequest.ts @@ -2,27 +2,27 @@ import Redis from "../../lib/redis"; import { expect } from "chai"; import { MaxRetriesPerRequestError } from "../../lib/errors"; -describe("maxRetriesPerRequest", function() { - it("throw the correct error when reached the limit", function(done) { - var redis = new Redis(9999, { +describe("maxRetriesPerRequest", function () { + it("throw the correct error when reached the limit", function (done) { + const redis = new Redis(9999, { connectTimeout: 1, retryStrategy() { return 1; - } + }, }); - redis.get("foo", err => { + redis.get("foo", (err) => { expect(err).instanceOf(MaxRetriesPerRequestError); redis.disconnect(); done(); }); }); - it("defaults to max 20 retries", function(done) { - var redis = new Redis(9999, { + it("defaults to max 20 retries", function (done) { + const redis = new Redis(9999, { connectTimeout: 1, retryStrategy() { return 1; - } + }, }); redis.get("foo", () => { expect(redis.retryAttempts).to.eql(21); @@ -34,12 +34,12 @@ describe("maxRetriesPerRequest", function() { }); }); - it("can be changed", function(done) { - var redis = new Redis(9999, { + it("can be changed", function (done) { + const redis = new Redis(9999, { maxRetriesPerRequest: 1, retryStrategy() { return 1; - } + }, }); redis.get("foo", () => { expect(redis.retryAttempts).to.eql(2); @@ -51,12 +51,12 @@ describe("maxRetriesPerRequest", function() { }); }); - it("allows 0", function(done) { - var redis = new Redis(9999, { + it("allows 0", function (done) { + const redis = new Redis(9999, { maxRetriesPerRequest: 0, retryStrategy() { return 1; - } + }, }); redis.get("foo", () => { expect(redis.retryAttempts).to.eql(1); diff --git a/test/functional/monitor.ts b/test/functional/monitor.ts index 6e3b948f..efe3955a 100644 --- a/test/functional/monitor.ts +++ b/test/functional/monitor.ts @@ -2,16 +2,16 @@ import Redis from "../../lib/redis"; import { expect } from "chai"; import * as sinon from "sinon"; -describe("monitor", function() { - it("should receive commands", function(done) { - var redis = new Redis(); - redis.on("ready", function() { - redis.monitor(function(err, monitor) { +describe("monitor", function () { + it("should receive commands", function (done) { + const redis = new Redis(); + redis.on("ready", function () { + redis.monitor(function (err, monitor) { if (err) { done(err); return; } - monitor.on("monitor", function(time, args) { + monitor.on("monitor", function (time, args) { expect(args[0]).to.eql("get"); expect(args[1]).to.eql("foo"); redis.disconnect(); @@ -23,10 +23,10 @@ describe("monitor", function() { }); }); - it("should reject processing commands", function(done) { - var redis = new Redis(); - redis.monitor(function(err, monitor) { - monitor.get("foo", function(err) { + it("should reject processing commands", function (done) { + const redis = new Redis(); + redis.monitor(function (err, monitor) { + monitor.get("foo", function (err) { expect(err.message).to.match(/Connection is in monitoring mode/); redis.disconnect(); monitor.disconnect(); @@ -35,14 +35,14 @@ describe("monitor", function() { }); }); - it("should continue monitoring after reconnection", function(done) { - var redis = new Redis(); - redis.monitor(function(err, monitor) { + it("should continue monitoring after reconnection", function (done) { + const redis = new Redis(); + redis.monitor(function (err, monitor) { if (err) { done(err); return; } - monitor.on("monitor", function(time, args) { + monitor.on("monitor", function (time, args) { if (args[0] === "set") { redis.disconnect(); monitor.disconnect(); @@ -50,17 +50,17 @@ describe("monitor", function() { } }); monitor.disconnect(true); - monitor.on("ready", function() { + monitor.on("ready", function () { redis.set("foo", "bar"); }); }); }); - it("should wait for the ready event before monitoring", function(done) { - var redis = new Redis(); - redis.on("ready", function() { + it("should wait for the ready event before monitoring", function (done) { + const redis = new Redis(); + redis.on("ready", function () { const readyCheck = sinon.spy(Redis.prototype, "_readyCheck"); - redis.monitor(function(err, monitor) { + redis.monitor(function (err, monitor) { expect(readyCheck.callCount).to.eql(1); Redis.prototype._readyCheck.restore(); redis.disconnect(); diff --git a/test/functional/pipeline.ts b/test/functional/pipeline.ts index 09907962..7a942631 100644 --- a/test/functional/pipeline.ts +++ b/test/functional/pipeline.ts @@ -1,9 +1,9 @@ import Redis from "../../lib/redis"; import { expect } from "chai"; -describe("pipeline", function() { - it("should return correct result", function(done) { - var redis = new Redis(); +describe("pipeline", function () { + it("should return correct result", function (done) { + const redis = new Redis(); redis .pipeline() .set("foo", "1") @@ -11,23 +11,23 @@ describe("pipeline", function() { .set("foo", "2") .incr("foo") .get("foo") - .exec(function(err, results) { + .exec(function (err, results) { expect(err).to.eql(null); expect(results).to.eql([ [null, "OK"], [null, "1"], [null, "OK"], [null, 3], - [null, "3"] + [null, "3"], ]); redis.disconnect(); done(); }); }); - it("should return an empty array on empty pipeline", function(done) { - var redis = new Redis(); - redis.pipeline().exec(function(err, results) { + it("should return an empty array on empty pipeline", function (done) { + const redis = new Redis(); + redis.pipeline().exec(function (err, results) { expect(err).to.eql(null); expect(results).to.eql([]); redis.disconnect(); @@ -35,33 +35,33 @@ describe("pipeline", function() { }); }); - it("should support mix string command and buffer command", function(done) { - var redis = new Redis(); + it("should support mix string command and buffer command", function (done) { + const redis = new Redis(); redis .pipeline() .set("foo", "bar") .set("foo", Buffer.from("bar")) .getBuffer("foo") .get(Buffer.from("foo")) - .exec(function(err, results) { + .exec(function (err, results) { expect(err).to.eql(null); expect(results).to.eql([ [null, "OK"], [null, "OK"], [null, Buffer.from("bar")], - [null, "bar"] + [null, "bar"], ]); redis.disconnect(); done(); }); }); - it("should handle error correctly", function(done) { - var redis = new Redis(); + it("should handle error correctly", function (done) { + const redis = new Redis(); redis .pipeline() .set("foo") - .exec(function(err, results) { + .exec(function (err, results) { expect(err).to.eql(null); expect(results.length).to.eql(1); expect(results[0].length).to.eql(1); @@ -71,17 +71,17 @@ describe("pipeline", function() { }); }); - it("should also invoke the command's callback", function(done) { - var redis = new Redis(); - var pending = 1; + it("should also invoke the command's callback", function (done) { + const redis = new Redis(); + let pending = 1; redis .pipeline() .set("foo", "bar") - .get("foo", function(err, result) { + .get("foo", function (err, result) { expect(result).to.eql("bar"); pending -= 1; }) - .exec(function(err, results) { + .exec(function (err, results) { expect(pending).to.eql(0); expect(results[1][1]).to.eql("bar"); redis.disconnect(); @@ -89,8 +89,8 @@ describe("pipeline", function() { }); }); - it("should support inline transaction", function(done) { - var redis = new Redis(); + it("should support inline transaction", function (done) { + const redis = new Redis(); redis .pipeline() @@ -98,7 +98,7 @@ describe("pipeline", function() { .set("foo", "bar") .get("foo") .exec() - .exec(function(err, result) { + .exec(function (err, result) { expect(result[0][1]).to.eql("OK"); expect(result[1][1]).to.eql("QUEUED"); expect(result[2][1]).to.eql("QUEUED"); @@ -108,15 +108,15 @@ describe("pipeline", function() { }); }); - it("should have the same options as its container", function() { - var redis = new Redis({ showFriendlyErrorStack: true }); - var pipeline = redis.pipeline(); + it("should have the same options as its container", function () { + const redis = new Redis({ showFriendlyErrorStack: true }); + const pipeline = redis.pipeline(); expect(pipeline.options).to.have.property("showFriendlyErrorStack", true); redis.disconnect(); }); - it("should support key prefixing", function(done) { - var redis = new Redis({ keyPrefix: "foo:" }); + it("should support key prefixing", function (done) { + const redis = new Redis({ keyPrefix: "foo:" }); redis .pipeline() .set("bar", "baz") @@ -124,56 +124,56 @@ describe("pipeline", function() { .lpush("app1", "test1") .lpop("app1") .keys("*") - .exec(function(err, results) { + .exec(function (err, results) { expect(err).to.eql(null); expect(results).to.eql([ [null, "OK"], [null, "baz"], [null, 1], [null, "test1"], - [null, ["foo:bar"]] + [null, ["foo:bar"]], ]); redis.disconnect(); done(); }); }); - describe("custom commands", function() { - var redis; + describe("custom commands", function () { + let redis; - before(function() { + before(function () { redis = new Redis(); redis.defineCommand("echo", { numberOfKeys: 2, - lua: "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}" + lua: "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}", }); }); - after(function() { + after(function () { redis.disconnect(); }); - it("should work", function(done) { + it("should work", function (done) { redis .pipeline() .echo("foo", "bar", "123", "abc") - .exec(function(err, results) { + .exec(function (err, results) { expect(err).to.eql(null); expect(results).to.eql([[null, ["foo", "bar", "123", "abc"]]]); done(); }); }); - it("should support callbacks", function(done) { - var pending = 1; + it("should support callbacks", function (done) { + let pending = 1; redis .pipeline() - .echo("foo", "bar", "123", "abc", function(err, result) { + .echo("foo", "bar", "123", "abc", function (err, result) { pending -= 1; expect(err).to.eql(null); expect(result).to.eql(["foo", "bar", "123", "abc"]); }) - .exec(function(err, results) { + .exec(function (err, results) { expect(err).to.eql(null); expect(results).to.eql([[null, ["foo", "bar", "123", "abc"]]]); expect(pending).to.eql(0); @@ -181,7 +181,7 @@ describe("pipeline", function() { }); }); - it("should be supported in transaction blocks", function(done) { + it("should be supported in transaction blocks", function (done) { redis .pipeline() .multi() @@ -189,7 +189,7 @@ describe("pipeline", function() { .echo("bar", "baz", "123", "abc") .get("foo") .exec() - .exec(function(err, results) { + .exec(function (err, results) { expect(err).to.eql(null); expect(results[4][1][1]).to.eql(["bar", "baz", "123", "abc"]); expect(results[4][1][2]).to.eql("asdf"); @@ -198,23 +198,23 @@ describe("pipeline", function() { }); }); - describe("#addBatch", function() { - it("should accept commands in constructor", function(done) { - var redis = new Redis(); - var pending = 1; + describe("#addBatch", function () { + it("should accept commands in constructor", function (done) { + const redis = new Redis(); + let pending = 1; redis .pipeline([ ["set", "foo", "bar"], [ "get", "foo", - function(err, result) { + function (err, result) { expect(result).to.eql("bar"); pending -= 1; - } - ] + }, + ], ]) - .exec(function(err, results) { + .exec(function (err, results) { expect(pending).to.eql(0); expect(results[1][1]).to.eql("bar"); redis.disconnect(); @@ -223,35 +223,35 @@ describe("pipeline", function() { }); }); - describe("exec", function() { - it("should group results", function(done) { - var redis = new Redis(); + describe("exec", function () { + it("should group results", function (done) { + const redis = new Redis(); redis.multi({ pipeline: false }); redis.set("foo", "bar"); redis.get("foo"); - redis.exec().then(function() { + redis.exec().then(function () { redis.disconnect(); done(); }); }); - it("should allow omitting callback", function(done) { - var redis = new Redis(); - redis.exec().catch(function(err) { + it("should allow omitting callback", function (done) { + const redis = new Redis(); + redis.exec().catch(function (err) { expect(err.message).to.eql("ERR EXEC without MULTI"); redis.disconnect(); done(); }); }); - it("should batch all commands before ready event", function(done) { - var redis = new Redis(); - redis.on("connect", function() { + it("should batch all commands before ready event", function (done) { + const redis = new Redis(); + redis.on("connect", function () { redis .pipeline() .info() .config("get", "maxmemory") - .exec(function(err, res) { + .exec(function (err, res) { expect(err).to.eql(null); expect(res).to.have.lengthOf(2); expect(res[0][0]).to.eql(null); @@ -264,30 +264,30 @@ describe("pipeline", function() { }); }); - it("should check and load uniq scripts only", function(done) { - var redis = new Redis(); + it("should check and load uniq scripts only", function (done) { + const redis = new Redis(); redis.defineCommand("test", { numberOfKeys: 1, - lua: "return {unpack(KEYS),unpack(ARGV)}" + lua: "return {unpack(KEYS),unpack(ARGV)}", }); redis.defineCommand("echo", { numberOfKeys: 1, - lua: "return {KEYS[1],ARGV[1]}" + lua: "return {KEYS[1],ARGV[1]}", }); - redis.once("ready", function() { - var expectedComands = [ + redis.once("ready", function () { + const expectedComands = [ "script", "script", "script", "evalsha", "evalsha", "evalsha", - "evalsha" + "evalsha", ]; - redis.monitor(function(err, monitor) { - monitor.on("monitor", function(_, command) { - var name = expectedComands.shift(); + redis.monitor(function (err, monitor) { + monitor.on("monitor", function (_, command) { + const name = expectedComands.shift(); expect(name).to.eql(command[0]); if (!expectedComands.length) { monitor.disconnect(); @@ -295,7 +295,7 @@ describe("pipeline", function() { done(); } }); - var pipe = redis.pipeline(); + const pipe = redis.pipeline(); pipe .echo("f", "0") .test("a", "1") @@ -307,11 +307,11 @@ describe("pipeline", function() { }); }); - describe("#length", function() { - it("return the command count", function() { - var redis = new Redis(); + describe("#length", function () { + it("return the command count", function () { + const redis = new Redis(); - var pipeline1 = redis + const pipeline1 = redis .pipeline() .multi() .set("foo", "bar") @@ -319,7 +319,10 @@ describe("pipeline", function() { .exec(); expect(pipeline1.length).to.eql(4); - var pipeline2 = redis.pipeline([["set", "foo", "bar"], ["get", "foo"]]); + const pipeline2 = redis.pipeline([ + ["set", "foo", "bar"], + ["get", "foo"], + ]); expect(pipeline2.length).to.eql(2); redis.disconnect(); }); diff --git a/test/functional/promise.ts b/test/functional/promise.ts index e8dc3de4..dbf2bbc9 100644 --- a/test/functional/promise.ts +++ b/test/functional/promise.ts @@ -2,21 +2,21 @@ import Redis from "../../lib/redis"; import { expect } from "chai"; import * as bluebirdPromise from "bluebird"; -var nativePromise = global.Promise; +const nativePromise = global.Promise; -describe("Promise", function() { - it("uses native promise by default", function() { - var redis = new Redis(); +describe("Promise", function () { + it("uses native promise by default", function () { + const redis = new Redis(); expect(redis.get("foo").constructor).to.eql(nativePromise); }); - it("can switch to a custom Promise implementation", function() { - var origin = Promise; + it("can switch to a custom Promise implementation", function () { + const origin = Promise; // @ts-ignore Redis.Promise = bluebirdPromise; - var redis = new Redis(); + const redis = new Redis(); expect(redis.get("foo").constructor).to.eql(bluebirdPromise); // @ts-ignore diff --git a/test/functional/pub_sub.ts b/test/functional/pub_sub.ts index 9ebd917b..96976d3a 100644 --- a/test/functional/pub_sub.ts +++ b/test/functional/pub_sub.ts @@ -1,15 +1,15 @@ import Redis from "../../lib/redis"; import { expect } from "chai"; -describe("pub/sub", function() { - it("should invoke the callback when subscribe successfully", function(done) { - var redis = new Redis(); - var pending = 1; - redis.subscribe("foo", "bar", function(err, count) { +describe("pub/sub", function () { + it("should invoke the callback when subscribe successfully", function (done) { + const redis = new Redis(); + let pending = 1; + redis.subscribe("foo", "bar", function (err, count) { expect(count).to.eql(2); pending -= 1; }); - redis.subscribe("foo", "zoo", function(err, count) { + redis.subscribe("foo", "zoo", function (err, count) { expect(count).to.eql(3); expect(pending).to.eql(0); redis.disconnect(); @@ -17,10 +17,10 @@ describe("pub/sub", function() { }); }); - it("should reject when issue a command in the subscriber mode", function(done) { - var redis = new Redis(); - redis.subscribe("foo", function() { - redis.set("foo", "bar", function(err) { + it("should reject when issue a command in the subscriber mode", function (done) { + const redis = new Redis(); + redis.subscribe("foo", function () { + redis.set("foo", "bar", function (err) { expect(err instanceof Error); expect(err.toString()).to.match(/subscriber mode/); redis.disconnect(); @@ -29,18 +29,18 @@ describe("pub/sub", function() { }); }); - it("should exit subscriber mode using unsubscribe", function(done) { - var redis = new Redis(); - redis.subscribe("foo", "bar", function() { - redis.unsubscribe("foo", "bar", function(err, count) { + it("should exit subscriber mode using unsubscribe", function (done) { + const redis = new Redis(); + redis.subscribe("foo", "bar", function () { + redis.unsubscribe("foo", "bar", function (err, count) { expect(count).to.eql(0); - redis.set("foo", "bar", function(err) { + redis.set("foo", "bar", function (err) { expect(err).to.eql(null); - redis.subscribe("zoo", "foo", function() { - redis.unsubscribe(function(err, count) { + redis.subscribe("zoo", "foo", function () { + redis.unsubscribe(function (err, count) { expect(count).to.eql(0); - redis.set("foo", "bar", function(err) { + redis.set("foo", "bar", function (err) { expect(err).to.eql(null); redis.disconnect(); done(); @@ -52,14 +52,14 @@ describe("pub/sub", function() { }); }); - it("should receive messages when subscribe a channel", function(done) { - var redis = new Redis(); - var pub = new Redis(); - var pending = 2; - redis.subscribe("foo", function() { + it("should receive messages when subscribe a channel", function (done) { + const redis = new Redis(); + const pub = new Redis(); + let pending = 2; + redis.subscribe("foo", function () { pub.publish("foo", "bar"); }); - redis.on("message", function(channel, message) { + redis.on("message", function (channel, message) { expect(channel).to.eql("foo"); expect(message).to.eql("bar"); if (!--pending) { @@ -67,7 +67,7 @@ describe("pub/sub", function() { done(); } }); - redis.on("messageBuffer", function(channel, message) { + redis.on("messageBuffer", function (channel, message) { expect(channel).to.be.instanceof(Buffer); expect(channel.toString()).to.eql("foo"); expect(message).to.be.instanceof(Buffer); @@ -79,14 +79,14 @@ describe("pub/sub", function() { }); }); - it("should receive messages when psubscribe a pattern", function(done) { - var redis = new Redis(); - var pub = new Redis(); - var pending = 2; - redis.psubscribe("f?oo", function() { + it("should receive messages when psubscribe a pattern", function (done) { + const redis = new Redis(); + const pub = new Redis(); + let pending = 2; + redis.psubscribe("f?oo", function () { pub.publish("fzoo", "bar"); }); - redis.on("pmessage", function(pattern, channel, message) { + redis.on("pmessage", function (pattern, channel, message) { expect(pattern).to.eql("f?oo"); expect(channel).to.eql("fzoo"); expect(message).to.eql("bar"); @@ -96,7 +96,7 @@ describe("pub/sub", function() { done(); } }); - redis.on("pmessageBuffer", function(pattern, channel, message) { + redis.on("pmessageBuffer", function (pattern, channel, message) { expect(pattern).to.eql("f?oo"); expect(channel).to.be.instanceof(Buffer); expect(channel.toString()).to.eql("fzoo"); @@ -110,18 +110,18 @@ describe("pub/sub", function() { }); }); - it("should exit subscriber mode using punsubscribe", function(done) { - var redis = new Redis(); - redis.psubscribe("f?oo", "b?ar", function() { - redis.punsubscribe("f?oo", "b?ar", function(err, count) { + it("should exit subscriber mode using punsubscribe", function (done) { + const redis = new Redis(); + redis.psubscribe("f?oo", "b?ar", function () { + redis.punsubscribe("f?oo", "b?ar", function (err, count) { expect(count).to.eql(0); - redis.set("foo", "bar", function(err) { + redis.set("foo", "bar", function (err) { expect(err).to.eql(null); - redis.psubscribe("z?oo", "f?oo", function() { - redis.punsubscribe(function(err, count) { + redis.psubscribe("z?oo", "f?oo", function () { + redis.punsubscribe(function (err, count) { expect(count).to.eql(0); - redis.set("foo", "bar", function(err) { + redis.set("foo", "bar", function (err) { expect(err).to.eql(null); redis.disconnect(); done(); @@ -133,31 +133,31 @@ describe("pub/sub", function() { }); }); - it("should be able to send quit command in the subscriber mode", function(done) { - var redis = new Redis(); - var pending = 1; - redis.subscribe("foo", function() { - redis.quit(function() { + it("should be able to send quit command in the subscriber mode", function (done) { + const redis = new Redis(); + let pending = 1; + redis.subscribe("foo", function () { + redis.quit(function () { pending -= 1; }); }); - redis.on("end", function() { + redis.on("end", function () { expect(pending).to.eql(0); redis.disconnect(); done(); }); }); - it("should restore subscription after reconnecting(subscribe)", function(done) { - var redis = new Redis(); - var pub = new Redis(); - redis.subscribe("foo", "bar", function() { - redis.on("ready", function() { + it("should restore subscription after reconnecting(subscribe)", function (done) { + const redis = new Redis(); + const pub = new Redis(); + redis.subscribe("foo", "bar", function () { + redis.on("ready", function () { // Execute a random command to make sure that `subscribe` // is sent - redis.ping(function() { - var pending = 2; - redis.on("message", function(channel, message) { + redis.ping(function () { + let pending = 2; + redis.on("message", function (channel, message) { if (!--pending) { redis.disconnect(); pub.disconnect(); @@ -172,14 +172,14 @@ describe("pub/sub", function() { }); }); - it("should restore subscription after reconnecting(psubscribe)", function(done) { - var redis = new Redis(); - var pub = new Redis(); - redis.psubscribe("fo?o", "ba?r", function() { - redis.on("ready", function() { - redis.ping(function() { - var pending = 2; - redis.on("pmessage", function(pattern, channel, message) { + it("should restore subscription after reconnecting(psubscribe)", function (done) { + const redis = new Redis(); + const pub = new Redis(); + redis.psubscribe("fo?o", "ba?r", function () { + redis.on("ready", function () { + redis.ping(function () { + let pending = 2; + redis.on("pmessage", function (pattern, channel, message) { if (!--pending) { redis.disconnect(); pub.disconnect(); diff --git a/test/functional/ready_check.ts b/test/functional/ready_check.ts index cd7c4562..b7ea16e4 100644 --- a/test/functional/ready_check.ts +++ b/test/functional/ready_check.ts @@ -1,11 +1,11 @@ import Redis from "../../lib/redis"; import * as sinon from "sinon"; -describe("ready_check", function() { - it("should retry when redis is not ready", function(done) { - var redis = new Redis({ lazyConnect: true }); +describe("ready_check", function () { + it("should retry when redis is not ready", function (done) { + const redis = new Redis({ lazyConnect: true }); - sinon.stub(redis, "info").callsFake(callback => { + sinon.stub(redis, "info").callsFake((callback) => { callback(null, "loading:1\r\nloading_eta_seconds:7"); }); // @ts-ignore @@ -19,16 +19,16 @@ describe("ready_check", function() { redis.connect(); }); - it("should reconnect when info return a error", function(done) { - var redis = new Redis({ + it("should reconnect when info return a error", function (done) { + const redis = new Redis({ lazyConnect: true, - retryStrategy: function() { + retryStrategy: function () { done(); return; - } + }, }); - sinon.stub(redis, "info").callsFake(callback => { + sinon.stub(redis, "info").callsFake((callback) => { callback(new Error("info error")); }); diff --git a/test/functional/reconnect_on_error.ts b/test/functional/reconnect_on_error.ts index b8f1bd2c..169a29b8 100644 --- a/test/functional/reconnect_on_error.ts +++ b/test/functional/reconnect_on_error.ts @@ -2,9 +2,9 @@ import Redis from "../../lib/redis"; import { expect } from "chai"; import * as sinon from "sinon"; -describe("reconnectOnError", function() { - it("should pass the error as the first param", function(done) { - var pending = 2; +describe("reconnectOnError", function () { + it("should pass the error as the first param", function (done) { + let pending = 2; function assert(err) { expect(err.name).to.eql("ReplyError"); expect(err.command.name).to.eql("set"); @@ -13,91 +13,91 @@ describe("reconnectOnError", function() { done(); } } - var redis = new Redis({ - reconnectOnError: function(err) { + const redis = new Redis({ + reconnectOnError: function (err) { assert(err); return 1; - } + }, }); - redis.set("foo", function(err) { + redis.set("foo", function (err) { assert(err); }); }); - it("should not reconnect if reconnectOnError returns false", function(done) { - var redis = new Redis({ - reconnectOnError: function(err) { + it("should not reconnect if reconnectOnError returns false", function (done) { + const redis = new Redis({ + reconnectOnError: function (err) { return false; - } + }, }); - redis.disconnect = function() { + redis.disconnect = function () { throw new Error("should not disconnect"); }; - redis.set("foo", function(err) { + redis.set("foo", function (err) { done(); }); }); - it("should reconnect if reconnectOnError returns true or 1", function(done) { - var redis = new Redis({ - reconnectOnError: function() { + it("should reconnect if reconnectOnError returns true or 1", function (done) { + const redis = new Redis({ + reconnectOnError: function () { return true; - } + }, }); - redis.set("foo", function() { - redis.on("ready", function() { + redis.set("foo", function () { + redis.on("ready", function () { done(); }); }); }); - it("should reconnect and retry the command if reconnectOnError returns 2", function(done) { + it("should reconnect and retry the command if reconnectOnError returns 2", function (done) { var redis = new Redis({ - reconnectOnError: function() { + reconnectOnError: function () { redis.del("foo"); return 2; - } + }, }); redis.set("foo", "bar"); - redis.sadd("foo", "a", function(err, res) { + redis.sadd("foo", "a", function (err, res) { expect(res).to.eql(1); done(); }); }); - it("should select the currect database", function(done) { + it("should select the currect database", function (done) { var redis = new Redis({ - reconnectOnError: function() { + reconnectOnError: function () { redis.select(3); redis.del("foo"); redis.select(0); return 2; - } + }, }); redis.select(3); redis.set("foo", "bar"); - redis.sadd("foo", "a", function(err, res) { + redis.sadd("foo", "a", function (err, res) { expect(res).to.eql(1); redis.select(3); - redis.type("foo", function(err, type) { + redis.type("foo", function (err, type) { expect(type).to.eql("set"); done(); }); }); }); - it("should work with pipeline", function(done) { + it("should work with pipeline", function (done) { var redis = new Redis({ - reconnectOnError: function() { + reconnectOnError: function () { redis.del("foo"); return 2; - } + }, }); redis.set("foo", "bar"); @@ -105,21 +105,24 @@ describe("reconnectOnError", function() { .pipeline() .get("foo") .sadd("foo", "a") - .exec(function(err, res) { - expect(res).to.eql([[null, "bar"], [null, 1]]); + .exec(function (err, res) { + expect(res).to.eql([ + [null, "bar"], + [null, 1], + ]); done(); }); }); - it("should work with pipelined multi", function(done) { + it("should work with pipelined multi", function (done) { var redis = new Redis({ - reconnectOnError: function() { + reconnectOnError: function () { // deleting foo allows sadd below to succeed on the second try redis.del("foo"); return 2; - } + }, }); - var delSpy = sinon.spy(redis, "del"); + const delSpy = sinon.spy(redis, "del"); redis.set("foo", "bar"); redis.set("i", 1); @@ -130,7 +133,7 @@ describe("reconnectOnError", function() { .get("foo") .incr("i") .exec() - .exec(function(err, res) { + .exec(function (err, res) { expect(delSpy.calledOnce).to.eql(true); expect(delSpy.firstCall.args[0]).to.eql("foo"); expect(err).to.be.null; @@ -139,7 +142,7 @@ describe("reconnectOnError", function() { [null, "OK"], [null, "QUEUED"], [null, "QUEUED"], - [null, ["bar", 2]] + [null, ["bar", 2]], ]); done(); }); diff --git a/test/functional/scan_stream.ts b/test/functional/scan_stream.ts index 5fe62a19..e2eed40e 100644 --- a/test/functional/scan_stream.ts +++ b/test/functional/scan_stream.ts @@ -5,17 +5,17 @@ import * as sinon from "sinon"; import MockServer from "../helpers/mock_server"; import { Cluster } from "../../lib"; -describe("*scanStream", function() { - describe("scanStream", function() { - it("should return a readable stream", function() { - var redis = new Redis(); - var stream = redis.scanStream(); +describe("*scanStream", function () { + describe("scanStream", function () { + it("should return a readable stream", function () { + const redis = new Redis(); + const stream = redis.scanStream(); expect(stream instanceof Readable).to.eql(true); }); - it("should iterate all keys", function(done) { - var keys = []; - var redis = new Redis(); + it("should iterate all keys", function (done) { + let keys = []; + const redis = new Redis(); redis.mset( "foo1", 1, @@ -27,18 +27,18 @@ describe("*scanStream", function() { 1, "foo10", 1, - function() { - var stream = redis.scanStream(); - stream.on("data", function(data) { + function () { + const stream = redis.scanStream(); + stream.on("data", function (data) { keys = keys.concat(data); }); - stream.on("end", function() { + stream.on("end", function () { expect(keys.sort()).to.eql([ "foo1", "foo10", "foo2", "foo3", - "foo4" + "foo4", ]); redis.disconnect(); done(); @@ -47,9 +47,9 @@ describe("*scanStream", function() { ); }); - it("should recognize `MATCH`", function(done) { - var keys = []; - var redis = new Redis(); + it("should recognize `MATCH`", function (done) { + let keys = []; + const redis = new Redis(); redis.mset( "foo1", 1, @@ -61,14 +61,14 @@ describe("*scanStream", function() { 1, "foo10", 1, - function() { - var stream = redis.scanStream({ - match: "foo??" + function () { + const stream = redis.scanStream({ + match: "foo??", }); - stream.on("data", function(data) { + stream.on("data", function (data) { keys = keys.concat(data); }); - stream.on("end", function() { + stream.on("end", function () { expect(keys).to.eql(["foo10"]); redis.disconnect(); done(); @@ -77,9 +77,9 @@ describe("*scanStream", function() { ); }); - it("should recognize `COUNT`", function(done) { - var keys = []; - var redis = new Redis(); + it("should recognize `COUNT`", function (done) { + let keys = []; + const redis = new Redis(); sinon.spy(Redis.prototype, "scan"); redis.mset( "foo1", @@ -92,20 +92,20 @@ describe("*scanStream", function() { 1, "foo10", 1, - function() { - var stream = redis.scanStream({ - count: 2 + function () { + const stream = redis.scanStream({ + count: 2, }); - stream.on("data", function(data) { + stream.on("data", function (data) { keys = keys.concat(data); }); - stream.on("end", function() { + stream.on("end", function () { expect(keys.sort()).to.eql([ "foo1", "foo10", "foo2", "foo3", - "foo4" + "foo4", ]); const [args] = Redis.prototype.scan.getCall(0).args; let count; @@ -126,9 +126,9 @@ describe("*scanStream", function() { ); }); - it("should emit an error when connection is down", function(done) { - var keys = []; - var redis = new Redis(); + it("should emit an error when connection is down", function (done) { + let keys = []; + const redis = new Redis(); redis.mset( "foo1", 1, @@ -140,13 +140,13 @@ describe("*scanStream", function() { 1, "foo10", 1, - function() { + function () { redis.disconnect(); - var stream = redis.scanStream({ count: 1 }); - stream.on("data", function(data) { + const stream = redis.scanStream({ count: 1 }); + stream.on("data", function (data) { keys = keys.concat(data); }); - stream.on("error", function(err) { + stream.on("error", function (err) { expect(err.message).to.eql("Connection is closed."); done(); }); @@ -155,10 +155,10 @@ describe("*scanStream", function() { }); }); - describe("scanBufferStream", function() { - it("should return buffer", function(done) { - var keys = []; - var redis = new Redis(); + describe("scanBufferStream", function () { + it("should return buffer", function (done) { + let keys = []; + const redis = new Redis(); redis.mset( "foo1", 1, @@ -170,18 +170,18 @@ describe("*scanStream", function() { 1, "foo10", 1, - function() { - var stream = redis.scanBufferStream(); - stream.on("data", function(data) { + function () { + const stream = redis.scanBufferStream(); + stream.on("data", function (data) { keys = keys.concat(data); }); - stream.on("end", function() { + stream.on("end", function () { expect(keys.sort()).to.eql([ Buffer.from("foo1"), Buffer.from("foo10"), Buffer.from("foo2"), Buffer.from("foo3"), - Buffer.from("foo4") + Buffer.from("foo4"), ]); redis.disconnect(); done(); @@ -191,16 +191,16 @@ describe("*scanStream", function() { }); }); - describe("sscanStream", function() { - it("should iterate all values in the set", function(done) { - var keys = []; - var redis = new Redis(); - redis.sadd("set", "foo1", "foo2", "foo3", "foo4", "foo10", function() { - var stream = redis.sscanStream("set", { match: "foo??" }); - stream.on("data", function(data) { + describe("sscanStream", function () { + it("should iterate all values in the set", function (done) { + let keys = []; + const redis = new Redis(); + redis.sadd("set", "foo1", "foo2", "foo3", "foo4", "foo10", function () { + const stream = redis.sscanStream("set", { match: "foo??" }); + stream.on("data", function (data) { keys = keys.concat(data); }); - stream.on("end", function() { + stream.on("end", function () { expect(keys).to.eql(["foo10"]); redis.disconnect(); done(); @@ -209,20 +209,20 @@ describe("*scanStream", function() { }); }); - describe("Cluster", function() { - it("should work in cluster mode", function(done) { - var slotTable = [ + describe("Cluster", function () { + it("should work in cluster mode", function (done) { + const slotTable = [ [0, 5460, ["127.0.0.1", 30001]], [5461, 10922, ["127.0.0.1", 30002]], - [10923, 16383, ["127.0.0.1", 30003]] + [10923, 16383, ["127.0.0.1", 30003]], ]; - var serverKeys = ["foo1", "foo2", "foo3", "foo4", "foo10"]; - var argvHandler = function(argv) { + const serverKeys = ["foo1", "foo2", "foo3", "foo4", "foo10"]; + const argvHandler = function (argv) { if (argv[0] === "cluster" && argv[1] === "slots") { return slotTable; } if (argv[0] === "sscan" && argv[1] === "set") { - var cursor = Number(argv[2]); + const cursor = Number(argv[2]); if (cursor >= serverKeys.length) { return ["0", []]; } @@ -233,17 +233,17 @@ describe("*scanStream", function() { new MockServer(30002, argvHandler); new MockServer(30003, argvHandler); - var cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }]); + const cluster = new Cluster([{ host: "127.0.0.1", port: "30001" }]); - var keys = []; + let keys = []; // @ts-ignore - cluster.sadd("set", serverKeys, function() { + cluster.sadd("set", serverKeys, function () { // @ts-ignore - var stream = cluster.sscanStream("set"); - stream.on("data", function(data) { + const stream = cluster.sscanStream("set"); + stream.on("data", function (data) { keys = keys.concat(data); }); - stream.on("end", function() { + stream.on("end", function () { expect(keys).to.eql(serverKeys); cluster.disconnect(); done(); diff --git a/test/functional/scripting.ts b/test/functional/scripting.ts index 014aa812..56907781 100644 --- a/test/functional/scripting.ts +++ b/test/functional/scripting.ts @@ -1,60 +1,60 @@ import Redis from "../../lib/redis"; import { expect } from "chai"; -describe("scripting", function() { - describe("#numberOfKeys", function() { - it("should recognize the numberOfKeys property", function(done) { - var redis = new Redis(); +describe("scripting", function () { + describe("#numberOfKeys", function () { + it("should recognize the numberOfKeys property", function (done) { + const redis = new Redis(); redis.defineCommand("test", { numberOfKeys: 2, - lua: "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}" + lua: "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}", }); - redis.test("k1", "k2", "a1", "a2", function(err, result) { + redis.test("k1", "k2", "a1", "a2", function (err, result) { expect(result).to.eql(["k1", "k2", "a1", "a2"]); redis.disconnect(); done(); }); }); - it("should support dynamic key count", function(done) { - var redis = new Redis(); + it("should support dynamic key count", function (done) { + const redis = new Redis(); redis.defineCommand("test", { - lua: "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}" + lua: "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}", }); - redis.test(2, "k1", "k2", "a1", "a2", function(err, result) { + redis.test(2, "k1", "k2", "a1", "a2", function (err, result) { expect(result).to.eql(["k1", "k2", "a1", "a2"]); redis.disconnect(); done(); }); }); - it("should support numberOfKeys being 0", function(done) { - var redis = new Redis(); + it("should support numberOfKeys being 0", function (done) { + const redis = new Redis(); redis.defineCommand("test", { numberOfKeys: 0, - lua: "return {ARGV[1],ARGV[2]}" + lua: "return {ARGV[1],ARGV[2]}", }); - redis.test("2", "a2", function(err, result) { + redis.test("2", "a2", function (err, result) { expect(result).to.eql(["2", "a2"]); redis.disconnect(); done(); }); }); - it("should throw when numberOfKeys is omit", function(done) { - var redis = new Redis(); + it("should throw when numberOfKeys is omit", function (done) { + const redis = new Redis(); redis.defineCommand("test", { - lua: "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}" + lua: "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}", }); - redis.test("k1", "k2", "a1", "a2", function(err, result) { + redis.test("k1", "k2", "a1", "a2", function (err, result) { expect(err).to.be.instanceof(Error); expect(err.toString()).to.match(/value is not an integer/); redis.disconnect(); @@ -63,57 +63,60 @@ describe("scripting", function() { }); }); - it("should have a buffer version", function(done) { - var redis = new Redis(); + it("should have a buffer version", function (done) { + const redis = new Redis(); redis.defineCommand("test", { numberOfKeys: 2, - lua: "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}" + lua: "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}", }); - redis.testBuffer("k1", "k2", "a1", "a2", function(err, result) { + redis.testBuffer("k1", "k2", "a1", "a2", function (err, result) { expect(result).to.eql([ Buffer.from("k1"), Buffer.from("k2"), Buffer.from("a1"), - Buffer.from("a2") + Buffer.from("a2"), ]); redis.disconnect(); done(); }); }); - it("should work well with pipeline", function(done) { - var redis = new Redis(); + it("should work well with pipeline", function (done) { + const redis = new Redis(); redis.defineCommand("test", { numberOfKeys: 1, - lua: 'return redis.call("get", KEYS[1])' + lua: 'return redis.call("get", KEYS[1])', }); redis .pipeline() .set("test", "pipeline") .test("test") - .exec(function(err, results) { - expect(results).to.eql([[null, "OK"], [null, "pipeline"]]); + .exec(function (err, results) { + expect(results).to.eql([ + [null, "OK"], + [null, "pipeline"], + ]); redis.disconnect(); done(); }); }); - it("should following pipeline style when throw", function(done) { - var redis = new Redis(); + it("should following pipeline style when throw", function (done) { + const redis = new Redis(); redis.defineCommand("test", { - lua: 'return redis.call("get", KEYS[1])' + lua: 'return redis.call("get", KEYS[1])', }); redis .pipeline() .set("test", "pipeline") .test("test") - .exec(function(err, results) { + .exec(function (err, results) { expect(err).to.eql(null); expect(results[1][0]).to.be.instanceof(Error); expect(results[1][0].toString()).to.match(/value is not an integer/); @@ -122,16 +125,16 @@ describe("scripting", function() { }); }); - it("should use evalsha when script is loaded", function(done) { - var redis = new Redis(); + it("should use evalsha when script is loaded", function (done) { + const redis = new Redis(); - redis.on("ready", function() { + redis.on("ready", function () { redis.defineCommand("test", { - lua: "return 1" + lua: "return 1", }); - redis.monitor(function(err, monitor) { - var sent = false; - monitor.on("monitor", function(_, command) { + redis.monitor(function (err, monitor) { + let sent = false; + monitor.on("monitor", function (_, command) { if (!sent) { sent = true; expect(command[0]).to.eql("evalsha"); @@ -139,28 +142,28 @@ describe("scripting", function() { done(); } }); - redis.test(0, function() { + redis.test(0, function () { redis.disconnect(); }); }); }); }); - it("should try to use EVALSHA and fallback to EVAL if fails", function(done) { - var redis = new Redis(); + it("should try to use EVALSHA and fallback to EVAL if fails", function (done) { + const redis = new Redis(); redis.defineCommand("test", { numberOfKeys: 1, - lua: 'return redis.call("get", KEYS[1])' + lua: 'return redis.call("get", KEYS[1])', }); - redis.once("ready", function() { - var flush = new Redis(); - flush.script("flush", function() { - var expectedComands = ["evalsha", "eval", "get", "evalsha", "get"]; - redis.monitor(function(err, monitor) { - monitor.on("monitor", function(_, command) { - var name = expectedComands.shift(); + redis.once("ready", function () { + const flush = new Redis(); + flush.script("flush", function () { + const expectedComands = ["evalsha", "eval", "get", "evalsha", "get"]; + redis.monitor(function (err, monitor) { + monitor.on("monitor", function (_, command) { + const name = expectedComands.shift(); expect(name).to.eql(command[0]); if (!expectedComands.length) { monitor.disconnect(); @@ -168,7 +171,7 @@ describe("scripting", function() { done(); } }); - redis.test("bar", function() { + redis.test("bar", function () { redis.test("foo"); }); }); @@ -176,31 +179,31 @@ describe("scripting", function() { }); }); - it("should load scripts first before execute pipeline", function(done) { - var redis = new Redis(); + it("should load scripts first before execute pipeline", function (done) { + const redis = new Redis(); redis.defineCommand("testGet", { numberOfKeys: 1, - lua: 'return redis.call("get", KEYS[1])' + lua: 'return redis.call("get", KEYS[1])', }); - redis.testGet("init", function() { + redis.testGet("init", function () { redis.defineCommand("testSet", { numberOfKeys: 1, - lua: 'return redis.call("set", KEYS[1], "bar")' + lua: 'return redis.call("set", KEYS[1], "bar")', }); - var expectedComands = [ + const expectedComands = [ "script", "script", "evalsha", "get", "evalsha", "set", - "get" + "get", ]; - redis.monitor(function(err, monitor) { - monitor.on("monitor", function(_, command) { - var name = expectedComands.shift(); + redis.monitor(function (err, monitor) { + monitor.on("monitor", function (_, command) { + const name = expectedComands.shift(); expect(name).to.eql(command[0]); if (!expectedComands.length) { monitor.disconnect(); @@ -208,25 +211,21 @@ describe("scripting", function() { done(); } }); - var pipe = redis.pipeline(); - pipe - .testGet("foo") - .testSet("foo") - .get("foo") - .exec(); + const pipe = redis.pipeline(); + pipe.testGet("foo").testSet("foo").get("foo").exec(); }); }); }); - it("should support key prefixing", function(done) { - var redis = new Redis({ keyPrefix: "foo:" }); + it("should support key prefixing", function (done) { + const redis = new Redis({ keyPrefix: "foo:" }); redis.defineCommand("echo", { numberOfKeys: 2, - lua: "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}" + lua: "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}", }); - redis.echo("k1", "k2", "a1", "a2", function(err, result) { + redis.echo("k1", "k2", "a1", "a2", function (err, result) { expect(result).to.eql(["foo:k1", "foo:k2", "a1", "a2"]); redis.disconnect(); done(); diff --git a/test/functional/select.ts b/test/functional/select.ts index 17146afe..5e544144 100644 --- a/test/functional/select.ts +++ b/test/functional/select.ts @@ -1,30 +1,30 @@ import Redis from "../../lib/redis"; import { expect } from "chai"; -describe("select", function() { - it("should support auto select", function(done) { - var redis = new Redis({ db: 2 }); +describe("select", function () { + it("should support auto select", function (done) { + const redis = new Redis({ db: 2 }); redis.set("foo", "2"); redis.select("2"); - redis.get("foo", function(err, res) { + redis.get("foo", function (err, res) { expect(res).to.eql("2"); redis.disconnect(); done(); }); }); - it("should resend commands to the correct db", function(done) { - var redis = new Redis(); - redis.once("ready", function() { - redis.set("foo", "2", function() { + it("should resend commands to the correct db", function (done) { + const redis = new Redis(); + redis.once("ready", function () { + redis.set("foo", "2", function () { redis.stream.destroy(); redis.select("3"); redis.set("foo", "3"); redis.select("0"); - redis.get("foo", function(err, res) { + redis.get("foo", function (err, res) { expect(res).to.eql("2"); redis.select("3"); - redis.get("foo", function(err, res) { + redis.get("foo", function (err, res) { expect(res).to.eql("3"); redis.disconnect(); done(); @@ -34,15 +34,15 @@ describe("select", function() { }); }); - it("should re-select the current db when reconnect", function(done) { - var redis = new Redis(); + it("should re-select the current db when reconnect", function (done) { + const redis = new Redis(); - redis.once("ready", function() { + redis.once("ready", function () { redis.set("foo", "bar"); redis.select(2); - redis.set("foo", "2", function() { + redis.set("foo", "2", function () { redis.stream.destroy(); - redis.get("foo", function(err, res) { + redis.get("foo", function (err, res) { expect(res).to.eql("2"); redis.disconnect(); done(); @@ -51,17 +51,17 @@ describe("select", function() { }); }); - it('should emit "select" event when db changes', function(done) { - var changes = []; - var redis = new Redis(); - redis.on("select", function(db) { + it('should emit "select" event when db changes', function (done) { + const changes = []; + const redis = new Redis(); + redis.on("select", function (db) { changes.push(db); }); - redis.select("2", function() { + redis.select("2", function () { expect(changes).to.eql([2]); - redis.select("4", function() { + redis.select("4", function () { expect(changes).to.eql([2, 4]); - redis.select("4", function() { + redis.select("4", function () { expect(changes).to.eql([2, 4]); redis.disconnect(); done(); @@ -70,17 +70,17 @@ describe("select", function() { }); }); - it("should be sent on the connect event", function(done) { - var redis = new Redis({ db: 2 }); - var select = redis.select; - redis.select = function() { - return select.apply(redis, arguments).then(function() { + it("should be sent on the connect event", function (done) { + const redis = new Redis({ db: 2 }); + const select = redis.select; + redis.select = function () { + return select.apply(redis, arguments).then(function () { redis.select = select; redis.disconnect(); done(); }); }; - redis.on("connect", function() { + redis.on("connect", function () { redis.subscribe("anychannel"); }); }); diff --git a/test/functional/send_command.ts b/test/functional/send_command.ts index 0b93174c..f8763687 100644 --- a/test/functional/send_command.ts +++ b/test/functional/send_command.ts @@ -1,173 +1,173 @@ import Redis from "../../lib/redis"; import { expect } from "chai"; -describe("send command", function() { - it("should support callback", function(done) { - var redis = new Redis(); +describe("send command", function () { + it("should support callback", function (done) { + const redis = new Redis(); redis.set("foo", "bar"); - redis.get("foo", function(err, result) { + redis.get("foo", function (err, result) { expect(result).to.eql("bar"); done(); }); }); - it("should support promise", function() { - var redis = new Redis(); + it("should support promise", function () { + const redis = new Redis(); redis.set("foo", "bar"); - return redis.get("foo").then(function(result) { + return redis.get("foo").then(function (result) { expect(result).to.eql("bar"); }); }); - it("should keep the response order when mix using callback & promise", function(done) { - var redis = new Redis(); - var order = 0; - redis.get("foo").then(function() { + it("should keep the response order when mix using callback & promise", function (done) { + const redis = new Redis(); + let order = 0; + redis.get("foo").then(function () { expect(++order).to.eql(1); }); - redis.get("foo", function() { + redis.get("foo", function () { expect(++order).to.eql(2); }); - redis.get("foo").then(function() { + redis.get("foo").then(function () { expect(++order).to.eql(3); }); - redis.get("foo", function() { + redis.get("foo", function () { expect(++order).to.eql(4); done(); }); }); - it("should support get & set buffer", function(done) { - var redis = new Redis(); - redis.set(Buffer.from("foo"), Buffer.from("bar"), function(err, res) { + it("should support get & set buffer", function (done) { + const redis = new Redis(); + redis.set(Buffer.from("foo"), Buffer.from("bar"), function (err, res) { expect(res).to.eql("OK"); }); - redis.getBuffer(Buffer.from("foo"), function(err, result) { + redis.getBuffer(Buffer.from("foo"), function (err, result) { expect(result).to.be.instanceof(Buffer); expect(result.toString()).to.eql("bar"); done(); }); }); - it("should support get & set buffer via `call`", function(done) { - var redis = new Redis(); - redis.call("set", Buffer.from("foo"), Buffer.from("bar"), function( + it("should support get & set buffer via `call`", function (done) { + const redis = new Redis(); + redis.call("set", Buffer.from("foo"), Buffer.from("bar"), function ( err, res ) { expect(res).to.eql("OK"); }); - redis.callBuffer("get", Buffer.from("foo"), function(err, result) { + redis.callBuffer("get", Buffer.from("foo"), function (err, result) { expect(result).to.be.instanceof(Buffer); expect(result.toString()).to.eql("bar"); done(); }); }); - it("should handle empty buffer", function(done) { - var redis = new Redis(); + it("should handle empty buffer", function (done) { + const redis = new Redis(); redis.set(Buffer.from("foo"), Buffer.from("")); - redis.getBuffer(Buffer.from("foo"), function(err, result) { + redis.getBuffer(Buffer.from("foo"), function (err, result) { expect(result).to.be.instanceof(Buffer); expect(result.toString()).to.eql(""); done(); }); }); - it("should support utf8", function(done) { - var redis = new Redis(); + it("should support utf8", function (done) { + const redis = new Redis(); redis.set(Buffer.from("你好"), new String("你好")); - redis.getBuffer("你好", function(err, result) { + redis.getBuffer("你好", function (err, result) { expect(result.toString()).to.eql("你好"); - redis.get("你好", function(err, result) { + redis.get("你好", function (err, result) { expect(result).to.eql("你好"); done(); }); }); }); - it("should consider null as empty str", function(done) { - var redis = new Redis(); - redis.set("foo", null, function() { - redis.get("foo", function(err, res) { + it("should consider null as empty str", function (done) { + const redis = new Redis(); + redis.set("foo", null, function () { + redis.get("foo", function (err, res) { expect(res).to.eql(""); done(); }); }); }); - it("should support return int value", function(done) { - var redis = new Redis(); - redis.exists("foo", function(err, exists) { + it("should support return int value", function (done) { + const redis = new Redis(); + redis.exists("foo", function (err, exists) { expect(typeof exists).to.eql("number"); done(); }); }); - it("should reject when disconnected", function(done) { - var redis = new Redis(); + it("should reject when disconnected", function (done) { + const redis = new Redis(); redis.disconnect(); - redis.get("foo", function(err) { + redis.get("foo", function (err) { expect(err.message).to.match(/Connection is closed./); done(); }); }); - it("should reject when enableOfflineQueue is disabled", function(done) { - var redis = new Redis({ enableOfflineQueue: false }); - redis.get("foo", function(err) { + it("should reject when enableOfflineQueue is disabled", function (done) { + const redis = new Redis({ enableOfflineQueue: false }); + redis.get("foo", function (err) { expect(err.message).to.match(/enableOfflineQueue options is false/); done(); }); }); - it("should support key prefixing", function(done) { - var redis = new Redis({ keyPrefix: "foo:" }); + it("should support key prefixing", function (done) { + const redis = new Redis({ keyPrefix: "foo:" }); redis.set("bar", "baz"); - redis.get("bar", function(err, result) { + redis.get("bar", function (err, result) { expect(result).to.eql("baz"); - redis.keys("*", function(err, result) { + redis.keys("*", function (err, result) { expect(result).to.eql(["foo:bar"]); done(); }); }); }); - it("should support key prefixing with multiple keys", function(done) { - var redis = new Redis({ keyPrefix: "foo:" }); + it("should support key prefixing with multiple keys", function (done) { + const redis = new Redis({ keyPrefix: "foo:" }); redis.lpush("app1", "test1"); redis.lpush("app2", "test2"); redis.lpush("app3", "test3"); - redis.blpop("app1", "app2", "app3", 0, function(err, result) { + redis.blpop("app1", "app2", "app3", 0, function (err, result) { expect(result).to.eql(["foo:app1", "test1"]); - redis.keys("*", function(err, result) { + redis.keys("*", function (err, result) { expect(result).to.have.members(["foo:app2", "foo:app3"]); done(); }); }); }); - it("should support key prefixing for zunionstore", function(done) { - var redis = new Redis({ keyPrefix: "foo:" }); + it("should support key prefixing for zunionstore", function (done) { + const redis = new Redis({ keyPrefix: "foo:" }); redis.zadd("zset1", 1, "one"); redis.zadd("zset1", 2, "two"); redis.zadd("zset2", 1, "one"); redis.zadd("zset2", 2, "two"); redis.zadd("zset2", 3, "three"); - redis.zunionstore("out", 2, "zset1", "zset2", "WEIGHTS", 2, 3, function( + redis.zunionstore("out", 2, "zset1", "zset2", "WEIGHTS", 2, 3, function ( err, result ) { expect(result).to.eql(3); - redis.keys("*", function(err, result) { + redis.keys("*", function (err, result) { expect(result).to.have.members(["foo:zset1", "foo:zset2", "foo:out"]); done(); }); }); }); - it("should support key prefixing for sort", function(done) { - var redis = new Redis({ keyPrefix: "foo:" }); + it("should support key prefixing for sort", function (done) { + const redis = new Redis({ keyPrefix: "foo:" }); redis.hset("object_1", "name", "better"); redis.hset("weight_1", "value", "20"); redis.hset("object_2", "name", "best"); @@ -183,10 +183,10 @@ describe("send command", function() { "object_*->name", "STORE", "dest", - function(err, result) { - redis.lrange("dest", 0, -1, function(err, result) { + function (err, result) { + redis.lrange("dest", 0, -1, function (err, result) { expect(result).to.eql(["good", "better", "best"]); - redis.keys("*", function(err, result) { + redis.keys("*", function (err, result) { expect(result).to.have.members([ "foo:object_1", "foo:weight_1", @@ -195,7 +195,7 @@ describe("send command", function() { "foo:object_3", "foo:weight_3", "foo:src", - "foo:dest" + "foo:dest", ]); done(); }); @@ -204,20 +204,20 @@ describe("send command", function() { ); }); - it("should allow sending the loading valid commands in connect event", function(done) { - var redis = new Redis({ enableOfflineQueue: false }); - redis.on("connect", function() { - redis.select(2, function(err, res) { + it("should allow sending the loading valid commands in connect event", function (done) { + const redis = new Redis({ enableOfflineQueue: false }); + redis.on("connect", function () { + redis.select(2, function (err, res) { expect(res).to.eql("OK"); done(); }); }); }); - it("should reject loading invalid commands in connect event", function(done) { - var redis = new Redis({ enableOfflineQueue: false }); - redis.on("connect", function() { - redis.get("foo", function(err) { + it("should reject loading invalid commands in connect event", function (done) { + const redis = new Redis({ enableOfflineQueue: false }); + redis.on("connect", function () { + redis.get("foo", function (err) { expect(err.message).to.eql( "Stream isn't writeable and enableOfflineQueue options is false" ); diff --git a/test/functional/sentinel.ts b/test/functional/sentinel.ts index 12d5c59d..204f35cb 100644 --- a/test/functional/sentinel.ts +++ b/test/functional/sentinel.ts @@ -3,37 +3,37 @@ import MockServer from "../helpers/mock_server"; import { expect } from "chai"; import * as sinon from "sinon"; -describe("sentinel", function() { - describe("connect", function() { - it("should connect to sentinel successfully", function(done) { - var sentinel = new MockServer(27379); - sentinel.once("connect", function() { +describe("sentinel", function () { + describe("connect", function () { + it("should connect to sentinel successfully", function (done) { + const sentinel = new MockServer(27379); + sentinel.once("connect", function () { redis.disconnect(); sentinel.disconnect(done); }); var redis = new Redis({ sentinels: [{ host: "127.0.0.1", port: 27379 }], - name: "master" + name: "master", }); }); - it("should default to the default sentinel port", function(done) { - var sentinel = new MockServer(26379); - sentinel.once("connect", function() { + it("should default to the default sentinel port", function (done) { + const sentinel = new MockServer(26379); + sentinel.once("connect", function () { redis.disconnect(); sentinel.disconnect(done); }); var redis = new Redis({ sentinels: [{ host: "127.0.0.1" }], - name: "master" + name: "master", }); }); - it("should try to connect to all sentinel", function(done) { - var sentinel = new MockServer(27380); - sentinel.once("connect", function() { + it("should try to connect to all sentinel", function (done) { + const sentinel = new MockServer(27380); + sentinel.once("connect", function () { redis.disconnect(); sentinel.disconnect(done); }); @@ -41,57 +41,57 @@ describe("sentinel", function() { var redis = new Redis({ sentinels: [ { host: "127.0.0.1", port: 27379 }, - { host: "127.0.0.1", port: 27380 } + { host: "127.0.0.1", port: 27380 }, ], - name: "master" + name: "master", }); }); - it("should call sentinelRetryStrategy when all sentinels are unreachable", function(done) { - var t = 0; + it("should call sentinelRetryStrategy when all sentinels are unreachable", function (done) { + let t = 0; var redis = new Redis({ sentinels: [ { host: "127.0.0.1", port: 27379 }, - { host: "127.0.0.1", port: 27380 } + { host: "127.0.0.1", port: 27380 }, ], - sentinelRetryStrategy: function(times) { + sentinelRetryStrategy: function (times) { expect(times).to.eql(++t); - var sentinel = new MockServer(27380); - sentinel.once("connect", function() { + const sentinel = new MockServer(27380); + sentinel.once("connect", function () { redis.disconnect(); sentinel.disconnect(done); }); return 0; }, - name: "master" + name: "master", }); }); - it("should raise error when all sentinel are unreachable and retry is disabled", function(done) { - var redis = new Redis({ + it("should raise error when all sentinel are unreachable and retry is disabled", function (done) { + const redis = new Redis({ sentinels: [ { host: "127.0.0.1", port: 27379 }, - { host: "127.0.0.1", port: 27380 } + { host: "127.0.0.1", port: 27380 }, ], sentinelRetryStrategy: null, - name: "master" + name: "master", }); - redis.get("foo", function(error) { + redis.get("foo", function (error) { finish(); expect(error.message).to.match(/are unreachable/); }); - redis.on("error", function(error) { + redis.on("error", function (error) { expect(error.message).to.match(/are unreachable/); finish(); }); - redis.on("end", function() { + redis.on("end", function () { finish(); }); - var pending = 3; + let pending = 3; function finish() { if (!--pending) { redis.disconnect(); @@ -100,49 +100,49 @@ describe("sentinel", function() { } }); - it("should close the connection to the sentinel when resolving successfully", function(done) { - var sentinel = new MockServer(27379, function(argv) { + it("should close the connection to the sentinel when resolving successfully", function (done) { + const sentinel = new MockServer(27379, function (argv) { if (argv[0] === "sentinel" && argv[1] === "get-master-addr-by-name") { return ["127.0.0.1", "17380"]; } }); - var master = new MockServer(17380); - sentinel.once("disconnect", function() { + const master = new MockServer(17380); + sentinel.once("disconnect", function () { redis.disconnect(); - master.disconnect(function() { + master.disconnect(function () { sentinel.disconnect(done); }); }); var redis = new Redis({ sentinels: [{ host: "127.0.0.1", port: 27379 }], - name: "master" + name: "master", }); }); - it("should add additionally discovered sentinels when resolving successfully", function(done) { - var sentinels = [{ host: "127.0.0.1", port: 27379 }]; - var cloned; + it("should add additionally discovered sentinels when resolving successfully", function (done) { + const sentinels = [{ host: "127.0.0.1", port: 27379 }]; + let cloned; sinon.stub(sentinels, "slice").callsFake((start, end) => { cloned = [].slice.call(sentinels, start, end); return cloned; }); - var sentinel = new MockServer(27379, function(argv) { + const sentinel = new MockServer(27379, function (argv) { if (argv[0] === "sentinel" && argv[1] === "get-master-addr-by-name") { return ["127.0.0.1", "17380"]; } else if (argv[0] === "sentinel" && argv[1] === "sentinels") { return [ ["ip", "127.0.0.1", "port", "27379"], - ["ip", "127.0.0.1", "port", "27380"] + ["ip", "127.0.0.1", "port", "27380"], ]; } }); - var master = new MockServer(17380); - sentinel.once("disconnect", function() { + const master = new MockServer(17380); + sentinel.once("disconnect", function () { redis.disconnect(); - master.disconnect(function() { + master.disconnect(function () { expect(cloned.length).to.eql(2); sentinel.disconnect(done); }); @@ -150,27 +150,27 @@ describe("sentinel", function() { var redis = new Redis({ sentinels: sentinels, - name: "master" + name: "master", }); }); - it("should skip additionally discovered sentinels even if they are resolved successfully", function(done) { - var sentinels = [{ host: "127.0.0.1", port: 27379 }]; + it("should skip additionally discovered sentinels even if they are resolved successfully", function (done) { + const sentinels = [{ host: "127.0.0.1", port: 27379 }]; - var sentinel = new MockServer(27379, function(argv) { + const sentinel = new MockServer(27379, function (argv) { if (argv[0] === "sentinel" && argv[1] === "get-master-addr-by-name") { return ["127.0.0.1", "17380"]; } else if (argv[0] === "sentinel" && argv[1] === "sentinels") { return [ ["ip", "127.0.0.1", "port", "27379"], - ["ip", "127.0.0.1", "port", "27380"] + ["ip", "127.0.0.1", "port", "27380"], ]; } }); - var master = new MockServer(17380); - sentinel.once("disconnect", function() { + const master = new MockServer(17380); + sentinel.once("disconnect", function () { redis.disconnect(); - master.disconnect(function() { + master.disconnect(function () { expect(sentinels.length).to.eql(1); expect(sentinels[0].port).to.eql(27379); sentinel.disconnect(done); @@ -180,12 +180,12 @@ describe("sentinel", function() { var redis = new Redis({ sentinels: sentinels, updateSentinels: false, - name: "master" + name: "master", }); }); - it("should connect to sentinel with authentication successfully", function(done) { - var authed = false; - var redisServer = new MockServer(17380, function(argv) { + it("should connect to sentinel with authentication successfully", function (done) { + let authed = false; + var redisServer = new MockServer(17380, function (argv) { if (argv[0] === "auth" && argv[1] === "pass") { authed = true; } else if (argv[0] === "get" && argv[1] === "foo") { @@ -194,63 +194,63 @@ describe("sentinel", function() { done(); } }); - var sentinel = new MockServer(27379, function(argv) { + var sentinel = new MockServer(27379, function (argv) { if (argv[0] === "sentinel" && argv[1] === "get-master-addr-by-name") { sentinel.disconnect(done); return ["127.0.0.1", "17380"]; } }); - var redis = new Redis({ + const redis = new Redis({ sentinelPassword: "pass", sentinels: [{ host: "127.0.0.1", port: 27379 }], - name: "master" + name: "master", }); - redis.get("foo").catch(function() {}); + redis.get("foo").catch(function () {}); }); }); - describe("master", function() { - it("should connect to the master successfully", function(done) { - var sentinel = new MockServer(27379, function(argv) { + describe("master", function () { + it("should connect to the master successfully", function (done) { + const sentinel = new MockServer(27379, function (argv) { if (argv[0] === "sentinel" && argv[1] === "get-master-addr-by-name") { return ["127.0.0.1", "17380"]; } }); - var master = new MockServer(17380); - master.on("connect", function() { + const master = new MockServer(17380); + master.on("connect", function () { redis.disconnect(); - sentinel.disconnect(function() { + sentinel.disconnect(function () { master.disconnect(done); }); }); var redis = new Redis({ sentinels: [{ host: "127.0.0.1", port: 27379 }], - name: "master" + name: "master", }); }); - it("should reject when sentinel is rejected", function(done) { - var sentinel = new MockServer(27379, function(argv) { + it("should reject when sentinel is rejected", function (done) { + const sentinel = new MockServer(27379, function (argv) { if (argv[0] === "sentinel" && argv[1] === "get-master-addr-by-name") { return new Error("just rejected"); } }); - var redis = new Redis({ + const redis = new Redis({ sentinels: [{ host: "127.0.0.1", port: 27379 }], name: "master", sentinelRetryStrategy: null, - lazyConnect: true + lazyConnect: true, }); redis .connect() - .then(function() { + .then(function () { throw new Error("Expect `connect` to be thrown"); }) - .catch(function(err) { + .catch(function (err) { expect(err.message).to.eql( "All sentinels are unreachable and retry is disabled. Last error: just rejected" ); @@ -259,17 +259,17 @@ describe("sentinel", function() { }); }); - it("should connect to the next sentinel if getting master failed", function(done) { - var sentinel = new MockServer(27379, function(argv) { + it("should connect to the next sentinel if getting master failed", function (done) { + const sentinel = new MockServer(27379, function (argv) { if (argv[0] === "sentinel" && argv[1] === "get-master-addr-by-name") { return null; } }); - var sentinel2 = new MockServer(27380); - sentinel2.on("connect", function() { + const sentinel2 = new MockServer(27380); + sentinel2.on("connect", function () { redis.disconnect(); - sentinel.disconnect(function() { + sentinel.disconnect(function () { sentinel2.disconnect(done); }); }); @@ -277,14 +277,14 @@ describe("sentinel", function() { var redis = new Redis({ sentinels: [ { host: "127.0.0.1", port: 27379 }, - { host: "127.0.0.1", port: 27380 } + { host: "127.0.0.1", port: 27380 }, ], - name: "master" + name: "master", }); }); - it("should connect to the next sentinel if the role is wrong", function(done) { - new MockServer(27379, function(argv) { + it("should connect to the next sentinel if the role is wrong", function (done) { + new MockServer(27379, function (argv) { if ( argv[0] === "sentinel" && argv[1] === "get-master-addr-by-name" && @@ -294,13 +294,13 @@ describe("sentinel", function() { } }); - var sentinel = new MockServer(27380); - sentinel.on("connect", function() { + const sentinel = new MockServer(27380); + sentinel.on("connect", function () { redis.disconnect(); done(); }); - new MockServer(17380, function(argv) { + new MockServer(17380, function (argv) { if (argv[0] === "info") { return "role:slave"; } @@ -309,16 +309,16 @@ describe("sentinel", function() { var redis = new Redis({ sentinels: [ { host: "127.0.0.1", port: 27379 }, - { host: "127.0.0.1", port: 27380 } + { host: "127.0.0.1", port: 27380 }, ], - name: "master" + name: "master", }); }); }); - describe("slave", function() { - it("should connect to the slave successfully", function(done) { - var sentinel = new MockServer(27379, function(argv) { + describe("slave", function () { + it("should connect to the slave successfully", function (done) { + const sentinel = new MockServer(27379, function (argv) { if ( argv[0] === "sentinel" && argv[1] === "slaves" && @@ -327,10 +327,10 @@ describe("sentinel", function() { return [["ip", "127.0.0.1", "port", "17381", "flags", "slave"]]; } }); - var slave = new MockServer(17381); - slave.on("connect", function() { + const slave = new MockServer(17381); + slave.on("connect", function () { redis.disconnect(); - sentinel.disconnect(function() { + sentinel.disconnect(function () { slave.disconnect(done); }); }); @@ -339,12 +339,12 @@ describe("sentinel", function() { sentinels: [{ host: "127.0.0.1", port: 27379 }], name: "master", role: "slave", - preferredSlaves: [{ ip: "127.0.0.1", port: "17381", prio: 10 }] + preferredSlaves: [{ ip: "127.0.0.1", port: "17381", prio: 10 }], }); }); - it("should connect to the slave successfully based on preferred slave priority", function(done) { - var sentinel = new MockServer(27379, function(argv) { + it("should connect to the slave successfully based on preferred slave priority", function (done) { + const sentinel = new MockServer(27379, function (argv) { if ( argv[0] === "sentinel" && argv[1] === "slaves" && @@ -353,14 +353,14 @@ describe("sentinel", function() { return [ ["ip", "127.0.0.1", "port", "44444", "flags", "slave"], ["ip", "127.0.0.1", "port", "17381", "flags", "slave"], - ["ip", "127.0.0.1", "port", "55555", "flags", "slave"] + ["ip", "127.0.0.1", "port", "55555", "flags", "slave"], ]; } }); - var slave = new MockServer(17381); - slave.on("connect", function() { + const slave = new MockServer(17381); + slave.on("connect", function () { redis.disconnect(); - sentinel.disconnect(function() { + sentinel.disconnect(function () { slave.disconnect(done); }); }); @@ -375,13 +375,13 @@ describe("sentinel", function() { { ip: "127.0.0.1", port: "17381", prio: 1 }, { ip: "127.0.0.1", port: "22222", prio: 100 }, { ip: "127.0.0.1", port: "17381" }, - { ip: "127.0.0.1", port: "17381" } - ] + { ip: "127.0.0.1", port: "17381" }, + ], }); }); - it("should connect to the slave successfully based on preferred slave filter function", function(done) { - new MockServer(27379, function(argv) { + it("should connect to the slave successfully based on preferred slave filter function", function (done) { + new MockServer(27379, function (argv) { if ( argv[0] === "sentinel" && argv[1] === "slaves" && @@ -391,8 +391,8 @@ describe("sentinel", function() { } }); // only one running slave, which we will prefer - var slave = new MockServer(17381); - slave.on("connect", function() { + const slave = new MockServer(17381); + slave.on("connect", function () { redis.disconnect(); done(); }); @@ -402,19 +402,19 @@ describe("sentinel", function() { name: "master", role: "slave", preferredSlaves(slaves) { - for (var i = 0; i < slaves.length; i++) { - var slave = slaves[i]; + for (let i = 0; i < slaves.length; i++) { + const slave = slaves[i]; if (slave.ip == "127.0.0.1" && slave.port == "17381") { return slave; } } return null; - } + }, }); }); - it("should connect to the next sentinel if getting slave failed", function(done) { - var sentinel = new MockServer(27379, function(argv) { + it("should connect to the next sentinel if getting slave failed", function (done) { + const sentinel = new MockServer(27379, function (argv) { if ( argv[0] === "sentinel" && argv[1] === "slaves" && @@ -424,10 +424,10 @@ describe("sentinel", function() { } }); - var sentinel2 = new MockServer(27380); - sentinel2.on("connect", function() { + const sentinel2 = new MockServer(27380); + sentinel2.on("connect", function () { redis.disconnect(); - sentinel.disconnect(function() { + sentinel.disconnect(function () { sentinel2.disconnect(done); }); }); @@ -435,15 +435,15 @@ describe("sentinel", function() { var redis = new Redis({ sentinels: [ { host: "127.0.0.1", port: 27379 }, - { host: "127.0.0.1", port: 27380 } + { host: "127.0.0.1", port: 27380 }, ], name: "master", - role: "slave" + role: "slave", }); }); - it("should connect to the next sentinel if the role is wrong", function(done) { - var sentinel = new MockServer(27379, function(argv) { + it("should connect to the next sentinel if the role is wrong", function (done) { + const sentinel = new MockServer(27379, function (argv) { if ( argv[0] === "sentinel" && argv[1] === "slaves" && @@ -453,17 +453,17 @@ describe("sentinel", function() { } }); - var sentinel2 = new MockServer(27380); - sentinel2.on("connect", function(c) { + const sentinel2 = new MockServer(27380); + sentinel2.on("connect", function (c) { redis.disconnect(); - sentinel.disconnect(function() { - slave.disconnect(function() { + sentinel.disconnect(function () { + slave.disconnect(function () { sentinel2.disconnect(done); }); }); }); - var slave = new MockServer(17381, function(argv) { + var slave = new MockServer(17381, function (argv) { if (argv[0] === "info") { return "role:master"; } @@ -472,38 +472,38 @@ describe("sentinel", function() { var redis = new Redis({ sentinels: [ { host: "127.0.0.1", port: 27379 }, - { host: "127.0.0.1", port: 27380 } + { host: "127.0.0.1", port: 27380 }, ], name: "master", - role: "slave" + role: "slave", }); }); }); - describe("failover", function() { - it("should switch to new master automatically without any commands being lost", function(done) { - var sentinel = new MockServer(27379, function(argv) { + describe("failover", function () { + it("should switch to new master automatically without any commands being lost", function (done) { + const sentinel = new MockServer(27379, function (argv) { if (argv[0] === "sentinel" && argv[1] === "get-master-addr-by-name") { return ["127.0.0.1", "17380"]; } }); - var master = new MockServer(17380); - master.on("connect", function(c) { + const master = new MockServer(17380); + master.on("connect", function (c) { c.destroy(); master.disconnect(); - redis.get("foo", function(err, res) { + redis.get("foo", function (err, res) { expect(res).to.eql("bar"); redis.disconnect(); - newMaster.disconnect(function() { + newMaster.disconnect(function () { sentinel.disconnect(done); }); }); - var newMaster = new MockServer(17381, function(argv) { + var newMaster = new MockServer(17381, function (argv) { if (argv[0] === "get" && argv[1] === "foo") { return "bar"; } }); - sentinel.handler = function(argv) { + sentinel.handler = function (argv) { if (argv[0] === "sentinel" && argv[1] === "get-master-addr-by-name") { return ["127.0.0.1", "17381"]; } @@ -512,7 +512,7 @@ describe("sentinel", function() { var redis = new Redis({ sentinels: [{ host: "127.0.0.1", port: 27379 }], - name: "master" + name: "master", }); }); }); diff --git a/test/functional/sentinel_nat.ts b/test/functional/sentinel_nat.ts index 844047b3..a89b4ae7 100644 --- a/test/functional/sentinel_nat.ts +++ b/test/functional/sentinel_nat.ts @@ -1,37 +1,37 @@ import Redis from "../../lib/redis"; import MockServer from "../helpers/mock_server"; -describe("sentinel_nat", function() { - it("connects to server as expected", function(done) { - var sentinel = new MockServer(27379, function(argv) { +describe("sentinel_nat", function () { + it("connects to server as expected", function (done) { + const sentinel = new MockServer(27379, function (argv) { if (argv[0] === "sentinel" && argv[1] === "get-master-addr-by-name") { return ["127.0.0.1", "17380"]; } }); - var redis = new Redis({ + const redis = new Redis({ sentinels: [{ host: "127.0.0.1", port: 27379 }], natMap: { "127.0.0.1:17380": { host: "localhost", - port: 6379 - } + port: 6379, + }, }, name: "master", - lazyConnect: true + lazyConnect: true, }); - redis.connect(function(err) { + redis.connect(function (err) { if (err) { - sentinel.disconnect(function() {}); + sentinel.disconnect(function () {}); return done(err); } sentinel.disconnect(done); }); }); - it("rejects connection if host is not defined in map", function(done) { - var sentinel = new MockServer(27379, function(argv) { + it("rejects connection if host is not defined in map", function (done) { + const sentinel = new MockServer(27379, function (argv) { if (argv[0] === "sentinel" && argv[1] === "get-master-addr-by-name") { return ["127.0.0.1", "17380"]; } @@ -45,25 +45,25 @@ describe("sentinel_nat", function() { } }); - var redis = new Redis({ + const redis = new Redis({ sentinels: [{ host: "127.0.0.1", port: 27379 }], natMap: { "127.0.0.1:17381": { host: "localhost", - port: 6379 - } + port: 6379, + }, }, maxRetriesPerRequest: 1, name: "master", - lazyConnect: true + lazyConnect: true, }); redis .connect() - .then(function() { + .then(function () { throw new Error("Should not call"); }) - .catch(function(err) { + .catch(function (err) { if (err.message === "Connection is closed.") { return done(null); } diff --git a/test/functional/show_friendly_error_stack.ts b/test/functional/show_friendly_error_stack.ts index 9b7f3cb5..214ecec4 100644 --- a/test/functional/show_friendly_error_stack.ts +++ b/test/functional/show_friendly_error_stack.ts @@ -1,14 +1,14 @@ import Redis from "../../lib/redis"; import { expect } from "chai"; -var path = require("path"); -var scriptName = path.basename(__filename); +const path = require("path"); +const scriptName = path.basename(__filename); -describe("showFriendlyErrorStack", function() { - it("should show friendly error stack", function(done) { - var redis = new Redis({ showFriendlyErrorStack: true }); - redis.set("foo").catch(function(err) { - var errors = err.stack.split("\n"); +describe("showFriendlyErrorStack", function () { + it("should show friendly error stack", function (done) { + const redis = new Redis({ showFriendlyErrorStack: true }); + redis.set("foo").catch(function (err) { + const errors = err.stack.split("\n"); expect(errors[0].indexOf("ReplyError")).not.eql(-1); expect(errors[1].indexOf(scriptName)).not.eql(-1); done(); diff --git a/test/functional/string_numbers.ts b/test/functional/string_numbers.ts index 33235ae5..c9dc1fef 100644 --- a/test/functional/string_numbers.ts +++ b/test/functional/string_numbers.ts @@ -1,16 +1,16 @@ import Redis from "../../lib/redis"; import { expect } from "chai"; -var MAX_NUMBER = 9007199254740991; // Number.MAX_SAFE_INTEGER +const MAX_NUMBER = 9007199254740991; // Number.MAX_SAFE_INTEGER -describe("stringNumbers", function() { - context("enabled", function() { - it("returns numbers as strings", function(done) { - var redis = new Redis({ - stringNumbers: true +describe("stringNumbers", function () { + context("enabled", function () { + it("returns numbers as strings", function (done) { + const redis = new Redis({ + stringNumbers: true, }); - var pending = 0; + let pending = 0; redis.set("foo", MAX_NUMBER); redis.incr("foo", check("9007199254740992")); @@ -27,7 +27,7 @@ describe("stringNumbers", function() { function check(expected) { pending += 1; - return function(err, res) { + return function (err, res) { expect(res).to.eql(expected); if (!--pending) { redis.disconnect(); @@ -38,12 +38,12 @@ describe("stringNumbers", function() { }); }); - context("disabled", function() { - it("returns numbers", function(done) { - var redis = new Redis(); + context("disabled", function () { + it("returns numbers", function (done) { + const redis = new Redis(); redis.set("foo", "123"); - redis.incr("foo", function(err, res) { + redis.incr("foo", function (err, res) { expect(res).to.eql(124); redis.disconnect(); done(); diff --git a/test/functional/tls.ts b/test/functional/tls.ts index 9ca727d6..6dc3ba14 100644 --- a/test/functional/tls.ts +++ b/test/functional/tls.ts @@ -7,17 +7,17 @@ import MockServer from "../helpers/mock_server"; describe("tls option", () => { describe("Standalone", () => { - it("supports tls", done => { + it("supports tls", (done) => { let redis; // @ts-ignore - const stub = sinon.stub(tls, "connect").callsFake(op => { + const stub = sinon.stub(tls, "connect").callsFake((op) => { // @ts-ignore expect(op.ca).to.eql("123"); // @ts-ignore expect(op.port).to.eql(6379); const stream = net.createConnection(op); - stream.on("connect", data => { + stream.on("connect", (data) => { stream.emit("secureConnect", data); }); return stream; @@ -33,8 +33,8 @@ describe("tls option", () => { }); describe("Sentinel", () => { - it("does not use tls option by default", done => { - new MockServer(27379, function(argv) { + it("does not use tls option by default", (done) => { + new MockServer(27379, function (argv) { if (argv[0] === "sentinel" && argv[1] === "get-master-addr-by-name") { return ["127.0.0.1", "6379"]; } @@ -47,7 +47,7 @@ describe("tls option", () => { const redis = new Redis({ sentinels: [{ port: 27379 }], name: "my", - tls: { ca: "123" } + tls: { ca: "123" }, }); redis.on("ready", () => { redis.disconnect(); @@ -56,8 +56,8 @@ describe("tls option", () => { }); }); - it("can be enabled by `enableTLSForSentinelMode`", done => { - new MockServer(27379, function(argv) { + it("can be enabled by `enableTLSForSentinelMode`", (done) => { + new MockServer(27379, function (argv) { if (argv[0] === "sentinel" && argv[1] === "get-master-addr-by-name") { return ["127.0.0.1", "6379"]; } @@ -65,7 +65,7 @@ describe("tls option", () => { let redis; - const stub = sinon.stub(tls, "connect").callsFake(op => { + const stub = sinon.stub(tls, "connect").callsFake((op) => { // @ts-ignore expect(op.ca).to.eql("123"); redis.disconnect(); @@ -78,12 +78,12 @@ describe("tls option", () => { sentinels: [{ port: 27379 }], name: "my", tls: { ca: "123" }, - enableTLSForSentinelMode: true + enableTLSForSentinelMode: true, }); }); - it("supports sentinelTLS", done => { - new MockServer(27379, function(argv) { + it("supports sentinelTLS", (done) => { + new MockServer(27379, function (argv) { if (argv[0] === "sentinel" && argv[1] === "get-master-addr-by-name") { return ["127.0.0.1", "6379"]; } @@ -92,13 +92,13 @@ describe("tls option", () => { let redis; // @ts-ignore - const stub = sinon.stub(tls, "connect").callsFake(op => { + const stub = sinon.stub(tls, "connect").callsFake((op) => { // @ts-ignore expect(op.ca).to.eql("123"); // @ts-ignore expect(op.port).to.eql(27379); const stream = net.createConnection(op); - stream.on("connect", data => { + stream.on("connect", (data) => { stream.emit("secureConnect", data); }); return stream; @@ -107,7 +107,7 @@ describe("tls option", () => { redis = new Redis({ sentinels: [{ port: 27379 }], name: "my", - sentinelTLS: { ca: "123" } + sentinelTLS: { ca: "123" }, }); redis.on("ready", () => { redis.disconnect(); diff --git a/test/functional/transaction.ts b/test/functional/transaction.ts index 50ddef2c..8ed77c42 100644 --- a/test/functional/transaction.ts +++ b/test/functional/transaction.ts @@ -2,27 +2,30 @@ import Redis from "../../lib/redis"; import { expect } from "chai"; import Command from "../../lib/command"; -describe("transaction", function() { - it("should works like pipeline by default", function(done) { - var redis = new Redis(); +describe("transaction", function () { + it("should works like pipeline by default", function (done) { + const redis = new Redis(); redis .multi() .set("foo", "transaction") .get("foo") - .exec(function(err, result) { + .exec(function (err, result) { expect(err).to.eql(null); - expect(result).to.eql([[null, "OK"], [null, "transaction"]]); + expect(result).to.eql([ + [null, "OK"], + [null, "transaction"], + ]); done(); }); }); - it("should handle runtime errors correctly", function(done) { - var redis = new Redis(); + it("should handle runtime errors correctly", function (done) { + const redis = new Redis(); redis .multi() .set("foo", "bar") .lpush("foo", "abc") - .exec(function(err, result) { + .exec(function (err, result) { expect(err).to.eql(null); expect(result.length).to.eql(2); expect(result[0]).to.eql([null, "OK"]); @@ -32,13 +35,13 @@ describe("transaction", function() { }); }); - it("should handle compile-time errors correctly", function(done) { - var redis = new Redis(); + it("should handle compile-time errors correctly", function (done) { + const redis = new Redis(); redis .multi() .set("foo") .get("foo") - .exec(function(err) { + .exec(function (err) { expect(err).to.be.instanceof(Error); expect(err.toString()).to.match( /Transaction discarded because of previous errors/ @@ -47,33 +50,36 @@ describe("transaction", function() { }); }); - it("should also support command callbacks", function(done) { - var redis = new Redis(); - var pending = 1; + it("should also support command callbacks", function (done) { + const redis = new Redis(); + let pending = 1; redis .multi() .set("foo", "bar") - .get("foo", function(err, value) { + .get("foo", function (err, value) { pending -= 1; expect(value).to.eql("QUEUED"); }) - .exec(function(err, result) { + .exec(function (err, result) { expect(pending).to.eql(0); - expect(result).to.eql([[null, "OK"], [null, "bar"]]); + expect(result).to.eql([ + [null, "OK"], + [null, "bar"], + ]); done(); }); }); - it("should also handle errors in command callbacks", function(done) { - var redis = new Redis(); - var pending = 1; + it("should also handle errors in command callbacks", function (done) { + const redis = new Redis(); + let pending = 1; redis .multi() - .set("foo", function(err) { + .set("foo", function (err) { expect(err.toString()).to.match(/wrong number of arguments/); pending -= 1; }) - .exec(function(err) { + .exec(function (err) { expect(err.toString()).to.match( /Transaction discarded because of previous errors/ ); @@ -83,26 +89,29 @@ describe("transaction", function() { }); }); - it("should work without pipeline", function(done) { - var redis = new Redis(); + it("should work without pipeline", function (done) { + const redis = new Redis(); redis.multi({ pipeline: false }); redis.set("foo", "bar"); redis.get("foo"); - redis.exec(function(err, results) { - expect(results).to.eql([[null, "OK"], [null, "bar"]]); + redis.exec(function (err, results) { + expect(results).to.eql([ + [null, "OK"], + [null, "bar"], + ]); done(); }); }); - describe("transformer", function() { - it("should trigger transformer", function(done) { - var redis = new Redis(); - var pending = 2; - var data = { name: "Bob", age: "17" }; + describe("transformer", function () { + it("should trigger transformer", function (done) { + const redis = new Redis(); + let pending = 2; + const data = { name: "Bob", age: "17" }; redis .multi() .hmset("foo", data) - .hgetall("foo", function(err, res) { + .hgetall("foo", function (err, res) { expect(res).to.eql("QUEUED"); if (!--pending) { done(); @@ -111,12 +120,12 @@ describe("transaction", function() { .hgetallBuffer("foo") .get("foo") .getBuffer("foo") - .exec(function(err, res) { + .exec(function (err, res) { expect(res[0][1]).to.eql("OK"); expect(res[1][1]).to.eql(data); expect(res[2][1]).to.eql({ name: Buffer.from("Bob"), - age: Buffer.from("17") + age: Buffer.from("17"), }); expect(res[3][0]).to.have.property( "message", @@ -133,9 +142,9 @@ describe("transaction", function() { }); }); - it("should trigger transformer inside pipeline", function(done) { - var redis = new Redis(); - var data = { name: "Bob", age: "17" }; + it("should trigger transformer inside pipeline", function (done) { + const redis = new Redis(); + const data = { name: "Bob", age: "17" }; redis .pipeline() .hmset("foo", data) @@ -144,7 +153,7 @@ describe("transaction", function() { .hgetall("foo") .exec() .hgetall("foo") - .exec(function(err, res) { + .exec(function (err, res) { expect(res[0][1]).to.eql("OK"); expect(res[1][1]).to.eql("OK"); expect(res[2][1]).to.eql(Buffer.from("QUEUED")); @@ -155,18 +164,18 @@ describe("transaction", function() { }); }); - it("should handle custom transformer exception", function(done) { - var transformError = "transformer error"; + it("should handle custom transformer exception", function (done) { + const transformError = "transformer error"; // @ts-ignore - Command._transformer.reply.get = function() { + Command._transformer.reply.get = function () { throw new Error(transformError); }; - var redis = new Redis(); + const redis = new Redis(); redis .multi() .get("foo") - .exec(function(err, res) { + .exec(function (err, res) { expect(res[0][0]).to.have.property("message", transformError); // @ts-ignore delete Command._transformer.reply.get; @@ -175,23 +184,23 @@ describe("transaction", function() { }); }); - describe("#addBatch", function() { - it("should accept commands in constructor", function(done) { - var redis = new Redis(); - var pending = 1; + describe("#addBatch", function () { + it("should accept commands in constructor", function (done) { + const redis = new Redis(); + let pending = 1; redis .multi([ ["set", "foo", "bar"], [ "get", "foo", - function(err, result) { + function (err, result) { expect(result).to.eql("QUEUED"); pending -= 1; - } - ] + }, + ], ]) - .exec(function(err, results) { + .exec(function (err, results) { expect(pending).to.eql(0); expect(results[1][1]).to.eql("bar"); done(); @@ -199,15 +208,15 @@ describe("transaction", function() { }); }); - describe("#exec", function() { - it("should batch all commands before ready event", function(done) { - var redis = new Redis(); - redis.on("connect", function() { + describe("#exec", function () { + it("should batch all commands before ready event", function (done) { + const redis = new Redis(); + redis.on("connect", function () { redis .multi() .info() .config("get", "maxmemory") - .exec(function(err, res) { + .exec(function (err, res) { expect(err).to.eql(null); expect(res).to.have.lengthOf(2); expect(res[0][0]).to.eql(null); diff --git a/test/functional/transformer.ts b/test/functional/transformer.ts index d5d6818f..6e4e7960 100644 --- a/test/functional/transformer.ts +++ b/test/functional/transformer.ts @@ -1,40 +1,40 @@ import Redis from "../../lib/redis"; import { expect } from "chai"; -describe("transformer", function() { - describe("default transformer", function() { - describe("hmset", function() { - it("should support object", function(done) { - var redis = new Redis(); - redis.hmset("foo", { a: 1, b: "2" }, function(err, result) { +describe("transformer", function () { + describe("default transformer", function () { + describe("hmset", function () { + it("should support object", function (done) { + const redis = new Redis(); + redis.hmset("foo", { a: 1, b: "2" }, function (err, result) { expect(result).to.eql("OK"); - redis.hget("foo", "b", function(err, result) { + redis.hget("foo", "b", function (err, result) { expect(result).to.eql("2"); done(); }); }); }); - it("should support Map", function(done) { + it("should support Map", function (done) { if (typeof Map === "undefined") { return done(); } - var redis = new Redis(); - var map = new Map(); + const redis = new Redis(); + const map = new Map(); map.set("a", 1); map.set("b", "2"); - redis.hmset("foo", map, function(err, result) { + redis.hmset("foo", map, function (err, result) { expect(result).to.eql("OK"); - redis.hget("foo", "b", function(err, result) { + redis.hget("foo", "b", function (err, result) { expect(result).to.eql("2"); done(); }); }); }); - it("should not affect the old way", function(done) { - var redis = new Redis(); - redis.hmset("foo", "a", 1, "b", "2", function(err, result) { + it("should not affect the old way", function (done) { + const redis = new Redis(); + redis.hmset("foo", "a", 1, "b", "2", function (err, result) { expect(result).to.eql("OK"); - redis.hget("foo", "b", function(err, result) { + redis.hget("foo", "b", function (err, result) { expect(result).to.eql("2"); done(); }); @@ -42,49 +42,49 @@ describe("transformer", function() { }); }); - describe("mset", function() { - it("should support object", function(done) { - var redis = new Redis(); - redis.mset({ a: 1, b: "2" }, function(err, result) { + describe("mset", function () { + it("should support object", function (done) { + const redis = new Redis(); + redis.mset({ a: 1, b: "2" }, function (err, result) { expect(result).to.eql("OK"); - redis.mget("a", "b", function(err, result) { + redis.mget("a", "b", function (err, result) { expect(result).to.eql(["1", "2"]); done(); }); }); }); - it("should support Map", function(done) { + it("should support Map", function (done) { if (typeof Map === "undefined") { return done(); } - var redis = new Redis(); - var map = new Map(); + const redis = new Redis(); + const map = new Map(); map.set("a", 1); map.set("b", "2"); - redis.mset(map, function(err, result) { + redis.mset(map, function (err, result) { expect(result).to.eql("OK"); - redis.mget("a", "b", function(err, result) { + redis.mget("a", "b", function (err, result) { expect(result).to.eql(["1", "2"]); done(); }); }); }); - it("should not affect the old way", function(done) { - var redis = new Redis(); - redis.mset("a", 1, "b", "2", function(err, result) { + it("should not affect the old way", function (done) { + const redis = new Redis(); + redis.mset("a", 1, "b", "2", function (err, result) { expect(result).to.eql("OK"); - redis.mget("a", "b", function(err, result) { + redis.mget("a", "b", function (err, result) { expect(result).to.eql(["1", "2"]); done(); }); }); }); - it("should work with keyPrefix option", function(done) { - var redis = new Redis({ keyPrefix: "foo:" }); - redis.mset({ a: 1, b: "2" }, function(err, result) { + it("should work with keyPrefix option", function (done) { + const redis = new Redis({ keyPrefix: "foo:" }); + redis.mset({ a: 1, b: "2" }, function (err, result) { expect(result).to.eql("OK"); - var otherRedis = new Redis(); - otherRedis.mget("foo:a", "foo:b", function(err, result) { + const otherRedis = new Redis(); + otherRedis.mget("foo:a", "foo:b", function (err, result) { expect(result).to.eql(["1", "2"]); done(); }); @@ -92,49 +92,49 @@ describe("transformer", function() { }); }); - describe("msetnx", function() { - it("should support object", function(done) { - var redis = new Redis(); - redis.msetnx({ a: 1, b: "2" }, function(err, result) { + describe("msetnx", function () { + it("should support object", function (done) { + const redis = new Redis(); + redis.msetnx({ a: 1, b: "2" }, function (err, result) { expect(result).to.eql(1); - redis.mget("a", "b", function(err, result) { + redis.mget("a", "b", function (err, result) { expect(result).to.eql(["1", "2"]); done(); }); }); }); - it("should support Map", function(done) { + it("should support Map", function (done) { if (typeof Map === "undefined") { return done(); } - var redis = new Redis(); - var map = new Map(); + const redis = new Redis(); + const map = new Map(); map.set("a", 1); map.set("b", "2"); - redis.msetnx(map, function(err, result) { + redis.msetnx(map, function (err, result) { expect(result).to.eql(1); - redis.mget("a", "b", function(err, result) { + redis.mget("a", "b", function (err, result) { expect(result).to.eql(["1", "2"]); done(); }); }); }); - it("should not affect the old way", function(done) { - var redis = new Redis(); - redis.msetnx("a", 1, "b", "2", function(err, result) { + it("should not affect the old way", function (done) { + const redis = new Redis(); + redis.msetnx("a", 1, "b", "2", function (err, result) { expect(result).to.eql(1); - redis.mget("a", "b", function(err, result) { + redis.mget("a", "b", function (err, result) { expect(result).to.eql(["1", "2"]); done(); }); }); }); - it("should work with keyPrefix option", function(done) { - var redis = new Redis({ keyPrefix: "foo:" }); - redis.msetnx({ a: 1, b: "2" }, function(err, result) { + it("should work with keyPrefix option", function (done) { + const redis = new Redis({ keyPrefix: "foo:" }); + redis.msetnx({ a: 1, b: "2" }, function (err, result) { expect(result).to.eql(1); - var otherRedis = new Redis(); - otherRedis.mget("foo:a", "foo:b", function(err, result) { + const otherRedis = new Redis(); + otherRedis.mget("foo:a", "foo:b", function (err, result) { expect(result).to.eql(["1", "2"]); done(); }); @@ -142,58 +142,58 @@ describe("transformer", function() { }); }); - describe("hgetall", function() { - it("should return an object", function(done) { - var redis = new Redis(); - redis.hmset("foo", "k1", "v1", "k2", "v2", function() { - redis.hgetall("foo", function(err, result) { + describe("hgetall", function () { + it("should return an object", function (done) { + const redis = new Redis(); + redis.hmset("foo", "k1", "v1", "k2", "v2", function () { + redis.hgetall("foo", function (err, result) { expect(result).to.eql({ k1: "v1", k2: "v2" }); done(); }); }); }); - it("should return {} when key not exists", function(done) { - var redis = new Redis(); - redis.hgetall("foo", function(err, result) { + it("should return {} when key not exists", function (done) { + const redis = new Redis(); + redis.hgetall("foo", function (err, result) { expect(result).to.eql({}); done(); }); }); }); - describe("hset", function() { - it("should support object", function(done) { - var redis = new Redis(); - redis.hset("foo", { a: 1, b: "e", c: 123 }, function(err, result) { + describe("hset", function () { + it("should support object", function (done) { + const redis = new Redis(); + redis.hset("foo", { a: 1, b: "e", c: 123 }, function (err, result) { expect(result).to.eql(3); - redis.hget("foo", "b", function(err, result) { + redis.hget("foo", "b", function (err, result) { expect(result).to.eql("e"); done(); }); }); }); - it("should support Map", function(done) { + it("should support Map", function (done) { if (typeof Map === "undefined") { return done(); } - var redis = new Redis(); - var map = new Map(); + const redis = new Redis(); + const map = new Map(); map.set("a", 1); map.set("b", "e"); - redis.hset("foo", map, function(err, result) { + redis.hset("foo", map, function (err, result) { expect(result).to.eql(2); - redis.hget("foo", "b", function(err, result) { + redis.hget("foo", "b", function (err, result) { expect(result).to.eql("e"); done(); }); }); }); - it("should affect the old way", function(done) { - var redis = new Redis(); - redis.hset("foo", "a", 1, "b", "e", function(err, result) { + it("should affect the old way", function (done) { + const redis = new Redis(); + redis.hset("foo", "a", 1, "b", "e", function (err, result) { expect(result).to.eql(2); - redis.hget("foo", "b", function(err, result) { + redis.hget("foo", "b", function (err, result) { expect(result).to.eql("e"); done(); }); diff --git a/test/functional/watch-exec.ts b/test/functional/watch-exec.ts index 3c016240..4485cd52 100644 --- a/test/functional/watch-exec.ts +++ b/test/functional/watch-exec.ts @@ -1,38 +1,32 @@ import Redis from "../../lib/redis"; import { expect } from "chai"; -describe("watch-exec", function() { - it("should support watch/exec transactions", function() { - var redis1 = new Redis(); +describe("watch-exec", function () { + it("should support watch/exec transactions", function () { + const redis1 = new Redis(); return redis1 .watch("watchkey") - .then(function() { - return redis1 - .multi() - .set("watchkey", "1") - .exec(); + .then(function () { + return redis1.multi().set("watchkey", "1").exec(); }) - .then(function(result) { + .then(function (result) { expect(result.length).to.eql(1); expect(result[0]).to.eql([null, "OK"]); }); }); - it("should support watch/exec transaction rollback", function() { - var redis1 = new Redis(); - var redis2 = new Redis(); + it("should support watch/exec transaction rollback", function () { + const redis1 = new Redis(); + const redis2 = new Redis(); return redis1 .watch("watchkey") - .then(function() { + .then(function () { return redis2.set("watchkey", "2"); }) - .then(function() { - return redis1 - .multi() - .set("watchkey", "1") - .exec(); + .then(function () { + return redis1.multi().set("watchkey", "1").exec(); }) - .then(function(result) { + .then(function (result) { expect(result).to.be.null; }); }); diff --git a/test/helpers/global.ts b/test/helpers/global.ts index b9d4bc8a..54e0a7fe 100644 --- a/test/helpers/global.ts +++ b/test/helpers/global.ts @@ -1,7 +1,7 @@ import * as sinon from "sinon"; import Redis from "../../lib/redis"; -afterEach(function(done) { +afterEach(function (done) { sinon.restore(); new Redis() .pipeline() @@ -11,4 +11,4 @@ afterEach(function(done) { .exec(done); }); -console.error = function() {}; +console.error = function () {}; diff --git a/test/helpers/mock_server.ts b/test/helpers/mock_server.ts index b6905aa6..d694577b 100644 --- a/test/helpers/mock_server.ts +++ b/test/helpers/mock_server.ts @@ -7,12 +7,12 @@ import Parser = require("redis-parser"); let createdMockServers: MockServer[] = []; const RAW_DATA_KEY = "___IOREDIS_MOCK_ROW_DATA___"; -afterEach(function(done) { +afterEach(function (done) { if (createdMockServers.length === 0) { done(); return; } - var pending = 0; + let pending = 0; for (const server of createdMockServers) { pending += 1; server.disconnect(check); @@ -46,7 +46,7 @@ export default class MockServer extends EventEmitter { static raw(data: T): { [RAW_DATA_KEY]: T } { return { - [RAW_DATA_KEY]: data + [RAW_DATA_KEY]: data, }; } @@ -64,13 +64,13 @@ export default class MockServer extends EventEmitter { } connect() { - this.socket = createServer(c => { - var clientIndex = this.clients.push(c) - 1; + this.socket = createServer((c) => { + const clientIndex = this.clients.push(c) - 1; process.nextTick(() => { this.emit("connect", c); }); - var parser = new Parser({ + const parser = new Parser({ returnBuffers: true, stringNumbers: false, returnReply: (reply: any) => { @@ -91,14 +91,14 @@ export default class MockServer extends EventEmitter { this.write(c, this.slotTable); return; } - let flags: Flags = {}; - let handlerResult = this.handler && this.handler(reply, c, flags); + const flags: Flags = {}; + const handlerResult = this.handler && this.handler(reply, c, flags); this.write(c, handlerResult); if (flags.disconnect) { this.disconnect(); } }, - returnError: function() {} + returnError: function () {}, }); c.on("end", () => { @@ -106,7 +106,7 @@ export default class MockServer extends EventEmitter { this.emit("disconnect", c); }); - c.on("data", data => { + c.on("data", (data) => { // @ts-ignore parser.execute(data); }); @@ -123,8 +123,8 @@ export default class MockServer extends EventEmitter { broadcast(data: any) { this.clients - .filter(c => c) - .forEach(client => { + .filter((c) => c) + .forEach((client) => { this.write(client, data); }); } @@ -145,7 +145,7 @@ export default class MockServer extends EventEmitter { result = "-" + data.message + "\r\n"; } else if (Array.isArray(data)) { result = "*" + data.length + "\r\n"; - data.forEach(function(item) { + data.forEach(function (item) { result += convert(str, item); }); } else if (typeof data === "number") { @@ -165,8 +165,8 @@ export default class MockServer extends EventEmitter { findClientByName(name: string): Socket | undefined { return this.clients - .filter(c => c) - .find(client => { + .filter((c) => c) + .find((client) => { return getConnectionName(client) === name; }); } diff --git a/test/mocha.opts b/test/mocha.opts deleted file mode 100644 index 02f687b6..00000000 --- a/test/mocha.opts +++ /dev/null @@ -1,5 +0,0 @@ ---reporter spec ---recursive ---timeout 8000 ---require ts-node/register ---exit diff --git a/test/unit/clusters/ConnectionPool.ts b/test/unit/clusters/ConnectionPool.ts index aff8e014..1bad7bab 100644 --- a/test/unit/clusters/ConnectionPool.ts +++ b/test/unit/clusters/ConnectionPool.ts @@ -10,7 +10,7 @@ describe("ConnectionPool", () => { pool.reset([ { host: "127.0.0.1", port: 30001, readOnly: true }, - { host: "127.0.0.1", port: 30001, readOnly: false } + { host: "127.0.0.1", port: 30001, readOnly: false }, ]); expect(stub.callCount).to.eql(1); @@ -18,7 +18,7 @@ describe("ConnectionPool", () => { pool.reset([ { host: "127.0.0.1", port: 30001, readOnly: false }, - { host: "127.0.0.1", port: 30001, readOnly: true } + { host: "127.0.0.1", port: 30001, readOnly: true }, ]); expect(stub.callCount).to.eql(2); diff --git a/test/unit/clusters/index.ts b/test/unit/clusters/index.ts index 02c6061d..cec80f03 100644 --- a/test/unit/clusters/index.ts +++ b/test/unit/clusters/index.ts @@ -3,40 +3,40 @@ import { Cluster } from "../../../lib"; import * as sinon from "sinon"; import { expect } from "chai"; -describe("cluster", function() { - beforeEach(function() { +describe("cluster", function () { + beforeEach(function () { sinon.stub(Cluster.prototype, "connect").callsFake(() => Promise.resolve()); }); - afterEach(function() { + afterEach(function () { Cluster.prototype.connect.restore(); }); - it("should support frozen options", function() { - var options = Object.freeze({ maxRedirections: 1000 }); - var cluster = new Cluster([{ port: 7777 }], options); + it("should support frozen options", function () { + const options = Object.freeze({ maxRedirections: 1000 }); + const cluster = new Cluster([{ port: 7777 }], options); expect(cluster.options).to.have.property("maxRedirections", 1000); expect(cluster.options).to.have.property("showFriendlyErrorStack", false); expect(cluster.options).to.have.property("scaleReads", "master"); }); - it("should allow overriding Commander options", function() { + it("should allow overriding Commander options", function () { const cluster = new Cluster([{ port: 7777 }], { - showFriendlyErrorStack: true + showFriendlyErrorStack: true, }); expect(cluster.options).to.have.property("showFriendlyErrorStack", true); }); - it("throws when scaleReads is invalid", function() { - expect(function() { + it("throws when scaleReads is invalid", function () { + expect(function () { new Cluster([{}], { scaleReads: "invalid" }); }).to.throw(/Invalid option scaleReads/); }); - describe("#nodes()", function() { - it("throws when role is invalid", function() { - var cluster = new Cluster([{}]); - expect(function() { + describe("#nodes()", function () { + it("throws when role is invalid", function () { + const cluster = new Cluster([{}]); + expect(function () { cluster.nodes("invalid"); }).to.throw(/Invalid role/); }); @@ -47,19 +47,19 @@ describe("nodeKeyToRedisOptions()", () => { it("returns correct result", () => { expect(nodeKeyToRedisOptions("127.0.0.1:6379")).to.eql({ port: 6379, - host: "127.0.0.1" + host: "127.0.0.1", }); expect(nodeKeyToRedisOptions("192.168.1.1:30001")).to.eql({ port: 30001, - host: "192.168.1.1" + host: "192.168.1.1", }); expect(nodeKeyToRedisOptions("::0:6379")).to.eql({ port: 6379, - host: "::0" + host: "::0", }); expect(nodeKeyToRedisOptions("0:0:6379")).to.eql({ port: 6379, - host: "0:0" + host: "0:0", }); }); }); diff --git a/test/unit/command.ts b/test/unit/command.ts index a7277c97..8dd9158f 100644 --- a/test/unit/command.ts +++ b/test/unit/command.ts @@ -1,25 +1,25 @@ import { expect } from "chai"; import Command from "../../lib/command"; -describe("Command", function() { - describe("constructor()", function() { - it("should flatten the args", function() { - var command = new Command("get", ["foo", ["bar", ["zoo", "zoo"]]]); +describe("Command", function () { + describe("constructor()", function () { + it("should flatten the args", function () { + const command = new Command("get", ["foo", ["bar", ["zoo", "zoo"]]]); expect(command.args).to.eql(["foo", "bar", "zoo,zoo"]); }); }); - describe("#toWritable()", function() { - it("should return correct string", function() { - var command = new Command("get", ["foo", "bar", "zooo"]); + describe("#toWritable()", function () { + it("should return correct string", function () { + const command = new Command("get", ["foo", "bar", "zooo"]); expect(command.toWritable()).to.eql( "*4\r\n$3\r\nget\r\n$3\r\nfoo\r\n$3\r\nbar\r\n$4\r\nzooo\r\n" ); }); - it("should return buffer when there's at least one arg is a buffer", function() { - var command = new Command("get", ["foo", Buffer.from("bar"), "zooo"]); - var result = command.toWritable(); + it("should return buffer when there's at least one arg is a buffer", function () { + const command = new Command("get", ["foo", Buffer.from("bar"), "zooo"]); + const result = command.toWritable(); expect(result).to.be.instanceof(Buffer); expect(result.toString()).to.eql( "*4\r\n$3\r\nget\r\n$3\r\nfoo\r\n$3\r\nbar\r\n$4\r\nzooo\r\n" @@ -27,13 +27,13 @@ describe("Command", function() { }); }); - describe("#resolve()", function() { - it("should return buffer when replyEncoding is not set", function(done) { - var command = new Command( + describe("#resolve()", function () { + it("should return buffer when replyEncoding is not set", function (done) { + const command = new Command( "get", ["foo"], { replyEncoding: null }, - function(err, result) { + function (err, result) { expect(result).to.be.instanceof(Buffer); expect(result.toString()).to.eql("foo"); done(); @@ -42,12 +42,12 @@ describe("Command", function() { command.resolve(Buffer.from("foo")); }); - it("should covert result to string if replyEncoding is specified", function(done) { - var command = new Command( + it("should covert result to string if replyEncoding is specified", function (done) { + const command = new Command( "get", ["foo"], { replyEncoding: "utf8" }, - function(err, result) { + function (err, result) { expect(result).to.eql("foo"); done(); } @@ -55,13 +55,13 @@ describe("Command", function() { command.resolve(Buffer.from("foo")); }); - it("should regard replyEncoding", function(done) { - var base64 = Buffer.from("foo").toString("base64"); - var command = new Command( + it("should regard replyEncoding", function (done) { + const base64 = Buffer.from("foo").toString("base64"); + const command = new Command( "get", ["foo"], { replyEncoding: "base64" }, - function(err, result) { + function (err, result) { expect(result).to.eql(base64); done(); } @@ -70,30 +70,30 @@ describe("Command", function() { }); }); - describe("#getKeys()", function() { - it("should return keys", function() { + describe("#getKeys()", function () { + it("should return keys", function () { expect(getKeys("get", ["foo"])).to.eql(["foo"]); expect(getKeys("mget", ["foo", "bar"])).to.eql(["foo", "bar"]); expect(getKeys("mset", ["foo", "v1", "bar", "v2"])).to.eql([ "foo", - "bar" + "bar", ]); expect(getKeys("hmset", ["key", "foo", "v1", "bar", "v2"])).to.eql([ - "key" + "key", ]); expect(getKeys("blpop", ["key1", "key2", "17"])).to.eql(["key1", "key2"]); expect(getKeys("evalsha", ["23123", "2", "foo", "bar", "zoo"])).to.eql([ "foo", - "bar" + "bar", ]); expect(getKeys("evalsha", ["23123", 2, "foo", "bar", "zoo"])).to.eql([ "foo", - "bar" + "bar", ]); expect(getKeys("sort", ["key"])).to.eql(["key"]); expect(getKeys("sort", ["key", "BY", "hash:*->field"])).to.eql([ "key", - "hash:*->field" + "hash:*->field", ]); expect( getKeys("sort", [ @@ -112,7 +112,7 @@ describe("Command", function() { "DESC", "ALPHA", "STORE", - "store" + "store", ]) ).to.eql(["key", "hash:*->field", "gk", "gh->f*", "store"]); expect( @@ -123,18 +123,18 @@ describe("Command", function() { ).to.eql(["out", "zset1", "zset2"]); function getKeys(commandName, args) { - var command = new Command(commandName, args); + const command = new Command(commandName, args); return command.getKeys(); } }); }); - describe("#getSlot()", function() { + describe("#getSlot()", function () { function expectSlot(key: any, slot: number) { expect(new Command("get", [key]).getSlot()).to.eql(slot); } - it("should return correctly", function() { + it("should return correctly", function () { expectSlot("123", 5970); expectSlot(123, 5970); expectSlot("ab{c", 4619); @@ -155,8 +155,8 @@ describe("Command", function() { }); }); - describe(".checkFlag()", function() { - it("should return correct result", function() { + describe(".checkFlag()", function () { + it("should return correct result", function () { expect(Command.checkFlag("VALID_IN_SUBSCRIBER_MODE", "ping")).to.eql( true ); diff --git a/test/unit/commander.ts b/test/unit/commander.ts index 8d06b163..1291f12b 100644 --- a/test/unit/commander.ts +++ b/test/unit/commander.ts @@ -2,7 +2,7 @@ import * as sinon from "sinon"; import { expect } from "chai"; import Commander from "../../lib/commander"; -describe("Commander", function() { +describe("Commander", function () { describe("#getBuiltinCommands()", () => { it("returns a new copy of commands", () => { const c = new Commander(); @@ -13,14 +13,14 @@ describe("Commander", function() { }); }); - it("should pass the correct arguments", function() { - sinon.stub(Commander.prototype, "sendCommand").callsFake(command => { + it("should pass the correct arguments", function () { + sinon.stub(Commander.prototype, "sendCommand").callsFake((command) => { return command; }); - var command; + let command; - var c = new Commander(); + const c = new Commander(); command = c.call("set", "foo", "bar"); expect(command.name).to.eql("set"); expect(command.args[0]).to.eql("foo"); @@ -31,11 +31,11 @@ describe("Commander", function() { expect(command.args[0]).to.eql("foo"); expect(command.args[1]).to.eql("bar"); - command = c.call("set", "foo", "bar", function() {}); + command = c.call("set", "foo", "bar", function () {}); expect(command.name).to.eql("set"); expect(command.args.length).to.eql(2); - command = c.callBuffer("set", "foo", "bar", function() {}); + command = c.callBuffer("set", "foo", "bar", function () {}); expect(command.name).to.eql("set"); expect(command.args.length).to.eql(2); diff --git a/test/unit/connectors/connector.ts b/test/unit/connectors/connector.ts index 37417818..45a19731 100644 --- a/test/unit/connectors/connector.ts +++ b/test/unit/connectors/connector.ts @@ -32,7 +32,7 @@ describe("StandaloneConnector", () => { const spy = sinon.stub(tls, "connect"); const connector = new StandaloneConnector({ port: 6379, - tls: { ca: "on" } + tls: { ca: "on" }, }); await connector.connect(() => {}); expect(spy.calledOnce).to.eql(true); diff --git a/test/unit/debug.ts b/test/unit/debug.ts index bfd4ef8c..309955a9 100644 --- a/test/unit/debug.ts +++ b/test/unit/debug.ts @@ -3,16 +3,16 @@ import * as sinon from "sinon"; import { expect } from "chai"; import debug, { getStringValue, - MAX_ARGUMENT_LENGTH + MAX_ARGUMENT_LENGTH, } from "../../lib/utils/debug"; -describe("utils/debug", function() { - afterEach(function() { +describe("utils/debug", function () { + afterEach(function () { rDebug.enable(process.env.DEBUG || ""); }); - describe(".exports.getStringValue", function() { - it("should return a string or undefined", function() { + describe(".exports.getStringValue", function () { + it("should return a string or undefined", function () { expect(getStringValue(true)).to.be.undefined; expect(getStringValue(undefined)).to.be.undefined; expect(getStringValue(null)).to.be.undefined; @@ -31,18 +31,18 @@ describe("utils/debug", function() { }); }); - describe(".exports", function() { - it("should return a function", function() { + describe(".exports", function () { + it("should return a function", function () { expect(debug("test")).to.be.a("function"); }); - it("should output to console if DEBUG is set", function() { - var dbgNS = "ioredis:debugtest"; + it("should output to console if DEBUG is set", function () { + const dbgNS = "ioredis:debugtest"; rDebug.enable(dbgNS); - var logspy = sinon.spy(); - var fn = debug("debugtest"); + const logspy = sinon.spy(); + const fn = debug("debugtest"); // @ts-ignore fn.log = logspy; @@ -52,7 +52,7 @@ describe("utils/debug", function() { // @ts-ignore expect(fn.namespace).to.equal(dbgNS); - var data = [], + let data = [], i = 0; while (i < 1000) { @@ -60,14 +60,14 @@ describe("utils/debug", function() { i += 1; } - var datastr = JSON.stringify(data); + const datastr = JSON.stringify(data); fn("my message %s", { json: data }); expect(logspy.called).to.equal(true); - var args = logspy.getCall(0).args; + const args = logspy.getCall(0).args; - var wantedArglen = + const wantedArglen = 30 + // " ... " MAX_ARGUMENT_LENGTH + // max-length of redacted string datastr.length.toString().length; // length of string of string length (inception much?) diff --git a/test/unit/index.ts b/test/unit/index.ts index c736e77e..bf056f20 100644 --- a/test/unit/index.ts +++ b/test/unit/index.ts @@ -2,9 +2,9 @@ import * as sinon from "sinon"; import { expect } from "chai"; import { print } from "../../lib"; -describe("index", function() { - describe("print()", function() { - it("prints logs", function() { +describe("index", function () { + describe("print()", function () { + it("prints logs", function () { const stub = sinon.stub(console, "log"); print(new Error("err")); print(null, "success"); diff --git a/test/unit/pipeline.ts b/test/unit/pipeline.ts index b3e2a63b..1a303463 100644 --- a/test/unit/pipeline.ts +++ b/test/unit/pipeline.ts @@ -4,10 +4,10 @@ import Pipeline from "../../lib/pipeline"; import Commander from "../../lib/commander"; import Redis from "../../lib/redis"; -describe("Pipeline", function() { +describe("Pipeline", function () { beforeEach(() => { sinon.stub(Redis.prototype, "connect").resolves(); - sinon.stub(Commander.prototype, "sendCommand").callsFake(command => { + sinon.stub(Commander.prototype, "sendCommand").callsFake((command) => { return command; }); }); @@ -16,7 +16,7 @@ describe("Pipeline", function() { sinon.restore(); }); - it("should properly mark commands as transactions", function() { + it("should properly mark commands as transactions", function () { const redis = new Redis(); const p = new Pipeline(redis); let i = 0; @@ -44,7 +44,7 @@ describe("Pipeline", function() { validate("get", false); }); - it("should properly set pipelineIndex on commands", function() { + it("should properly set pipelineIndex on commands", function () { const redis = new Redis(); const p = new Pipeline(redis); let i = 0; diff --git a/test/unit/redis.ts b/test/unit/redis.ts index 116584de..226ce236 100644 --- a/test/unit/redis.ts +++ b/test/unit/redis.ts @@ -2,14 +2,14 @@ import * as sinon from "sinon"; import { expect } from "chai"; import Redis from "../../lib/redis"; -describe("Redis", function() { - describe("constructor", function() { - it("should parse options correctly", function() { +describe("Redis", function () { + describe("constructor", function () { + it("should parse options correctly", function () { const stub = sinon .stub(Redis.prototype, "connect") .returns(Promise.resolve()); - var option; + let option; try { option = getOption(); expect(option).to.have.property("port", 6379); @@ -29,7 +29,7 @@ describe("Redis", function() { option = getOption(6381, "192.168.1.1", { password: "123", - db: 2 + db: 2, }); expect(option).to.have.property("port", 6381); expect(option).to.have.property("host", "192.168.1.1"); @@ -58,34 +58,34 @@ describe("Redis", function() { option = getOption({ port: 6380, - host: "192.168.1.1" + host: "192.168.1.1", }); expect(option).to.have.property("port", 6380); expect(option).to.have.property("host", "192.168.1.1"); option = getOption({ - path: "/tmp/redis.sock" + path: "/tmp/redis.sock", }); expect(option).to.have.property("path", "/tmp/redis.sock"); option = getOption({ - port: "6380" + port: "6380", }); expect(option).to.have.property("port", 6380); option = getOption({ - showFriendlyErrorStack: true + showFriendlyErrorStack: true, }); expect(option).to.have.property("showFriendlyErrorStack", true); option = getOption(6380, { - host: "192.168.1.1" + host: "192.168.1.1", }); expect(option).to.have.property("port", 6380); expect(option).to.have.property("host", "192.168.1.1"); option = getOption("6380", { - host: "192.168.1.1" + host: "192.168.1.1", }); expect(option).to.have.property("port", 6380); @@ -93,7 +93,7 @@ describe("Redis", function() { expect(option).to.have.property("tls", true); option = getOption("rediss://example.test", { - tls: { hostname: "example.test" } + tls: { hostname: "example.test" }, }); expect(option.tls).to.deep.equal({ hostname: "example.test" }); } catch (err) { @@ -104,30 +104,30 @@ describe("Redis", function() { function getOption(...args) { // @ts-ignore - var redis = new Redis(...args); + const redis = new Redis(...args); return redis.options; } }); - it("should throw when arguments is invalid", function() { - expect(function() { + it("should throw when arguments is invalid", function () { + expect(function () { // @ts-ignore - new Redis(function() {}); + new Redis(function () {}); }).to.throw(Error); }); }); - describe(".createClient", function() { - it("should redirect to constructor", function() { - var redis = Redis.createClient({ name: "pass", lazyConnect: true }); + describe(".createClient", function () { + it("should redirect to constructor", function () { + const redis = Redis.createClient({ name: "pass", lazyConnect: true }); expect(redis.options).to.have.property("name", "pass"); expect(redis.options).to.have.property("lazyConnect", true); }); }); - describe("#end", function() { - it("should redirect to #disconnect", function(done) { - var redis = new Redis({ lazyConnect: true }); + describe("#end", function () { + it("should redirect to #disconnect", function (done) { + const redis = new Redis({ lazyConnect: true }); const stub = sinon.stub(redis, "disconnect").callsFake(() => { stub.restore(); done(); @@ -136,15 +136,15 @@ describe("Redis", function() { }); }); - describe("#flushQueue", function() { - it("should flush all queues by default", function() { - var flushQueue = Redis.prototype.flushQueue; - var redis = { - offlineQueue: [{ command: { reject: function() {} } }], - commandQueue: [{ command: { reject: function() {} } }] + describe("#flushQueue", function () { + it("should flush all queues by default", function () { + const flushQueue = Redis.prototype.flushQueue; + const redis = { + offlineQueue: [{ command: { reject: function () {} } }], + commandQueue: [{ command: { reject: function () {} } }], }; - var offline = sinon.mock(redis.offlineQueue[0].command); - var command = sinon.mock(redis.commandQueue[0].command); + const offline = sinon.mock(redis.offlineQueue[0].command); + const command = sinon.mock(redis.commandQueue[0].command); offline.expects("reject").once(); command.expects("reject").once(); flushQueue.call(redis); @@ -152,14 +152,14 @@ describe("Redis", function() { command.verify(); }); - it("should be able to ignore a queue", function() { - var flushQueue = Redis.prototype.flushQueue; - var redis = { - offlineQueue: [{ command: { reject: function() {} } }], - commandQueue: [{ command: { reject: function() {} } }] + it("should be able to ignore a queue", function () { + const flushQueue = Redis.prototype.flushQueue; + const redis = { + offlineQueue: [{ command: { reject: function () {} } }], + commandQueue: [{ command: { reject: function () {} } }], }; - var offline = sinon.mock(redis.offlineQueue[0].command); - var command = sinon.mock(redis.commandQueue[0].command); + const offline = sinon.mock(redis.offlineQueue[0].command); + const command = sinon.mock(redis.commandQueue[0].command); offline.expects("reject").once(); command.expects("reject").never(); flushQueue.call(redis, new Error(), { commandQueue: false }); diff --git a/test/unit/utils.ts b/test/unit/utils.ts index 52d2aae8..c8acbad0 100644 --- a/test/unit/utils.ts +++ b/test/unit/utils.ts @@ -2,9 +2,9 @@ import * as sinon from "sinon"; import { expect } from "chai"; import * as utils from "../../lib/utils"; -describe("utils", function() { - describe(".bufferEqual", function() { - it("should return correctly", function() { +describe("utils", function () { + describe(".bufferEqual", function () { + it("should return correctly", function () { expect(utils.bufferEqual(Buffer.from("123"), Buffer.from("abc"))).to.eql( false ); @@ -17,8 +17,8 @@ describe("utils", function() { expect(utils.bufferEqual(Buffer.from(""), Buffer.from(""))).to.eql(true); }); - it("should work when Buffer#equals not exists", function() { - var equals = Buffer.prototype.equals; + it("should work when Buffer#equals not exists", function () { + const equals = Buffer.prototype.equals; delete Buffer.prototype.equals; expect(utils.bufferEqual(Buffer.from("123"), Buffer.from("abc"))).to.eql( false @@ -34,8 +34,8 @@ describe("utils", function() { }); }); - describe(".convertBufferToString", function() { - it("should return correctly", function() { + describe(".convertBufferToString", function () { + it("should return correctly", function () { expect(utils.convertBufferToString(Buffer.from("123"))).to.eql("123"); expect( utils.convertBufferToString([Buffer.from("abc"), Buffer.from("abc")]) @@ -43,7 +43,7 @@ describe("utils", function() { expect( utils.convertBufferToString([ Buffer.from("abc"), - [[Buffer.from("abc")]] + [[Buffer.from("abc")]], ]) ).to.eql(["abc", [["abc"]]]); expect( @@ -51,28 +51,31 @@ describe("utils", function() { Buffer.from("abc"), 5, "b", - [[Buffer.from("abc"), 4]] + [[Buffer.from("abc"), 4]], ]) ).to.eql(["abc", 5, "b", [["abc", 4]]]); }); }); - describe(".wrapMultiResult", function() { - it("should return correctly", function() { + describe(".wrapMultiResult", function () { + it("should return correctly", function () { expect(utils.wrapMultiResult(null)).to.eql(null); - expect(utils.wrapMultiResult([1, 2])).to.eql([[null, 1], [null, 2]]); + expect(utils.wrapMultiResult([1, 2])).to.eql([ + [null, 1], + [null, 2], + ]); - var error = new Error("2"); + const error = new Error("2"); expect(utils.wrapMultiResult([1, 2, error])).to.eql([ [null, 1], [null, 2], - [error] + [error], ]); }); }); - describe(".isInt", function() { - it("should return correctly", function() { + describe(".isInt", function () { + it("should return correctly", function () { expect(utils.isInt(2)).to.eql(true); expect(utils.isInt("2231")).to.eql(true); expect(utils.isInt("s")).to.eql(false); @@ -81,31 +84,31 @@ describe("utils", function() { }); }); - describe(".packObject", function() { - it("should return correctly", function() { + describe(".packObject", function () { + it("should return correctly", function () { expect(utils.packObject([1, 2])).to.eql({ 1: 2 }); expect(utils.packObject([1, "2"])).to.eql({ 1: "2" }); expect(utils.packObject([1, "2", "abc", "def"])).to.eql({ 1: "2", - abc: "def" + abc: "def", }); }); }); - describe(".timeout", function() { - it("should return a callback", function(done) { - var invoked = false; - var wrappedCallback1 = utils.timeout(function() { + describe(".timeout", function () { + it("should return a callback", function (done) { + let invoked = false; + const wrappedCallback1 = utils.timeout(function () { invoked = true; }, 0); wrappedCallback1(); - var invokedTimes = 0; - var wrappedCallback2 = utils.timeout(function(err) { + let invokedTimes = 0; + var wrappedCallback2 = utils.timeout(function (err) { expect(err.message).to.match(/timeout/); invokedTimes += 1; wrappedCallback2(); - setTimeout(function() { + setTimeout(function () { expect(invoked).to.eql(true); expect(invokedTimes).to.eql(1); done(); @@ -114,9 +117,9 @@ describe("utils", function() { }); }); - describe(".convertObjectToArray", function() { - it("should return correctly", function() { - var nullObject = Object.create(null); + describe(".convertObjectToArray", function () { + it("should return correctly", function () { + const nullObject = Object.create(null); nullObject.abc = "def"; expect(utils.convertObjectToArray(nullObject)).to.eql(["abc", "def"]); expect(utils.convertObjectToArray({ 1: 2 })).to.eql(["1", 2]); @@ -125,27 +128,30 @@ describe("utils", function() { "1", "2", "abc", - "def" + "def", ]); }); }); - describe(".convertMapToArray", function() { - it("should return correctly", function() { + describe(".convertMapToArray", function () { + it("should return correctly", function () { if (typeof Map !== "undefined") { expect(utils.convertMapToArray(new Map([["1", 2]]))).to.eql(["1", 2]); expect(utils.convertMapToArray(new Map([[1, 2]]))).to.eql([1, 2]); expect( utils.convertMapToArray( - new Map([[1, "2"], ["abc", "def"]]) + new Map([ + [1, "2"], + ["abc", "def"], + ]) ) ).to.eql([1, "2", "abc", "def"]); } }); }); - describe(".toArg", function() { - it("should return correctly", function() { + describe(".toArg", function () { + it("should return correctly", function () { expect(utils.toArg(null)).to.eql(""); expect(utils.toArg(undefined)).to.eql(""); expect(utils.toArg("abc")).to.eql("abc"); @@ -153,10 +159,10 @@ describe("utils", function() { }); }); - describe(".optimizeErrorStack", function() { - it("should return correctly", function() { - var error = new Error(); - var res = utils.optimizeErrorStack( + describe(".optimizeErrorStack", function () { + it("should return correctly", function () { + const error = new Error(); + const res = utils.optimizeErrorStack( error, new Error().stack + "\n@", __dirname @@ -165,20 +171,20 @@ describe("utils", function() { }); }); - describe(".parseURL", function() { - it("should return correctly", function() { + describe(".parseURL", function () { + it("should return correctly", function () { expect(utils.parseURL("/tmp.sock")).to.eql({ path: "/tmp.sock" }); expect(utils.parseURL("127.0.0.1")).to.eql({ host: "127.0.0.1" }); expect(utils.parseURL("6379")).to.eql({ port: "6379" }); expect(utils.parseURL("127.0.0.1:6379")).to.eql({ host: "127.0.0.1", - port: "6379" + port: "6379", }); expect(utils.parseURL("127.0.0.1:6379?db=2&key=value")).to.eql({ host: "127.0.0.1", port: "6379", db: "2", - key: "value" + key: "value", }); expect( utils.parseURL("redis://user:pass@127.0.0.1:6380/4?key=value") @@ -187,10 +193,10 @@ describe("utils", function() { port: "6380", db: "4", password: "pass", - key: "value" + key: "value", }); expect(utils.parseURL("redis://127.0.0.1/")).to.eql({ - host: "127.0.0.1" + host: "127.0.0.1", }); expect( utils.parseURL("rediss://user:pass@127.0.0.1:6380/4?key=value") @@ -199,13 +205,13 @@ describe("utils", function() { port: "6380", db: "4", password: "pass", - key: "value" + key: "value", }); }); }); - describe(".sample", function() { - it("should return a random value", function() { + describe(".sample", function () { + it("should return a random value", function () { let stub = sinon.stub(Math, "random").callsFake(() => 0); expect(utils.sample([1, 2, 3])).to.eql(1); expect(utils.sample([1, 2, 3], 1)).to.eql(2); @@ -220,7 +226,7 @@ describe("utils", function() { }); }); - describe(".shuffle", function() { + describe(".shuffle", function () { function compareArray(arr1, arr2) { if (arr1.length !== arr2.length) { return false;