From 68d3556aab8c76fa9a54ec5f44644c134154654e Mon Sep 17 00:00:00 2001 From: Arnold Trakhtenberg Date: Wed, 11 Jul 2018 10:55:23 -0700 Subject: [PATCH 01/70] Make things prettier, add RedisFeatureStore to toplevel ts declarations, fix LDFeatureStore.close return value --- index.d.ts | 58 ++++++++++++++++++++++++++++++++++------------- package-lock.json | 23 +++++++++++++++++-- package.json | 1 + 3 files changed, 64 insertions(+), 18 deletions(-) diff --git a/index.d.ts b/index.d.ts index e37f8e4..ae0704a 100644 --- a/index.d.ts +++ b/index.d.ts @@ -6,13 +6,17 @@ * Documentation: http://docs.launchdarkly.com/docs/node-sdk-reference */ -declare module "ldclient-node" { +declare module 'ldclient-node' { import { EventEmitter } from 'events'; - + import { ClientOpts } from 'redis'; + namespace errors { export const LDPollingError: ErrorConstructor; export const LDStreamingError: ErrorConstructor; export const LDClientError: ErrorConstructor; + export const LDUnexpectedResponseError: ErrorConstructor; + export const LDInvalidSDKKeyError: ErrorConstructor; + export function isHttpErrorRecoverable(status: number): boolean; } /** @@ -20,6 +24,16 @@ declare module "ldclient-node" { */ export function init(key: string, options?: LDOptions): LDClient; + /** + * Create a feature flag store backed by a Redis instance + */ + export function RedisFeatureStore( + redisOpts: ClientOpts, + cacheTTL: number, + prefix: string, + logger: LDLogger | object + ): LDFeatureStore; + /** * The types of values a feature flag can have. * @@ -31,7 +45,7 @@ declare module "ldclient-node" { * A map of feature flags from their keys to their values. */ export type LDFlagSet = { - [key: string]: LDFlagValue, + [key: string]: LDFlagValue; }; /** @@ -79,7 +93,6 @@ declare module "ldclient-node" { */ logger?: LDLogger | object; - /** * Feature store used by the LaunchDarkly client, defaults to in memory storage. * @@ -131,7 +144,7 @@ declare module "ldclient-node" { /** * Whether to send events back to LaunchDarkly - */ + */ sendEvents?: boolean; /** @@ -165,7 +178,6 @@ declare module "ldclient-node" { * Defaults to 300. */ userKeysFlushInterval?: number; - } /** @@ -230,7 +242,11 @@ declare module "ldclient-node" { * Any additional attributes associated with the user. */ custom?: { - [key: string]: string | boolean | number | Array, + [key: string]: + | string + | boolean + | number + | Array; }; } @@ -358,10 +374,8 @@ declare module "ldclient-node" { /** * Close the feature store. * - * @returns - * The store instance. */ - close: () => LDFeatureStore; + close: () => void; } /** @@ -412,12 +426,22 @@ declare module "ldclient-node" { * * @param callback * The callback to receive the variation result. - * + * * @returns a Promise containing the flag value */ - variation: (key: string, user: LDUser, defaultValue: LDFlagValue, callback?: (err: any, res: LDFlagValue) => void) => Promise; + variation: ( + key: string, + user: LDUser, + defaultValue: LDFlagValue, + callback?: (err: any, res: LDFlagValue) => void + ) => Promise; - toggle: (key: string, user: LDUser, defaultValue: LDFlagValue, callback?: (err: any, res: LDFlagValue) => void) => Promise; + toggle: ( + key: string, + user: LDUser, + defaultValue: LDFlagValue, + callback?: (err: any, res: LDFlagValue) => void + ) => Promise; /** * Retrieves the set of all flag values for a user. @@ -429,7 +453,10 @@ declare module "ldclient-node" { * The node style callback to receive the variation result. * @returns a Promise containing the set of all flag values for a user */ - allFlags: (user: LDUser, callback?: (err: any, res: LDFlagSet) => void) => Promise; + allFlags: ( + user: LDUser, + callback?: (err: any, res: LDFlagSet) => void + ) => Promise; /** * @@ -449,7 +476,6 @@ declare module "ldclient-node" { */ close: () => void; - /** * * @returns Whether the client is configured in offline mode. @@ -491,7 +517,7 @@ declare module "ldclient-node" { * Internally, the LaunchDarkly SDK keeps an event queue for track and identify calls. * These are flushed periodically (see configuration option: flushInterval) * and when the queue size limit (see configuration option: capacity) is reached. - * + * * @returns a Promise which resolves once flushing is finished */ flush: (callback?: (err: any, res: boolean) => void) => Promise; diff --git a/package-lock.json b/package-lock.json index d29d597..3d9a264 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ldclient-node", - "version": "5.0.1", + "version": "5.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -24,6 +24,25 @@ "js-tokens": "3.0.2" } }, + "@types/events": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@types/events/-/events-1.2.0.tgz", + "integrity": "sha512-KEIlhXnIutzKwRbQkGWb/I4HFqBuUykAdHgDED6xqwXJfONCjF5VoE0cXEiurh3XauygxzeDzgtXUqvLkxFzzA==" + }, + "@types/node": { + "version": "10.5.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.5.2.tgz", + "integrity": "sha512-m9zXmifkZsMHZBOyxZWilMwmTlpC8x5Ty360JKTiXvlXZfBWYpsg9ZZvP/Ye+iZUh+Q+MxDLjItVTWIsfwz+8Q==" + }, + "@types/redis": { + "version": "2.8.6", + "resolved": "https://registry.npmjs.org/@types/redis/-/redis-2.8.6.tgz", + "integrity": "sha512-kaSI4XQwCfJtPiuyCXvLxCaw2N0fMZesdob3Jh01W20vNFct+3lfvJ/4yCJxbSopXOBOzpg+pGxkW6uWZrPZHA==", + "requires": { + "@types/events": "1.2.0", + "@types/node": "10.5.2" + } + }, "abab": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/abab/-/abab-1.0.4.tgz", @@ -5708,7 +5727,7 @@ }, "tunnel": { "version": "https://github.com/launchdarkly/node-tunnel/tarball/d860e57650cce1ea655d00854c81babe6b47e02c", - "integrity": "sha512-prl+yIntUTIhkHoz2YtT7xtcAoMEgfsm+RL2bUGFI6e229NTICfo+jFKj1UFCDqc1wm/SQK7TM2U06sgeoO9jQ==" + "integrity": "sha1-DxkgfzcgRtPUaCGDy+INSgR8zdk=" }, "tunnel-agent": { "version": "0.6.0", diff --git a/package.json b/package.json index 279ccaa..0a582c4 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ }, "homepage": "https://github.com/launchdarkly/node-client", "dependencies": { + "@types/redis": "2.8.6", "async": "2.6.0", "crypto": "0.0.3", "hoek": "4.2.1", From c5c665fc98d1ecb86acc6dde5797c518367c75b6 Mon Sep 17 00:00:00 2001 From: Arnold Trakhtenberg Date: Wed, 11 Jul 2018 10:58:36 -0700 Subject: [PATCH 02/70] Add modules for ldclient StreamProcessor, Requestor, and FeatureStore --- index.d.ts | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/index.d.ts b/index.d.ts index ae0704a..f3e456c 100644 --- a/index.d.ts +++ b/index.d.ts @@ -378,6 +378,32 @@ declare module 'ldclient-node' { close: () => void; } + /** + * The LaunchDarkly client stream processor + * + * The client uses this internally to retrieve updates from LaunchDarkly. + */ + export interface LDStreamProcessor { + start: (fn?: (err?: any) => void) => void; + stop: () => void; + close: () => void; + } + + /** + * The LaunchDarkly client feature flag requetor + * + * The client uses this internally to retrieve feature + * flags from LaunchDarkly. + */ + export interface LDFeatureRequestor { + requestObject: ( + kind: any, + key: string, + cb: (err: any, body: any) => void + ) => void; + requestAllData: (cb: (err: any, body: any) => void) => void; + } + /** * The LaunchDarkly client's instance interface. * @@ -523,3 +549,31 @@ declare module 'ldclient-node' { flush: (callback?: (err: any, res: boolean) => void) => Promise; } } + +declare module 'ldclient-node/streaming' { + import { + LDOptions, + LDFeatureRequestor, + LDStreamProcessor + } from 'ldclient-node'; + + function StreamProcessor( + sdkKey: string, + options: LDOptions, + requestor: LDFeatureRequestor + ): LDStreamProcessor; + export = StreamProcessor; +} +declare module 'ldclient-node/requestor' { + import { LDOptions, LDFeatureRequestor } from 'ldclient-node'; + + function Requestor(sdkKey: string, options: LDOptions): LDFeatureRequestor; + export = Requestor; +} + +declare module 'ldclient-node/feature_store' { + import { LDFeatureStore } from 'ldclient-node'; + + function InMemoryFeatureStore(): LDFeatureStore; + export = InMemoryFeatureStore; +} From 407e6ce8ba5604bc0dc0678a1d5ffe61d90a6115 Mon Sep 17 00:00:00 2001 From: Arnold Trakhtenberg Date: Wed, 11 Jul 2018 13:57:22 -0700 Subject: [PATCH 03/70] address review --- index.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index f3e456c..2805344 100644 --- a/index.d.ts +++ b/index.d.ts @@ -16,7 +16,6 @@ declare module 'ldclient-node' { export const LDClientError: ErrorConstructor; export const LDUnexpectedResponseError: ErrorConstructor; export const LDInvalidSDKKeyError: ErrorConstructor; - export function isHttpErrorRecoverable(status: number): boolean; } /** @@ -390,7 +389,7 @@ declare module 'ldclient-node' { } /** - * The LaunchDarkly client feature flag requetor + * The LaunchDarkly client feature flag requestor * * The client uses this internally to retrieve feature * flags from LaunchDarkly. From 762b1c8deb3423d22957fbccc09eece9f412588e Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Thu, 19 Jul 2018 16:03:35 +0000 Subject: [PATCH 04/70] fix: package.json to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/npm:cryptiles:20180710 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0a582c4..278c2ef 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "node-cache": "^3.2.1", "node-sha1": "0.0.1", "redis": "^2.6.0-2", - "request": "2.85.0", + "request": "2.87.0", "request-etag": "^2.0.3", "semver": "5.5.0", "tunnel": "https://github.com/launchdarkly/node-tunnel/tarball/d860e57650cce1ea655d00854c81babe6b47e02c", From c45414efca8bcce4f4982bc2193769b28589aa09 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Thu, 26 Jul 2018 14:10:35 -0700 Subject: [PATCH 05/70] remove npm dependency on "crypto", use built-in version instead --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 6be5295..c3d97e9 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,6 @@ "dependencies": { "@types/redis": "2.8.6", "async": "2.6.0", - "crypto": "0.0.3", "hoek": "4.2.1", "lrucache": "^1.0.3", "node-cache": "^3.2.1", From b4fe5f49f5a88fa796d2d489042f21ebbf85b3bc Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Thu, 26 Jul 2018 14:15:31 -0700 Subject: [PATCH 06/70] update package-lock --- package-lock.json | 111 ++++++++++++++++------------------------------ 1 file changed, 37 insertions(+), 74 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3d9a264..d79cab9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ldclient-node", - "version": "5.1.0", + "version": "5.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -72,14 +72,14 @@ } }, "ajv": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.2.3.tgz", - "integrity": "sha1-wG9Zh3jETGsWGrr+NGa4GtGBTtI=", + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", "requires": { "co": "4.6.0", - "fast-deep-equal": "1.0.0", - "json-schema-traverse": "0.3.1", - "json-stable-stringify": "1.0.1" + "fast-deep-equal": "1.1.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" } }, "align-text": { @@ -817,14 +817,6 @@ "inherits": "2.0.3" } }, - "boom": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", - "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", - "requires": { - "hoek": "4.2.1" - } - }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -1191,29 +1183,6 @@ "which": "1.3.0" } }, - "cryptiles": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", - "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", - "requires": { - "boom": "5.2.0" - }, - "dependencies": { - "boom": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", - "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", - "requires": { - "hoek": "4.2.1" - } - } - } - }, - "crypto": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/crypto/-/crypto-0.0.3.tgz", - "integrity": "sha1-RwqBuGvkxe4XrMggeh9TFa4g27A=" - }, "cssom": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.2.tgz", @@ -1584,9 +1553,14 @@ "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=" }, "fast-deep-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz", - "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" }, "fast-levenshtein": { "version": "2.0.6", @@ -1668,13 +1642,23 @@ "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" }, "form-data": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.1.tgz", - "integrity": "sha1-b7lPvXGIUwbXPRXMSX/kzE7NRL8=", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", + "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", "requires": { "asynckit": "0.4.0", - "combined-stream": "1.0.5", + "combined-stream": "1.0.6", "mime-types": "2.1.17" + }, + "dependencies": { + "combined-stream": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "requires": { + "delayed-stream": "1.0.0" + } + } } }, "fragment-cache": { @@ -2098,7 +2082,7 @@ "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", "requires": { - "ajv": "5.2.3", + "ajv": "5.5.2", "har-schema": "2.0.0" } }, @@ -2193,17 +2177,6 @@ } } }, - "hawk": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", - "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", - "requires": { - "boom": "4.3.1", - "cryptiles": "3.1.2", - "hoek": "4.2.1", - "sntp": "2.0.2" - } - }, "hoek": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", @@ -3113,7 +3086,7 @@ "nwmatcher": "1.4.4", "parse5": "4.0.0", "pn": "1.1.0", - "request": "2.85.0", + "request": "2.87.0", "request-promise-native": "1.0.5", "sax": "1.2.4", "symbol-tree": "3.2.2", @@ -4420,9 +4393,9 @@ } }, "request": { - "version": "2.85.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.85.0.tgz", - "integrity": "sha512-8H7Ehijd4js+s6wuVPLjwORxD4zeuyjYugprdOXlPSqaApmL/QOy+EB/beICHVCHkGMKNh5rvihb5ov+IDw4mg==", + "version": "2.87.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.87.0.tgz", + "integrity": "sha512-fcogkm7Az5bsS6Sl0sibkbhcKsnyon/jV1kF3ajGmF0c8HrttdKTPRT9hieOaQHA5HEq6r8OyWOo/o781C1tNw==", "requires": { "aws-sign2": "0.7.0", "aws4": "1.6.0", @@ -4430,9 +4403,8 @@ "combined-stream": "1.0.5", "extend": "3.0.1", "forever-agent": "0.6.1", - "form-data": "2.3.1", + "form-data": "2.3.2", "har-validator": "5.0.3", - "hawk": "6.0.2", "http-signature": "1.2.0", "is-typedarray": "1.0.0", "isstream": "0.1.2", @@ -4442,7 +4414,6 @@ "performance-now": "2.1.0", "qs": "6.5.1", "safe-buffer": "5.1.1", - "stringstream": "0.0.5", "tough-cookie": "2.3.3", "tunnel-agent": "0.6.0", "uuid": "3.1.0" @@ -4456,7 +4427,7 @@ "lodash.assign": "4.2.0", "lodash.clonedeep": "4.5.0", "lru-cache": "4.1.2", - "request": "2.85.0" + "request": "2.87.0" } }, "request-promise-core": { @@ -5040,14 +5011,6 @@ "kind-of": "3.2.2" } }, - "sntp": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.0.2.tgz", - "integrity": "sha1-UGQRDwr4X3z9t9a2ekACjOUrSys=", - "requires": { - "hoek": "4.2.1" - } - }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -5727,7 +5690,7 @@ }, "tunnel": { "version": "https://github.com/launchdarkly/node-tunnel/tarball/d860e57650cce1ea655d00854c81babe6b47e02c", - "integrity": "sha1-DxkgfzcgRtPUaCGDy+INSgR8zdk=" + "integrity": "sha512-prl+yIntUTIhkHoz2YtT7xtcAoMEgfsm+RL2bUGFI6e229NTICfo+jFKj1UFCDqc1wm/SQK7TM2U06sgeoO9jQ==" }, "tunnel-agent": { "version": "0.6.0", From d4e15b1e7c748cdd0f79c62a7f76d4026c03c6ae Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Wed, 1 Aug 2018 12:54:58 -0700 Subject: [PATCH 07/70] treat HTTP 400 as a recoverable error --- errors.js | 2 +- test/event_processor-test.js | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/errors.js b/errors.js index 74b7495..7112be3 100644 --- a/errors.js +++ b/errors.js @@ -20,7 +20,7 @@ exports.LDClientError = createCustomError('LaunchDarklyClientError'); exports.isHttpErrorRecoverable = function(status) { if (status >= 400 && status < 500) { - return status === 408 || status === 429; + return status === 400 || status === 408 || status === 429; } return true; } diff --git a/test/event_processor-test.js b/test/event_processor-test.js index acdfebc..6ae8014 100644 --- a/test/event_processor-test.js +++ b/test/event_processor-test.js @@ -417,8 +417,8 @@ describe('EventProcessor', function() { function verifyRecoverableHttpError(done, status) { ep = EventProcessor(sdkKey, defaultConfig); - var e = { kind: 'identify', creationDate: 1000, user: user }; - ep.sendEvent(e); + var e0 = { kind: 'identify', creationDate: 1000, user: user }; + ep.sendEvent(e0); nock(eventsUri).post('/bulk').reply(status); nock(eventsUri).post('/bulk').reply(status); @@ -427,10 +427,24 @@ describe('EventProcessor', function() { function() {}, function(err) { expect(err.message).toContain('error ' + status); - done(); + + var e1 = { kind: 'identify', creationDate: 1001, user: user }; + ep.sendEvent(e1); + + // this second event should go through + flushAndGetRequest(function(output) { + expect(output.length).toEqual(1); + expect(output[0].creationDate).toEqual(1001); + + done(); + }); }); } + it('retries after a 400 error', function(done) { + verifyRecoverableHttpError(done, 400); + }); + it('stops sending events after a 401 error', function(done) { verifyUnrecoverableHttpError(done, 401); }); From ccbb753e179ef3c89aa2e973d19ab896fe288aab Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Wed, 1 Aug 2018 14:40:49 -0700 Subject: [PATCH 08/70] update doc comment for new waitForInitialization behavior --- index.d.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.d.ts b/index.d.ts index 2805344..d0906bb 100644 --- a/index.d.ts +++ b/index.d.ts @@ -429,11 +429,12 @@ declare module 'ldclient-node' { /** * Returns a Promise that will be resolved if the client successfully initializes, or * rejected if client initialization has irrevocably failed (for instance, if it detects - * that the SDK key is invalid). The sucess and failure cases can also be detected by listening + * that the SDK key is invalid). The success and failure cases can also be detected by listening * for the events "ready" and "failed". - * @returns a Promise containing the initialization state of the client + * @returns a Promise containing the initialization state of the client; if successful, the resolved + * value is the same client object */ - waitForInitialization: () => Promise; + waitForInitialization: () => Promise; /** * Retrieves a flag's value. From 018c6f218c4402848e305a129777d353ced25dbb Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Wed, 1 Aug 2018 15:24:07 -0700 Subject: [PATCH 09/70] fix waitForInitialization to always resolve with a value --- index.js | 2 +- test/LDClient-test.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 3a7589b..f2f9e8b 100644 --- a/index.js +++ b/index.js @@ -144,7 +144,7 @@ var newClient = function(sdkKey, config) { } return new Promise(function(resolve, reject) { - client.once('ready', resolve); + client.once('ready', function() { resolve(client) }); client.once('failed', reject); }); }; diff --git a/test/LDClient-test.js b/test/LDClient-test.js index 22dd209..8f87334 100644 --- a/test/LDClient-test.js +++ b/test/LDClient-test.js @@ -325,6 +325,7 @@ describe('LDClient', function() { client.waitForInitialization().then(callback) .then(() => { expect(callback).toHaveBeenCalled(); + expect(callback.mock.calls[0][0]).toBe(client); done(); }).catch(done.error) }); @@ -338,6 +339,7 @@ describe('LDClient', function() { client.waitForInitialization().then(callback) .then(() => { expect(callback).toHaveBeenCalled(); + expect(callback.mock.calls[0][0]).toBe(client); done(); }).catch(done.error) }).catch(done.error) From 95951819c8c46d58849d589113cceead12835d29 Mon Sep 17 00:00:00 2001 From: Arnold Trakhtenberg Date: Fri, 17 Aug 2018 13:44:30 -0700 Subject: [PATCH 10/70] Update feature store type for versioned data kind --- index.d.ts | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/index.d.ts b/index.d.ts index d0906bb..da67fcf 100644 --- a/index.d.ts +++ b/index.d.ts @@ -302,21 +302,27 @@ declare module 'ldclient-node' { /** * Get a flag's value. * + * @param kind + * The type of data to be accessed + * * @param key * The flag key * * @param callback * Will be called with the resulting flag. */ - get: (key: string, callback: (res: LDFlagValue) => void) => void; + get: (kind: object, key: string, callback: (res: LDFlagValue) => void) => void; /** * Get all flags. * + * @param kind + * The type of data to be accessed + * * @param callback * Will be called with the resulting flag set. */ - all: (callback: (res: LDFlagSet) => void) => void; + all: (kind: object, callback: (res: LDFlagSet) => void) => void; /** * Initialize the store. @@ -332,6 +338,9 @@ declare module 'ldclient-node' { /** * Delete a key from the store. * + * @param kind + * The type of data to be accessed + * * @param key * The flag key. * @@ -342,11 +351,14 @@ declare module 'ldclient-node' { * @param callback * Will be called when the delete operation is complete. */ - delete: (key: string, version: string, callback?: () => void) => void; + delete: (kind: object, key: string, version: string, callback?: () => void) => void; /** * Upsert a flag to the store. * + * @param kind + * The type of data to be accessed + * * @param key * The flag key. * @@ -356,7 +368,7 @@ declare module 'ldclient-node' { * @param callback * Will be called after the upsert operation is complete. */ - upsert: (key: string, flag: LDFlagValue, callback?: () => void) => void; + upsert: (kind: object, key: string, flag: LDFlagValue, callback?: () => void) => void; /** * Is the store initialized? From e51d5548f1f11af0bb22325a234b2e5c6cb7782d Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Mon, 20 Aug 2018 15:14:07 -0700 Subject: [PATCH 11/70] add new version of allFlags() that captures more metadata --- flags_state.js | 36 +++++++++++++++++++++++++ index.d.ts | 61 +++++++++++++++++++++++++++++++++++++++++-- index.js | 25 ++++++++++++------ test/LDClient-test.js | 47 +++++++++++++++++++++++++++++++++ 4 files changed, 159 insertions(+), 10 deletions(-) create mode 100644 flags_state.js diff --git a/flags_state.js b/flags_state.js new file mode 100644 index 0000000..d7bd8f2 --- /dev/null +++ b/flags_state.js @@ -0,0 +1,36 @@ + +function FlagsStateBuilder(valid) { + var builder = {}; + var flagValues = {}; + var flagMetadata = {}; + + builder.addFlag = function(flag, value, variation) { + flagValues[flag.key] = value; + var meta = { + version: flag.version, + trackEvents: flag.trackEvents + }; + if (variation !== undefined && variation !== null) { + meta.variation = variation; + } + if (flag.debugEventsUntilDate !== undefined && flag.debugEventsUntilDate !== null) { + meta.debugEventsUntilDate = flag.debugEventsUntilDate; + } + flagMetadata[flag.key] = meta; + }; + + builder.build = function() { + return { + valid: valid, + allValues: function() { return flagValues; }, + getFlagValue: function(key) { return flagValues[key]; }, + toJson: function() { + return Object.assign({}, flagValues, { $flagsState: flagMetadata }); + } + }; + } + + return builder; +} + +module.exports = FlagsStateBuilder; diff --git a/index.d.ts b/index.d.ts index da67fcf..a1bdc62 100644 --- a/index.d.ts +++ b/index.d.ts @@ -47,6 +47,45 @@ declare module 'ldclient-node' { [key: string]: LDFlagValue; }; + /** + * An object that contains the state of all feature flags, generated by the client's + * allFlagsState() method. + */ + export interface LDFlagsState = { + /** + * True if this object contains a valid snapshot of feature flag state, or false if the + * state could not be computed (for instance, because the client was offline or there + * was no user). + */ + valid: boolean; + + /** + * Returns the value of an individual feature flag at the time the state was recorded. + * It will be null if the flag returned the default value, or if there was no such flag. + * @param key the flag key + */ + getFlagValue: (key: string) => LDFlagValue; + + /** + * Returns a map of feature flag keys to values. If a flag would have evaluated to the + * default value, its value will be null. + * + * Do not use this method if you are passing data to the front end to "bootstrap" the + * JavaScript client. Instead, use toJson(). + */ + allValues: () => LDFlagSet; + + /** + * Returns a Javascript representation of the entire state map, in the format used by + * the Javascript SDK. Use this method if you are passing data to the front end in + * order to "bootstrap" the JavaScript client. + * + * Do nto rely on the exact shape of this data, as it may change in future to support + * the needs of the JavaScript client. + */ + toJson: () => object; + }; + /** * LaunchDarkly initialization options. */ @@ -484,8 +523,9 @@ declare module 'ldclient-node' { /** * Retrieves the set of all flag values for a user. * - * @param key - * The key of the flag for which to retrieve the corresponding value. + * This method is deprecated; user allFlagsState() instead. Current versions of the client-side + * SDK will not generate analytics events correctly if you pass the result of allFlags(). + * * @param user * @param callback * The node style callback to receive the variation result. @@ -496,6 +536,23 @@ declare module 'ldclient-node' { callback?: (err: any, res: LDFlagSet) => void ) => Promise; + /** + * Builds an object that encapsulates the state of all feature flags for a given user, + * including the flag values and also metadata that can be used on the front end. This + * method does not send analytics events back to LaunchDarkly. + * + * The most common use case for this method is to bootstrap a set of client-side + * feature flags from a back-end service. + * + * @param user The end user requesting the feature flags. + * @param callback The node-style callback to receive the state result. + * @returns a Promise containing the state object + */ + allFlagsState: ( + user: LDUser, + callback?: (err: any, res: LDFlagsState) => void + ) => Promise; + /** * * The secure_mode_hash method computes an HMAC signature of a user signed with the client's SDK key. diff --git a/index.js b/index.js index f2f9e8b..9403363 100644 --- a/index.js +++ b/index.js @@ -5,6 +5,7 @@ var EventEmitter = require('events').EventEmitter; var EventProcessor = require('./event_processor'); var PollingProcessor = require('./polling'); var StreamingProcessor = require('./streaming'); +var FlagsStateBuilder = require('./flags_state'); var configuration = require('./configuration'); var evaluate = require('./evaluate_flag'); var messages = require('./messages'); @@ -232,29 +233,37 @@ var newClient = function(sdkKey, config) { } client.allFlags = function(user, callback) { + return wrapPromiseCallback( + client.allFlagsState(user).then(function(state) { + return state.allValues(); + }), + callback); + } + + client.allFlagsState = function(user, callback) { return wrapPromiseCallback(new Promise(function(resolve, reject) { sanitizeUser(user); - var results = {}; - + if (this.isOffline()) { - config.logger.info("allFlags() called in offline mode. Returning empty map."); - return resolve({}); + config.logger.info("allFlagsState() called in offline mode. Returning empty state."); + return resolve(FlagsStateBuilder(false).build()); } if (!user) { - config.logger.info("allFlags() called without user. Returning empty map."); - return resolve({}); + config.logger.info("allFlagsState() called without user. Returning empty state."); + return resolve(FlagsStateBuilder(false).build()); } + var builder = FlagsStateBuilder(true); config.featureStore.all(dataKind.features, function(flags) { async.forEachOf(flags, function(flag, key, iterateeCb) { // At the moment, we don't send any events here evaluate.evaluate(flag, user, config.featureStore, function(err, variation, value, events) { - results[key] = value; + builder.addFlag(flag, value, variation); setImmediate(iterateeCb); }) }, function(err) { - return err ? reject(err) : resolve(results); + return err ? reject(err) : resolve(builder.build()); }); }); }.bind(this)), callback); diff --git a/test/LDClient-test.js b/test/LDClient-test.js index 8f87334..a4c16e8 100644 --- a/test/LDClient-test.js +++ b/test/LDClient-test.js @@ -83,6 +83,18 @@ describe('LDClient', function() { }); }); + it('returns empty state for allFlagsState in offline mode and logs a message', function(done) { + var client = LDClient.init('secret', {offline: true, logger: logger}); + client.on('ready', function() { + client.allFlagsState({key: 'user'}, function(err, state) { + expect(state.valid).toEqual(false); + expect(state.allValues()).toEqual({}); + expect(logger.info).toHaveBeenCalledTimes(1); + done(); + }); + }); + }); + it('allows deprecated method all_flags', function(done) { var client = LDClient.init('secret', {offline: true, logger: logger}); client.on('ready', function() { @@ -262,6 +274,41 @@ describe('LDClient', function() { }); }); + it('captures flag state with allFlagsState()', function(done) { + var flag = { + key: 'feature', + version: 100, + on: true, + targets: [], + fallthrough: { variation: 1 }, + variations: ['a', 'b'], + trackEvents: true, + debugEventsUntilDate: 1000 + }; + var client = createOnlineClientWithFlags({ feature: flag }); + var user = { key: 'user' }; + client.on('ready', function() { + client.allFlagsState(user, function(err, state) { + expect(err).toBeNull(); + expect(state.valid).toEqual(true); + expect(state.allValues()).toEqual({feature: 'b'}); + expect(state.getFlagValue('feature')).toEqual('b'); + expect(state.toJson()).toEqual({ + feature: 'b', + $flagsState: { + feature: { + version: 100, + variation: 1, + trackEvents: true, + debugEventsUntilDate: 1000 + } + } + }); + done(); + }); + }); + }); + it('should not overflow the call stack when evaluating a huge number of flags', function(done) { var flagCount = 5000; var flags = {}; From 38616c815367dd0cd62aa28862da1603a14844f6 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Mon, 20 Aug 2018 15:24:06 -0700 Subject: [PATCH 12/70] add deprecation warning for allFlags --- index.js | 1 + test/LDClient-test.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 9403363..07c1aa8 100644 --- a/index.js +++ b/index.js @@ -233,6 +233,7 @@ var newClient = function(sdkKey, config) { } client.allFlags = function(user, callback) { + config.logger.warn("allFlags() is deprecated. Call 'allFlagsState' instead and call toJson() on the result"); return wrapPromiseCallback( client.allFlagsState(user).then(function(state) { return state.allValues(); diff --git a/test/LDClient-test.js b/test/LDClient-test.js index a4c16e8..075b5a7 100644 --- a/test/LDClient-test.js +++ b/test/LDClient-test.js @@ -29,8 +29,10 @@ describe('LDClient', function() { }; beforeEach(function() { + logger.debug = jest.fn(); logger.info = jest.fn(); logger.warn = jest.fn(); + logger.error = jest.fn(); eventProcessor.events = []; updateProcessor.error = null; }); @@ -115,7 +117,8 @@ describe('LDClient', function() { return LDClient.init('secret', { featureStore: store, eventProcessor: eventProcessor, - updateProcessor: updateProcessor + updateProcessor: updateProcessor, + logger: logger }); } @@ -269,6 +272,7 @@ describe('LDClient', function() { client.allFlags(user, function(err, results) { expect(err).toBeNull(); expect(results).toEqual({feature: 'b'}); + expect(logger.warn).toHaveBeenCalledTimes(1); // deprecation warning done(); }); }); From 90e1c1cc02cc5b7fa60071b3d772e33c398565c2 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Mon, 20 Aug 2018 18:06:53 -0700 Subject: [PATCH 13/70] typo --- index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index a1bdc62..3e15617 100644 --- a/index.d.ts +++ b/index.d.ts @@ -80,7 +80,7 @@ declare module 'ldclient-node' { * the Javascript SDK. Use this method if you are passing data to the front end in * order to "bootstrap" the JavaScript client. * - * Do nto rely on the exact shape of this data, as it may change in future to support + * Do not rely on the exact shape of this data, as it may change in future to support * the needs of the JavaScript client. */ toJson: () => object; From 2b672fb7aed01c89a1c979fce6e59e43c0473bc9 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Mon, 20 Aug 2018 18:07:19 -0700 Subject: [PATCH 14/70] name function toJSON so JSON.stringify will use it --- flags_state.js | 2 +- index.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flags_state.js b/flags_state.js index d7bd8f2..e3e0ffc 100644 --- a/flags_state.js +++ b/flags_state.js @@ -24,7 +24,7 @@ function FlagsStateBuilder(valid) { valid: valid, allValues: function() { return flagValues; }, getFlagValue: function(key) { return flagValues[key]; }, - toJson: function() { + toJSON: function() { return Object.assign({}, flagValues, { $flagsState: flagMetadata }); } }; diff --git a/index.d.ts b/index.d.ts index 3e15617..42eda94 100644 --- a/index.d.ts +++ b/index.d.ts @@ -83,7 +83,7 @@ declare module 'ldclient-node' { * Do not rely on the exact shape of this data, as it may change in future to support * the needs of the JavaScript client. */ - toJson: () => object; + toJSON: () => object; }; /** From 1a35b79e31c14385744f11005e4ea0936cb5bc6b Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Mon, 20 Aug 2018 18:09:08 -0700 Subject: [PATCH 15/70] comment edits --- index.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index 42eda94..4872297 100644 --- a/index.d.ts +++ b/index.d.ts @@ -523,7 +523,7 @@ declare module 'ldclient-node' { /** * Retrieves the set of all flag values for a user. * - * This method is deprecated; user allFlagsState() instead. Current versions of the client-side + * This method is deprecated; use allFlagsState() instead. Current versions of the client-side * SDK will not generate analytics events correctly if you pass the result of allFlags(). * * @param user @@ -542,7 +542,8 @@ declare module 'ldclient-node' { * method does not send analytics events back to LaunchDarkly. * * The most common use case for this method is to bootstrap a set of client-side - * feature flags from a back-end service. + * feature flags from a back-end service. Call the toJSON() method of the returned object + * to convert it to the data structure used by the client-side SDK. * * @param user The end user requesting the feature flags. * @param callback The node-style callback to receive the state result. From 72e2e24bcca31fd483fb2243100b10f54282cf97 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Mon, 20 Aug 2018 18:10:04 -0700 Subject: [PATCH 16/70] fix test --- test/LDClient-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/LDClient-test.js b/test/LDClient-test.js index 075b5a7..762c1fa 100644 --- a/test/LDClient-test.js +++ b/test/LDClient-test.js @@ -297,7 +297,7 @@ describe('LDClient', function() { expect(state.valid).toEqual(true); expect(state.allValues()).toEqual({feature: 'b'}); expect(state.getFlagValue('feature')).toEqual('b'); - expect(state.toJson()).toEqual({ + expect(state.toJSON()).toEqual({ feature: 'b', $flagsState: { feature: { From ba0d334aa25e7b4fc0615fc1571979ac1fe54b41 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Mon, 20 Aug 2018 20:20:14 -0700 Subject: [PATCH 17/70] add $valid property in case we care about that on the front end --- flags_state.js | 2 +- test/LDClient-test.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/flags_state.js b/flags_state.js index e3e0ffc..10f15c6 100644 --- a/flags_state.js +++ b/flags_state.js @@ -25,7 +25,7 @@ function FlagsStateBuilder(valid) { allValues: function() { return flagValues; }, getFlagValue: function(key) { return flagValues[key]; }, toJSON: function() { - return Object.assign({}, flagValues, { $flagsState: flagMetadata }); + return Object.assign({}, flagValues, { $flagsState: flagMetadata, $valid: valid }); } }; } diff --git a/test/LDClient-test.js b/test/LDClient-test.js index 762c1fa..943ee64 100644 --- a/test/LDClient-test.js +++ b/test/LDClient-test.js @@ -306,7 +306,8 @@ describe('LDClient', function() { trackEvents: true, debugEventsUntilDate: 1000 } - } + }, + $valid: true }); done(); }); From a9a5c2f43273f7edd2a8ab57e36e71644c2f99dc Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Tue, 21 Aug 2018 13:50:08 -0700 Subject: [PATCH 18/70] add ability to filter for only client-side flags --- index.d.ts | 13 +++++++++++++ index.js | 16 +++++++++++----- test/LDClient-test.js | 23 +++++++++++++++++++++-- 3 files changed, 45 insertions(+), 7 deletions(-) diff --git a/index.d.ts b/index.d.ts index 4872297..1d05503 100644 --- a/index.d.ts +++ b/index.d.ts @@ -454,6 +454,16 @@ declare module 'ldclient-node' { requestAllData: (cb: (err: any, body: any) => void) => void; } + /** + * Optional settings that can be passed to LDClient.allFlagsState(). + */ + export type LDFlagsStateOptions = { + /** + * True if the state should include only flags that have been marked for use with the + * client-side SDK. By default, all flags are included. + clientSideOnly?: boolean; + }; + /** * The LaunchDarkly client's instance interface. * @@ -546,11 +556,14 @@ declare module 'ldclient-node' { * to convert it to the data structure used by the client-side SDK. * * @param user The end user requesting the feature flags. + * @param options Optional object with properties that determine how the state is computed; + * set `clientSideOnly: true` to include only client-side-enabled flags * @param callback The node-style callback to receive the state result. * @returns a Promise containing the state object */ allFlagsState: ( user: LDUser, + options?: LDFlagsStateOptions, callback?: (err: any, res: LDFlagsState) => void ) => Promise; diff --git a/index.js b/index.js index 07c1aa8..5f6f1fb 100644 --- a/index.js +++ b/index.js @@ -241,7 +241,8 @@ var newClient = function(sdkKey, config) { callback); } - client.allFlagsState = function(user, callback) { + client.allFlagsState = function(user, options, callback) { + options = options || {}; return wrapPromiseCallback(new Promise(function(resolve, reject) { sanitizeUser(user); @@ -256,13 +257,18 @@ var newClient = function(sdkKey, config) { } var builder = FlagsStateBuilder(true); + var clientOnly = options.clientSideOnly; config.featureStore.all(dataKind.features, function(flags) { async.forEachOf(flags, function(flag, key, iterateeCb) { - // At the moment, we don't send any events here - evaluate.evaluate(flag, user, config.featureStore, function(err, variation, value, events) { - builder.addFlag(flag, value, variation); + if (clientOnly && !flag.clientSide) { setImmediate(iterateeCb); - }) + } else { + // At the moment, we don't send any events here + evaluate.evaluate(flag, user, config.featureStore, function(err, variation, value, events) { + builder.addFlag(flag, value, variation); + setImmediate(iterateeCb); + }); + } }, function(err) { return err ? reject(err) : resolve(builder.build()); }); diff --git a/test/LDClient-test.js b/test/LDClient-test.js index 943ee64..bb132a7 100644 --- a/test/LDClient-test.js +++ b/test/LDClient-test.js @@ -88,7 +88,7 @@ describe('LDClient', function() { it('returns empty state for allFlagsState in offline mode and logs a message', function(done) { var client = LDClient.init('secret', {offline: true, logger: logger}); client.on('ready', function() { - client.allFlagsState({key: 'user'}, function(err, state) { + client.allFlagsState({key: 'user'}, {}, function(err, state) { expect(state.valid).toEqual(false); expect(state.allValues()).toEqual({}); expect(logger.info).toHaveBeenCalledTimes(1); @@ -292,7 +292,7 @@ describe('LDClient', function() { var client = createOnlineClientWithFlags({ feature: flag }); var user = { key: 'user' }; client.on('ready', function() { - client.allFlagsState(user, function(err, state) { + client.allFlagsState(user, {}, function(err, state) { expect(err).toBeNull(); expect(state.valid).toEqual(true); expect(state.allValues()).toEqual({feature: 'b'}); @@ -314,6 +314,25 @@ describe('LDClient', function() { }); }); + it('can filter for only client-side flags with allFlagsState()', function(done) { + var flag1 = { key: 'server-side-1', on: false, offVariation: 0, variations: ['a'], clientSide: false }; + var flag2 = { key: 'server-side-2', on: false, offVariation: 0, variations: ['b'], clientSide: false }; + var flag3 = { key: 'client-side-1', on: false, offVariation: 0, variations: ['value1'], clientSide: true }; + var flag4 = { key: 'client-side-2', on: false, offVariation: 0, variations: ['value2'], clientSide: true }; + var client = createOnlineClientWithFlags({ + 'server-side-1': flag1, 'server-side-2': flag2, 'client-side-1': flag3, 'client-side-2': flag4 + }); + var user = { key: 'user' }; + client.on('ready', function() { + client.allFlagsState(user, { clientSideOnly: true }, function(err, state) { + expect(err).toBeNull(); + expect(state.valid).toEqual(true); + expect(state.allValues()).toEqual({ 'client-side-1': 'value1', 'client-side-2': 'value2' }); + done(); + }); + }); + }); + it('should not overflow the call stack when evaluating a huge number of flags', function(done) { var flagCount = 5000; var flags = {}; From 06bdb460183a7a95f4344c66d79eb19dc1502242 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Tue, 21 Aug 2018 17:26:53 -0700 Subject: [PATCH 19/70] fix comment --- index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/index.d.ts b/index.d.ts index 1d05503..b5f5be8 100644 --- a/index.d.ts +++ b/index.d.ts @@ -461,6 +461,7 @@ declare module 'ldclient-node' { /** * True if the state should include only flags that have been marked for use with the * client-side SDK. By default, all flags are included. + */ clientSideOnly?: boolean; }; From aa39f0e346fd6163361322e2b4f874655d129c63 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Wed, 22 Aug 2018 16:06:36 -0700 Subject: [PATCH 20/70] add npm audit to build --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9cc27c7..1d0ed68 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,6 +16,7 @@ node-template: &node-template command: npm test environment: JEST_JUNIT_OUTPUT: "reports/junit/js-test-results.xml" + - run: npm audit - store_test_results: path: reports/junit - store_artifacts: From 2dd2edcedb0dc5318da985e311ce820f55d86998 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Wed, 22 Aug 2018 16:08:24 -0700 Subject: [PATCH 21/70] run npm audit fix --- package-lock.json | 5240 +++++++++++++++++++++++---------------------- 1 file changed, 2652 insertions(+), 2588 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0d9fa69..e5e628e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,23 +5,42 @@ "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.0.0-beta.42", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.42.tgz", - "integrity": "sha512-L8i94FLSyaLQpRfDo/qqSm8Ndb44zMtXParXo0MebJICG1zoCCL4+GkzUOlB4BNTRSXXQdb3feam/qw7bKPipQ==", + "version": "7.0.0-rc.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-rc.2.tgz", + "integrity": "sha512-+cVix+HBNakVp7IU1WReJV8dnJl/yaBA5JRXc758BSrvJCH2hKp1Z0xHIiUaOvxMwKXc3EXGIYhlnx5T+6ofGA==", "dev": true, "requires": { - "@babel/highlight": "7.0.0-beta.42" + "@babel/highlight": "7.0.0-rc.2" } }, "@babel/highlight": { - "version": "7.0.0-beta.42", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.42.tgz", - "integrity": "sha512-X3Ur/A/lIbbP8W0pmwgqtDXIxhQmxPaiwY9SKP7kF9wvZfjZRwMvbJE92ozUhF3UDK3DCKaV7oGqmI1rP/zqWA==", + "version": "7.0.0-rc.2", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-rc.2.tgz", + "integrity": "sha512-96V6XHAh9XHzjmucShCP8tULwXsC446doZ6REaLVdZDPNj3NsWbsC7OBeY+u6UWiFxHTTv6YmA4Veh4wXuucYw==", "dev": true, "requires": { - "chalk": "2.3.2", - "esutils": "2.0.2", - "js-tokens": "3.0.2" + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + } } }, "@types/events": { @@ -39,36 +58,29 @@ "resolved": "https://registry.npmjs.org/@types/redis/-/redis-2.8.6.tgz", "integrity": "sha1-NnTQehOtdrzNpMN9w5CeTpV1fn4=", "requires": { - "@types/events": "1.2.0", - "@types/node": "10.5.2" + "@types/events": "*", + "@types/node": "*" } }, "abab": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/abab/-/abab-1.0.4.tgz", - "integrity": "sha1-X6rZwsB/YN12dw9xzwJbYqY8/U4=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.0.tgz", + "integrity": "sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w==", "dev": true }, - "abbrev": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz", - "integrity": "sha1-0FVMIlZjbi9W58LlrRg/hZQo2B8=", - "dev": true, - "optional": true - }, "acorn": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz", - "integrity": "sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz", + "integrity": "sha512-d+nbxBUGKg7Arpsvbnlq61mc12ek3EY8EQldM3GPAhWJ1UVxC6TDGbIvUMNU6obBX3i1+ptCIzV4vq0gFPEGVQ==", "dev": true }, "acorn-globals": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.1.0.tgz", - "integrity": "sha1-q3FgJdvhfFTT74HTLs4rLZn+JTg=", + "integrity": "sha512-KjZwU26uG3u6eZcfGbTULzFcsoz6pegNKtHPksZPOUsiKo5bUmiBPa38FuHZ/Eun+XYh/JCCkS9AS3Lu4McQOQ==", "dev": true, "requires": { - "acorn": "5.5.3" + "acorn": "^5.0.0" } }, "ajv": { @@ -76,10 +88,10 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", "requires": { - "co": "4.6.0", - "fast-deep-equal": "1.1.0", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.3.1" + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" } }, "align-text": { @@ -88,9 +100,9 @@ "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "dev": true, "requires": { - "kind-of": "3.2.2", - "longest": "1.0.1", - "repeat-string": "1.6.1" + "kind-of": "^3.0.2", + "longest": "^1.0.1", + "repeat-string": "^1.5.2" } }, "amdefine": { @@ -99,34 +111,29 @@ "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", "dev": true }, - "ansi-escapes": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", - "integrity": "sha1-9zIHu4EgfXX9bIPxJa8m7qN4yjA=", - "dev": true - }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true }, "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha1-QfuyAkPlCxK+DwS43tvwdSDOhB0=", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { - "color-convert": "1.9.1" + "color-convert": "^1.9.0" } }, "anymatch": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha1-vLJLTzeTTZqnrBe0ra+J58du8us=", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", "dev": true, "requires": { - "micromatch": "3.1.10", - "normalize-path": "2.1.1" + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" }, "dependencies": { "arr-diff": { @@ -142,41 +149,30 @@ "dev": true }, "braces": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.1.tgz", - "integrity": "sha512-SO5lYHA3vO6gz66erVvedSCkp7AKWdv6VcQ2N4ysXfPxdAlxAMMAdwegGGcv1Bqwm7naF1hNdk5d6AAIEHV2nQ==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "dev": true, "requires": { - "arr-flatten": "1.1.0", - "array-unique": "0.3.2", - "define-property": "1.0.0", - "extend-shallow": "2.0.1", - "fill-range": "4.0.0", - "isobject": "3.0.1", - "kind-of": "6.0.2", - "repeat-element": "1.1.2", - "snapdragon": "0.8.2", - "snapdragon-node": "2.1.1", - "split-string": "3.1.0", - "to-regex": "3.0.2" + "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": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "1.0.2" - } - }, "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.1" + "is-extendable": "^0.1.0" } } } @@ -187,13 +183,13 @@ "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", "dev": true, "requires": { - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "posix-character-classes": "0.1.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { "define-property": { @@ -202,7 +198,7 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } }, "extend-shallow": { @@ -211,24 +207,64 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "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" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "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" + } + } } }, "is-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha1-Nm2CQN3kh8pRgjsaufB6EKeCUco=", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "dev": true, "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" } }, "kind-of": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha1-cpyR4thXt6QZofmqZWhcTDP1hF0=", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", "dev": true } } @@ -236,17 +272,17 @@ "extglob": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha1-rQD+TcYSqSMuhxhxHcXLWrAoVUM=", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", "dev": true, "requires": { - "array-unique": "0.3.2", - "define-property": "1.0.0", - "expand-brackets": "2.1.4", - "extend-shallow": "2.0.1", - "fragment-cache": "0.2.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { "define-property": { @@ -255,7 +291,7 @@ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { - "is-descriptor": "1.0.2" + "is-descriptor": "^1.0.0" } }, "extend-shallow": { @@ -264,7 +300,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -275,10 +311,10 @@ "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.1" + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" }, "dependencies": { "extend-shallow": { @@ -287,49 +323,38 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } }, "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { - "kind-of": "3.2.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.6" - } - } + "kind-of": "^6.0.0" } }, "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "kind-of": "3.2.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.6" - } - } + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } }, "is-number": { @@ -338,7 +363,7 @@ "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -347,7 +372,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -361,66 +386,48 @@ "kind-of": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha1-ARRrNqYhjmTljzqNZt5df8b20FE=", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", "dev": true }, "micromatch": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha1-cIWbyVyYQJUvNZoGij/En57PrCM=", + "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.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "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" } } } }, "append-transform": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-0.4.0.tgz", - "integrity": "sha1-126/jKlNJ24keja61EpLdKthGZE=", - "dev": true, - "requires": { - "default-require-extensions": "1.0.0" - } - }, - "aproba": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.1.1.tgz", - "integrity": "sha1-ldNgDwdxCqDpKYxyatXs8urLq6s=", - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz", - "integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-1.0.0.tgz", + "integrity": "sha512-P009oYkeHyU742iSZJzZZywj4QRJdnTWffaKuJQLablCZ1uz6/cW4yaRgcDaoQ+uwOxxnt0gRUcwfsNP2ri0gw==", "dev": true, - "optional": true, "requires": { - "delegates": "1.0.0", - "readable-stream": "2.3.5" + "default-require-extensions": "^2.0.0" } }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha1-vNZ5HqWuCXJeF+WtmIE0zUCz2RE=", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { - "sprintf-js": "1.0.3" + "sprintf-js": "~1.0.2" } }, "arr-diff": { @@ -429,13 +436,13 @@ "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", "dev": true, "requires": { - "arr-flatten": "1.1.0" + "arr-flatten": "^1.0.1" } }, "arr-flatten": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha1-NgSLv/TntH4TZkQxbJlmnqWukfE=", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", "dev": true }, "arr-union": { @@ -463,9 +470,12 @@ "dev": true }, "asn1": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", - "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=" + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "requires": { + "safer-buffer": "~2.1.0" + } }, "assert-plus": { "version": "1.0.0", @@ -487,7 +497,7 @@ "astral-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha1-bIw/uCfdQ+45GPJ7gngqt2WKb9k=", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", "dev": true }, "async": { @@ -495,13 +505,13 @@ "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", "integrity": "sha1-YaKau2/MAm/qd+VtHG7FOnlZUfQ=", "requires": { - "lodash": "4.17.4" + "lodash": "^4.14.0" } }, "async-limiter": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", - "integrity": "sha1-ePrtjD0HSrgfIrTphdeehzj3IPg=", + "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==", "dev": true }, "asynckit": { @@ -510,9 +520,9 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "atob": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.0.tgz", - "integrity": "sha512-SuiKH8vbsOyCALjA/+EINmt/Kdl+TQPrtFgW7XZZcwtryFu9e5kQoX3bjCW6mIvGH1fbeAZZuvwGR5IlBRznGw==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", "dev": true }, "aws-sign2": { @@ -531,88 +541,52 @@ "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", "dev": true, "requires": { - "chalk": "1.1.3", - "esutils": "2.0.2", - "js-tokens": "3.0.2" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "2.1.1" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" } }, "babel-core": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.0.tgz", - "integrity": "sha1-rzL3izGm/O8RnIew/Y2XU/A6C7g=", - "dev": true, - "requires": { - "babel-code-frame": "6.26.0", - "babel-generator": "6.26.1", - "babel-helpers": "6.24.1", - "babel-messages": "6.23.0", - "babel-register": "6.26.0", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0", - "babylon": "6.18.0", - "convert-source-map": "1.5.1", - "debug": "2.6.9", - "json5": "0.5.1", - "lodash": "4.17.4", - "minimatch": "3.0.4", - "path-is-absolute": "1.0.1", - "private": "0.1.8", - "slash": "1.0.0", - "source-map": "0.5.7" + "version": "6.26.3", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", + "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", + "dev": true, + "requires": { + "babel-code-frame": "^6.26.0", + "babel-generator": "^6.26.0", + "babel-helpers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-register": "^6.26.0", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "convert-source-map": "^1.5.1", + "debug": "^2.6.9", + "json5": "^0.5.1", + "lodash": "^4.17.4", + "minimatch": "^3.0.4", + "path-is-absolute": "^1.0.1", + "private": "^0.1.8", + "slash": "^1.0.0", + "source-map": "^0.5.7" } }, "babel-generator": { "version": "6.26.1", "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", - "integrity": "sha1-GERAjTuPDTWkBOp6wYDwh6YBvZA=", + "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", "dev": true, "requires": { - "babel-messages": "6.23.0", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "detect-indent": "4.0.0", - "jsesc": "1.3.0", - "lodash": "4.17.4", - "source-map": "0.5.7", - "trim-right": "1.0.1" + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "detect-indent": "^4.0.0", + "jsesc": "^1.3.0", + "lodash": "^4.17.4", + "source-map": "^0.5.7", + "trim-right": "^1.0.1" } }, "babel-helpers": { @@ -621,18 +595,18 @@ "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", "dev": true, "requires": { - "babel-runtime": "6.26.0", - "babel-template": "6.26.0" + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" } }, "babel-jest": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-22.4.3.tgz", - "integrity": "sha512-BgSjmtl3mW3i+VeVHEr9d2zFSAT66G++pJcHQiUjd00pkW+voYXFctIm/indcqOWWXw5a1nUpR1XWszD9fJ1qg==", + "version": "22.4.4", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-22.4.4.tgz", + "integrity": "sha512-A9NB6/lZhYyypR9ATryOSDcqBaqNdzq4U+CN+/wcMsLcmKkPxQEoTKLajGfd3IkxNyVBT8NewUK2nWyGbSzHEQ==", "dev": true, "requires": { - "babel-plugin-istanbul": "4.1.5", - "babel-preset-jest": "22.4.3" + "babel-plugin-istanbul": "^4.1.5", + "babel-preset-jest": "^22.4.4" } }, "babel-messages": { @@ -641,24 +615,25 @@ "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", "dev": true, "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-plugin-istanbul": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.5.tgz", - "integrity": "sha1-Z2DN2Xf0EdPhdbsGTyvDJ9mbK24=", + "version": "4.1.6", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz", + "integrity": "sha512-PWP9FQ1AhZhS01T/4qLSKoHGY/xvkZdVBGlKM/HuxxS3+sC66HhTNR7+MpbO/so/cz/wY94MeSWJuP1hXIPfwQ==", "dev": true, "requires": { - "find-up": "2.1.0", - "istanbul-lib-instrument": "1.10.1", - "test-exclude": "4.2.1" + "babel-plugin-syntax-object-rest-spread": "^6.13.0", + "find-up": "^2.1.0", + "istanbul-lib-instrument": "^1.10.1", + "test-exclude": "^4.2.1" } }, "babel-plugin-jest-hoist": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-22.4.3.tgz", - "integrity": "sha512-zhvv4f6OTWy2bYevcJftwGCWXMFe7pqoz41IhMi4xna7xNsX5NygdagsrE0y6kkfuXq8UalwvPwKTyAxME2E/g==", + "version": "22.4.4", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-22.4.4.tgz", + "integrity": "sha512-DUvGfYaAIlkdnygVIEl0O4Av69NtuQWcrjMOv6DODPuhuGLDnbsARz3AwiiI/EkIMMlxQDUcrZ9yoyJvTNjcVQ==", "dev": true }, "babel-plugin-syntax-object-rest-spread": { @@ -668,13 +643,13 @@ "dev": true }, "babel-preset-jest": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-22.4.3.tgz", - "integrity": "sha512-a+M3LTEXTq3gxv0uBN9Qm6ahUl7a8pj923nFbCUdqFUSsf3YrX8Uc+C3MEwji5Af3LiQjSC7w4ooYewlz8HRTA==", + "version": "22.4.4", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-22.4.4.tgz", + "integrity": "sha512-+dxMtOFwnSYWfum0NaEc0O03oSdwBsjx4tMSChRDPGwu/4wSY6Q6ANW3wkjKpJzzguaovRs/DODcT4hbSN8yiA==", "dev": true, "requires": { - "babel-plugin-jest-hoist": "22.4.3", - "babel-plugin-syntax-object-rest-spread": "6.13.0" + "babel-plugin-jest-hoist": "^22.4.4", + "babel-plugin-syntax-object-rest-spread": "^6.13.0" } }, "babel-register": { @@ -683,22 +658,22 @@ "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", "dev": true, "requires": { - "babel-core": "6.26.0", - "babel-runtime": "6.26.0", - "core-js": "2.5.4", - "home-or-tmp": "2.0.0", - "lodash": "4.17.4", - "mkdirp": "0.5.1", - "source-map-support": "0.4.18" + "babel-core": "^6.26.0", + "babel-runtime": "^6.26.0", + "core-js": "^2.5.0", + "home-or-tmp": "^2.0.0", + "lodash": "^4.17.4", + "mkdirp": "^0.5.1", + "source-map-support": "^0.4.15" }, "dependencies": { "source-map-support": { "version": "0.4.18", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", - "integrity": "sha1-Aoam3ovkJkEzhZTpfM6nXwosWF8=", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", "dev": true, "requires": { - "source-map": "0.5.7" + "source-map": "^0.5.6" } } } @@ -709,8 +684,8 @@ "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", "dev": true, "requires": { - "core-js": "2.5.4", - "regenerator-runtime": "0.11.1" + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" } }, "babel-template": { @@ -719,11 +694,11 @@ "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", "dev": true, "requires": { - "babel-runtime": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0", - "babylon": "6.18.0", - "lodash": "4.17.4" + "babel-runtime": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "lodash": "^4.17.4" } }, "babel-traverse": { @@ -732,15 +707,15 @@ "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", "dev": true, "requires": { - "babel-code-frame": "6.26.0", - "babel-messages": "6.23.0", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "babylon": "6.18.0", - "debug": "2.6.9", - "globals": "9.18.0", - "invariant": "2.2.4", - "lodash": "4.17.4" + "babel-code-frame": "^6.26.0", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "debug": "^2.6.8", + "globals": "^9.18.0", + "invariant": "^2.2.2", + "lodash": "^4.17.4" } }, "babel-types": { @@ -749,16 +724,16 @@ "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", "dev": true, "requires": { - "babel-runtime": "6.26.0", - "esutils": "2.0.2", - "lodash": "4.17.4", - "to-fast-properties": "1.0.3" + "babel-runtime": "^6.26.0", + "esutils": "^2.0.2", + "lodash": "^4.17.4", + "to-fast-properties": "^1.0.3" } }, "babylon": { "version": "6.18.0", "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", - "integrity": "sha1-ry87iPpvXB5MY00aD46sT1WzleM=", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", "dev": true }, "balanced-match": { @@ -770,16 +745,16 @@ "base": { "version": "0.11.2", "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha1-e95c7RRbbVUakNuH+DxVi060io8=", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", "dev": true, "requires": { - "cache-base": "1.0.1", - "class-utils": "0.3.6", - "component-emitter": "1.2.1", - "define-property": "1.0.0", - "isobject": "3.0.1", - "mixin-deep": "1.3.1", - "pascalcase": "0.1.1" + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" }, "dependencies": { "define-property": { @@ -788,7 +763,36 @@ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { - "is-descriptor": "1.0.2" + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } }, "isobject": { @@ -796,34 +800,31 @@ "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true } } }, "bcrypt-pbkdf": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", - "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", "optional": true, "requires": { - "tweetnacl": "0.14.5" - } - }, - "block-stream": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", - "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", - "dev": true, - "requires": { - "inherits": "2.0.3" + "tweetnacl": "^0.14.3" } }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, @@ -833,9 +834,9 @@ "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", "dev": true, "requires": { - "expand-range": "1.8.2", - "preserve": "0.2.0", - "repeat-element": "1.1.2" + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" } }, "browser-process-hrtime": { @@ -845,9 +846,9 @@ "dev": true }, "browser-resolve": { - "version": "1.11.2", - "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.2.tgz", - "integrity": "sha1-j/CbCixCFxihBRwmCzLkj0QpOM4=", + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.3.tgz", + "integrity": "sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ==", "dev": true, "requires": { "resolve": "1.1.7" @@ -859,9 +860,15 @@ "integrity": "sha1-mseNPtXZFYBP2HrLFYvHlxR6Fxk=", "dev": true, "requires": { - "node-int64": "0.4.0" + "node-int64": "^0.4.0" } }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, "builtin-modules": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", @@ -871,18 +878,18 @@ "cache-base": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha1-Cn9GQWgxyLZi7jb+TnxZ129marI=", - "dev": true, - "requires": { - "collection-visit": "1.0.0", - "component-emitter": "1.2.1", - "get-value": "2.0.6", - "has-value": "1.0.0", - "isobject": "3.0.1", - "set-value": "2.0.0", - "to-object-path": "0.3.0", - "union-value": "1.0.0", - "unset-value": "1.0.0" + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" }, "dependencies": { "isobject": { @@ -906,6 +913,15 @@ "dev": true, "optional": true }, + "capture-exit": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-1.2.0.tgz", + "integrity": "sha1-HF/MSJ/QqwDU8ax64QcuMXP7q28=", + "dev": true, + "requires": { + "rsvp": "^3.3.3" + } + }, "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", @@ -918,8 +934,8 @@ "dev": true, "optional": true, "requires": { - "align-text": "0.1.4", - "lazy-cache": "1.0.4" + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" } }, "chai": { @@ -928,23 +944,48 @@ "integrity": "sha1-D2RYS6ZC8PKs4oBiefTwbKI61zw=", "dev": true, "requires": { - "assertion-error": "1.1.0", - "check-error": "1.0.2", - "deep-eql": "3.0.1", - "get-func-name": "2.0.0", - "pathval": "1.1.0", - "type-detect": "4.0.8" + "assertion-error": "^1.0.1", + "check-error": "^1.0.1", + "deep-eql": "^3.0.0", + "get-func-name": "^2.0.0", + "pathval": "^1.0.0", + "type-detect": "^4.0.0" } }, "chalk": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", - "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.3.0" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } } }, "check-error": { @@ -954,21 +995,21 @@ "dev": true }, "ci-info": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.1.3.tgz", - "integrity": "sha1-cQGTJkuwXHe4yQ0C9aryIhamZ7I=", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.4.0.tgz", + "integrity": "sha512-Oqmw2pVfCl8sCL+1QgMywPfdxPJPkC51y4usw0iiE2S9qnEOAqXy8bwl1CpMpnoU39g4iKJTz6QZj+28FvOnjQ==", "dev": true }, "class-utils": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha1-+TNprouafOAv1B+q0MqDAzGQxGM=", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", "dev": true, "requires": { - "arr-union": "3.1.0", - "define-property": "0.2.5", - "isobject": "3.0.1", - "static-extend": "0.1.2" + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" }, "dependencies": { "define-property": { @@ -977,58 +1018,7 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "0.1.6" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "3.2.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.6" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "3.2.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.6" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" + "is-descriptor": "^0.1.0" } }, "isobject": { @@ -1036,12 +1026,6 @@ "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", "dev": true - }, - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true } } }, @@ -1052,8 +1036,8 @@ "dev": true, "optional": true, "requires": { - "center-align": "0.1.3", - "right-align": "0.1.3", + "center-align": "^0.1.1", + "right-align": "^0.1.1", "wordwrap": "0.0.2" }, "dependencies": { @@ -1079,7 +1063,8 @@ "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true }, "collection-visit": { "version": "1.0.0", @@ -1087,23 +1072,23 @@ "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", "dev": true, "requires": { - "map-visit": "1.0.0", - "object-visit": "1.0.1" + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" } }, "color-convert": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", - "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.2.tgz", + "integrity": "sha512-3NUJZdhMhcdPn8vJ9v2UQJoH0qqoGUkYTgFEPZaPjEtwmmKUfNV46zZmgB2M5M4DCEQHMaCfWHCxiBflLm04Tg==", "dev": true, "requires": { - "color-name": "1.1.3" + "color-name": "1.1.1" } }, "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha1-SxQVMEz1ACjqgWQ2Q72C6gWANok=", "dev": true }, "colors": { @@ -1116,13 +1101,13 @@ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", "requires": { - "delayed-stream": "1.0.0" + "delayed-stream": "~1.0.0" } }, "compare-versions": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.1.0.tgz", - "integrity": "sha512-4hAxDSBypT/yp2ySFD346So6Ragw5xmBn/e/agIGl3bZr6DLUqnoRZPusxKrXdYRZpgexO9daejmIenlq/wrIQ==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.3.1.tgz", + "integrity": "sha512-GkIcfJ9sDt4+gS+RWH3X+kR7ezuKdu3fg2oA9nRA8HZoqZwAKv3ml3TyfB9OyV2iFXxCw7q5XfV6SyPbSCT2pw==", "dev": true }, "component-emitter": { @@ -1137,18 +1122,6 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, - "console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", - "dev": true - }, - "content-type-parser": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/content-type-parser/-/content-type-parser-1.0.2.tgz", - "integrity": "sha512-lM4l4CnMEwOLHAHr/P6MEZwZFPJFtAAKgL6pogbXmVZggIqXhdB6RbBtPOTsw2FcXwYhehRGERJmRrjOiIB8pQ==", - "dev": true - }, "convert-source-map": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", @@ -1162,9 +1135,9 @@ "dev": true }, "core-js": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.4.tgz", - "integrity": "sha1-8si/GB8qgLkvNgEhQpzmOi8K6uA=", + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", + "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==", "dev": true }, "core-util-is": { @@ -1178,24 +1151,24 @@ "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", "dev": true, "requires": { - "lru-cache": "4.1.2", - "shebang-command": "1.2.0", - "which": "1.3.0" + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" } }, "cssom": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.2.tgz", - "integrity": "sha1-uANhcMefB6kP8vFuIihAJ6JDhIs=", + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.4.tgz", + "integrity": "sha512-+7prCSORpXNeR4/fUP3rL+TzqtiFfhMvTd7uEqMdgPvLPt4+uzFUeufx5RHjGTACCargg/DiEt/moMQmvnfkog==", "dev": true }, "cssstyle": { - "version": "0.2.37", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-0.2.37.tgz", - "integrity": "sha1-VBCXI0yyUTyDzu06zdwn/yeYfVQ=", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.1.1.tgz", + "integrity": "sha512-364AI1l/M5TYcFH83JnOH/pSqgaNnKmYgKrm0didZMGKWjQB60dymwWy1rKUgL3J1ffdq9xVi2yGLHdSjjSNog==", "dev": true, "requires": { - "cssom": "0.3.2" + "cssom": "0.3.x" } }, "cycle": { @@ -1208,13 +1181,37 @@ "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", "requires": { - "assert-plus": "1.0.0" + "assert-plus": "^1.0.0" + } + }, + "data-urls": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.0.1.tgz", + "integrity": "sha512-0HdcMZzK6ubMUnsMmQmG0AcLQPvbvb47R0+7CCZQCYgcd8OUWG91CG7sM6GoXgjz+WLl4ArFzHtBMy/QqSF4eg==", + "dev": true, + "requires": { + "abab": "^2.0.0", + "whatwg-mimetype": "^2.1.0", + "whatwg-url": "^7.0.0" + }, + "dependencies": { + "whatwg-url": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.0.0.tgz", + "integrity": "sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ==", + "dev": true, + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + } } }, "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { "ms": "2.0.0" @@ -1238,7 +1235,7 @@ "integrity": "sha1-38lARACtHI/gI+faHfHBR8S0RN8=", "dev": true, "requires": { - "type-detect": "4.0.8" + "type-detect": "^4.0.0" } }, "deep-equal": { @@ -1247,13 +1244,6 @@ "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", "dev": true }, - "deep-extend": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.2.tgz", - "integrity": "sha1-SLaZwn4zS/ifEIkr5DL25MfTSn8=", - "dev": true, - "optional": true - }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -1261,38 +1251,72 @@ "dev": true }, "default-require-extensions": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-1.0.0.tgz", - "integrity": "sha1-836hXT4T/9m0N9M+GnW1+5eHTLg=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-2.0.0.tgz", + "integrity": "sha1-9fj7sYp9bVCyH2QfZJ67Uiz+JPc=", "dev": true, "requires": { - "strip-bom": "2.0.0" + "strip-bom": "^3.0.0" } }, "define-properties": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", - "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", + "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": { - "foreach": "2.0.5", - "object-keys": "1.0.11" + "object-keys": "^1.0.12" } }, "define-property": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha1-1Flono1lS6d+AqgX+HENcCyxbp0=", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", "dev": true, "requires": { - "is-descriptor": "1.0.2", - "isobject": "3.0.1" + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" }, "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", "dev": true } } @@ -1302,29 +1326,15 @@ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, - "delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", - "dev": true, - "optional": true - }, "detect-indent": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", "dev": true, "requires": { - "repeating": "2.0.1" + "repeating": "^2.0.0" } }, - "detect-libc": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.2.tgz", - "integrity": "sha1-ca1dIEvxempsqPRQxhRUBm70YeE=", - "dev": true, - "optional": true - }, "detect-newline": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", @@ -1334,16 +1344,16 @@ "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha1-gAwN0eCov7yVg1wgKtIg/jF+WhI=", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true }, "domexception": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", - "integrity": "sha1-k3RCZEymoxJh7zbj7Gd/6AVYLJA=", + "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", "dev": true, "requires": { - "webidl-conversions": "4.0.2" + "webidl-conversions": "^4.0.2" } }, "double-ended-queue": { @@ -1352,34 +1362,35 @@ "integrity": "sha1-ED01J/0xUo9AGIEwyEHv3XgmTlw=" }, "ecc-jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", - "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", "optional": true, "requires": { - "jsbn": "0.1.1" + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" } }, "error-ex": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", - "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "version": "1.3.2", + "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" + "is-arrayish": "^0.2.1" } }, "es-abstract": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.11.0.tgz", - "integrity": "sha512-ZnQrE/lXTTQ39ulXZ+J1DTFazV9qBy61x2bY071B+qGco8Z8q1QddsLdt/EF8Ai9hcWH72dWS0kFqXLxOxqslA==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", + "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", "dev": true, "requires": { - "es-to-primitive": "1.1.1", - "function-bind": "1.1.1", - "has": "1.0.1", - "is-callable": "1.1.3", - "is-regex": "1.0.4" + "es-to-primitive": "^1.1.1", + "function-bind": "^1.1.1", + "has": "^1.0.1", + "is-callable": "^1.1.3", + "is-regex": "^1.0.4" } }, "es-to-primitive": { @@ -1388,9 +1399,9 @@ "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", "dev": true, "requires": { - "is-callable": "1.1.3", - "is-date-object": "1.0.1", - "is-symbol": "1.0.1" + "is-callable": "^1.1.1", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.1" } }, "escape-string-regexp": { @@ -1400,16 +1411,16 @@ "dev": true }, "escodegen": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.9.1.tgz", - "integrity": "sha512-6hTjO1NAWkHnDk3OqQ4YrCuwwmGHL9S3nPlzBOUG/R44rda3wLNrfvQ5fkSGjyhHFKM7ALPKcKGrwvCLe0lC7Q==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.11.0.tgz", + "integrity": "sha512-IeMV45ReixHS53K/OmfKAIztN/igDHzTJUhZM3k1jMhIZWjk45SMwAtBsEXiJp3vSPmTcu6CXn7mDvFHRN66fw==", "dev": true, "requires": { - "esprima": "3.1.3", - "estraverse": "4.2.0", - "esutils": "2.0.2", - "optionator": "0.8.2", - "source-map": "0.6.1" + "esprima": "^3.1.3", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" }, "dependencies": { "esprima": { @@ -1421,16 +1432,16 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, "optional": true } } }, "esprima": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", - "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, "estraverse": { @@ -1446,12 +1457,12 @@ "dev": true }, "exec-sh": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.2.1.tgz", - "integrity": "sha512-aLt95pexaugVtQerpmE51+4QfWrNc304uez7jvj6fWnN8GeEHpttB8F36n8N7uVhUMbH/1enbxQ9HImZ4w/9qg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.2.2.tgz", + "integrity": "sha512-FIUCJz1RbuS0FKTdaAafAByGS0CPvU3R0MeHxgtl+djzCc//F8HakL8GzmVNZanasTbTAY/3DRFA0KpVqj/eAw==", "dev": true, "requires": { - "merge": "1.2.0" + "merge": "^1.2.0" } }, "execa": { @@ -1460,28 +1471,22 @@ "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", "dev": true, "requires": { - "cross-spawn": "5.1.0", - "get-stream": "3.0.0", - "is-stream": "1.1.0", - "npm-run-path": "2.0.2", - "p-finally": "1.0.0", - "signal-exit": "3.0.2", - "strip-eof": "1.0.0" + "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" } }, - "exit": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", - "dev": true - }, "expand-brackets": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", "dev": true, "requires": { - "is-posix-bracket": "0.1.1" + "is-posix-bracket": "^0.1.0" } }, "expand-range": { @@ -1490,21 +1495,21 @@ "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", "dev": true, "requires": { - "fill-range": "2.2.3" + "fill-range": "^2.1.0" } }, "expect": { "version": "22.4.3", "resolved": "https://registry.npmjs.org/expect/-/expect-22.4.3.tgz", - "integrity": "sha1-1aKdCg4fshU1V8rvJnTUVH6RRnQ=", + "integrity": "sha512-XcNXEPehqn8b/jm8FYotdX0YrXn36qp4HWlrVT4ktwQas1l1LPxiVWncYnnL2eyMtKAmVIaG0XAp0QlrqJaxaA==", "dev": true, "requires": { - "ansi-styles": "3.2.1", - "jest-diff": "22.4.3", - "jest-get-type": "22.4.3", - "jest-matcher-utils": "22.4.3", - "jest-message-util": "22.4.3", - "jest-regex-util": "22.4.3" + "ansi-styles": "^3.2.0", + "jest-diff": "^22.4.3", + "jest-get-type": "^22.4.3", + "jest-matcher-utils": "^22.4.3", + "jest-message-util": "^22.4.3", + "jest-regex-util": "^22.4.3" } }, "extend": { @@ -1518,17 +1523,17 @@ "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", "dev": true, "requires": { - "assign-symbols": "1.0.0", - "is-extendable": "1.0.1" + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" }, "dependencies": { "is-extendable": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha1-p0cPnkJnM9gb2B4RVSZOOjUHyrQ=", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "dev": true, "requires": { - "is-plain-object": "2.0.4" + "is-plain-object": "^2.0.4" } } } @@ -1539,7 +1544,7 @@ "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", "dev": true, "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^1.0.0" } }, "extsprintf": { @@ -1574,7 +1579,7 @@ "integrity": "sha1-VOmr99+i8mzZsWNsWIwa/AXeXVg=", "dev": true, "requires": { - "bser": "2.0.0" + "bser": "^2.0.0" } }, "filename-regex": { @@ -1589,21 +1594,21 @@ "integrity": "sha1-jnVIqW08wjJ+5eZ0FocjozO7oqA=", "dev": true, "requires": { - "glob": "7.1.2", - "minimatch": "3.0.4" + "glob": "^7.0.3", + "minimatch": "^3.0.3" } }, "fill-range": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", - "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", + "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", "dev": true, "requires": { - "is-number": "2.1.0", - "isobject": "2.1.0", - "randomatic": "1.1.7", - "repeat-element": "1.1.2", - "repeat-string": "1.6.1" + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^3.0.0", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" } }, "find-up": { @@ -1612,7 +1617,7 @@ "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { - "locate-path": "2.0.0" + "locate-path": "^2.0.0" } }, "for-in": { @@ -1627,15 +1632,9 @@ "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", "dev": true, "requires": { - "for-in": "1.0.2" + "for-in": "^1.0.1" } }, - "foreach": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", - "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", - "dev": true - }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -1646,9 +1645,9 @@ "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", "requires": { - "asynckit": "0.4.0", + "asynckit": "^0.4.0", "combined-stream": "1.0.6", - "mime-types": "2.1.17" + "mime-types": "^2.1.12" }, "dependencies": { "combined-stream": { @@ -1656,7 +1655,7 @@ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", "requires": { - "delayed-stream": "1.0.0" + "delayed-stream": "~1.0.0" } } } @@ -1667,7 +1666,7 @@ "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", "dev": true, "requires": { - "map-cache": "0.2.2" + "map-cache": "^0.2.2" } }, "fs.realpath": { @@ -1677,293 +1676,544 @@ "dev": true }, "fsevents": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz", - "integrity": "sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", + "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", "dev": true, "optional": true, "requires": { - "nan": "2.10.0", - "node-pre-gyp": "0.6.39" + "nan": "^2.9.2", + "node-pre-gyp": "^0.10.0" }, "dependencies": { - "ajv": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", - "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", - "requires": { - "co": "4.6.0", - "json-stable-stringify": "1.0.1" - } + "abbrev": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true }, - "assert-plus": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", - "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=" + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true }, - "aws-sign2": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", - "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=" + "aproba": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true }, - "balanced-match": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", - "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=" - }, - "boom": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", - "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", + "are-we-there-yet": { + "version": "1.1.4", + "bundled": true, + "dev": true, + "optional": true, "requires": { - "hoek": "2.16.3" + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" } }, - "cryptiles": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", - "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", + "balanced-match": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "dev": true, "requires": { - "boom": "2.10.1" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, - "extsprintf": { + "chownr": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "core-util-is": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz", - "integrity": "sha1-4QgOBljjALBilJkMxw4VAiNf1VA=" + "bundled": true, + "dev": true, + "optional": true }, - "form-data": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", - "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", + "debug": { + "version": "2.6.9", + "bundled": true, + "dev": true, + "optional": true, "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.5", - "mime-types": "2.1.17" + "ms": "2.0.0" } }, - "har-schema": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz", - "integrity": "sha1-0mMTX0MwfALGAq/I/pWXDAFRNp4=" + "deep-extend": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true }, - "har-validator": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz", - "integrity": "sha1-M0gdDxu/9gDdID11gSpqX7oALio=", + "fs-minipass": { + "version": "1.2.5", + "bundled": true, + "dev": true, + "optional": true, "requires": { - "ajv": "4.11.8", - "har-schema": "1.0.5" + "minipass": "^2.2.1" } }, - "hawk": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", - "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "dev": true, + "optional": true, "requires": { - "boom": "2.10.1", - "cryptiles": "2.0.5", - "hoek": "2.16.3", - "sntp": "1.0.9" + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" } }, - "hoek": { - "version": "2.16.3", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", - "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=" + "glob": { + "version": "7.1.2", + "bundled": true, + "dev": true, + "optional": 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" + } }, - "http-signature": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", - "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.21", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safer-buffer": "^2.1.0" + } + }, + "ignore-walk": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true, "requires": { - "assert-plus": "0.2.0", - "jsprim": "1.4.1", - "sshpk": "1.13.1" + "minimatch": "^3.0.4" } }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "ini": { + "version": "1.3.5", + "bundled": true, + "dev": true, + "optional": true + }, "is-fullwidth-code-point": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, "requires": { - "number-is-nan": "1.0.1" + "brace-expansion": "^1.1.7" } }, - "mime-db": { - "version": "1.27.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.27.0.tgz", - "integrity": "sha1-gg9XIpa70g7CXtVeW13oaeVDbrE=" + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true }, - "performance-now": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz", - "integrity": "sha1-M+8wxcd9TqIcWlOGnZG1bY8lVeU=" + "minipass": { + "version": "2.2.4", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "^5.1.1", + "yallist": "^3.0.0" + } }, - "process-nextick-args": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" - }, - "qs": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", - "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=" - }, - "request": { - "version": "2.81.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz", - "integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA=", + "minizlib": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true, "requires": { - "aws-sign2": "0.6.0", - "aws4": "1.6.0", - "caseless": "0.12.0", - "combined-stream": "1.0.5", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.1.4", - "har-validator": "4.2.1", - "hawk": "3.1.3", - "http-signature": "1.1.1", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.17", - "oauth-sign": "0.8.2", - "performance-now": "0.2.0", - "qs": "6.4.0", - "safe-buffer": "5.1.1", - "stringstream": "0.0.5", - "tough-cookie": "2.3.3", - "tunnel-agent": "0.6.0", - "uuid": "3.1.0" + "minipass": "^2.2.1" } }, - "semver": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=" - }, - "sntp": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", - "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, "requires": { - "hoek": "2.16.3" + "minimist": "0.0.8" } }, - "string-width": { + "ms": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "needle": { + "version": "2.2.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "debug": "^2.1.2", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.10.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.0", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.1.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-bundled": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "npm-packlist": { + "version": "1.1.10", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "bundled": true, + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "dev": true, + "optional": true, "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" } }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.7", + "bundled": true, + "dev": true, + "optional": true, "requires": { - "ansi-regex": "2.1.1" + "deep-extend": "^0.5.1", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + } } }, - "verror": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz", - "integrity": "sha1-z/XfEpRtKX0rqu+qJoniW+AcAFw=", + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "dev": true, + "optional": true, "requires": { - "extsprintf": "1.0.2" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } - } - } - }, - "fstream": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", - "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "inherits": "2.0.3", - "mkdirp": "0.5.1", - "rimraf": "2.6.2" - } - }, - "fstream-ignore": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.5.tgz", - "integrity": "sha1-nDHa40dnAY/h0kmyTa2mfQktoQU=", - "dev": true, - "optional": true, - "requires": { - "fstream": "1.0.11", - "inherits": "2.0.3", - "minimatch": "3.0.4" - } - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=", - "dev": true - }, - "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "dev": true, - "optional": true, - "requires": { - "aproba": "1.1.1", - "console-control-strings": "1.1.0", - "has-unicode": "2.0.1", - "object-assign": "4.1.1", - "signal-exit": "3.0.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.2" - }, - "dependencies": { - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + }, + "rimraf": { + "version": "2.6.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "glob": "^7.0.5" + } + }, + "safe-buffer": { + "version": "5.1.1", + "bundled": true, + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "bundled": true, + "dev": true, + "optional": true + }, + "semver": { + "version": "5.5.0", + "bundled": true, + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, "dev": true, - "optional": true, - "requires": { - "number-is-nan": "1.0.1" - } + "optional": true }, "string-width": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, "dev": true, "optional": true, "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "safe-buffer": "~5.1.0" } }, "strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "tar": { + "version": "4.4.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "chownr": "^1.0.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.2.4", + "minizlib": "^1.1.0", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.1", + "yallist": "^3.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "wide-align": { + "version": "1.1.2", + "bundled": true, "dev": true, + "optional": true, "requires": { - "ansi-regex": "2.1.1" + "string-width": "^1.0.2" } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "yallist": { + "version": "3.0.2", + "bundled": true, + "dev": 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 + }, "get-caller-file": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", - "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", "dev": true }, "get-func-name": { @@ -1989,21 +2239,21 @@ "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", "requires": { - "assert-plus": "1.0.0" + "assert-plus": "^1.0.0" } }, "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha1-wZyd+aAocC1nhhI4SmVSQExjbRU=", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "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" } }, "glob-base": { @@ -2012,8 +2262,8 @@ "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", "dev": true, "requires": { - "glob-parent": "2.0.0", - "is-glob": "2.0.1" + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" } }, "glob-parent": { @@ -2022,13 +2272,13 @@ "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", "dev": true, "requires": { - "is-glob": "2.0.1" + "is-glob": "^2.0.0" } }, "globals": { "version": "9.18.0", "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha1-qjiWs+abSH8X4x7SFD1pqOMMLYo=", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", "dev": true }, "graceful-fs": { @@ -2049,10 +2299,10 @@ "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", "dev": true, "requires": { - "async": "1.5.2", - "optimist": "0.6.1", - "source-map": "0.4.4", - "uglify-js": "2.8.29" + "async": "^1.4.0", + "optimist": "^0.6.1", + "source-map": "^0.4.4", + "uglify-js": "^2.6" }, "dependencies": { "async": { @@ -2067,7 +2317,7 @@ "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", "dev": true, "requires": { - "amdefine": "1.0.1" + "amdefine": ">=0.0.4" } } } @@ -2082,17 +2332,17 @@ "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", "requires": { - "ajv": "5.5.2", - "har-schema": "2.0.0" + "ajv": "^5.1.0", + "har-schema": "^2.0.0" } }, "has": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", - "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, "requires": { - "function-bind": "1.1.1" + "function-bind": "^1.1.1" } }, "has-ansi": { @@ -2101,7 +2351,7 @@ "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "has-flag": { @@ -2110,22 +2360,15 @@ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, - "has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", - "dev": true, - "optional": true - }, "has-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", "dev": true, "requires": { - "get-value": "2.0.6", - "has-values": "1.0.0", - "isobject": "3.0.1" + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" }, "dependencies": { "isobject": { @@ -2142,8 +2385,8 @@ "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", "dev": true, "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" + "is-number": "^3.0.0", + "kind-of": "^4.0.0" }, "dependencies": { "is-number": { @@ -2152,7 +2395,7 @@ "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -2161,7 +2404,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -2172,7 +2415,7 @@ "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -2188,23 +2431,23 @@ "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", "dev": true, "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.1" } }, "hosted-git-info": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz", - "integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", + "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", "dev": true }, "html-encoding-sniffer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", - "integrity": "sha1-5w2EuU2lOqN14R/jo1G+ZkLKRvg=", + "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==", "dev": true, "requires": { - "whatwg-encoding": "1.0.3" + "whatwg-encoding": "^1.0.1" } }, "http-signature": { @@ -2212,16 +2455,19 @@ "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", "requires": { - "assert-plus": "1.0.0", - "jsprim": "1.4.1", - "sshpk": "1.13.1" + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" } }, "iconv-lite": { - "version": "0.4.19", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", - "integrity": "sha1-90aPYBNfXl2tM5nAqBvpoWA6CCs=", - "dev": true + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", + "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } }, "import-local": { "version": "1.0.0", @@ -2229,8 +2475,8 @@ "integrity": "sha1-Xk/9wD9P5sAJxnKb6yljHC+CJ7w=", "dev": true, "requires": { - "pkg-dir": "2.0.0", - "resolve-cwd": "2.0.0" + "pkg-dir": "^2.0.0", + "resolve-cwd": "^2.0.0" } }, "imurmurhash": { @@ -2245,8 +2491,8 @@ "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { @@ -2255,20 +2501,13 @@ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, - "ini": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", - "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=", - "dev": true, - "optional": true - }, "invariant": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha1-YQ88ksk1nOHbYW5TgAjSP/NRWOY=", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", "dev": true, "requires": { - "loose-envify": "1.3.1" + "loose-envify": "^1.0.0" } }, "invert-kv": { @@ -2278,20 +2517,12 @@ "dev": true }, "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", "dev": true, "requires": { - "kind-of": "6.0.2" - }, - "dependencies": { - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - } + "kind-of": "^3.0.2" } }, "is-arrayish": { @@ -2303,7 +2534,7 @@ "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha1-76ouqdqg16suoTqXsritUf776L4=", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, "is-builtin-module": { @@ -2312,39 +2543,31 @@ "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", "dev": true, "requires": { - "builtin-modules": "1.1.1" + "builtin-modules": "^1.0.0" } }, "is-callable": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz", - "integrity": "sha1-hut1OSgF3cM69xySoO7fdO52BLI=", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", "dev": true }, "is-ci": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.1.0.tgz", - "integrity": "sha1-JH5BYueGDOu9rzC3dNawrH3P56U=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.0.tgz", + "integrity": "sha512-plgvKjQtalH2P3Gytb7L61Lmz95g2DlpzFiQyRSFew8WoJKxtKRzrZMeyRN2supblm3Psc8OQGy7Xjb6XG11jw==", "dev": true, "requires": { - "ci-info": "1.1.3" + "ci-info": "^1.3.0" } }, "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", "dev": true, "requires": { - "kind-of": "6.0.2" - }, - "dependencies": { - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - } + "kind-of": "^3.0.2" } }, "is-date-object": { @@ -2354,20 +2577,20 @@ "dev": true }, "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "dev": true, "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" }, "dependencies": { "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", "dev": true } } @@ -2384,7 +2607,7 @@ "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", "dev": true, "requires": { - "is-primitive": "2.0.0" + "is-primitive": "^2.0.0" } }, "is-extendable": { @@ -2405,7 +2628,7 @@ "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", "dev": true, "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "is-fullwidth-code-point": { @@ -2426,7 +2649,7 @@ "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", "dev": true, "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^1.0.0" } }, "is-number": { @@ -2435,33 +2658,16 @@ "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", "dev": true, "requires": { - "kind-of": "3.2.2" - } - }, - "is-odd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-2.0.0.tgz", - "integrity": "sha512-OTiixgpZAT1M4NHgS5IguFp/Vz2VI3U7Goh4/HA1adtwyLtSBrxYlcSYkhpAE07s4fKEcjrFxyvtQBND4vFQyQ==", - "dev": true, - "requires": { - "is-number": "4.0.0" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", - "dev": true - } + "kind-of": "^3.0.2" } }, "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha1-LBY7P6+xtgbZ0Xko8FwqHDjgdnc=", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, "requires": { - "isobject": "3.0.1" + "isobject": "^3.0.1" }, "dependencies": { "isobject": { @@ -2490,7 +2696,7 @@ "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", "dev": true, "requires": { - "has": "1.0.1" + "has": "^1.0.1" } }, "is-stream": { @@ -2519,7 +2725,7 @@ "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha1-0YUOuXkezRjmGCzhKjDzlmNLsZ0=", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", "dev": true }, "isarray": { @@ -2548,90 +2754,46 @@ "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, - "istanbul-api": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/istanbul-api/-/istanbul-api-1.3.1.tgz", - "integrity": "sha1-TDsF0YwAFtECLgebmNyCxA9IiVQ=", - "dev": true, - "requires": { - "async": "2.6.0", - "compare-versions": "3.1.0", - "fileset": "2.0.3", - "istanbul-lib-coverage": "1.2.0", - "istanbul-lib-hook": "1.2.0", - "istanbul-lib-instrument": "1.10.1", - "istanbul-lib-report": "1.1.4", - "istanbul-lib-source-maps": "1.2.4", - "istanbul-reports": "1.3.0", - "js-yaml": "3.11.0", - "mkdirp": "0.5.1", - "once": "1.4.0" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "istanbul-lib-source-maps": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.4.tgz", - "integrity": "sha512-UzuK0g1wyQijiaYQxj/CdNycFhAd2TLtO2obKQMTZrZ1jzEMRY3rvpASEKkaxbRR6brvdovfA03znPa/pXcejg==", - "dev": true, - "requires": { - "debug": "3.1.0", - "istanbul-lib-coverage": "1.2.0", - "mkdirp": "0.5.1", - "rimraf": "2.6.2", - "source-map": "0.5.7" - } - } - } - }, "istanbul-lib-coverage": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.0.tgz", - "integrity": "sha1-99jy5CuX43/nlhFMsPnWi146Q0E=", + "integrity": "sha512-GvgM/uXRwm+gLlvkWHTjDAvwynZkL9ns15calTrmhGgowlwJBbWMYzWbKqE2DT6JDP1AFXKa+Zi0EkqNCUqY0A==", "dev": true }, "istanbul-lib-hook": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-1.2.0.tgz", - "integrity": "sha512-p3En6/oGkFQV55Up8ZPC2oLxvgSxD8CzA0yBrhRZSh3pfv3OFj9aSGVC0yoerAi/O4u7jUVnOGVX1eVFM+0tmQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-1.2.1.tgz", + "integrity": "sha512-eLAMkPG9FU0v5L02lIkcj/2/Zlz9OuluaXikdr5iStk8FDbSwAixTK9TkYxbF0eNnzAJTwM2fkV2A1tpsIp4Jg==", "dev": true, "requires": { - "append-transform": "0.4.0" + "append-transform": "^1.0.0" } }, "istanbul-lib-instrument": { "version": "1.10.1", "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.1.tgz", - "integrity": "sha1-cktLbKzrqGktPx+dByfiecQBr3s=", + "integrity": "sha512-1dYuzkOCbuR5GRJqySuZdsmsNKPL3PTuyPevQfoCXJePT9C8y1ga75neU+Tuy9+yS3G/dgx8wgOmp2KLpgdoeQ==", "dev": true, "requires": { - "babel-generator": "6.26.1", - "babel-template": "6.26.0", - "babel-traverse": "6.26.0", - "babel-types": "6.26.0", - "babylon": "6.18.0", - "istanbul-lib-coverage": "1.2.0", - "semver": "5.5.0" + "babel-generator": "^6.18.0", + "babel-template": "^6.16.0", + "babel-traverse": "^6.18.0", + "babel-types": "^6.18.0", + "babylon": "^6.18.0", + "istanbul-lib-coverage": "^1.2.0", + "semver": "^5.3.0" } }, "istanbul-lib-report": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-1.1.4.tgz", - "integrity": "sha1-6IbN9QXE672OCZ5DlqkNCijirLU=", + "integrity": "sha512-Azqvq5tT0U09nrncK3q82e/Zjkxa4tkFZv7E6VcqP0QCPn6oNljDPfrZEC/umNXds2t7b8sRJfs6Kmpzt8m2kA==", "dev": true, "requires": { - "istanbul-lib-coverage": "1.2.0", - "mkdirp": "0.5.1", - "path-parse": "1.0.5", - "supports-color": "3.2.3" + "istanbul-lib-coverage": "^1.2.0", + "mkdirp": "^0.5.1", + "path-parse": "^1.0.5", + "supports-color": "^3.1.2" }, "dependencies": { "has-flag": { @@ -2646,206 +2808,587 @@ "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", "dev": true, "requires": { - "has-flag": "1.0.0" + "has-flag": "^1.0.0" } } } }, - "istanbul-lib-source-maps": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.3.tgz", - "integrity": "sha1-IPtUsU4Us/tu22rKNXH9IUPbROY=", + "istanbul-reports": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-1.3.0.tgz", + "integrity": "sha512-y2Z2IMqE1gefWUaVjrBm0mSKvUkaBy9Vqz8iwr/r40Y9hBbIteH5wqHG/9DLTfJ9xUnUT2j7A3+VVJ6EaYBllA==", + "dev": true, + "requires": { + "handlebars": "^4.0.3" + } + }, + "jest": { + "version": "22.4.3", + "resolved": "https://registry.npmjs.org/jest/-/jest-22.4.3.tgz", + "integrity": "sha1-ImH0sRfcRtmkoaZz0hUJWN7pLxY=", "dev": true, "requires": { - "debug": "3.1.0", - "istanbul-lib-coverage": "1.2.0", - "mkdirp": "0.5.1", - "rimraf": "2.6.2", - "source-map": "0.5.7" + "import-local": "^1.0.0", + "jest-cli": "^22.4.3" }, "dependencies": { + "cliui": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "dev": true, + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + } + }, "debug": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "dev": true, "requires": { "ms": "2.0.0" } + }, + "jest-cli": { + "version": "22.4.4", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-22.4.4.tgz", + "integrity": "sha512-I9dsgkeyjVEEZj9wrGrqlH+8OlNob9Iptyl+6L5+ToOLJmHm4JwOPatin1b2Bzp5R5YRQJ+oiedx7o1H7wJzhA==", + "dev": true, + "requires": { + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.1", + "exit": "^0.1.2", + "glob": "^7.1.2", + "graceful-fs": "^4.1.11", + "import-local": "^1.0.0", + "is-ci": "^1.0.10", + "istanbul-api": "^1.1.14", + "istanbul-lib-coverage": "^1.1.1", + "istanbul-lib-instrument": "^1.8.0", + "istanbul-lib-source-maps": "^1.2.1", + "jest-changed-files": "^22.2.0", + "jest-config": "^22.4.4", + "jest-environment-jsdom": "^22.4.1", + "jest-get-type": "^22.1.0", + "jest-haste-map": "^22.4.2", + "jest-message-util": "^22.4.0", + "jest-regex-util": "^22.1.0", + "jest-resolve-dependencies": "^22.1.0", + "jest-runner": "^22.4.4", + "jest-runtime": "^22.4.4", + "jest-snapshot": "^22.4.0", + "jest-util": "^22.4.1", + "jest-validate": "^22.4.4", + "jest-worker": "^22.2.2", + "micromatch": "^2.3.11", + "node-notifier": "^5.2.1", + "realpath-native": "^1.0.0", + "rimraf": "^2.5.4", + "slash": "^1.0.0", + "string-length": "^2.0.0", + "strip-ansi": "^4.0.0", + "which": "^1.2.12", + "yargs": "^10.0.3" + }, + "dependencies": { + "ansi-escapes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", + "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", + "dev": true + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "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" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "is-ci": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.0.tgz", + "integrity": "sha512-plgvKjQtalH2P3Gytb7L61Lmz95g2DlpzFiQyRSFew8WoJKxtKRzrZMeyRN2supblm3Psc8OQGy7Xjb6XG11jw==", + "dev": true, + "requires": { + "ci-info": "^1.3.0" + } + }, + "istanbul-api": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/istanbul-api/-/istanbul-api-1.3.1.tgz", + "integrity": "sha512-duj6AlLcsWNwUpfyfHt0nWIeRiZpuShnP40YTxOGQgtaN8fd6JYSxsvxUphTDy8V5MfDXo4s/xVCIIvVCO808g==", + "dev": true, + "requires": { + "async": "^2.1.4", + "compare-versions": "^3.1.0", + "fileset": "^2.0.2", + "istanbul-lib-coverage": "^1.2.0", + "istanbul-lib-hook": "^1.2.0", + "istanbul-lib-instrument": "^1.10.1", + "istanbul-lib-report": "^1.1.4", + "istanbul-lib-source-maps": "^1.2.4", + "istanbul-reports": "^1.3.0", + "js-yaml": "^3.7.0", + "mkdirp": "^0.5.1", + "once": "^1.4.0" + }, + "dependencies": { + "istanbul-lib-source-maps": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.5.tgz", + "integrity": "sha512-8O2T/3VhrQHn0XcJbP1/GN7kXMiRAlPi+fj3uEHrjBD8Oz7Py0prSC25C09NuAZS6bgW1NNKAvCSHZXB0irSGA==", + "dev": true, + "requires": { + "debug": "^3.1.0", + "istanbul-lib-coverage": "^1.2.0", + "mkdirp": "^0.5.1", + "rimraf": "^2.6.1", + "source-map": "^0.5.3" + } + } + } + }, + "istanbul-lib-coverage": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.0.tgz", + "integrity": "sha512-GvgM/uXRwm+gLlvkWHTjDAvwynZkL9ns15calTrmhGgowlwJBbWMYzWbKqE2DT6JDP1AFXKa+Zi0EkqNCUqY0A==", + "dev": true + }, + "istanbul-lib-instrument": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.1.tgz", + "integrity": "sha512-1dYuzkOCbuR5GRJqySuZdsmsNKPL3PTuyPevQfoCXJePT9C8y1ga75neU+Tuy9+yS3G/dgx8wgOmp2KLpgdoeQ==", + "dev": true, + "requires": { + "babel-generator": "^6.18.0", + "babel-template": "^6.16.0", + "babel-traverse": "^6.18.0", + "babel-types": "^6.18.0", + "babylon": "^6.18.0", + "istanbul-lib-coverage": "^1.2.0", + "semver": "^5.3.0" + } + }, + "istanbul-lib-source-maps": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.3.tgz", + "integrity": "sha512-fDa0hwU/5sDXwAklXgAoCJCOsFsBplVQ6WBldz5UwaqOzmDhUK4nfuR7/G//G2lERlblUNJB8P6e8cXq3a7MlA==", + "dev": true, + "requires": { + "debug": "^3.1.0", + "istanbul-lib-coverage": "^1.1.2", + "mkdirp": "^0.5.1", + "rimraf": "^2.6.1", + "source-map": "^0.5.3" + } + }, + "jest-changed-files": { + "version": "22.4.3", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-22.4.3.tgz", + "integrity": "sha512-83Dh0w1aSkUNFhy5d2dvqWxi/y6weDwVVLU6vmK0cV9VpRxPzhTeGimbsbRDSnEoszhF937M4sDLLeS7Cu/Tmw==", + "dev": true, + "requires": { + "throat": "^4.0.0" + } + }, + "jest-config": { + "version": "22.4.4", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-22.4.4.tgz", + "integrity": "sha512-9CKfo1GC4zrXSoMLcNeDvQBfgtqGTB1uP8iDIZ97oB26RCUb886KkKWhVcpyxVDOUxbhN+uzcBCeFe7w+Iem4A==", + "dev": true, + "requires": { + "chalk": "^2.0.1", + "glob": "^7.1.1", + "jest-environment-jsdom": "^22.4.1", + "jest-environment-node": "^22.4.1", + "jest-get-type": "^22.1.0", + "jest-jasmine2": "^22.4.4", + "jest-regex-util": "^22.1.0", + "jest-resolve": "^22.4.2", + "jest-util": "^22.4.1", + "jest-validate": "^22.4.4", + "pretty-format": "^22.4.0" + } + }, + "jest-environment-jsdom": { + "version": "22.4.3", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-22.4.3.tgz", + "integrity": "sha512-FviwfR+VyT3Datf13+ULjIMO5CSeajlayhhYQwpzgunswoaLIPutdbrnfUHEMyJCwvqQFaVtTmn9+Y8WCt6n1w==", + "dev": true, + "requires": { + "jest-mock": "^22.4.3", + "jest-util": "^22.4.3", + "jsdom": "^11.5.1" + } + }, + "jest-get-type": { + "version": "22.4.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-22.4.3.tgz", + "integrity": "sha512-/jsz0Y+V29w1chdXVygEKSz2nBoHoYqNShPe+QgxSNjAuP1i8+k4LbQNrfoliKej0P45sivkSCh7yiD6ubHS3w==", + "dev": true + }, + "jest-haste-map": { + "version": "22.4.3", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-22.4.3.tgz", + "integrity": "sha512-4Q9fjzuPVwnaqGKDpIsCSoTSnG3cteyk2oNVjBX12HHOaF1oxql+uUiqZb5Ndu7g/vTZfdNwwy4WwYogLh29DQ==", + "dev": true, + "requires": { + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.1.11", + "jest-docblock": "^22.4.3", + "jest-serializer": "^22.4.3", + "jest-worker": "^22.4.3", + "micromatch": "^2.3.11", + "sane": "^2.0.0" + } + }, + "jest-message-util": { + "version": "22.4.3", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-22.4.3.tgz", + "integrity": "sha512-iAMeKxhB3Se5xkSjU0NndLLCHtP4n+GtCqV0bISKA5dmOXQfEbdEmYiu2qpnWBDCQdEafNDDU6Q+l6oBMd/+BA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0-beta.35", + "chalk": "^2.0.1", + "micromatch": "^2.3.11", + "slash": "^1.0.0", + "stack-utils": "^1.0.1" + } + }, + "jest-regex-util": { + "version": "22.4.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-22.4.3.tgz", + "integrity": "sha512-LFg1gWr3QinIjb8j833bq7jtQopiwdAs67OGfkPrvy7uNUbVMfTXXcOKXJaeY5GgjobELkKvKENqq1xrUectWg==", + "dev": true + }, + "jest-resolve-dependencies": { + "version": "22.4.3", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-22.4.3.tgz", + "integrity": "sha512-06czCMVToSN8F2U4EvgSB1Bv/56gc7MpCftZ9z9fBgUQM7dzHGCMBsyfVA6dZTx8v0FDcnALf7hupeQxaBCvpA==", + "dev": true, + "requires": { + "jest-regex-util": "^22.4.3" + } + }, + "jest-runner": { + "version": "22.4.4", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-22.4.4.tgz", + "integrity": "sha512-5S/OpB51igQW9xnkM5Tgd/7ZjiAuIoiJAVtvVTBcEBiXBIFzWM3BAMPBM19FX68gRV0KWyFuGKj0EY3M3aceeQ==", + "dev": true, + "requires": { + "exit": "^0.1.2", + "jest-config": "^22.4.4", + "jest-docblock": "^22.4.0", + "jest-haste-map": "^22.4.2", + "jest-jasmine2": "^22.4.4", + "jest-leak-detector": "^22.4.0", + "jest-message-util": "^22.4.0", + "jest-runtime": "^22.4.4", + "jest-util": "^22.4.1", + "jest-worker": "^22.2.2", + "throat": "^4.0.0" + } + }, + "jest-runtime": { + "version": "22.4.4", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-22.4.4.tgz", + "integrity": "sha512-WRTj9m///npte1YjuphCYX7GRY/c2YvJImU9t7qOwFcqHr4YMzmX6evP/3Sehz5DKW2Vi8ONYPCFWe36JVXxfw==", + "dev": true, + "requires": { + "babel-core": "^6.0.0", + "babel-jest": "^22.4.4", + "babel-plugin-istanbul": "^4.1.5", + "chalk": "^2.0.1", + "convert-source-map": "^1.4.0", + "exit": "^0.1.2", + "graceful-fs": "^4.1.11", + "jest-config": "^22.4.4", + "jest-haste-map": "^22.4.2", + "jest-regex-util": "^22.1.0", + "jest-resolve": "^22.4.2", + "jest-util": "^22.4.1", + "jest-validate": "^22.4.4", + "json-stable-stringify": "^1.0.1", + "micromatch": "^2.3.11", + "realpath-native": "^1.0.0", + "slash": "^1.0.0", + "strip-bom": "3.0.0", + "write-file-atomic": "^2.1.0", + "yargs": "^10.0.3" + } + }, + "jest-snapshot": { + "version": "22.4.3", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-22.4.3.tgz", + "integrity": "sha512-JXA0gVs5YL0HtLDCGa9YxcmmV2LZbwJ+0MfyXBBc5qpgkEYITQFJP7XNhcHFbUvRiniRpRbGVfJrOoYhhGE0RQ==", + "dev": true, + "requires": { + "chalk": "^2.0.1", + "jest-diff": "^22.4.3", + "jest-matcher-utils": "^22.4.3", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "pretty-format": "^22.4.3" + } + }, + "jest-util": { + "version": "22.4.3", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-22.4.3.tgz", + "integrity": "sha512-rfDfG8wyC5pDPNdcnAlZgwKnzHvZDu8Td2NJI/jAGKEGxJPYiE4F0ss/gSAkG4778Y23Hvbz+0GMrDJTeo7RjQ==", + "dev": true, + "requires": { + "callsites": "^2.0.0", + "chalk": "^2.0.1", + "graceful-fs": "^4.1.11", + "is-ci": "^1.0.10", + "jest-message-util": "^22.4.3", + "mkdirp": "^0.5.1", + "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 + } + } + }, + "jest-validate": { + "version": "22.4.4", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-22.4.4.tgz", + "integrity": "sha512-dmlf4CIZRGvkaVg3fa0uetepcua44DHtktHm6rcoNVtYlpwe6fEJRkMFsaUVcFHLzbuBJ2cPw9Gl9TKfnzMVwg==", + "dev": true, + "requires": { + "chalk": "^2.0.1", + "jest-config": "^22.4.4", + "jest-get-type": "^22.1.0", + "leven": "^2.1.0", + "pretty-format": "^22.4.0" + } + }, + "jest-worker": { + "version": "22.4.3", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-22.4.3.tgz", + "integrity": "sha512-B1ucW4fI8qVAuZmicFxI1R3kr2fNeYJyvIQ1rKcuLYnenFV5K5aMbxFj6J0i00Ju83S8jP2d7Dz14+AvbIHRYQ==", + "dev": true, + "requires": { + "merge-stream": "^1.0.1" + } + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + } + }, + "node-notifier": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.2.1.tgz", + "integrity": "sha512-MIBs+AAd6dJ2SklbbE8RUDRlIVhU8MaNLh1A9SUZDUHPiZkWLFde6UNwG41yQHZEToHgJMXqyVZ9UcS/ReOVTg==", + "dev": true, + "requires": { + "growly": "^1.3.0", + "semver": "^5.4.1", + "shellwords": "^0.1.1", + "which": "^1.3.0" + } + }, + "realpath-native": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/realpath-native/-/realpath-native-1.0.1.tgz", + "integrity": "sha512-W14EcXuqUvKP8dkWkD7B95iMy77lpMnlFXbbk409bQtNCbeu0kvRE5reo+yIZ3JXxg6frbGsz2DLQ39lrCB40g==", + "dev": true, + "requires": { + "util.promisify": "^1.0.0" + } + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "^7.0.5" + } + }, + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "dev": true + }, + "string-length": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-2.0.0.tgz", + "integrity": "sha1-1A27aGo6zpYMHP/KVivyxF+DY+0=", + "dev": true, + "requires": { + "astral-regex": "^1.0.0", + "strip-ansi": "^4.0.0" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "yargs": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-10.1.2.tgz", + "integrity": "sha512-ivSoxqBGYOqQVruxD35+EyCFDYNEFL/Uo6FcOnz+9xZdZzK0Zzw4r4KhbrME1Oo2gOggwJod2MnsdamSG7H9ig==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.1.1", + "find-up": "^2.1.0", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^8.1.0" + } + } + } } } }, - "istanbul-reports": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-1.3.0.tgz", - "integrity": "sha1-LzIugeHZUgdnWX3KPCCgzOiaNVQ=", - "dev": true, - "requires": { - "handlebars": "4.0.11" - } - }, - "jest": { + "jest-diff": { "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest/-/jest-22.4.3.tgz", - "integrity": "sha1-ImH0sRfcRtmkoaZz0hUJWN7pLxY=", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-22.4.3.tgz", + "integrity": "sha512-/QqGvCDP5oZOF6PebDuLwrB2BMD8ffJv6TAGAdEVuDx1+uEgrHpSFrfrOiMRx2eJ1hgNjlQrOQEHetVwij90KA==", "dev": true, "requires": { - "import-local": "1.0.0", - "jest-cli": "22.4.3" + "chalk": "^2.0.1", + "diff": "^3.2.0", + "jest-get-type": "^22.4.3", + "pretty-format": "^22.4.3" }, "dependencies": { - "jest-cli": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-22.4.3.tgz", - "integrity": "sha512-IiHybF0DJNqZPsbjn4Cy4vcqcmImpoFwNFnkehzVw8lTUSl4axZh5DHewu5bdpZF2Y5gUqFKYzH0FH4Qx2k+UA==", + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-escapes": "3.1.0", - "chalk": "2.3.2", - "exit": "0.1.2", - "glob": "7.1.2", - "graceful-fs": "4.1.11", - "import-local": "1.0.0", - "is-ci": "1.1.0", - "istanbul-api": "1.3.1", - "istanbul-lib-coverage": "1.2.0", - "istanbul-lib-instrument": "1.10.1", - "istanbul-lib-source-maps": "1.2.3", - "jest-changed-files": "22.4.3", - "jest-config": "22.4.3", - "jest-environment-jsdom": "22.4.3", - "jest-get-type": "22.4.3", - "jest-haste-map": "22.4.3", - "jest-message-util": "22.4.3", - "jest-regex-util": "22.4.3", - "jest-resolve-dependencies": "22.4.3", - "jest-runner": "22.4.3", - "jest-runtime": "22.4.3", - "jest-snapshot": "22.4.3", - "jest-util": "22.4.3", - "jest-validate": "22.4.3", - "jest-worker": "22.4.3", - "micromatch": "2.3.11", - "node-notifier": "5.2.1", - "realpath-native": "1.0.0", - "rimraf": "2.6.2", - "slash": "1.0.0", - "string-length": "2.0.0", - "strip-ansi": "4.0.0", - "which": "1.3.0", - "yargs": "10.1.2" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" } } } }, - "jest-changed-files": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-22.4.3.tgz", - "integrity": "sha1-iIIYHgIsOL1GouTRjUTRnZCpD7I=", - "dev": true, - "requires": { - "throat": "4.1.0" - } - }, - "jest-config": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-22.4.3.tgz", - "integrity": "sha512-KSg3EOToCgkX+lIvenKY7J8s426h6ahXxaUFJxvGoEk0562Z6inWj1TnKoGycTASwiLD+6kSYFALcjdosq9KIQ==", - "dev": true, - "requires": { - "chalk": "2.3.2", - "glob": "7.1.2", - "jest-environment-jsdom": "22.4.3", - "jest-environment-node": "22.4.3", - "jest-get-type": "22.4.3", - "jest-jasmine2": "22.4.3", - "jest-regex-util": "22.4.3", - "jest-resolve": "22.4.3", - "jest-util": "22.4.3", - "jest-validate": "22.4.3", - "pretty-format": "22.4.3" - } - }, - "jest-diff": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-22.4.3.tgz", - "integrity": "sha1-4YzD/v8K7vFZ0CMQ8mhtQGU3gDA=", - "dev": true, - "requires": { - "chalk": "2.3.2", - "diff": "3.5.0", - "jest-get-type": "22.4.3", - "pretty-format": "22.4.3" - } - }, "jest-docblock": { "version": "22.4.3", "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-22.4.3.tgz", - "integrity": "sha1-UIhvEytCsoDJA8WSNzu26Tu2ixk=", - "dev": true, - "requires": { - "detect-newline": "2.1.0" - } - }, - "jest-environment-jsdom": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-22.4.3.tgz", - "integrity": "sha1-1n2qQVXjNRauzdNa/YLUq/D6ih4=", + "integrity": "sha512-uPKBEAw7YrEMcXueMKZXn/rbMxBiSv48fSqy3uEnmgOlQhSX+lthBqHb1fKWNVmFqAp9E/RsSdBfiV31LbzaOg==", "dev": true, "requires": { - "jest-mock": "22.4.3", - "jest-util": "22.4.3", - "jsdom": "11.6.2" + "detect-newline": "^2.1.0" } }, "jest-environment-node": { "version": "22.4.3", "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-22.4.3.tgz", - "integrity": "sha1-VMTqo3TIPdUqnah1m+FOvh0LkSk=", + "integrity": "sha512-reZl8XF6t/lMEuPWwo9OLfttyC26A5AMgDyEQ6DBgZuyfyeNUzYT8BFo6uxCCP/Av/b7eb9fTi3sIHFPBzmlRA==", "dev": true, "requires": { - "jest-mock": "22.4.3", - "jest-util": "22.4.3" + "jest-mock": "^22.4.3", + "jest-util": "^22.4.3" } }, "jest-get-type": { "version": "22.4.3", "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-22.4.3.tgz", - "integrity": "sha1-46hQTYR5NC3UQgI2syKGnxiQDOQ=", + "integrity": "sha512-/jsz0Y+V29w1chdXVygEKSz2nBoHoYqNShPe+QgxSNjAuP1i8+k4LbQNrfoliKej0P45sivkSCh7yiD6ubHS3w==", "dev": true }, - "jest-haste-map": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-22.4.3.tgz", - "integrity": "sha1-JYQvoro1AgB2esJ/ZY1YudXC4gs=", - "dev": true, - "requires": { - "fb-watchman": "2.0.0", - "graceful-fs": "4.1.11", - "jest-docblock": "22.4.3", - "jest-serializer": "22.4.3", - "jest-worker": "22.4.3", - "micromatch": "2.3.11", - "sane": "2.5.0" - } - }, "jest-jasmine2": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-22.4.3.tgz", - "integrity": "sha512-yZCPCJUcEY6R5KJB/VReo1AYI2b+5Ky+C+JA1v34jndJsRcLpU4IZX4rFJn7yDTtdNbO/nNqg+3SDIPNH2ecnw==", - "dev": true, - "requires": { - "chalk": "2.3.2", - "co": "4.6.0", - "expect": "22.4.3", - "graceful-fs": "4.1.11", - "is-generator-fn": "1.0.0", - "jest-diff": "22.4.3", - "jest-matcher-utils": "22.4.3", - "jest-message-util": "22.4.3", - "jest-snapshot": "22.4.3", - "jest-util": "22.4.3", - "source-map-support": "0.5.4" + "version": "22.4.4", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-22.4.4.tgz", + "integrity": "sha512-nK3vdUl50MuH7vj/8at7EQVjPGWCi3d5+6aCi7Gxy/XMWdOdbH1qtO/LjKbqD8+8dUAEH+BVVh7HkjpCWC1CSw==", + "dev": true, + "requires": { + "chalk": "^2.0.1", + "co": "^4.6.0", + "expect": "^22.4.0", + "graceful-fs": "^4.1.11", + "is-generator-fn": "^1.0.0", + "jest-diff": "^22.4.0", + "jest-matcher-utils": "^22.4.0", + "jest-message-util": "^22.4.0", + "jest-snapshot": "^22.4.0", + "jest-util": "^22.4.1", + "source-map-support": "^0.5.0" + }, + "dependencies": { + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + } } }, "jest-junit": { @@ -2854,195 +3397,172 @@ "integrity": "sha1-9MQ1jlKGNkpDJNwUq93VJqrfvTg=", "dev": true, "requires": { - "mkdirp": "0.5.1", - "strip-ansi": "4.0.0", - "xml": "1.0.1" + "mkdirp": "^0.5.1", + "strip-ansi": "^4.0.0", + "xml": "^1.0.1" } }, "jest-leak-detector": { "version": "22.4.3", "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-22.4.3.tgz", - "integrity": "sha1-K3smMQOvroxStrkSQaLeQBF+WzU=", + "integrity": "sha512-NZpR/Ls7+ndO57LuXROdgCGz2RmUdC541tTImL9bdUtU3WadgFGm0yV+Ok4Fuia/1rLAn5KaJ+i76L6e3zGJYQ==", "dev": true, "requires": { - "pretty-format": "22.4.3" + "pretty-format": "^22.4.3" } }, "jest-matcher-utils": { "version": "22.4.3", "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-22.4.3.tgz", - "integrity": "sha1-RjL+Qo68c+vBlNPHtl03sWH3EP8=", + "integrity": "sha512-lsEHVaTnKzdAPR5t4B6OcxXo9Vy4K+kRRbG5gtddY8lBEC+Mlpvm1CJcsMESRjzUhzkz568exMV1hTB76nAKbA==", "dev": true, "requires": { - "chalk": "2.3.2", - "jest-get-type": "22.4.3", - "pretty-format": "22.4.3" + "chalk": "^2.0.1", + "jest-get-type": "^22.4.3", + "pretty-format": "^22.4.3" + }, + "dependencies": { + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + } } }, "jest-message-util": { "version": "22.4.3", "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-22.4.3.tgz", - "integrity": "sha1-zz04qv5L792/xFXlfWXVI545nrc=", + "integrity": "sha512-iAMeKxhB3Se5xkSjU0NndLLCHtP4n+GtCqV0bISKA5dmOXQfEbdEmYiu2qpnWBDCQdEafNDDU6Q+l6oBMd/+BA==", "dev": true, "requires": { - "@babel/code-frame": "7.0.0-beta.42", - "chalk": "2.3.2", - "micromatch": "2.3.11", - "slash": "1.0.0", - "stack-utils": "1.0.1" + "@babel/code-frame": "^7.0.0-beta.35", + "chalk": "^2.0.1", + "micromatch": "^2.3.11", + "slash": "^1.0.0", + "stack-utils": "^1.0.1" + }, + "dependencies": { + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + } } }, "jest-mock": { "version": "22.4.3", "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-22.4.3.tgz", - "integrity": "sha1-9jui8HoVEXcs3Hl5czOX33cKq8c=", + "integrity": "sha512-+4R6mH5M1G4NK16CKg9N1DtCaFmuxhcIqF4lQK/Q1CIotqMs/XBemfpDPeVZBFow6iyUNu6EBT9ugdNOTT5o5Q==", "dev": true }, "jest-regex-util": { "version": "22.4.3", "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-22.4.3.tgz", - "integrity": "sha1-qCbrGRzfIlAhmMVAGh/ATenO9a8=", + "integrity": "sha512-LFg1gWr3QinIjb8j833bq7jtQopiwdAs67OGfkPrvy7uNUbVMfTXXcOKXJaeY5GgjobELkKvKENqq1xrUectWg==", "dev": true }, "jest-resolve": { "version": "22.4.3", "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-22.4.3.tgz", - "integrity": "sha1-DOnUOMhDgimqm5FpaOxrBcGrtOo=", - "dev": true, - "requires": { - "browser-resolve": "1.11.2", - "chalk": "2.3.2" - } - }, - "jest-resolve-dependencies": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-22.4.3.tgz", - "integrity": "sha1-4iVqWoRnMtw5acty88mtdyWoGV4=", - "dev": true, - "requires": { - "jest-regex-util": "22.4.3" - } - }, - "jest-runner": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-22.4.3.tgz", - "integrity": "sha512-U7PLlQPRlWNbvOHWOrrVay9sqhBJmiKeAdKIkvX4n1G2tsvzLlf77nBD28GL1N6tGv4RmuTfI8R8JrkvCa+IBg==", + "integrity": "sha512-u3BkD/MQBmwrOJDzDIaxpyqTxYH+XqAXzVJP51gt29H8jpj3QgKof5GGO2uPGKGeA1yTMlpbMs1gIQ6U4vcRhw==", "dev": true, "requires": { - "exit": "0.1.2", - "jest-config": "22.4.3", - "jest-docblock": "22.4.3", - "jest-haste-map": "22.4.3", - "jest-jasmine2": "22.4.3", - "jest-leak-detector": "22.4.3", - "jest-message-util": "22.4.3", - "jest-runtime": "22.4.3", - "jest-util": "22.4.3", - "jest-worker": "22.4.3", - "throat": "4.1.0" - } - }, - "jest-runtime": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-22.4.3.tgz", - "integrity": "sha512-Eat/esQjevhx9BgJEC8udye+FfoJ2qvxAZfOAWshYGS22HydHn5BgsvPdTtt9cp0fSl5LxYOFA1Pja9Iz2Zt8g==", - "dev": true, - "requires": { - "babel-core": "6.26.0", - "babel-jest": "22.4.3", - "babel-plugin-istanbul": "4.1.5", - "chalk": "2.3.2", - "convert-source-map": "1.5.1", - "exit": "0.1.2", - "graceful-fs": "4.1.11", - "jest-config": "22.4.3", - "jest-haste-map": "22.4.3", - "jest-regex-util": "22.4.3", - "jest-resolve": "22.4.3", - "jest-util": "22.4.3", - "jest-validate": "22.4.3", - "json-stable-stringify": "1.0.1", - "micromatch": "2.3.11", - "realpath-native": "1.0.0", - "slash": "1.0.0", - "strip-bom": "3.0.0", - "write-file-atomic": "2.3.0", - "yargs": "10.1.2" + "browser-resolve": "^1.11.2", + "chalk": "^2.0.1" }, "dependencies": { - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } } } }, "jest-serializer": { "version": "22.4.3", "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-22.4.3.tgz", - "integrity": "sha1-pnm4Gn8RHkdmI19PDEbSMO4PdDY=", + "integrity": "sha512-uPaUAppx4VUfJ0QDerpNdF43F68eqKWCzzhUlKNDsUPhjOon7ZehR4C809GCqh765FoMRtTVUVnGvIoskkYHiw==", "dev": true }, "jest-snapshot": { "version": "22.4.3", "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-22.4.3.tgz", - "integrity": "sha1-tcm0KEb/ufrMt2uEExW6Z4hzYtI=", + "integrity": "sha512-JXA0gVs5YL0HtLDCGa9YxcmmV2LZbwJ+0MfyXBBc5qpgkEYITQFJP7XNhcHFbUvRiniRpRbGVfJrOoYhhGE0RQ==", "dev": true, "requires": { - "chalk": "2.3.2", - "jest-diff": "22.4.3", - "jest-matcher-utils": "22.4.3", - "mkdirp": "0.5.1", - "natural-compare": "1.4.0", - "pretty-format": "22.4.3" + "chalk": "^2.0.1", + "jest-diff": "^22.4.3", + "jest-matcher-utils": "^22.4.3", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "pretty-format": "^22.4.3" + }, + "dependencies": { + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + } } }, "jest-util": { "version": "22.4.3", "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-22.4.3.tgz", - "integrity": "sha1-xw/sjuxIfDexCwgJ3AZKfs9qr6w=", + "integrity": "sha512-rfDfG8wyC5pDPNdcnAlZgwKnzHvZDu8Td2NJI/jAGKEGxJPYiE4F0ss/gSAkG4778Y23Hvbz+0GMrDJTeo7RjQ==", "dev": true, "requires": { - "callsites": "2.0.0", - "chalk": "2.3.2", - "graceful-fs": "4.1.11", - "is-ci": "1.1.0", - "jest-message-util": "22.4.3", - "mkdirp": "0.5.1", - "source-map": "0.6.1" + "callsites": "^2.0.0", + "chalk": "^2.0.1", + "graceful-fs": "^4.1.11", + "is-ci": "^1.0.10", + "jest-message-util": "^22.4.3", + "mkdirp": "^0.5.1", + "source-map": "^0.6.0" }, "dependencies": { + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true } } }, - "jest-validate": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-22.4.3.tgz", - "integrity": "sha512-CfFM18W3GSP/xgmA4UouIx0ljdtfD2mjeBC6c89Gg17E44D4tQhAcTrZmf9djvipwU30kSTnk6CzcxdCCeSXfA==", - "dev": true, - "requires": { - "chalk": "2.3.2", - "jest-config": "22.4.3", - "jest-get-type": "22.4.3", - "leven": "2.1.0", - "pretty-format": "22.4.3" - } - }, - "jest-worker": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-22.4.3.tgz", - "integrity": "sha1-XEIUF8uhwKv2S/Vr1ft5aNed1As=", - "dev": true, - "requires": { - "merge-stream": "1.0.1" - } - }, "js-tokens": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", @@ -3050,13 +3570,13 @@ "dev": true }, "js-yaml": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz", - "integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", + "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", "dev": true, "requires": { - "argparse": "1.0.10", - "esprima": "4.0.0" + "argparse": "^1.0.7", + "esprima": "^4.0.0" } }, "jsbn": { @@ -3066,37 +3586,49 @@ "optional": true }, "jsdom": { - "version": "11.6.2", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.6.2.tgz", - "integrity": "sha512-pAeZhpbSlUp5yQcS6cBQJwkbzmv4tWFaYxHbFVSxzXefqjvtRA851Z5N2P+TguVG9YeUDcgb8pdeVQRJh0XR3Q==", - "dev": true, - "requires": { - "abab": "1.0.4", - "acorn": "5.5.3", - "acorn-globals": "4.1.0", - "array-equal": "1.0.0", - "browser-process-hrtime": "0.1.2", - "content-type-parser": "1.0.2", - "cssom": "0.3.2", - "cssstyle": "0.2.37", - "domexception": "1.0.1", - "escodegen": "1.9.1", - "html-encoding-sniffer": "1.0.2", - "left-pad": "1.2.0", - "nwmatcher": "1.4.4", + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.12.0.tgz", + "integrity": "sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw==", + "dev": true, + "requires": { + "abab": "^2.0.0", + "acorn": "^5.5.3", + "acorn-globals": "^4.1.0", + "array-equal": "^1.0.0", + "cssom": ">= 0.3.2 < 0.4.0", + "cssstyle": "^1.0.0", + "data-urls": "^1.0.0", + "domexception": "^1.0.1", + "escodegen": "^1.9.1", + "html-encoding-sniffer": "^1.0.2", + "left-pad": "^1.3.0", + "nwsapi": "^2.0.7", "parse5": "4.0.0", - "pn": "1.1.0", - "request": "2.87.0", - "request-promise-native": "1.0.5", - "sax": "1.2.4", - "symbol-tree": "3.2.2", - "tough-cookie": "2.3.3", - "w3c-hr-time": "1.0.1", - "webidl-conversions": "4.0.2", - "whatwg-encoding": "1.0.3", - "whatwg-url": "6.4.0", - "ws": "4.1.0", - "xml-name-validator": "3.0.0" + "pn": "^1.1.0", + "request": "^2.87.0", + "request-promise-native": "^1.0.5", + "sax": "^1.2.4", + "symbol-tree": "^3.2.2", + "tough-cookie": "^2.3.4", + "w3c-hr-time": "^1.0.1", + "webidl-conversions": "^4.0.2", + "whatwg-encoding": "^1.0.3", + "whatwg-mimetype": "^2.1.0", + "whatwg-url": "^6.4.1", + "ws": "^5.2.0", + "xml-name-validator": "^3.0.0" + }, + "dependencies": { + "tough-cookie": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "dev": true, + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" + } + } } }, "jsesc": { @@ -3119,8 +3651,9 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "dev": true, "requires": { - "jsonify": "0.0.0" + "jsonify": "~0.0.0" } }, "json-stringify-safe": { @@ -3137,7 +3670,8 @@ "jsonify": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", - "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=" + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "dev": true }, "jsprim": { "version": "1.4.1", @@ -3156,7 +3690,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } }, "lazy-cache": { @@ -3172,13 +3706,13 @@ "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", "dev": true, "requires": { - "invert-kv": "1.0.0" + "invert-kv": "^1.0.0" } }, "left-pad": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.2.0.tgz", - "integrity": "sha1-0wpzxrggHY99jnlWupYWCHpo4O4=", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz", + "integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==", "dev": true }, "leven": { @@ -3193,8 +3727,8 @@ "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "dev": true, "requires": { - "prelude-ls": "1.1.2", - "type-check": "0.3.2" + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" } }, "load-json-file": { @@ -3203,11 +3737,22 @@ "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "parse-json": "2.2.0", - "pify": "2.3.0", - "pinkie-promise": "2.0.1", - "strip-bom": "2.0.0" + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + }, + "dependencies": { + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + } } }, "locate-path": { @@ -3216,14 +3761,14 @@ "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", "dev": true, "requires": { - "p-locate": "2.0.0", - "path-exists": "3.0.0" + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" } }, "lodash": { - "version": "4.17.4", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", - "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=" + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" }, "lodash.assign": { "version": "4.2.0", @@ -3248,12 +3793,12 @@ "dev": true }, "loose-envify": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", - "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", "dev": true, "requires": { - "js-tokens": "3.0.2" + "js-tokens": "^3.0.0 || ^4.0.0" } }, "lru-cache": { @@ -3261,8 +3806,8 @@ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.2.tgz", "integrity": "sha512-wgeVXhrDwAWnIF/yZARsFnMBtdFXOg1b8RIrhilp+0iDYN4mdQcNZElDZ0e4B64BhaxeQ5zN7PMyvu7we1kPeQ==", "requires": { - "pseudomap": "1.0.2", - "yallist": "2.1.2" + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" } }, "lrucache": { @@ -3276,7 +3821,7 @@ "integrity": "sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw=", "dev": true, "requires": { - "tmpl": "1.0.4" + "tmpl": "1.0.x" } }, "map-cache": { @@ -3291,16 +3836,22 @@ "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", "dev": true, "requires": { - "object-visit": "1.0.1" + "object-visit": "^1.0.0" } }, + "math-random": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", + "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", + "dev": true + }, "mem": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", "dev": true, "requires": { - "mimic-fn": "1.2.0" + "mimic-fn": "^1.0.0" } }, "merge": { @@ -3315,7 +3866,7 @@ "integrity": "sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE=", "dev": true, "requires": { - "readable-stream": "2.3.5" + "readable-stream": "^2.0.1" } }, "micromatch": { @@ -3324,19 +3875,19 @@ "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", "dev": true, "requires": { - "arr-diff": "2.0.0", - "array-unique": "0.2.1", - "braces": "1.8.5", - "expand-brackets": "0.1.5", - "extglob": "0.3.2", - "filename-regex": "2.0.1", - "is-extglob": "1.0.0", - "is-glob": "2.0.1", - "kind-of": "3.2.2", - "normalize-path": "2.1.1", - "object.omit": "2.0.1", - "parse-glob": "3.0.4", - "regex-cache": "0.4.4" + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" } }, "mime-db": { @@ -3349,22 +3900,22 @@ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz", "integrity": "sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=", "requires": { - "mime-db": "1.30.0" + "mime-db": "~1.30.0" } }, "mimic-fn": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha1-ggyGo5M0ZA6ZUWkovQP8qIBX0CI=", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", "dev": true }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.1.7" } }, "minimist": { @@ -3376,20 +3927,20 @@ "mixin-deep": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha1-pJ5yaNzhoNlpjkUybFYm3zVD0P4=", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", "dev": true, "requires": { - "for-in": "1.0.2", - "is-extendable": "1.0.1" + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" }, "dependencies": { "is-extendable": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha1-p0cPnkJnM9gb2B4RVSZOOjUHyrQ=", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "dev": true, "requires": { - "is-plain-object": "2.0.4" + "is-plain-object": "^2.0.4" } } } @@ -3412,322 +3963,119 @@ "nan": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", - "integrity": "sha1-ltDNYQ69WNS03pzAxoKM2pnHVI8=", + "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", "dev": true, "optional": true }, "nanomatch": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", - "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==", - "dev": true, - "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "fragment-cache": "0.2.1", - "is-odd": "2.0.0", - "is-windows": "1.0.2", - "kind-of": "6.0.2", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { "arr-diff": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha1-ARRrNqYhjmTljzqNZt5df8b20FE=", - "dev": true - } - } - }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true - }, - "nock": { - "version": "9.2.3", - "resolved": "https://registry.npmjs.org/nock/-/nock-9.2.3.tgz", - "integrity": "sha1-OXOAh9agSX06Fl+zUmErOKL5uS8=", - "dev": true, - "requires": { - "chai": "4.1.2", - "debug": "3.1.0", - "deep-equal": "1.0.1", - "json-stringify-safe": "5.0.1", - "lodash": "4.17.10", - "mkdirp": "0.5.1", - "propagate": "1.0.0", - "qs": "6.5.1", - "semver": "5.5.0" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", - "dev": true - } - } - }, - "node-cache": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/node-cache/-/node-cache-3.2.1.tgz", - "integrity": "sha1-p5WNMqikLZEZziWYZWfqLF+WZ3M=", - "requires": { - "clone": "1.0.2", - "lodash": "4.17.4" - } - }, - "node-int64": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", - "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", - "dev": true - }, - "node-notifier": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.2.1.tgz", - "integrity": "sha1-+jE90I9VF9sOJQLldY1mSsafneo=", - "dev": true, - "requires": { - "growly": "1.3.0", - "semver": "5.5.0", - "shellwords": "0.1.1", - "which": "1.3.0" - } - }, - "node-pre-gyp": { - "version": "0.6.39", - "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.6.39.tgz", - "integrity": "sha512-OsJV74qxnvz/AMGgcfZoDaeDXKD3oY3QVIbBmwszTFkRisTSXbMQyn4UWzUMOtA5SVhrBZOTp0wcoSBgfMfMmQ==", - "dev": true, - "optional": true, - "requires": { - "detect-libc": "1.0.2", - "hawk": "3.1.3", - "mkdirp": "0.5.1", - "nopt": "4.0.1", - "npmlog": "4.1.0", - "rc": "1.2.1", - "request": "2.81.0", - "rimraf": "2.6.2", - "semver": "5.5.0", - "tar": "2.2.1", - "tar-pack": "3.4.0" - }, - "dependencies": { - "ajv": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", - "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", - "dev": true, - "optional": true, - "requires": { - "co": "4.6.0", - "json-stable-stringify": "1.0.1" - } - }, - "assert-plus": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", - "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=", - "dev": true, - "optional": true - }, - "aws-sign2": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", - "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=", - "dev": true, - "optional": true - }, - "boom": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", - "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", - "dev": true, - "requires": { - "hoek": "2.16.3" - } - }, - "cryptiles": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", - "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", - "dev": true, - "requires": { - "boom": "2.10.1" - } - }, - "form-data": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", - "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", - "dev": true, - "optional": true, - "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.5", - "mime-types": "2.1.17" - } - }, - "har-schema": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz", - "integrity": "sha1-0mMTX0MwfALGAq/I/pWXDAFRNp4=", - "dev": true, - "optional": true - }, - "har-validator": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz", - "integrity": "sha1-M0gdDxu/9gDdID11gSpqX7oALio=", - "dev": true, - "optional": true, - "requires": { - "ajv": "4.11.8", - "har-schema": "1.0.5" - } - }, - "hawk": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", - "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", - "dev": true, - "requires": { - "boom": "2.10.1", - "cryptiles": "2.0.5", - "hoek": "2.16.3", - "sntp": "1.0.9" - } - }, - "hoek": { - "version": "2.16.3", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", - "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", - "dev": true - }, - "http-signature": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", - "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", - "dev": true, - "optional": true, - "requires": { - "assert-plus": "0.2.0", - "jsprim": "1.4.1", - "sshpk": "1.13.1" - } - }, - "performance-now": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz", - "integrity": "sha1-M+8wxcd9TqIcWlOGnZG1bY8lVeU=", - "dev": true, - "optional": true + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true }, - "qs": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", - "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=", - "dev": true, - "optional": true + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true }, - "request": { - "version": "2.81.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz", - "integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA=", + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "nock": { + "version": "9.2.3", + "resolved": "https://registry.npmjs.org/nock/-/nock-9.2.3.tgz", + "integrity": "sha1-OXOAh9agSX06Fl+zUmErOKL5uS8=", + "dev": true, + "requires": { + "chai": "^4.1.2", + "debug": "^3.1.0", + "deep-equal": "^1.0.0", + "json-stringify-safe": "^5.0.1", + "lodash": "^4.17.5", + "mkdirp": "^0.5.0", + "propagate": "^1.0.0", + "qs": "^6.5.1", + "semver": "^5.5.0" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=", "dev": true, - "optional": true, "requires": { - "aws-sign2": "0.6.0", - "aws4": "1.6.0", - "caseless": "0.12.0", - "combined-stream": "1.0.5", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.1.4", - "har-validator": "4.2.1", - "hawk": "3.1.3", - "http-signature": "1.1.1", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.17", - "oauth-sign": "0.8.2", - "performance-now": "0.2.0", - "qs": "6.4.0", - "safe-buffer": "5.1.1", - "stringstream": "0.0.5", - "tough-cookie": "2.3.3", - "tunnel-agent": "0.6.0", - "uuid": "3.1.0" + "ms": "2.0.0" } }, - "sntp": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", - "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", - "dev": true, - "requires": { - "hoek": "2.16.3" - } + "lodash": { + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "dev": true } } }, + "node-cache": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/node-cache/-/node-cache-3.2.1.tgz", + "integrity": "sha1-p5WNMqikLZEZziWYZWfqLF+WZ3M=", + "requires": { + "clone": "1.0.x", + "lodash": "4.x" + } + }, + "node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", + "dev": true + }, "node-sha1": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/node-sha1/-/node-sha1-0.0.1.tgz", "integrity": "sha1-VmL8eZ8cPJXZPjAV3QSAZVFJhdM=" }, - "nopt": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", - "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", - "dev": true, - "optional": true, - "requires": { - "abbrev": "1.1.0", - "osenv": "0.1.4" - } - }, "normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha1-EvlaMH1YNSB1oEkHuErIvpisAS8=", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", "dev": true, "requires": { - "hosted-git-info": "2.6.0", - "is-builtin-module": "1.0.0", - "semver": "5.5.0", - "validate-npm-package-license": "3.0.3" + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" } }, "normalize-path": { @@ -3736,7 +4084,7 @@ "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", "dev": true, "requires": { - "remove-trailing-separator": "1.1.0" + "remove-trailing-separator": "^1.0.1" } }, "npm-run-path": { @@ -3745,31 +4093,19 @@ "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", "dev": true, "requires": { - "path-key": "2.0.1" - } - }, - "npmlog": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.0.tgz", - "integrity": "sha512-ocolIkZYZt8UveuiDS0yAkkIjid1o7lPG8cYm05yNYzBn8ykQtaiPMEGp8fY9tKdDgm8okpdKzkvu1y9hUYugA==", - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "1.1.4", - "console-control-strings": "1.1.0", - "gauge": "2.7.4", - "set-blocking": "2.0.0" + "path-key": "^2.0.0" } }, "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true }, - "nwmatcher": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/nwmatcher/-/nwmatcher-1.4.4.tgz", - "integrity": "sha512-3iuY4N5dhgMpCUrOVnuAdGrgxVqV2cJpM+XNccjR2DKOB1RUP0aA+wGXEiNziG/UKboFyGBIoKOaNlJxx8bciQ==", + "nwsapi": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.0.8.tgz", + "integrity": "sha512-7RZ+qbFGiVc6v14Y8DSZjPN1wZPOaMbiiP4tzf5eNuyOITAeOIA3cMhjuKUypVIqBgCSg1KaSyAv8Ocq/0ZJ1A==", "dev": true }, "oauth-sign": { @@ -3789,9 +4125,9 @@ "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", "dev": true, "requires": { - "copy-descriptor": "0.1.1", - "define-property": "0.2.5", - "kind-of": "3.2.2" + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" }, "dependencies": { "define-property": { @@ -3800,52 +4136,15 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "0.1.6" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } + "is-descriptor": "^0.1.0" } } } }, "object-keys": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz", - "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=", + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", + "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", "dev": true }, "object-visit": { @@ -3854,7 +4153,7 @@ "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", "dev": true, "requires": { - "isobject": "3.0.1" + "isobject": "^3.0.0" }, "dependencies": { "isobject": { @@ -3871,8 +4170,8 @@ "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", "dev": true, "requires": { - "define-properties": "1.1.2", - "es-abstract": "1.11.0" + "define-properties": "^1.1.2", + "es-abstract": "^1.5.1" } }, "object.omit": { @@ -3881,8 +4180,8 @@ "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", "dev": true, "requires": { - "for-own": "0.1.5", - "is-extendable": "0.1.1" + "for-own": "^0.1.4", + "is-extendable": "^0.1.1" } }, "object.pick": { @@ -3891,7 +4190,7 @@ "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", "dev": true, "requires": { - "isobject": "3.0.1" + "isobject": "^3.0.1" }, "dependencies": { "isobject": { @@ -3908,7 +4207,7 @@ "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } }, "optimist": { @@ -3917,8 +4216,8 @@ "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", "dev": true, "requires": { - "minimist": "0.0.8", - "wordwrap": "0.0.3" + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" } }, "optionator": { @@ -3927,12 +4226,12 @@ "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", "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", - "wordwrap": "1.0.0" + "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" }, "dependencies": { "wordwrap": { @@ -3952,12 +4251,12 @@ "os-locale": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", - "integrity": "sha1-QrwpAKa1uL0XN2yOiCtlr8zyS/I=", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", "dev": true, "requires": { - "execa": "0.7.0", - "lcid": "1.0.0", - "mem": "1.1.0" + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" } }, "os-tmpdir": { @@ -3966,17 +4265,6 @@ "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, - "osenv": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz", - "integrity": "sha1-Qv5tWVPfBsgGS+bxdsPQWqqjRkQ=", - "dev": true, - "optional": true, - "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" - } - }, "p-finally": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", @@ -3989,7 +4277,7 @@ "integrity": "sha512-Y/OtIaXtUPr4/YpMv1pCL5L5ed0rumAaAeBSj12F+bSlMdys7i8oQF/GUJmfpTS/QoaRrS/k6pma29haJpsMng==", "dev": true, "requires": { - "p-try": "1.0.0" + "p-try": "^1.0.0" } }, "p-locate": { @@ -3998,7 +4286,7 @@ "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "dev": true, "requires": { - "p-limit": "1.2.0" + "p-limit": "^1.1.0" } }, "p-try": { @@ -4013,10 +4301,10 @@ "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", "dev": true, "requires": { - "glob-base": "0.3.0", - "is-dotfile": "1.0.3", - "is-extglob": "1.0.0", - "is-glob": "2.0.1" + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" } }, "parse-json": { @@ -4025,13 +4313,13 @@ "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", "dev": true, "requires": { - "error-ex": "1.3.1" + "error-ex": "^1.2.0" } }, "parse5": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", - "integrity": "sha1-bXhlbj2o14tOwLkG98CO8d/j9gg=", + "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==", "dev": true }, "pascalcase": { @@ -4059,9 +4347,9 @@ "dev": true }, "path-parse": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", - "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, "path-type": { @@ -4070,9 +4358,9 @@ "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" } }, "pathval": { @@ -4104,7 +4392,7 @@ "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "dev": true, "requires": { - "pinkie": "2.0.4" + "pinkie": "^2.0.0" } }, "pkg-dir": { @@ -4113,13 +4401,13 @@ "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", "dev": true, "requires": { - "find-up": "2.1.0" + "find-up": "^2.1.0" } }, "pn": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", - "integrity": "sha1-4vTO8OIZ9GPBeas3Rj5OHs3Muvs=", + "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==", "dev": true }, "posix-character-classes": { @@ -4143,11 +4431,11 @@ "pretty-format": { "version": "22.4.3", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-22.4.3.tgz", - "integrity": "sha1-+HPXgIOanALpZkyKCC6e556qwW8=", + "integrity": "sha512-S4oT9/sT6MN7/3COoOy+ZJeA92VmOnveLHgrwBE3Z1W5N9S2A1QGNYiE1z75DAENbJrXXUb+OWXhpJcg05QKQQ==", "dev": true, "requires": { - "ansi-regex": "3.0.0", - "ansi-styles": "3.2.1" + "ansi-regex": "^3.0.0", + "ansi-styles": "^3.2.0" }, "dependencies": { "ansi-regex": { @@ -4161,13 +4449,13 @@ "private": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", - "integrity": "sha1-I4Hts2ifelPWUxkAYPz4ItLzaP8=", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", "dev": true }, "process-nextick-args": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha1-o31zL0JxtKsa0HDTVQjoKQeI/6o=", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "dev": true }, "propagate": { @@ -4181,6 +4469,12 @@ "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" }, + "psl": { + "version": "1.1.29", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", + "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==", + "dev": true + }, "punycode": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", @@ -4192,65 +4486,27 @@ "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" }, "randomatic": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", - "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.0.tgz", + "integrity": "sha512-KnGPVE0lo2WoXxIZ7cPR8YBpiol4gsSuOwDSg410oHh80ZMp5EiypNqL2K4Z77vJn6lB5rap7IkAmcUlalcnBQ==", "dev": true, "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" + "is-number": "^4.0.0", + "kind-of": "^6.0.0", + "math-random": "^1.0.1" }, "dependencies": { "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.2.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.6" - } - } - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true }, "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "rc": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.1.tgz", - "integrity": "sha1-LgPo5C7kULjLPc5lvhv4l04d/ZU=", - "dev": true, - "optional": true, - "requires": { - "deep-extend": "0.4.2", - "ini": "1.3.4", - "minimist": "1.2.0", - "strip-json-comments": "2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true, - "optional": true + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true } } }, @@ -4260,9 +4516,9 @@ "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", "dev": true, "requires": { - "load-json-file": "1.1.0", - "normalize-package-data": "2.4.0", - "path-type": "1.1.0" + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" } }, "read-pkg-up": { @@ -4271,8 +4527,8 @@ "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", "dev": true, "requires": { - "find-up": "1.1.2", - "read-pkg": "1.1.0" + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" }, "dependencies": { "find-up": { @@ -4281,8 +4537,8 @@ "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", "dev": true, "requires": { - "path-exists": "2.1.0", - "pinkie-promise": "2.0.1" + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" } }, "path-exists": { @@ -4291,33 +4547,24 @@ "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", "dev": true, "requires": { - "pinkie-promise": "2.0.1" + "pinkie-promise": "^2.0.0" } } } }, "readable-stream": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.5.tgz", - "integrity": "sha512-tK0yDhrkygt/knjowCUiWP9YdV7c5R+8cR0r/kt9ZhBU906Fs6RpQJCEilamRJj1Nx2rWI6LkW9gKqjTkshhEw==", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.1", - "string_decoder": "1.0.3", - "util-deprecate": "1.0.2" - } - }, - "realpath-native": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/realpath-native/-/realpath-native-1.0.0.tgz", - "integrity": "sha512-XJtlRJ9jf0E1H1SLeJyQ9PGzQD7S65h1pRXEcAeK48doKOnKxcgPeNohJvD5u/2sI9J1oke6E8bZHS/fmW1UiQ==", + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { - "util.promisify": "1.0.0" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, "redis": { @@ -4325,9 +4572,9 @@ "resolved": "https://registry.npmjs.org/redis/-/redis-2.8.0.tgz", "integrity": "sha1-ICKI4/WMSfYHnZevehDhMDrhSwI=", "requires": { - "double-ended-queue": "2.1.0-0", - "redis-commands": "1.3.1", - "redis-parser": "2.6.0" + "double-ended-queue": "^2.1.0-0", + "redis-commands": "^1.2.0", + "redis-parser": "^2.6.0" } }, "redis-commands": { @@ -4343,26 +4590,26 @@ "regenerator-runtime": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha1-vgWtf5v30i4Fb5cmzuUBf78Z4uk=", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", "dev": true }, "regex-cache": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha1-db3FiioUls7EihKDW8VMjVYjNt0=", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", "dev": true, "requires": { - "is-equal-shallow": "0.1.3" + "is-equal-shallow": "^0.1.3" } }, "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha1-H07OJ+ALC2XgJHpoEOaoXYOldSw=", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", "dev": true, "requires": { - "extend-shallow": "3.0.2", - "safe-regex": "1.1.0" + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" } }, "remove-trailing-separator": { @@ -4372,9 +4619,9 @@ "dev": true }, "repeat-element": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", - "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", "dev": true }, "repeat-string": { @@ -4389,7 +4636,7 @@ "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", "dev": true, "requires": { - "is-finite": "1.0.2" + "is-finite": "^1.0.0" } }, "request": { @@ -4397,26 +4644,26 @@ "resolved": "https://registry.npmjs.org/request/-/request-2.87.0.tgz", "integrity": "sha1-MvACNc0I1IK00NaNuTqCnA7VdW4=", "requires": { - "aws-sign2": "0.7.0", - "aws4": "1.6.0", - "caseless": "0.12.0", - "combined-stream": "1.0.5", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.3.2", - "har-validator": "5.0.3", - "http-signature": "1.2.0", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.17", - "oauth-sign": "0.8.2", - "performance-now": "2.1.0", - "qs": "6.5.1", - "safe-buffer": "5.1.1", - "tough-cookie": "2.3.3", - "tunnel-agent": "0.6.0", - "uuid": "3.1.0" + "aws-sign2": "~0.7.0", + "aws4": "^1.6.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.1", + "forever-agent": "~0.6.1", + "form-data": "~2.3.1", + "har-validator": "~5.0.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.17", + "oauth-sign": "~0.8.2", + "performance-now": "^2.1.0", + "qs": "~6.5.1", + "safe-buffer": "^5.1.1", + "tough-cookie": "~2.3.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.1.0" } }, "request-etag": { @@ -4424,10 +4671,10 @@ "resolved": "https://registry.npmjs.org/request-etag/-/request-etag-2.0.3.tgz", "integrity": "sha1-E8kjdhfWxYnrcYX29FC4MTBovBc=", "requires": { - "lodash.assign": "4.2.0", - "lodash.clonedeep": "4.5.0", - "lru-cache": "4.1.2", - "request": "2.87.0" + "lodash.assign": "^4.0.0", + "lodash.clonedeep": "^4.0.1", + "lru-cache": "^4.0.0", + "request": "^2.67.0" } }, "request-promise-core": { @@ -4436,7 +4683,7 @@ "integrity": "sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY=", "dev": true, "requires": { - "lodash": "4.17.4" + "lodash": "^4.13.1" } }, "request-promise-native": { @@ -4446,8 +4693,8 @@ "dev": true, "requires": { "request-promise-core": "1.1.1", - "stealthy-require": "1.1.1", - "tough-cookie": "2.3.3" + "stealthy-require": "^1.1.0", + "tough-cookie": ">=2.3.3" } }, "require-directory": { @@ -4474,7 +4721,7 @@ "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", "dev": true, "requires": { - "resolve-from": "3.0.0" + "resolve-from": "^3.0.0" } }, "resolve-from": { @@ -4492,7 +4739,7 @@ "ret": { "version": "0.1.15", "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha1-uKSCXVvbH8P29Twrwz+BOIaBx7w=", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", "dev": true }, "right-align": { @@ -4502,17 +4749,14 @@ "dev": true, "optional": true, "requires": { - "align-text": "0.1.4" + "align-text": "^0.1.1" } }, - "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha1-LtgVDSShbqhlHm1u8PR8QVjOejY=", - "dev": true, - "requires": { - "glob": "7.1.2" - } + "rsvp": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-3.6.2.tgz", + "integrity": "sha512-OfWGQTb9vnwRjwtA2QwpG2ICclHC3pgXZO5xt8H2EfgDquO0qVdSb5T88L4qJVAEugbS56pAuV4XZM58UX8ulw==", + "dev": true }, "safe-buffer": { "version": "5.1.1", @@ -4525,23 +4769,29 @@ "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "dev": true, "requires": { - "ret": "0.1.15" + "ret": "~0.1.10" } }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, "sane": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/sane/-/sane-2.5.0.tgz", - "integrity": "sha512-glfKd7YH4UCrh/7dD+UESsr8ylKWRE7UQPoXuz28FgmcF0ViJQhCTCCZHICRKxf8G8O1KdLEn20dcICK54c7ew==", - "dev": true, - "requires": { - "anymatch": "2.0.0", - "exec-sh": "0.2.1", - "fb-watchman": "2.0.0", - "fsevents": "1.1.3", - "micromatch": "3.1.10", - "minimist": "1.2.0", - "walker": "1.0.7", - "watch": "0.18.0" + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/sane/-/sane-2.5.2.tgz", + "integrity": "sha1-tNwYYcIbQn6SlQej51HiosuKs/o=", + "dev": true, + "requires": { + "anymatch": "^2.0.0", + "capture-exit": "^1.2.0", + "exec-sh": "^0.2.0", + "fb-watchman": "^2.0.0", + "fsevents": "^1.2.3", + "micromatch": "^3.1.4", + "minimist": "^1.1.1", + "walker": "~1.0.5", + "watch": "~0.18.0" }, "dependencies": { "arr-diff": { @@ -4557,41 +4807,30 @@ "dev": true }, "braces": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.1.tgz", - "integrity": "sha512-SO5lYHA3vO6gz66erVvedSCkp7AKWdv6VcQ2N4ysXfPxdAlxAMMAdwegGGcv1Bqwm7naF1hNdk5d6AAIEHV2nQ==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "dev": true, "requires": { - "arr-flatten": "1.1.0", - "array-unique": "0.3.2", - "define-property": "1.0.0", - "extend-shallow": "2.0.1", - "fill-range": "4.0.0", - "isobject": "3.0.1", - "kind-of": "6.0.2", - "repeat-element": "1.1.2", - "snapdragon": "0.8.2", - "snapdragon-node": "2.1.1", - "split-string": "3.1.0", - "to-regex": "3.0.2" + "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": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "1.0.2" - } - }, "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.1" + "is-extendable": "^0.1.0" } } } @@ -4602,13 +4841,13 @@ "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", "dev": true, "requires": { - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "posix-character-classes": "0.1.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { "define-property": { @@ -4617,7 +4856,7 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } }, "extend-shallow": { @@ -4626,24 +4865,64 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "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" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "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" + } + } } }, "is-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha1-Nm2CQN3kh8pRgjsaufB6EKeCUco=", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "dev": true, "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" } }, "kind-of": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha1-cpyR4thXt6QZofmqZWhcTDP1hF0=", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", "dev": true } } @@ -4651,17 +4930,17 @@ "extglob": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha1-rQD+TcYSqSMuhxhxHcXLWrAoVUM=", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", "dev": true, "requires": { - "array-unique": "0.3.2", - "define-property": "1.0.0", - "expand-brackets": "2.1.4", - "extend-shallow": "2.0.1", - "fragment-cache": "0.2.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { "define-property": { @@ -4670,7 +4949,7 @@ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { - "is-descriptor": "1.0.2" + "is-descriptor": "^1.0.0" } }, "extend-shallow": { @@ -4679,7 +4958,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -4690,10 +4969,10 @@ "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.1" + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" }, "dependencies": { "extend-shallow": { @@ -4702,49 +4981,38 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } }, "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { - "kind-of": "3.2.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.6" - } - } + "kind-of": "^6.0.0" } }, "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "kind-of": "3.2.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.6" - } - } + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } }, "is-number": { @@ -4753,7 +5021,7 @@ "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -4762,7 +5030,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -4776,28 +5044,28 @@ "kind-of": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha1-ARRrNqYhjmTljzqNZt5df8b20FE=", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", "dev": true }, "micromatch": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha1-cIWbyVyYQJUvNZoGij/En57PrCM=", + "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.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "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" } }, "minimist": { @@ -4811,7 +5079,7 @@ "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha1-KBYjTiN4vdxOU1T6tcqold9xANk=", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "dev": true }, "semver": { @@ -4828,13 +5096,13 @@ "set-value": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha1-ca5KiPD+77v1LR6mBPP7MV67YnQ=", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", "dev": true, "requires": { - "extend-shallow": "2.0.1", - "is-extendable": "0.1.1", - "is-plain-object": "2.0.4", - "split-string": "3.1.0" + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" }, "dependencies": { "extend-shallow": { @@ -4843,7 +5111,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -4854,7 +5122,7 @@ "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "dev": true, "requires": { - "shebang-regex": "1.0.0" + "shebang-regex": "^1.0.0" } }, "shebang-regex": { @@ -4866,7 +5134,7 @@ "shellwords": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", - "integrity": "sha1-1rkYHBpI05cyTISHHvvPxz/AZUs=", + "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", "dev": true }, "signal-exit": { @@ -4881,108 +5149,51 @@ "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", "dev": true }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha1-ZJIufFZbDhQgS6GqfWlkJ40lGC0=", - "dev": true, - "requires": { - "base": "0.11.2", - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "map-cache": "0.2.2", - "source-map": "0.5.7", - "source-map-resolve": "0.5.1", - "use": "3.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "0.1.6" - } - }, - "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.1" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "3.2.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.6" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "kind-of": "3.2.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.6" - } - } + "is-descriptor": "^0.1.0" } }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "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-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" + "is-extendable": "^0.1.0" } - }, - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true } } }, "snapdragon-node": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha1-bBdfhv8UvbByRWPo88GwIaKGhTs=", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", "dev": true, "requires": { - "define-property": "1.0.0", - "isobject": "3.0.1", - "snapdragon-util": "3.0.1" + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" }, "dependencies": { "define-property": { @@ -4991,7 +5202,36 @@ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { - "is-descriptor": "1.0.2" + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } }, "isobject": { @@ -4999,16 +5239,22 @@ "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true } } }, "snapdragon-util": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha1-+VZHlIbyrNeXAGk/b3uAXkWrVuI=", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.2.0" } }, "source-map": { @@ -5018,31 +5264,32 @@ "dev": true }, "source-map-resolve": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.1.tgz", - "integrity": "sha512-0KW2wvzfxm8NCTb30z0LMNyPqWCdDGE2viwzUaucqJdkTRXtZiSY3I+2A6nVAjmdOy0I4gU8DwnVVGsk9jvP2A==", + "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==", "dev": true, "requires": { - "atob": "2.1.0", - "decode-uri-component": "0.2.0", - "resolve-url": "0.2.1", - "source-map-url": "0.4.0", - "urix": "0.1.0" + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" } }, "source-map-support": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.4.tgz", - "integrity": "sha512-PETSPG6BjY1AHs2t64vS2aqAgu6dMIMXJULWFBGbh2Gr8nVLbCFDo6i/RMMvviIQ2h1Z8+5gQhVKSn2je9nmdg==", + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.9.tgz", + "integrity": "sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA==", "dev": true, "requires": { - "source-map": "0.6.1" + "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": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true } } @@ -5056,42 +5303,42 @@ "spdx-correct": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", - "integrity": "sha1-BaW01xU6GVvJLDxCW2nzsqlSTII=", + "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", "dev": true, "requires": { - "spdx-expression-parse": "3.0.0", - "spdx-license-ids": "3.0.0" + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" } }, "spdx-exceptions": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", - "integrity": "sha1-LHrmEFbHFKW5ubKyr30xHvXHj+k=", + "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", "dev": true }, "spdx-expression-parse": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha1-meEZt6XaAOBUkcn6M4t5BII7QdA=", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", "dev": true, "requires": { - "spdx-exceptions": "2.1.0", - "spdx-license-ids": "3.0.0" + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" } }, "spdx-license-ids": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", - "integrity": "sha1-enzShHDMbToc/m1miG9rxDDTrIc=", + "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", "dev": true }, "split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha1-fLCd2jqGWFcFxks5pkZgOGguj+I=", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", "dev": true, "requires": { - "extend-shallow": "3.0.2" + "extend-shallow": "^3.0.0" } }, "sprintf-js": { @@ -5101,18 +5348,19 @@ "dev": true }, "sshpk": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", - "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", + "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", "requires": { - "asn1": "0.2.3", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.1", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.1", - "getpass": "0.1.7", - "jsbn": "0.1.1", - "tweetnacl": "0.14.5" + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" } }, "stack-trace": { @@ -5132,8 +5380,8 @@ "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", "dev": true, "requires": { - "define-property": "0.2.5", - "object-copy": "0.1.0" + "define-property": "^0.2.5", + "object-copy": "^0.1.0" }, "dependencies": { "define-property": { @@ -5142,65 +5390,8 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "0.1.6" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "3.2.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.6" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "3.2.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.6" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" + "is-descriptor": "^0.1.0" } - }, - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true } } }, @@ -5210,47 +5401,32 @@ "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", "dev": true }, - "string-length": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/string-length/-/string-length-2.0.0.tgz", - "integrity": "sha1-1A27aGo6zpYMHP/KVivyxF+DY+0=", - "dev": true, - "requires": { - "astral-regex": "1.0.0", - "strip-ansi": "4.0.0" - } - }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" } }, "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "~5.1.0" } }, - "stringstream": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", - "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=" - }, "strip-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { - "ansi-regex": "3.0.0" + "ansi-regex": "^3.0.0" }, "dependencies": { "ansi-regex": { @@ -5262,13 +5438,10 @@ } }, "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "requires": { - "is-utf8": "0.2.1" - } + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true }, "strip-eof": { "version": "1.0.0", @@ -5276,20 +5449,13 @@ "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true, - "optional": true - }, "supports-color": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", - "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { - "has-flag": "3.0.0" + "has-flag": "^3.0.0" } }, "symbol-tree": { @@ -5298,45 +5464,17 @@ "integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=", "dev": true }, - "tar": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", - "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", - "dev": true, - "requires": { - "block-stream": "0.0.9", - "fstream": "1.0.11", - "inherits": "2.0.3" - } - }, - "tar-pack": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/tar-pack/-/tar-pack-3.4.0.tgz", - "integrity": "sha1-I74tf2cagzk3bL2wuP4/3r8xeYQ=", - "dev": true, - "optional": true, - "requires": { - "debug": "2.6.9", - "fstream": "1.0.11", - "fstream-ignore": "1.0.5", - "once": "1.4.0", - "readable-stream": "2.3.5", - "rimraf": "2.6.2", - "tar": "2.2.1", - "uid-number": "0.0.6" - } - }, "test-exclude": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-4.2.1.tgz", - "integrity": "sha1-36Ii8DSAvKaSB8pyizfXS0X3JPo=", + "integrity": "sha512-qpqlP/8Zl+sosLxBcVKl9vYy26T9NPalxSzzCP/OY6K7j938ui2oKgo+kRZYfxAeIpLqpbVnsHq1tyV70E4lWQ==", "dev": true, "requires": { - "arrify": "1.0.1", - "micromatch": "3.1.10", - "object-assign": "4.1.1", - "read-pkg-up": "1.0.1", - "require-main-filename": "1.0.1" + "arrify": "^1.0.1", + "micromatch": "^3.1.8", + "object-assign": "^4.1.0", + "read-pkg-up": "^1.0.1", + "require-main-filename": "^1.0.1" }, "dependencies": { "arr-diff": { @@ -5352,41 +5490,30 @@ "dev": true }, "braces": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.1.tgz", - "integrity": "sha512-SO5lYHA3vO6gz66erVvedSCkp7AKWdv6VcQ2N4ysXfPxdAlxAMMAdwegGGcv1Bqwm7naF1hNdk5d6AAIEHV2nQ==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "dev": true, "requires": { - "arr-flatten": "1.1.0", - "array-unique": "0.3.2", - "define-property": "1.0.0", - "extend-shallow": "2.0.1", - "fill-range": "4.0.0", - "isobject": "3.0.1", - "kind-of": "6.0.2", - "repeat-element": "1.1.2", - "snapdragon": "0.8.2", - "snapdragon-node": "2.1.1", - "split-string": "3.1.0", - "to-regex": "3.0.2" + "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": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "1.0.2" - } - }, "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.1" + "is-extendable": "^0.1.0" } } } @@ -5397,13 +5524,13 @@ "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", "dev": true, "requires": { - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "posix-character-classes": "0.1.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { "define-property": { @@ -5412,7 +5539,7 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } }, "extend-shallow": { @@ -5421,24 +5548,64 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "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" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "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" + } + } } }, "is-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha1-Nm2CQN3kh8pRgjsaufB6EKeCUco=", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "dev": true, "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" } }, "kind-of": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha1-cpyR4thXt6QZofmqZWhcTDP1hF0=", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", "dev": true } } @@ -5446,17 +5613,17 @@ "extglob": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha1-rQD+TcYSqSMuhxhxHcXLWrAoVUM=", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", "dev": true, "requires": { - "array-unique": "0.3.2", - "define-property": "1.0.0", - "expand-brackets": "2.1.4", - "extend-shallow": "2.0.1", - "fragment-cache": "0.2.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { "define-property": { @@ -5465,7 +5632,7 @@ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { - "is-descriptor": "1.0.2" + "is-descriptor": "^1.0.0" } }, "extend-shallow": { @@ -5474,7 +5641,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -5485,10 +5652,10 @@ "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.1" + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" }, "dependencies": { "extend-shallow": { @@ -5497,49 +5664,38 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } }, "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { - "kind-of": "3.2.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.6" - } - } + "kind-of": "^6.0.0" } }, "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "kind-of": "3.2.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.6" - } - } + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } }, "is-number": { @@ -5548,7 +5704,7 @@ "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -5557,7 +5713,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -5571,28 +5727,28 @@ "kind-of": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha1-ARRrNqYhjmTljzqNZt5df8b20FE=", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", "dev": true }, "micromatch": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha1-cIWbyVyYQJUvNZoGij/En57PrCM=", + "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.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "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" } } } @@ -5621,19 +5777,19 @@ "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" } }, "to-regex": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha1-E8/dmzNlUvMLUfM6iuG0Knp1mc4=", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", "dev": true, "requires": { - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "regex-not": "1.0.2", - "safe-regex": "1.1.0" + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" } }, "to-regex-range": { @@ -5642,8 +5798,8 @@ "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", "dev": true, "requires": { - "is-number": "3.0.0", - "repeat-string": "1.6.1" + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" }, "dependencies": { "is-number": { @@ -5652,7 +5808,7 @@ "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" } } } @@ -5662,7 +5818,7 @@ "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz", "integrity": "sha1-C2GKVWW23qkL80JdBNVe3EdadWE=", "requires": { - "punycode": "1.4.1" + "punycode": "^1.4.1" } }, "tr46": { @@ -5671,13 +5827,13 @@ "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", "dev": true, "requires": { - "punycode": "2.1.0" + "punycode": "^2.1.0" }, "dependencies": { "punycode": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.0.tgz", - "integrity": "sha1-X4Y+3Im5bbCQdLrXlHvwkFbKTn0=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true } } @@ -5697,7 +5853,7 @@ "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "^5.0.1" } }, "tweetnacl": { @@ -5712,7 +5868,7 @@ "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "dev": true, "requires": { - "prelude-ls": "1.1.2" + "prelude-ls": "~1.1.2" } }, "type-detect": { @@ -5728,24 +5884,9 @@ "dev": true, "optional": true, "requires": { - "source-map": "0.5.7", - "uglify-to-browserify": "1.0.2", - "yargs": "3.10.0" - }, - "dependencies": { - "yargs": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", - "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", - "dev": true, - "optional": true, - "requires": { - "camelcase": "1.2.1", - "cliui": "2.1.0", - "decamelize": "1.2.0", - "window-size": "0.1.0" - } - } + "source-map": "~0.5.1", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.10.0" } }, "uglify-to-browserify": { @@ -5755,23 +5896,16 @@ "dev": true, "optional": true }, - "uid-number": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz", - "integrity": "sha1-DqEOgDXo61uOREnwbaHHMGY7qoE=", - "dev": true, - "optional": true - }, "union-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", "dev": true, "requires": { - "arr-union": "3.1.0", - "get-value": "2.0.6", - "is-extendable": "0.1.1", - "set-value": "0.4.3" + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" }, "dependencies": { "extend-shallow": { @@ -5780,7 +5914,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } }, "set-value": { @@ -5789,10 +5923,10 @@ "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", "dev": true, "requires": { - "extend-shallow": "2.0.1", - "is-extendable": "0.1.1", - "is-plain-object": "2.0.4", - "to-object-path": "0.3.0" + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" } } } @@ -5803,8 +5937,8 @@ "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", "dev": true, "requires": { - "has-value": "0.3.1", - "isobject": "3.0.1" + "has-value": "^0.3.1", + "isobject": "^3.0.0" }, "dependencies": { "has-value": { @@ -5813,9 +5947,9 @@ "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", "dev": true, "requires": { - "get-value": "2.0.6", - "has-values": "0.1.4", - "isobject": "2.1.0" + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" }, "dependencies": { "isobject": { @@ -5850,21 +5984,10 @@ "dev": true }, "use": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.0.tgz", - "integrity": "sha512-6UJEQM/L+mzC3ZJNM56Q4DFGLX/evKGRg15UJHGB9X5j5Z3AFbgZvjUh2yq/UJUY4U5dh7Fal++XbNg1uzpRAw==", - "dev": true, - "requires": { - "kind-of": "6.0.2" - }, - "dependencies": { - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - } - } + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true }, "util-deprecate": { "version": "1.0.2", @@ -5875,11 +5998,11 @@ "util.promisify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz", - "integrity": "sha1-RA9xZaRZyaFtwUXrjnLzVocJcDA=", + "integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==", "dev": true, "requires": { - "define-properties": "1.1.2", - "object.getownpropertydescriptors": "2.0.3" + "define-properties": "^1.1.2", + "object.getownpropertydescriptors": "^2.0.3" } }, "uuid": { @@ -5888,13 +6011,13 @@ "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==" }, "validate-npm-package-license": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", - "integrity": "sha1-gWQ7y+8b3+zUYjeT3EZIlIupgzg=", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "dev": true, "requires": { - "spdx-correct": "3.0.0", - "spdx-expression-parse": "3.0.0" + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" } }, "verror": { @@ -5902,9 +6025,9 @@ "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", "requires": { - "assert-plus": "1.0.0", + "assert-plus": "^1.0.0", "core-util-is": "1.0.2", - "extsprintf": "1.3.0" + "extsprintf": "^1.2.0" } }, "w3c-hr-time": { @@ -5913,7 +6036,7 @@ "integrity": "sha1-gqwr/2PZUOqeMYmlimViX+3xkEU=", "dev": true, "requires": { - "browser-process-hrtime": "0.1.2" + "browser-process-hrtime": "^0.1.2" } }, "walker": { @@ -5922,7 +6045,7 @@ "integrity": "sha1-L3+bj9ENZ3JisYqITijRlhjgKPs=", "dev": true, "requires": { - "makeerror": "1.0.11" + "makeerror": "1.0.x" } }, "watch": { @@ -5931,8 +6054,8 @@ "integrity": "sha1-KAlUdsbffJDJYxOJkMClQj60uYY=", "dev": true, "requires": { - "exec-sh": "0.2.1", - "minimist": "1.2.0" + "exec-sh": "^0.2.0", + "minimist": "^1.2.0" }, "dependencies": { "minimist": { @@ -5946,36 +6069,42 @@ "webidl-conversions": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha1-qFWYCx8LazWbodXZ+zmulB+qY60=", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", "dev": true }, "whatwg-encoding": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.3.tgz", - "integrity": "sha1-V8I1vIZX6RTSTho5fTyC2u4Ka6M=", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.4.tgz", + "integrity": "sha512-vM9KWN6MP2mIHZ86ytcyIv7e8Cj3KTfO2nd2c8PFDqcI4bxFmQp83ibq4wadq7rL9l9sZV6o9B0LTt8ygGAAXg==", "dev": true, "requires": { - "iconv-lite": "0.4.19" + "iconv-lite": "0.4.23" } }, + "whatwg-mimetype": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.1.0.tgz", + "integrity": "sha512-FKxhYLytBQiUKjkYteN71fAUA3g6KpNXoho1isLiLSB3N1G4F35Q5vUxWfKFhBwi5IWF27VE6WxhrnnC+m0Mew==", + "dev": true + }, "whatwg-url": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-6.4.0.tgz", - "integrity": "sha512-Z0CVh/YE217Foyb488eo+iBv+r7eAQ0wSTyApi9n06jhcA3z6Nidg/EGvl0UFkg7kMdKxfBzzr+o9JF+cevgMg==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-6.5.0.tgz", + "integrity": "sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ==", "dev": true, "requires": { - "lodash.sortby": "4.7.0", - "tr46": "1.0.1", - "webidl-conversions": "4.0.2" + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" } }, "which": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", - "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "requires": { - "isexe": "2.0.0" + "isexe": "^2.0.0" } }, "which-module": { @@ -5984,50 +6113,6 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, - "wide-align": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.2.tgz", - "integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==", - "dev": true, - "optional": true, - "requires": { - "string-width": "1.0.2" - }, - "dependencies": { - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "optional": true, - "requires": { - "number-is-nan": "1.0.1" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "optional": true, - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "optional": true, - "requires": { - "ansi-regex": "2.1.1" - } - } - } - }, "window-size": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", @@ -6040,12 +6125,12 @@ "resolved": "https://registry.npmjs.org/winston/-/winston-2.4.1.tgz", "integrity": "sha1-o6kmUQVWQmPGeFtFg7jIrKJv3tY=", "requires": { - "async": "1.0.0", - "colors": "1.0.3", - "cycle": "1.0.3", - "eyes": "0.1.8", - "isstream": "0.1.2", - "stack-trace": "0.0.10" + "async": "~1.0.0", + "colors": "1.0.x", + "cycle": "1.0.x", + "eyes": "0.1.x", + "isstream": "0.1.x", + "stack-trace": "0.0.x" }, "dependencies": { "async": { @@ -6067,8 +6152,8 @@ "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "dev": true, "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1" + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" }, "dependencies": { "is-fullwidth-code-point": { @@ -6077,7 +6162,7 @@ "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "string-width": { @@ -6086,9 +6171,9 @@ "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" } }, "strip-ansi": { @@ -6097,7 +6182,7 @@ "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } } } @@ -6111,22 +6196,21 @@ "write-file-atomic": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz", - "integrity": "sha1-H/YVdcLipOjlENb6TiQ8zhg5mas=", + "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "imurmurhash": "0.1.4", - "signal-exit": "3.0.2" + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" } }, "ws": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-4.1.0.tgz", - "integrity": "sha1-qXm119TaaL9U7+BAiWfDJIaacok=", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", + "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", "dev": true, "requires": { - "async-limiter": "1.0.0", - "safe-buffer": "5.1.1" + "async-limiter": "~1.0.0" } }, "xml": { @@ -6138,7 +6222,7 @@ "xml-name-validator": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", - "integrity": "sha1-auc+Bt5NjG5H+fsYH3jWSK1FfGo=", + "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", "dev": true }, "y18n": { @@ -6153,45 +6237,25 @@ "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" }, "yargs": { - "version": "10.1.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-10.1.2.tgz", - "integrity": "sha1-RU0HTCsWpRpD4vt4B+T53mnMtcU=", - "dev": true, - "requires": { - "cliui": "4.0.0", - "decamelize": "1.2.0", - "find-up": "2.1.0", - "get-caller-file": "1.0.2", - "os-locale": "2.1.0", - "require-directory": "2.1.1", - "require-main-filename": "1.0.1", - "set-blocking": "2.0.0", - "string-width": "2.1.1", - "which-module": "2.0.0", - "y18n": "3.2.1", - "yargs-parser": "8.1.0" - }, - "dependencies": { - "cliui": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.0.0.tgz", - "integrity": "sha512-nY3W5Gu2racvdDk//ELReY+dHjb9PlIcVDFXP72nVIhq2Gy3LuVXYwJoPVudwQnv1shtohpgkdCKT2YaKY0CKw==", - "dev": true, - "requires": { - "string-width": "2.1.1", - "strip-ansi": "4.0.0", - "wrap-ansi": "2.1.0" - } - } + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "optional": true, + "requires": { + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", + "window-size": "0.1.0" } }, "yargs-parser": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-8.1.0.tgz", - "integrity": "sha1-8TdqM7Ziml0GN4KUTacyYx6WaVA=", + "integrity": "sha512-yP+6QqN8BmrgW2ggLtTbdrOyBNSI7zBa4IykmiV5R1wl1JWNxQvWhMfMdmzIYtKU7oP3OOInY/tl2ov3BDjnJQ==", "dev": true, "requires": { - "camelcase": "4.1.0" + "camelcase": "^4.1.0" }, "dependencies": { "camelcase": { From 511e783ab34469663bf39fc5528150d17deeadda Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Wed, 22 Aug 2018 16:12:37 -0700 Subject: [PATCH 22/70] run npm audit only in current Node --- .circleci/config.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1d0ed68..c876306 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,7 +16,10 @@ node-template: &node-template command: npm test environment: JEST_JUNIT_OUTPUT: "reports/junit/js-test-results.xml" - - run: npm audit + - run: | + if [[ $CIRCLE_JOB == current-release ]]; then + npm audit + fi - store_test_results: path: reports/junit - store_artifacts: From 00e08c8d5c91cead0affb5ea7e8d79bc85d44989 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Thu, 23 Aug 2018 16:29:55 -0700 Subject: [PATCH 23/70] implement evaluation with explanation --- evaluate_flag.js | 148 +++++++++++++++++++++-------------- event_processor.js | 3 + flags_state.js | 8 +- index.d.ts | 100 ++++++++++++++++++++++- index.js | 124 ++++++++++++++++++----------- test/LDClient-test.js | 122 +++++++++++++++++++++++++---- test/evaluate_flag-test.js | 86 +++++++++++--------- test/event_processor-test.js | 17 ++++ 8 files changed, 446 insertions(+), 162 deletions(-) diff --git a/evaluate_flag.js b/evaluate_flag.js index c89e418..4e68bef 100644 --- a/evaluate_flag.js +++ b/evaluate_flag.js @@ -8,90 +8,95 @@ var builtins = ['key', 'ip', 'country', 'email', 'firstName', 'lastName', 'avata var noop = function(){}; +// Callback receives (err, detail, events) where detail has the properties "value", "variationIndex", and "reason"; +// detail will never be null even if there's an error. function evaluate(flag, user, featureStore, cb) { cb = cb || noop; if (!user || user.key === null || user.key === undefined) { - cb(null, null, null, null); + cb(null, errorResult('USER_NOT_SPECIFIED'), []); return; } if (!flag) { - cb(null, null, null, null); + cb(null, errorResult('FLAG_NOT_FOUND'), []); return; } + var events = []; + evalInternal(flag, user, featureStore, events, function(err, detail) { + cb(err, detail, events); + }); +} + +function evalInternal(flag, user, featureStore, events, cb) { + // If flag is off, return the off variation if (!flag.on) { - // Return the off variation if defined and valid - cb(null, flag.offVariation, getVariation(flag, flag.offVariation), null); + getOffResult(flag, { kind: 'OFF' }, function(err, detail) { + cb(err, detail); + }); return; } - evalInternal(flag, user, featureStore, [], function(err, variation, value, events) { - if (err) { - cb(err, variation, value, events); - return; - } - - if (variation === null) { - // Return the off variation if defined and valid - cb(null, flag.offVariation, getVariation(flag, flag.offVariation), events); + checkPrerequisites(flag, user, featureStore, events, function(err, failureReason) { + if (err != null || failureReason != null) { + getOffResult(flag, failureReason, cb); } else { - cb(err, variation, value, events); + evalRules(flag, user, featureStore, cb); } }); - return; } -function evalInternal(flag, user, featureStore, events, cb) { - // Evaluate prerequisites, if any +// Callback receives (err, reason) where reason is null if successful, or a "prerequisite failed" reason +function checkPrerequisites(flag, user, featureStore, events, cb) { if (flag.prerequisites) { async.mapSeries(flag.prerequisites, function(prereq, callback) { featureStore.get(dataKind.features, prereq.key, function(f) { // If the flag does not exist in the store or is not on, the prerequisite // is not satisfied - if (!f || !f.on) { - callback(new Error("Unsatisfied prerequisite"), null); + if (!f) { + callback({ key: prereq.key, err: new Error("Could not retrieve prerequisite feature flag \"" + prereq.key + "\"") }); + return; + } + if (!f.on) { + callback({ key: prereq.key }); return; } - evalInternal(f, user, featureStore, events, function(err, variation, value) { + evalInternal(f, user, featureStore, events, function(err, detail) { // If there was an error, the value is null, the variation index is out of range, // or the value does not match the indexed variation the prerequisite is not satisfied - events.push(createFlagEvent(f.key, f, user, variation, value, null, flag.key)); - if (err || value === null || variation != prereq.variation) { - callback(new Error("Unsatisfied prerequisite"), null) + events.push(createFlagEvent(f.key, f, user, detail, null, flag.key, true)); + if (err) { + callback({ key: prereq.key, err: err }); + } else if (detail.variationIndex != prereq.variation) { + callback({ key: prereq.key }); } else { // The prerequisite was satisfied - callback(null, null); + callback(null); } }); }); }, - function(err, results) { - // If the error is that prerequisites weren't satisfied, we don't return an error, - // because we want to serve the 'offVariation' - if (err) { - cb(null, null, null, events); - return; - } - evalRules(flag, user, featureStore, function(e, variation, value) { - cb(e, variation, value, events); - }); - }) + function(errInfo) { + if (errInfo) { + cb(errInfo.err, { 'kind': 'PREREQUISITE_FAILED', 'prerequisiteKey': errInfo.key }); + } else { + cb(null, null); + } + }); } else { - evalRules(flag, user, featureStore, function(e, variation, value) { - cb(e, variation, value, events); - }); + cb(null, null); } } +// Callback receives (err, detail) function evalRules(flag, user, featureStore, cb) { var i, j; var target; var variation; var rule; // Check target matches - for (i = 0; i < flag.targets.length; i++) { + for (i = 0; i < (flag.targets || []).length; i++) { target = flag.targets[i]; if (!target.values) { @@ -100,32 +105,30 @@ function evalRules(flag, user, featureStore, cb) { for (j = 0; j < target.values.length; j++) { if (user.key === target.values[j]) { - value = getVariation(flag, target.variation); - cb(value === null ? new Error("Undefined variation for flag " + flag.key) : null, - target.variation, value); + getVariation(flag, target.variation, { kind: 'TARGET_MATCH' }, cb); return; } } } - async.mapSeries(flag.rules, + i = 0; + async.mapSeries(flag.rules || [], function(rule, callback) { ruleMatchUser(rule, user, featureStore, function(matched) { - setImmediate(callback, matched ? rule : null, null); + var match = matched ? { index: i, rule: rule } : null; + setImmediate(callback, match, null); }); }, function(err, results) { // we use the "error" value to indicate that a rule was successfully matched (since we only care // about the first match, and mapSeries terminates on the first "error") if (err) { - var rule = err; - variation = variationForUser(rule, user, flag); + var reason = { kind: 'RULE_MATCH', ruleIndex: err.index, ruleId: err.rule.id }; + getResultForVariationOrRollout(err.rule, user, flag, reason, cb); } else { // no rule matched; check the fallthrough - variation = variationForUser(flag.fallthrough, user, flag); + getResultForVariationOrRollout(flag.fallthrough, user, flag, { kind: 'FALLTHROUGH' }, cb); } - cb(variation === null ? new Error("Undefined variation for flag " + flag.key) : null, - variation, getVariation(flag, variation)); } ); } @@ -255,16 +258,39 @@ function matchAny(matchFn, value, values) { return false; } -// Given an index, return the variation value, or null if -// the index is invalid -function getVariation(flag, index) { - if (index === null || index === undefined || index >= flag.variations.length) { - return null; +function getVariation(flag, index, reason, cb) { + if (index === null || index === undefined || index < 0 || index >= flag.variations.length) { + cb(new Error('Invalid variation index in flag', errResult('MALFORMED_FLAG'))); } else { - return flag.variations[index]; + cb(null, { value: flag.variations[index], variationIndex: index, reason: reason }); } } +function getOffResult(flag, reason, cb) { + if (flag.offVariation === null || flag.offVariation === undefined) { + cb(null, { value: null, variationIndex: null, reason: reason }); + } else { + getVariation(flag, flag.offVariation, reason, cb); + } +} + +function getResultForVariationOrRollout(r, user, flag, reason, cb) { + if (!r) { + cb(new Error('Fallthrough variation undefined'), errResult('MALFORMED_FLAG')); + } else { + var index = variationForUser(r, user, flag); + if (index === null) { + cb(new Error('Variation/rollout object with no variation or rollout'), errResult('MALFORMED_FLAG')); + } else { + getVariation(flag, index, reason, cb); + } + } +} + +function errorResult(errorKind) { + return { value: null, variationIndex: null, reason: { kind: 'ERROR', errorKind: errorKind }}; +} + // Given a variation or rollout 'r', select // the variation for the given user function variationForUser(r, user, flag) { @@ -337,13 +363,13 @@ function bucketableStringValue(value) { return null; } -function createFlagEvent(key, flag, user, variation, value, defaultVal, prereqOf) { - return { +function createFlagEvent(key, flag, user, detail, defaultVal, prereqOf, includeReason) { + var e = { "kind": "feature", "key": key, "user": user, - "variation": variation, - "value": value, + "variation": detail.variationIndex, + "value": detail.value, "default": defaultVal, "creationDate": new Date().getTime(), "version": flag ? flag.version : null, @@ -351,6 +377,10 @@ function createFlagEvent(key, flag, user, variation, value, defaultVal, prereqOf "trackEvents": flag ? flag.trackEvents : null, "debugEventsUntilDate": flag ? flag.debugEventsUntilDate : null }; + if (includeReason) { + e['reason'] = detail.reason; + } + return e; } module.exports = {evaluate: evaluate, bucketUser: bucketUser, createFlagEvent: createFlagEvent}; \ No newline at end of file diff --git a/event_processor.js b/event_processor.js index ab453b1..42bfdb2 100644 --- a/event_processor.js +++ b/event_processor.js @@ -59,6 +59,9 @@ function EventProcessor(sdkKey, config, errorReporter) { if (event.version) { out.version = event.version; } + if (event.reason) { + out.reason = event.reason; + } if (config.inlineUsersInEvents || debug) { out.user = userFilter.filterUser(event.user); } else { diff --git a/flags_state.js b/flags_state.js index 10f15c6..5a7a2eb 100644 --- a/flags_state.js +++ b/flags_state.js @@ -4,7 +4,7 @@ function FlagsStateBuilder(valid) { var flagValues = {}; var flagMetadata = {}; - builder.addFlag = function(flag, value, variation) { + builder.addFlag = function(flag, value, variation, reason) { flagValues[flag.key] = value; var meta = { version: flag.version, @@ -16,6 +16,9 @@ function FlagsStateBuilder(valid) { if (flag.debugEventsUntilDate !== undefined && flag.debugEventsUntilDate !== null) { meta.debugEventsUntilDate = flag.debugEventsUntilDate; } + if (reason) { + meta.reason = reason; + } flagMetadata[flag.key] = meta; }; @@ -24,6 +27,9 @@ function FlagsStateBuilder(valid) { valid: valid, allValues: function() { return flagValues; }, getFlagValue: function(key) { return flagValues[key]; }, + getFlagReason: function(key) { + return flagMetadata[key] ? flagMetadata[key].reason : null; + }, toJSON: function() { return Object.assign({}, flagValues, { $flagsState: flagMetadata, $valid: valid }); } diff --git a/index.d.ts b/index.d.ts index b5f5be8..6440831 100644 --- a/index.d.ts +++ b/index.d.ts @@ -53,7 +53,7 @@ declare module 'ldclient-node' { */ export interface LDFlagsState = { /** - * True if this object contains a valid snapshot of feature flag state, or false if the + * True if this object contains a valid snapshot of feature flag state, or false if the * state could not be computed (for instance, because the client was offline or there * was no user). */ @@ -86,6 +86,74 @@ declare module 'ldclient-node' { toJSON: () => object; }; + /** + * Describes the reason that a flag evaluation produced a particular value. This is + * part of the LDEvaluationDetail object returned by variationDetail(). + */ + export type LDEvaluationReason = { + /** + * The general category of the reason: + * + * 'OFF': the flag was off and therefore returned its configured off value + * + * 'FALLTHROUGH': the flag was on but the user did not match any targets or rules + * + * 'TARGET_MATCH': the user key was specifically targeted for this flag + * + * 'RULE_MATCH': the user matched one of the flag's rules + * + * 'PREREQUISITE_FAILED': the flag was considered off because it had at least one + * prerequisite flag that either was off or did not return the desired variation + * + * 'ERROR': the flag could not be evaluated, e.g. because it does not exist or due + * to an unexpected error + */ + kind: string; + + /** + * A further description of the error condition, if the kind was 'ERROR'. + */ + errorKind?: string; + + /** + * The index of the matched rule (0 for the first), if the kind was 'RULE_MATCH'. + */ + ruleIndex?: number; + + /** + * The unique identifier of the matched rule, if the kind was 'RULE_MATCH'. + */ + ruleId?: string; + + /** + * The key of the failed prerequisite flag, if the kind was 'PREREQUISITE_FAILED'. + */ + prerequisiteKey?: string; + }; + + /** + * An object returned by LDClient.variationDetail(), combining the result of a feature flag + * evaluation with information about how it was calculated. + */ + export type LDEvaluationDetail = { + /** + * The result of the flag evaluation. This will be either one of the flag's variations or + * the default value that was passed to variationDetail(). + */ + value: LDFlagValue; + + /** + * The index of the returned value within the flag's list of variations, e.g. 0 for the + * first variation - or null if the default value was returned. + */ + variationIndex?: number; + + /** + * An object describing the main factor that influenced the flag evaluation value. + */ + reason: LDEvaluationReason; + }; + /** * LaunchDarkly initialization options. */ @@ -524,6 +592,36 @@ declare module 'ldclient-node' { callback?: (err: any, res: LDFlagValue) => void ) => Promise; + /** + * Retrieves a flag's value, along with information about how it was calculated, in the form + * of an LDEvaluationDetail object. + * + * The reason property of the result will also be included in analytics events, if you are + * capturing detailed event data for this flag. + * + * @param key + * The key of the flag for which to retrieve the corresponding value. + * @param user + * The user for the variation. + * + * The variation call will automatically create a user in LaunchDarkly if a user with that user key doesn't exist already. + * + * @param defaultValue + * The value to use if the flag is not available (for example, if the + * user is offline or a flag is requested that does not exist). + * + * @param callback + * The callback to receive the result. + * + * @returns a Promise containing the flag value and explanation + */ + variationDetail: ( + key: string, + user: LDUser, + defaultValue: LDFlagValue, + callback?: (err: ay, res: LDEvaluationDetail) => void + ) => Promise; + toggle: ( key: string, user: LDUser, diff --git a/index.js b/index.js index 5f6f1fb..3415e03 100644 --- a/index.js +++ b/index.js @@ -152,54 +152,78 @@ var newClient = function(sdkKey, config) { client.variation = function(key, user, defaultVal, callback) { return wrapPromiseCallback(new Promise(function(resolve, reject) { - sanitizeUser(user); - var variationErr; + evaluateIfPossible(key, user, defaultVal, false, + function(detail) { + resolve(detail.value) + }, + reject); + }.bind(this)), callback); + }; - if (this.isOffline()) { - config.logger.info("Variation called in offline mode. Returning default value."); - return resolve(defaultVal); - } + client.variationDetail = function(key, user, defaultVal, callback) { + return wrapPromiseCallback(new Promise(function(resolve, reject) { + evaluateIfPossible(key, user, defaultVal, true, resolve, reject); + }.bind(this)), callback); + }; - else if (!key) { - variationErr = new errors.LDClientError('No feature flag key specified. Returning default value.'); - maybeReportError(variationError); - sendFlagEvent(key, null, user, null, defaultVal, defaultVal); - return resolve(defaultVal); - } + function errorResult(errorKind, defaultVal) { + return { value: defaultVal, variationIndex: null, reason: { kind: 'ERROR', errorKind: errorKind } }; + }; - else if (user && user.key === "") { - config.logger.warn("User key is blank. Flag evaluation will proceed, but the user will not be stored in LaunchDarkly"); - } + function evaluateIfPossible(key, user, defaultVal, includeReasonsInEvents, resolve, reject) { + if (!initComplete) { + config.featureStore.initialized(function(storeInited) { + if (storeInited) { + config.logger.warn("Variation called before LaunchDarkly client initialization completed (did you wait for the 'ready' event?) - using last known values from feature store") + variationInternal(key, user, defaultVal, includeReasonsInEvents, resolve, reject); + } else { + var err = new errors.LDClientError("Variation called before LaunchDarkly client initialization completed (did you wait for the 'ready' event?) - using default value"); + maybeReportError(variationErr); + var result = errorResult('CLIENT_NOT_READY', defaultVal); + sendFlagEvent(key, null, user, result, defaultVal, includeReasonsInEvents); + return resolve(result); + } + }); + } else { + variationInternal(key, user, defaultVal, includeReasonsInEvents, resolve, reject); + } + } - if (!initComplete) { - config.featureStore.initialized(function(storeInited) { - if (storeInited) { - config.logger.warn("Variation called before LaunchDarkly client initialization completed (did you wait for the 'ready' event?) - using last known values from feature store") - variationInternal(key, user, defaultVal, resolve, reject); - } else { - variationErr = new errors.LDClientError("Variation called before LaunchDarkly client initialization completed (did you wait for the 'ready' event?) - using default value"); - maybeReportError(variationErr); - sendFlagEvent(key, null, user, null, defaultVal, defaultVal); - return resolve(defaultVal); - } - }); - return; - } + // resolves to a "detail" object with properties "value", "variationIndex", "reason" + function variationInternal(key, user, defaultVal, includeReasonsInEvents, resolve, reject) { + if (client.isOffline()) { + config.logger.info("Variation called in offline mode. Returning default value."); + return resolve(errorResult('CLIENT_NOT_READY', defaultVal)); + } - variationInternal(key, user, defaultVal, resolve, reject); - }.bind(this)), callback); - } + else if (!key) { + err = new errors.LDClientError('No feature flag key specified. Returning default value.'); + maybeReportError(variationError); + return resolve(errorResult('FLAG_NOT_FOUND', defaultVal)); + } + + sanitizeUser(user); + if (user && user.key === "") { + config.logger.warn("User key is blank. Flag evaluation will proceed, but the user will not be stored in LaunchDarkly"); + } - function variationInternal(key, user, defaultVal, resolve, reject) { config.featureStore.get(dataKind.features, key, function(flag) { if (!user) { variationErr = new errors.LDClientError('No user specified. Returning default value.'); maybeReportError(variationErr); - sendFlagEvent(key, flag, user, null, defaultVal, defaultVal); - return resolve(defaultVal); + var result = errorResult('USER_NOT_SPECIFIED', defaultVal); + sendFlagEvent(key, flag, user, result, defaultVal, includeReasonsInEvents); + return resolve(result); } - evaluate.evaluate(flag, user, config.featureStore, function(err, variation, value, events) { + if (!flag) { + maybeReportError(new errors.LDClientError('Unknown feature flag "' + key + '"; returning default value')); + var result = errorResult('FLAG_NOT_FOUND', defaultVal); + sendFlagEvent(key, null, user, result, defaultVal, includeReasonsInEvents); + return resolve(result); + } + + evaluate.evaluate(flag, user, config.featureStore, function(err, detail, events) { var i; var version = flag ? flag.version : null; @@ -211,18 +235,20 @@ var newClient = function(sdkKey, config) { // have already been constructed, so we just have to push them onto the queue. if (events) { for (i = 0; i < events.length; i++) { - eventProcessor.sendEvent(events[i]); + var e = events[i]; + if (!includeReasonsInEvents) { + delete e['reason']; + } + eventProcessor.sendEvent(e); } } - if (value === null) { + if (detail.value === null) { config.logger.debug("Result value is null in variation"); - sendFlagEvent(key, flag, user, null, defaultVal, defaultVal); - return resolve(defaultVal); - } else { - sendFlagEvent(key, flag, user, variation, value, defaultVal); - return resolve(value); + detail.value = defaultVal; } + sendFlagEvent(key, flag, user, detail, defaultVal, includeReasonsInEvents); + return resolve(detail); }); }); } @@ -258,14 +284,18 @@ var newClient = function(sdkKey, config) { var builder = FlagsStateBuilder(true); var clientOnly = options.clientSideOnly; + var withReasons = options.withReasons; config.featureStore.all(dataKind.features, function(flags) { async.forEachOf(flags, function(flag, key, iterateeCb) { if (clientOnly && !flag.clientSide) { setImmediate(iterateeCb); } else { // At the moment, we don't send any events here - evaluate.evaluate(flag, user, config.featureStore, function(err, variation, value, events) { - builder.addFlag(flag, value, variation); + evaluate.evaluate(flag, user, config.featureStore, function(err, detail, events) { + if (err != null) { + maybeReportError(new Error('Error for feature flag "' + flag.key + '" while evaluating all flags: ' + err)); + } + builder.addFlag(flag, detail.value, detail.variationIndex, withReasons ? detail.reason : null); setImmediate(iterateeCb); }); } @@ -322,8 +352,8 @@ var newClient = function(sdkKey, config) { return eventProcessor.flush(callback); }; - function sendFlagEvent(key, flag, user, variation, value, defaultVal) { - var event = evaluate.createFlagEvent(key, flag, user, variation, value, defaultVal); + function sendFlagEvent(key, flag, user, detail, defaultVal, includeReasonsInEvents) { + var event = evaluate.createFlagEvent(key, flag, user, detail, defaultVal, null, includeReasonsInEvents); eventProcessor.sendEvent(event); } diff --git a/test/LDClient-test.js b/test/LDClient-test.js index bb132a7..7c0cdb6 100644 --- a/test/LDClient-test.js +++ b/test/LDClient-test.js @@ -143,6 +143,27 @@ describe('LDClient', function() { }); }); + it('evaluates a flag with variationDetail()', function(done) { + var flag = { + key: 'flagkey', + version: 1, + on: true, + targets: [], + fallthrough: { variation: 1 }, + variations: ['a', 'b'], + trackEvents: true + }; + var client = createOnlineClientWithFlags({ flagkey: flag }); + var user = { key: 'user' }; + client.on('ready', function() { + client.variationDetail(flag.key, user, 'c', function(err, result) { + expect(err).toBeNull(); + expect(result).toMatchObject({ value: 'b', variationIndex: 1, reason: { kind: 'FALLTHROUGH' } }); + done(); + }); + }); + }); + it('generates an event for an existing feature', function(done) { var flag = { key: 'flagkey', @@ -174,6 +195,38 @@ describe('LDClient', function() { }); }); + it('generates an event for an existing feature with reason', function(done) { + var flag = { + key: 'flagkey', + version: 1, + on: true, + targets: [], + fallthrough: { variation: 1 }, + variations: ['a', 'b'], + trackEvents: true + }; + var client = createOnlineClientWithFlags({ flagkey: flag }); + var user = { key: 'user' }; + client.on('ready', function() { + client.variationDetail(flag.key, user, 'c', function(err, result) { + expect(eventProcessor.events).toHaveLength(1); + var e = eventProcessor.events[0]; + expect(e).toMatchObject({ + kind: 'feature', + key: 'flagkey', + version: 1, + user: user, + variation: 1, + value: 'b', + default: 'c', + reason: { kind: 'FALLTHROUGH' }, + trackEvents: true + }); + done(); + }); + }); + }); + it('generates an event for an unknown feature', function(done) { var client = createOnlineClientWithFlags({}); var user = { key: 'user' }; @@ -333,28 +386,65 @@ describe('LDClient', function() { }); }); - it('should not overflow the call stack when evaluating a huge number of flags', function(done) { - var flagCount = 5000; - var flags = {}; - for (var i = 0; i < flagCount; i++) { - var key = 'feature' + i; - var flag = { - key: key, - version: 1, - on: false - }; - flags[key] = flag; - } - var client = createOnlineClientWithFlags(flags); + it('can include reasons in allFlagsState()', function(done) { + var flag = { + key: 'feature', + version: 100, + on: true, + targets: [], + fallthrough: { variation: 1 }, + variations: ['a', 'b'], + trackEvents: true, + debugEventsUntilDate: 1000 + }; + var client = createOnlineClientWithFlags({ feature: flag }); + var user = { key: 'user' }; client.on('ready', function() { - client.allFlags({key: 'user'}, function(err, result) { - expect(err).toEqual(null); - expect(Object.keys(result).length).toEqual(flagCount); + client.allFlagsState(user, { withReasons: true }, function(err, state) { + expect(err).toBeNull(); + expect(state.valid).toEqual(true); + expect(state.allValues()).toEqual({feature: 'b'}); + expect(state.getFlagValue('feature')).toEqual('b'); + expect(state.toJSON()).toEqual({ + feature: 'b', + $flagsState: { + feature: { + version: 100, + variation: 1, + reason: { kind: 'FALLTHROUGH' }, + trackEvents: true, + debugEventsUntilDate: 1000 + } + }, + $valid: true + }); done(); }); }); }); + // it('should not overflow the call stack when evaluating a huge number of flags', function(done) { + // var flagCount = 5000; + // var flags = {}; + // for (var i = 0; i < flagCount; i++) { + // var key = 'feature' + i; + // var flag = { + // key: key, + // version: 1, + // on: false + // }; + // flags[key] = flag; + // } + // var client = createOnlineClientWithFlags(flags); + // client.on('ready', function() { + // client.allFlags({key: 'user'}, function(err, result) { + // expect(err).toEqual(null); + // expect(Object.keys(result).length).toEqual(flagCount); + // done(); + // }); + // }); + // }); + it('should not crash when closing an offline client', function(done) { var client = LDClient.init('sdk_key', {offline: true}); expect(() => client.close()).not.toThrow(); diff --git a/test/evaluate_flag-test.js b/test/evaluate_flag-test.js index d4c3cf3..181e9c6 100644 --- a/test/evaluate_flag-test.js +++ b/test/evaluate_flag-test.js @@ -58,8 +58,9 @@ describe('evaluate', function() { variations: ['a', 'b', 'c'] }; var user = { key: 'x' }; - evaluate.evaluate(flag, user, featureStore, function(err, variation, result) { - expect(result).toBe('b'); + evaluate.evaluate(flag, user, featureStore, function(err, detail, events) { + expect(detail).toMatchObject({ value: 'b', variationIndex: 1, reason: { kind: 'OFF' } }); + expect(events).toMatchObject([]); done(); }); }); @@ -72,8 +73,9 @@ describe('evaluate', function() { variations: ['a', 'b', 'c'] }; var user = { key: 'x' }; - evaluate.evaluate(flag, user, featureStore, function(err, variation, result) { - expect(result).toBe(null); + evaluate.evaluate(flag, user, featureStore, function(err, detail, events) { + expect(detail).toMatchObject({ value: null, variationIndex: null, reason: { kind: 'OFF' } }); + expect(events).toMatchObject([]); done(); }); }); @@ -89,8 +91,9 @@ describe('evaluate', function() { variations: ['a', 'b', 'c'] }; var user = { key: 'x' }; - evaluate.evaluate(flag, user, featureStore, function(err, variation, result) { - expect(result).toBe('a'); + evaluate.evaluate(flag, user, featureStore, function(err, detail, events) { + expect(detail).toMatchObject({ value: 'a', variationIndex: 0, reason: { kind: 'FALLTHROUGH' } }); + expect(events).toMatchObject([]); done(); }); }); @@ -105,8 +108,10 @@ describe('evaluate', function() { variations: ['a', 'b', 'c'] }; var user = { key: 'x' }; - evaluate.evaluate(flag, user, featureStore, function(err, variation, result) { - expect(result).toBe('b'); + evaluate.evaluate(flag, user, featureStore, function(err, detail, events) { + expect(detail).toMatchObject({ value: 'b', variationIndex: 1, + reason: { kind: 'PREREQUISITE_FAILED', prerequisiteKey: 'badfeature' } }); + expect(events).toMatchObject([]); done(); }); }); @@ -137,8 +142,9 @@ describe('evaluate', function() { var eventsShouldBe = [ { kind: 'feature', key: 'feature1', variation: 0, value: 'd', version: 2, prereqOf: 'feature0' } ]; - evaluate.evaluate(flag, user, featureStore, function(err, variation, result, events) { - expect(result).toBe('b'); + evaluate.evaluate(flag, user, featureStore, function(err, detail, events) { + expect(detail).toMatchObject({ value: 'b', variationIndex: 1, + reason: { kind: 'PREREQUISITE_FAILED', prerequisiteKey: 'feature1' } }); expect(events).toMatchObject(eventsShouldBe); done(); }); @@ -171,8 +177,8 @@ describe('evaluate', function() { var eventsShouldBe = [ { kind: 'feature', key: 'feature1', variation: 1, value: 'e', version: 2, prereqOf: 'feature0' } ]; - evaluate.evaluate(flag, user, featureStore, function(err, variation, result, events) { - expect(result).toBe('a'); + evaluate.evaluate(flag, user, featureStore, function(err, detail, events) { + expect(detail).toMatchObject({ value: 'a', variationIndex: 0, reason: { kind: 'FALLTHROUGH' } }); expect(events).toMatchObject(eventsShouldBe); done(); }); @@ -185,6 +191,7 @@ describe('evaluate', function() { on: true, rules: [ { + id: 'id', clauses: [ { attribute: 'key', @@ -201,8 +208,10 @@ describe('evaluate', function() { variations: ['a', 'b', 'c'] }; var user = { key: 'userkey' }; - evaluate.evaluate(flag, user, featureStore, function(err, variation, result) { - expect(result).toBe('c'); + evaluate.evaluate(flag, user, featureStore, function(err, detail, events) { + expect(detail).toMatchObject({ value: 'c', variationIndex: 2, + reason: { kind: 'RULE_MATCH', ruleIndex: 0, ruleId: 'id' } }); + expect(events).toMatchObject([]); done(); }); }); @@ -223,16 +232,17 @@ describe('evaluate', function() { variations: ['a', 'b', 'c'] }; var user = { key: 'userkey' }; - evaluate.evaluate(flag, user, featureStore, function(err, variation, result) { - expect(result).toBe('c'); + evaluate.evaluate(flag, user, featureStore, function(err, detail, events) { + expect(detail).toMatchObject({ value: 'c', variationIndex: 2, reason: { kind: 'TARGET_MATCH' } }); + expect(events).toMatchObject([]); done(); }); }); function testClauseMatch(clause, user, shouldBe, done) { var flag = makeBooleanFlagWithOneClause(clause); - evaluate.evaluate(flag, user, featureStore, function(err, variation, result) { - expect(result).toBe(shouldBe); + evaluate.evaluate(flag, user, featureStore, function(err, detail, events) { + expect(detail.value).toBe(shouldBe); done(); }); } @@ -270,8 +280,8 @@ describe('evaluate', function() { defineSegment(segment, function() { var flag = makeFlagWithSegmentMatch(segment); var user = { key: 'foo' }; - evaluate.evaluate(flag, user, featureStore, function(err, variation, result) { - expect(result).toBe(true); + evaluate.evaluate(flag, user, featureStore, function(err, detail) { + expect(detail.value).toBe(true); done(); }); }); @@ -286,8 +296,8 @@ describe('evaluate', function() { defineSegment(segment, function() { var flag = makeFlagWithSegmentMatch(segment); var user = { key: 'foo' }; - evaluate.evaluate(flag, user, featureStore, function(err, variation, result) { - expect(result).toBe(false); + evaluate.evaluate(flag, user, featureStore, function(err, detail) { + expect(detail.value).toBe(false); done(); }); }); @@ -302,8 +312,8 @@ describe('evaluate', function() { defineSegment(segment, function() { var flag = makeFlagWithSegmentMatch(segment); var user = { key: 'bar' }; - evaluate.evaluate(flag, user, featureStore, function(err, variation, result) { - expect(result).toBe(false); + evaluate.evaluate(flag, user, featureStore, function(err, detail) { + expect(detail.value).toBe(false); done(); }); }); @@ -319,8 +329,8 @@ describe('evaluate', function() { defineSegment(segment, function() { var flag = makeFlagWithSegmentMatch(segment); var user = { key: 'foo' }; - evaluate.evaluate(flag, user, featureStore, function(err, variation, result) { - expect(result).toBe(true); + evaluate.evaluate(flag, user, featureStore, function(err, detail) { + expect(detail.value).toBe(true); done(); }); }); @@ -346,8 +356,8 @@ describe('evaluate', function() { defineSegment(segment, function() { var flag = makeFlagWithSegmentMatch(segment); var user = { key: 'foo', email: 'test@example.com' }; - evaluate.evaluate(flag, user, featureStore, function(err, variation, result) { - expect(result).toBe(true); + evaluate.evaluate(flag, user, featureStore, function(err, detail) { + expect(detail.value).toBe(true); done(); }); }); @@ -373,8 +383,8 @@ describe('evaluate', function() { defineSegment(segment, function() { var flag = makeFlagWithSegmentMatch(segment); var user = { key: 'foo', email: 'test@example.com' }; - evaluate.evaluate(flag, user, featureStore, function(err, variation, result) { - expect(result).toBe(false); + evaluate.evaluate(flag, user, featureStore, function(err, detail) { + expect(detail.value).toBe(false); done(); }); }); @@ -404,8 +414,8 @@ describe('evaluate', function() { defineSegment(segment, function() { var flag = makeFlagWithSegmentMatch(segment); var user = { key: 'foo', email: 'test@example.com', name: 'bob' }; - evaluate.evaluate(flag, user, featureStore, function(err, variation, result) { - expect(result).toBe(true); + evaluate.evaluate(flag, user, featureStore, function(err, detail) { + expect(detail.value).toBe(true); done(); }); }); @@ -435,8 +445,8 @@ describe('evaluate', function() { defineSegment(segment, function() { var flag = makeFlagWithSegmentMatch(segment); var user = { key: 'foo', email: 'test@example.com', name: 'bob' }; - evaluate.evaluate(flag, user, featureStore, function(err, variation, result) { - expect(result).toBe(false); + evaluate.evaluate(flag, user, featureStore, function(err, detail) { + expect(detail.value).toBe(false); done(); }); }); @@ -463,9 +473,9 @@ describe('evaluate', function() { rules.push({ clauses: [clause], variation: 1 }); } flag.rules = rules; - evaluate.evaluate(flag, {key: 'user'}, featureStore, function(err, variation, value) { + evaluate.evaluate(flag, {key: 'user'}, featureStore, function(err, detail) { expect(err).toEqual(null); - expect(value).toEqual(false); + expect(detail.value).toEqual(false); done(); }); }); @@ -492,9 +502,9 @@ describe('evaluate', function() { } var rule = { clauses: clauses, variation: 1 }; flag.rules = [rule]; - evaluate.evaluate(flag, {key: 'user'}, featureStore, function(err, variation, value) { + evaluate.evaluate(flag, {key: 'user'}, featureStore, function(err, detail) { expect(err).toEqual(null); - expect(value).toEqual(true); + expect(detail.value).toEqual(true); done(); }); }); diff --git a/test/event_processor-test.js b/test/event_processor-test.js index 6ae8014..eb0f8f8 100644 --- a/test/event_processor-test.js +++ b/test/event_processor-test.js @@ -66,6 +66,7 @@ describe('EventProcessor', function() { expect(e.variation).toEqual(source.variation); expect(e.value).toEqual(source.value); expect(e.default).toEqual(source.default); + expect(e.reason).toEqual(source.reason); if (inlineUser) { expect(e.user).toEqual(inlineUser); } else { @@ -184,6 +185,22 @@ describe('EventProcessor', function() { }); }); + it('can include reason in feature event', function(done) { + var config = Object.assign({}, defaultConfig, { inlineUsersInEvents: true }); + ep = EventProcessor(sdkKey, config); + var e = { kind: 'feature', creationDate: 1000, user: user, key: 'flagkey', + version: 11, variation: 1, value: 'value', trackEvents: true, + reason: { kind: 'FALLTHROUGH' } }; + ep.sendEvent(e); + + flushAndGetRequest(function(output) { + expect(output.length).toEqual(2); + checkFeatureEvent(output[0], e, false, user); + checkSummaryEvent(output[1]); + done(); + }); + }); + it('still generates index event if inlineUsers is true but feature event is not tracked', function(done) { var config = Object.assign({}, defaultConfig, { inlineUsersInEvents: true }); ep = EventProcessor(sdkKey, config); From bece5f2c108564fc7b8a1b14378fe8845a794cf5 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Thu, 23 Aug 2018 16:34:06 -0700 Subject: [PATCH 24/70] add doc comment --- index.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/index.d.ts b/index.d.ts index 6440831..07ea0de 100644 --- a/index.d.ts +++ b/index.d.ts @@ -66,6 +66,13 @@ declare module 'ldclient-node' { */ getFlagValue: (key: string) => LDFlagValue; + /** + * Returns the evaluation reason for a feature flag at the time the state was recorded. + * It will be null if reasons were not recorded, or if there was no such flag. + * @param key the flag key + */ + getFlagReason: (key: string) => LDEvaluationReason; + /** * Returns a map of feature flag keys to values. If a flag would have evaluated to the * default value, its value will be null. From 69f27dac7b9c2636d7b47e1695b54cc7f4b828f8 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Thu, 23 Aug 2018 16:34:54 -0700 Subject: [PATCH 25/70] uncomment test --- test/LDClient-test.js | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/test/LDClient-test.js b/test/LDClient-test.js index 7c0cdb6..b07b258 100644 --- a/test/LDClient-test.js +++ b/test/LDClient-test.js @@ -423,27 +423,27 @@ describe('LDClient', function() { }); }); - // it('should not overflow the call stack when evaluating a huge number of flags', function(done) { - // var flagCount = 5000; - // var flags = {}; - // for (var i = 0; i < flagCount; i++) { - // var key = 'feature' + i; - // var flag = { - // key: key, - // version: 1, - // on: false - // }; - // flags[key] = flag; - // } - // var client = createOnlineClientWithFlags(flags); - // client.on('ready', function() { - // client.allFlags({key: 'user'}, function(err, result) { - // expect(err).toEqual(null); - // expect(Object.keys(result).length).toEqual(flagCount); - // done(); - // }); - // }); - // }); + it('should not overflow the call stack when evaluating a huge number of flags', function(done) { + var flagCount = 5000; + var flags = {}; + for (var i = 0; i < flagCount; i++) { + var key = 'feature' + i; + var flag = { + key: key, + version: 1, + on: false + }; + flags[key] = flag; + } + var client = createOnlineClientWithFlags(flags); + client.on('ready', function() { + client.allFlags({key: 'user'}, function(err, result) { + expect(err).toEqual(null); + expect(Object.keys(result).length).toEqual(flagCount); + done(); + }); + }); + }); it('should not crash when closing an offline client', function(done) { var client = LDClient.init('sdk_key', {offline: true}); From ad940ea4415d22671d8d85f4d6dcf020bb478f87 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Thu, 23 Aug 2018 17:22:00 -0700 Subject: [PATCH 26/70] tests for default logic --- index.js | 2 +- test/LDClient-test.js | 59 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 3415e03..6aad80e 100644 --- a/index.js +++ b/index.js @@ -243,7 +243,7 @@ var newClient = function(sdkKey, config) { } } - if (detail.value === null) { + if (detail.variationIndex === null) { config.logger.debug("Result value is null in variation"); detail.value = defaultVal; } diff --git a/test/LDClient-test.js b/test/LDClient-test.js index b07b258..e007864 100644 --- a/test/LDClient-test.js +++ b/test/LDClient-test.js @@ -143,6 +143,35 @@ describe('LDClient', function() { }); }); + it('returns default from variation() for unknown flag', function(done) { + var client = createOnlineClientWithFlags({ }); + var user = { key: 'user' }; + client.on('ready', function() { + client.variation('flagkey', user, 'default', function(err, result) { + expect(err).toBeNull(); + expect(result).toEqual('default'); + done(); + }); + }); + }); + + it('returns default from variation() for flag that evaluates to null', function(done) { + var flag = { + key: 'flagkey', + on: false, + offVariation: null + }; + var client = createOnlineClientWithFlags({ flagkey: flag }); + var user = { key: 'user' }; + client.on('ready', function() { + client.variation(flag.key, user, 'default', function(err, result) { + expect(err).toBeNull(); + expect(result).toEqual('default'); + done(); + }); + }); + }); + it('evaluates a flag with variationDetail()', function(done) { var flag = { key: 'flagkey', @@ -164,6 +193,36 @@ describe('LDClient', function() { }); }); + it('returns default from variationDetail() for unknown flag', function(done) { + var client = createOnlineClientWithFlags({ }); + var user = { key: 'user' }; + client.on('ready', function() { + client.variationDetail('flagkey', user, 'default', function(err, result) { + expect(err).toBeNull(); + expect(result).toMatchObject({ value: 'default', variationIndex: null, + reason: { kind: 'ERROR', errorKind: 'FLAG_NOT_FOUND' } }); + done(); + }); + }); + }); + + it('returns default from variationDetail() for flag that evaluates to null', function(done) { + var flag = { + key: 'flagkey', + on: false, + offVariation: null + }; + var client = createOnlineClientWithFlags({ flagkey: flag }); + var user = { key: 'user' }; + client.on('ready', function() { + client.variationDetail(flag.key, user, 'default', function(err, result) { + expect(err).toBeNull(); + expect(result).toMatchObject({ value: 'default', variationIndex: null, reason: { kind: 'OFF' } }); + done(); + }); + }); + }); + it('generates an event for an existing feature', function(done) { var flag = { key: 'flagkey', From 45dad9d864acf4a0d17a1e2f6dadbd7d9ec9531c Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Fri, 24 Aug 2018 11:49:10 -0700 Subject: [PATCH 27/70] typo --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 5f6f1fb..7cb2044 100644 --- a/index.js +++ b/index.js @@ -233,7 +233,7 @@ var newClient = function(sdkKey, config) { } client.allFlags = function(user, callback) { - config.logger.warn("allFlags() is deprecated. Call 'allFlagsState' instead and call toJson() on the result"); + config.logger.warn("allFlags() is deprecated. Call 'allFlagsState' instead and call toJSON() on the result"); return wrapPromiseCallback( client.allFlagsState(user).then(function(state) { return state.allValues(); From 277c77c3d24075413181c242cef16f641de4ff20 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Mon, 27 Aug 2018 14:57:29 -0700 Subject: [PATCH 28/70] fix allFlagsState behavior when options are omitted --- index.js | 7 ++++++- test/LDClient-test.js | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 7cb2044..d70f12b 100644 --- a/index.js +++ b/index.js @@ -242,7 +242,12 @@ var newClient = function(sdkKey, config) { } client.allFlagsState = function(user, options, callback) { - options = options || {}; + if (callback === undefined && typeof(options) === 'function') { + callback = options; + options = {}; + } else { + options = options || {}; + } return wrapPromiseCallback(new Promise(function(resolve, reject) { sanitizeUser(user); diff --git a/test/LDClient-test.js b/test/LDClient-test.js index bb132a7..e297e45 100644 --- a/test/LDClient-test.js +++ b/test/LDClient-test.js @@ -333,6 +333,20 @@ describe('LDClient', function() { }); }); + it('can omit options parameter for allFlagsState()', function(done) { + var flag = { key: 'key', on: false, offVariation: 0, variations: ['value'] }; + var client = createOnlineClientWithFlags({ 'key': flag }); + var user = { key: 'user' }; + client.on('ready', function() { + client.allFlagsState(user, function(err, state) { + expect(err).toBeNull(); + expect(state.valid).toEqual(true); + expect(state.allValues()).toEqual({ 'key': 'value' }); + done(); + }); + }); + }); + it('should not overflow the call stack when evaluating a huge number of flags', function(done) { var flagCount = 5000; var flags = {}; From 1217a54784f7b0d955aad09e210d1c1ebbc5698d Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Wed, 29 Aug 2018 11:38:34 -0700 Subject: [PATCH 29/70] fix for ch22995 - send event for prerequisite even if it's off --- evaluate_flag.js | 8 +++----- test/evaluate_flag-test.js | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/evaluate_flag.js b/evaluate_flag.js index 4e68bef..d985778 100644 --- a/evaluate_flag.js +++ b/evaluate_flag.js @@ -58,17 +58,15 @@ function checkPrerequisites(flag, user, featureStore, events, cb) { callback({ key: prereq.key, err: new Error("Could not retrieve prerequisite feature flag \"" + prereq.key + "\"") }); return; } - if (!f.on) { - callback({ key: prereq.key }); - return; - } evalInternal(f, user, featureStore, events, function(err, detail) { // If there was an error, the value is null, the variation index is out of range, // or the value does not match the indexed variation the prerequisite is not satisfied events.push(createFlagEvent(f.key, f, user, detail, null, flag.key, true)); if (err) { callback({ key: prereq.key, err: err }); - } else if (detail.variationIndex != prereq.variation) { + } else if (!f.on || detail.variationIndex != prereq.variation) { + // Note that if the prerequisite flag is off, we don't consider it a match no matter what its + // off variation was. But we still evaluate it and generate an event. callback({ key: prereq.key }); } else { // The prerequisite was satisfied diff --git a/test/evaluate_flag-test.js b/test/evaluate_flag-test.js index 181e9c6..ca6ce35 100644 --- a/test/evaluate_flag-test.js +++ b/test/evaluate_flag-test.js @@ -116,6 +116,43 @@ describe('evaluate', function() { }); }); + it('returns off variation and event if prerequisite is off', function(done) { + var flag = { + key: 'feature0', + on: true, + prerequisites: [{key: 'feature1', variation: 1}], + fallthrough: { variation: 0 }, + offVariation: 1, + targets: [], + rules: [], + variations: ['a', 'b', 'c'], + version: 1 + }; + var flag1 = { + key: 'feature1', + on: false, + offVariation: 1, + // note that even though it returns the desired variation, it is still off and therefore not a match + fallthrough: { variation: 0 }, + targets: [], + rules: [], + variations: ['d', 'e'], + version: 2 + }; + defineFeatures([flag, flag1], function() { + var user = { key: 'x' }; + var eventsShouldBe = [ + { kind: 'feature', key: 'feature1', variation: 1, value: 'e', version: 2, prereqOf: 'feature0' } + ]; + evaluate.evaluate(flag, user, featureStore, function(err, detail, events) { + expect(detail).toMatchObject({ value: 'b', variationIndex: 1, + reason: { kind: 'PREREQUISITE_FAILED', prerequisiteKey: 'feature1' } }); + expect(events).toMatchObject(eventsShouldBe); + done(); + }); + }); + }); + it('returns off variation and event if prerequisite is not met', function(done) { var flag = { key: 'feature0', From 07b6eb490509633969f98c55599db118ebbcf4df Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Wed, 29 Aug 2018 12:06:35 -0700 Subject: [PATCH 30/70] validate TypeScript definitions in CI build --- index.d.ts | 2 +- package-lock.json | 6 ++++++ package.json | 3 ++- test-types.ts | 3 +++ tsconfig.json | 6 +++++- 5 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 test-types.ts diff --git a/index.d.ts b/index.d.ts index b94a870..ea534d0 100644 --- a/index.d.ts +++ b/index.d.ts @@ -84,7 +84,7 @@ declare module 'ldclient-node' { * the needs of the JavaScript client. */ toJSON: () => object; - }; + } /** * LaunchDarkly initialization options. diff --git a/package-lock.json b/package-lock.json index db4b1e6..2468223 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5877,6 +5877,12 @@ "integrity": "sha1-dkb7XxiHHPu3dJ5pvTmmOI63RQw=", "dev": true }, + "typescript": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.0.1.tgz", + "integrity": "sha512-zQIMOmC+372pC/CCVLqnQ0zSBiY7HHodU7mpQdjiZddek4GMj31I3dUJ7gAs9o65X7mnRma6OokOkc6f9jjfBg==", + "dev": true + }, "uglify-js": { "version": "2.8.29", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", diff --git a/package.json b/package.json index 2ac8809..25f47ee 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,8 @@ "devDependencies": { "jest": "22.4.3", "jest-junit": "3.6.0", - "nock": "9.2.3" + "nock": "9.2.3", + "typescript": "3.0.1" }, "jest": { "rootDir": ".", diff --git a/test-types.ts b/test-types.ts new file mode 100644 index 0000000..234febc --- /dev/null +++ b/test-types.ts @@ -0,0 +1,3 @@ + +// This file exists only so that we can run the TypeScript compiler in the CI build +// to valid our index.d.ts file. diff --git a/tsconfig.json b/tsconfig.json index 918b0e1..3b8c161 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,5 +5,9 @@ "lib": [ "es6" ] - } + }, + "files": [ + "index.d.ts", + "test-types.ts" + ] } \ No newline at end of file From 01c83716a25f619591a427249f6180a52524760c Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Wed, 29 Aug 2018 12:08:47 -0700 Subject: [PATCH 31/70] add tsc build step --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index c876306..62bef83 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,6 +16,7 @@ node-template: &node-template command: npm test environment: JEST_JUNIT_OUTPUT: "reports/junit/js-test-results.xml" + - run: tsc - run: | if [[ $CIRCLE_JOB == current-release ]]; then npm audit From a15959c6e0f3cdc4b7361b59864044a7c725678e Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Wed, 29 Aug 2018 12:11:16 -0700 Subject: [PATCH 32/70] fix tsc command --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 62bef83..b8e5767 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,7 +16,7 @@ node-template: &node-template command: npm test environment: JEST_JUNIT_OUTPUT: "reports/junit/js-test-results.xml" - - run: tsc + - run: node_modules/typescript/bin/tsc - run: | if [[ $CIRCLE_JOB == current-release ]]; then npm audit From aad1895de43a7e31654a78b9e2c2df46eb168771 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Wed, 29 Aug 2018 12:18:47 -0700 Subject: [PATCH 33/70] add npm script --- .circleci/config.yml | 2 +- package.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b8e5767..8b8a577 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,7 +16,7 @@ node-template: &node-template command: npm test environment: JEST_JUNIT_OUTPUT: "reports/junit/js-test-results.xml" - - run: node_modules/typescript/bin/tsc + - run: npm run check-typescript - run: | if [[ $CIRCLE_JOB == current-release ]]; then npm audit diff --git a/package.json b/package.json index 25f47ee..e7c7f52 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "description": "LaunchDarkly SDK for Node.js", "main": "index.js", "scripts": { - "test": "jest --ci --forceExit" + "test": "jest --ci --forceExit", + "check-typescript": "node_modules/typescript/bin/tsc" }, "types": "./index.d.ts", "repository": { From 623956a1f55fea457c411db2efc96e47063f46ef Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Wed, 29 Aug 2018 12:28:18 -0700 Subject: [PATCH 34/70] typo --- test-types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-types.ts b/test-types.ts index 234febc..331dd28 100644 --- a/test-types.ts +++ b/test-types.ts @@ -1,3 +1,3 @@ // This file exists only so that we can run the TypeScript compiler in the CI build -// to valid our index.d.ts file. +// to validate our index.d.ts file. From 48e750b5ffef1e05fd0f094fc22dbb411baed256 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Wed, 29 Aug 2018 13:05:40 -0700 Subject: [PATCH 35/70] TS syntax error --- index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index efd592c..ab78012 100644 --- a/index.d.ts +++ b/index.d.ts @@ -626,7 +626,7 @@ declare module 'ldclient-node' { key: string, user: LDUser, defaultValue: LDFlagValue, - callback?: (err: ay, res: LDEvaluationDetail) => void + callback?: (err: any, res: LDEvaluationDetail) => void ) => Promise; toggle: ( From 7f2c79755553392d17a5ae65c894e3e462f26e3b Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Thu, 30 Aug 2018 18:19:42 -0700 Subject: [PATCH 36/70] fix "indirect put" and add tests for streaming --- feature_store.js | 2 +- streaming.js | 40 ++++- test/streaming-test.js | 321 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 355 insertions(+), 8 deletions(-) create mode 100644 test/streaming-test.js diff --git a/feature_store.js b/feature_store.js index c65a3d6..ec21e22 100644 --- a/feature_store.js +++ b/feature_store.js @@ -73,7 +73,7 @@ function InMemoryFeatureStore() { var items = this.allData[kind.namespace]; if (!items) { items = {}; - this.allData[kind] = items; + this.allData[kind.namespace] = items; } if (Object.hasOwnProperty.call(items, key)) { diff --git a/streaming.js b/streaming.js index 16b5498..18a67ee 100644 --- a/streaming.js +++ b/streaming.js @@ -3,18 +3,20 @@ var errors = require('./errors'); var EventSource = require('./eventsource'); var dataKind = require('./versioned_data_kind'); -function StreamProcessor(sdkKey, config, requestor) { +function StreamProcessor(sdkKey, config, requestor, eventSourceFactory) { var processor = {}, featureStore = config.featureStore, es; + eventSourceFactory = eventSourceFactory || EventSource; + function getKeyFromPath(kind, path) { return path.startsWith(kind.streamApiPath) ? path.substring(kind.streamApiPath.length) : null; } processor.start = function(fn) { var cb = fn || function(){}; - es = new EventSource(config.streamUri + "/all", + es = eventSourceFactory(config.streamUri + "/all", { agent: config.proxyAgent, headers: {'Authorization': sdkKey,'User-Agent': config.userAgent} @@ -24,10 +26,22 @@ function StreamProcessor(sdkKey, config, requestor) { cb(new errors.LDStreamingError(err.message, err.code)); }; + function reportJsonError(type, data) { + config.logger.error('Stream received invalid data in "' + type + '" message'); + config.logger.debug('Invalid JSON follows: ' + data); + cb(new errors.LDStreamingError('Malformed JSON data in event stream')); + } + es.addEventListener('put', function(e) { config.logger.debug('Received put event'); if (e && e.data) { - var all = JSON.parse(e.data); + var all; + try { + all = JSON.parse(e.data); + } catch (err) { + reportJsonError('put', e.data); + return; + } var initData = {}; initData[dataKind.features.namespace] = all.data.flags; initData[dataKind.segments.namespace] = all.data.segments; @@ -42,7 +56,13 @@ function StreamProcessor(sdkKey, config, requestor) { es.addEventListener('patch', function(e) { config.logger.debug('Received patch event'); if (e && e.data) { - var patch = JSON.parse(e.data); + var patch; + try { + patch = JSON.parse(e.data); + } catch (err) { + reportJsonError('patch', e.data); + return; + } for (var k in dataKind) { var kind = dataKind[k]; var key = getKeyFromPath(kind, patch.path); @@ -60,8 +80,14 @@ function StreamProcessor(sdkKey, config, requestor) { es.addEventListener('delete', function(e) { config.logger.debug('Received delete event'); if (e && e.data) { - var data = JSON.parse(e.data), - version = data.version; + var data, version; + try { + data = JSON.parse(e.data); + } catch (err) { + reportJsonError('delete', e.data); + return; + } + version = data.version; for (var k in dataKind) { var kind = dataKind[k]; var key = getKeyFromPath(kind, data.path); @@ -78,7 +104,7 @@ function StreamProcessor(sdkKey, config, requestor) { es.addEventListener('indirect/put', function(e) { config.logger.debug('Received indirect put event') - requestor.requestAllFlags(function (err, resp) { + requestor.requestAllData(function (err, resp) { if (err) { cb(err); } else { diff --git a/test/streaming-test.js b/test/streaming-test.js new file mode 100644 index 0000000..fea8ec5 --- /dev/null +++ b/test/streaming-test.js @@ -0,0 +1,321 @@ +var InMemoryFeatureStore = require('../feature_store'); +var StreamProcessor = require('../streaming'); +var dataKind = require('../versioned_data_kind'); + +describe('StreamProcessor', function() { + var sdkKey = 'SDK_KEY'; + + function fakeEventSource() { + var es = { handlers: {} }; + es.initialize = function(url, options) { + es.url = url; + es.options = options; + return es; + }; + es.addEventListener = function(type, handler) { + es.handlers[type] = handler; + }; + return es; + } + + function fakeLogger() { + return { + debug: jest.fn(), + error: jest.fn() + }; + } + + function expectJsonError(config, done) { + return function(err) { + expect(err).not.toBe(undefined); + expect(err.message).toEqual('Malformed JSON data in event stream'); + expect(config.logger.error).toHaveBeenCalled(); + done(); + } + } + + it('uses expected URL', function() { + var config = { streamUri: 'http://test' }; + var es = fakeEventSource(); + var sp = StreamProcessor(sdkKey, config, null, es.initialize); + sp.start(); + expect(es.url).toEqual(config.streamUri + '/all'); + }); + + it('sets expected headers', function() { + var config = { streamUri: 'http://test', userAgent: 'agent' }; + var es = fakeEventSource(); + var sp = StreamProcessor(sdkKey, config, null, es.initialize); + sp.start(); + expect(es.options.headers['Authorization']).toEqual(sdkKey); + expect(es.options.headers['User-Agent']).toEqual(config.userAgent); + }); + + describe('put message', function() { + var putData = { + data: { + flags: { + flagkey: { key: 'flagkey', version: 1 } + }, + segments: { + segkey: { key: 'segkey', version: 2 } + } + } + }; + + it('causes flags and segments to be stored', function(done) { + var featureStore = InMemoryFeatureStore(); + var config = { featureStore: featureStore, logger: fakeLogger() }; + var es = fakeEventSource(); + var sp = StreamProcessor(sdkKey, config, null, es.initialize); + sp.start(); + + es.handlers.put({ data: JSON.stringify(putData) }); + + featureStore.initialized(function(flag) { + expect(flag).toEqual(true); + }); + + featureStore.get(dataKind.features, 'flagkey', function(f) { + expect(f.version).toEqual(1); + featureStore.get(dataKind.segments, 'segkey', function(s) { + expect(s.version).toEqual(2); + done(); + }); + }); + }); + + it('calls initialization callback', function(done) { + var featureStore = InMemoryFeatureStore(); + var config = { featureStore: featureStore, logger: fakeLogger() }; + var es = fakeEventSource(); + var sp = StreamProcessor(sdkKey, config, null, es.initialize); + + var cb = function(err) { + expect(err).toBe(undefined); + done(); + } + + sp.start(cb); + es.handlers.put({ data: JSON.stringify(putData) }); + }); + + it('passes error to callback if data is invalid', function(done) { + var featureStore = InMemoryFeatureStore(); + var config = { featureStore: featureStore, logger: fakeLogger() }; + var es = fakeEventSource(); + var sp = StreamProcessor(sdkKey, config, null, es.initialize); + + sp.start(expectJsonError(config, done)); + es.handlers.put({ data: '{not-good' }); + }); + }); + + describe('patch message', function() { + it('updates flag', function(done) { + var featureStore = InMemoryFeatureStore(); + var config = { featureStore: featureStore, logger: fakeLogger() }; + var es = fakeEventSource(); + var sp = StreamProcessor(sdkKey, config, null, es.initialize); + + var patchData = { + path: '/flags/flagkey', + data: { key: 'flagkey', version: 1 } + }; + + sp.start(); + es.handlers.patch({ data: JSON.stringify(patchData) }); + + featureStore.get(dataKind.features, 'flagkey', function(f) { + expect(f.version).toEqual(1); + done(); + }); + }); + + it('updates segment', function(done) { + var featureStore = InMemoryFeatureStore(); + var config = { featureStore: featureStore, logger: fakeLogger() }; + var es = fakeEventSource(); + var sp = StreamProcessor(sdkKey, config, null, es.initialize); + + var patchData = { + path: '/segments/segkey', + data: { key: 'segkey', version: 1 } + }; + + sp.start(); + es.handlers.patch({ data: JSON.stringify(patchData) }); + + featureStore.get(dataKind.segments, 'segkey', function(s) { + expect(s.version).toEqual(1); + done(); + }); + }); + + it('passes error to callback if data is invalid', function(done) { + var featureStore = InMemoryFeatureStore(); + var config = { featureStore: featureStore, logger: fakeLogger() }; + var es = fakeEventSource(); + var sp = StreamProcessor(sdkKey, config, null, es.initialize); + + sp.start(expectJsonError(config, done)); + es.handlers.patch({ data: '{not-good' }); + }); + }); + + describe('delete message', function() { + it('deletes flag', function(done) { + var featureStore = InMemoryFeatureStore(); + var config = { featureStore: featureStore, logger: fakeLogger() }; + var es = fakeEventSource(); + var sp = StreamProcessor(sdkKey, config, null, es.initialize); + + sp.start(); + + var flag = { key: 'flagkey', version: 1 } + featureStore.upsert(dataKind.features, flag, function() { + featureStore.get(dataKind.features, flag.key, function(f) { + expect(f).toEqual(flag); + + var deleteData = { path: '/flags/' + flag.key, version: 2 }; + es.handlers.delete({ data: JSON.stringify(deleteData) }); + + featureStore.get(dataKind.features, flag.key, function(f) { + expect(f).toBe(null); + done(); + }) + }); + }); + }); + + it('deletes segment', function(done) { + var featureStore = InMemoryFeatureStore(); + var config = { featureStore: featureStore, logger: fakeLogger() }; + var es = fakeEventSource(); + var sp = StreamProcessor(sdkKey, config, null, es.initialize); + + sp.start(); + + var segment = { key: 'segkey', version: 1 } + featureStore.upsert(dataKind.segments, segment, function() { + featureStore.get(dataKind.segments, segment.key, function(s) { + expect(s).toEqual(segment); + + var deleteData = { path: '/segments/' + segment.key, version: 2 }; + es.handlers.delete({ data: JSON.stringify(deleteData) }); + + featureStore.get(dataKind.segments, segment.key, function(s) { + expect(s).toBe(null); + done(); + }) + }); + }); + }); + + it('passes error to callback if data is invalid', function(done) { + var featureStore = InMemoryFeatureStore(); + var config = { featureStore: featureStore, logger: fakeLogger() }; + var es = fakeEventSource(); + var sp = StreamProcessor(sdkKey, config, null, es.initialize); + + sp.start(expectJsonError(config, done)); + es.handlers.delete({ data: '{not-good' }); + }); + }); + + describe('indirect put message', function() { + var allData = { + flags: { + flagkey: { key: 'flagkey', version: 1 } + }, + segments: { + segkey: { key: 'segkey', version: 2 } + } + }; + var fakeRequestor = { + requestAllData: function(cb) { + cb(null, JSON.stringify(allData)); + } + }; + + it('requests and stores flags and segments', function(done) { + var featureStore = InMemoryFeatureStore(); + var config = { featureStore: featureStore, logger: fakeLogger() }; + var es = fakeEventSource(); + var sp = StreamProcessor(sdkKey, config, fakeRequestor, es.initialize); + + sp.start(); + + es.handlers['indirect/put']({}); + + setImmediate(function() { + featureStore.get(dataKind.features, 'flagkey', function(f) { + expect(f.version).toEqual(1); + featureStore.get(dataKind.segments, 'segkey', function(s) { + expect(s.version).toEqual(2); + featureStore.initialized(function(flag) { + expect(flag).toBe(true); + }); + done(); + }); + }); + }); + }); + }); + + describe('indirect patch message', function() { + it('requests and updates flag', function(done) { + var flag = { key: 'flagkey', version: 1 }; + var fakeRequestor = { + requestObject: function(kind, key, cb) { + expect(kind).toBe(dataKind.features); + expect(key).toEqual(flag.key); + cb(null, JSON.stringify(flag)); + } + }; + + var featureStore = InMemoryFeatureStore(); + var config = { featureStore: featureStore, logger: fakeLogger() }; + var es = fakeEventSource(); + var sp = StreamProcessor(sdkKey, config, fakeRequestor, es.initialize); + + sp.start(); + + es.handlers['indirect/patch']({ data: '/flags/flagkey' }); + + setImmediate(function() { + featureStore.get(dataKind.features, 'flagkey', function(f) { + expect(f.version).toEqual(1); + done(); + }); + }); + }); + + it('requests and updates segment', function(done) { + var segment = { key: 'segkey', version: 1 }; + var fakeRequestor = { + requestObject: function(kind, key, cb) { + expect(kind).toBe(dataKind.segments); + expect(key).toEqual(segment.key); + cb(null, JSON.stringify(segment)); + } + }; + + var featureStore = InMemoryFeatureStore(); + var config = { featureStore: featureStore, logger: fakeLogger() }; + var es = fakeEventSource(); + var sp = StreamProcessor(sdkKey, config, fakeRequestor, es.initialize); + + sp.start(); + + es.handlers['indirect/patch']({ data: '/segments/segkey' }); + + setImmediate(function() { + featureStore.get(dataKind.segments, 'segkey', function(s) { + expect(s.version).toEqual(1); + done(); + }); + }); + }); + }); +}); From 135b45871067f1f89f3472d09d9ae662623a0f8b Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Wed, 5 Sep 2018 10:42:19 -0700 Subject: [PATCH 37/70] fix error handling for malformed flags --- evaluate_flag.js | 6 +- test/evaluate_flag-test.js | 171 +++++++++++++++++++++++++++++++------ 2 files changed, 148 insertions(+), 29 deletions(-) diff --git a/evaluate_flag.js b/evaluate_flag.js index d985778..6eb1dcb 100644 --- a/evaluate_flag.js +++ b/evaluate_flag.js @@ -258,7 +258,7 @@ function matchAny(matchFn, value, values) { function getVariation(flag, index, reason, cb) { if (index === null || index === undefined || index < 0 || index >= flag.variations.length) { - cb(new Error('Invalid variation index in flag', errResult('MALFORMED_FLAG'))); + cb(new Error('Invalid variation index in flag'), errorResult('MALFORMED_FLAG')); } else { cb(null, { value: flag.variations[index], variationIndex: index, reason: reason }); } @@ -274,11 +274,11 @@ function getOffResult(flag, reason, cb) { function getResultForVariationOrRollout(r, user, flag, reason, cb) { if (!r) { - cb(new Error('Fallthrough variation undefined'), errResult('MALFORMED_FLAG')); + cb(new Error('Fallthrough variation undefined'), errorResult('MALFORMED_FLAG')); } else { var index = variationForUser(r, user, flag); if (index === null) { - cb(new Error('Variation/rollout object with no variation or rollout'), errResult('MALFORMED_FLAG')); + cb(new Error('Variation/rollout object with no variation or rollout'), errorResult('MALFORMED_FLAG')); } else { getVariation(flag, index, reason, cb); } diff --git a/test/evaluate_flag-test.js b/test/evaluate_flag-test.js index ca6ce35..61367da 100644 --- a/test/evaluate_flag-test.js +++ b/test/evaluate_flag-test.js @@ -28,6 +28,21 @@ function evalBooleanFlag(flag, user, cb) { }); } +function makeFlagWithRules(rules, fallthrough) { + if (!fallthrough) { + fallthrough = { variation: 0 }; + } + return { + key: 'feature', + on: true, + rules: rules, + targets: [], + fallthrough: fallthrough, + offVariation: 1, + variations: ['a', 'b', 'c'] + }; +} + function makeBooleanFlagWithOneClause(clause) { return { key: 'feature', @@ -80,17 +95,44 @@ describe('evaluate', function() { }); }); - it('returns fallthrough if flag is on and there are no rules', function(done) { + it('returns error if off variation is too high', function(done) { var flag = { key: 'feature', - on: true, - rules: [], - targets: [], - offVariation: null, + on: false, + offVariation: 99, + fallthrough: { variation: 0 }, + variations: ['a', 'b', 'c'] + }; + var user = { key: 'x' }; + evaluate.evaluate(flag, user, featureStore, function(err, detail, events) { + expect(err).toEqual(Error('Invalid variation index in flag')); + expect(detail).toMatchObject({ value: null, variationIndex: null, reason: { kind: 'ERROR', errorKind: 'MALFORMED_FLAG' } }); + expect(events).toMatchObject([]); + done(); + }); + }); + + it('returns error if off variation is negative', function(done) { + var flag = { + key: 'feature', + on: false, + offVariation: -1, fallthrough: { variation: 0 }, variations: ['a', 'b', 'c'] }; var user = { key: 'x' }; + evaluate.evaluate(flag, user, featureStore, function(err, detail, events) { + expect(err).toEqual(Error('Invalid variation index in flag')); + expect(detail).toMatchObject({ value: null, variationIndex: null, reason: { kind: 'ERROR', errorKind: 'MALFORMED_FLAG' } }); + expect(events).toMatchObject([]); + done(); + }); + }); + + it('returns fallthrough variation if flag is on and no rules match', function(done) { + var rule = { id: 'id', clauses: [{ attribute: 'key', op: 'in', values: ['other'] }], variation: 2 }; + var flag = makeFlagWithRules([rule], { variation: 0 }); + var user = { key: 'x' }; evaluate.evaluate(flag, user, featureStore, function(err, detail, events) { expect(detail).toMatchObject({ value: 'a', variationIndex: 0, reason: { kind: 'FALLTHROUGH' } }); expect(events).toMatchObject([]); @@ -98,6 +140,54 @@ describe('evaluate', function() { }); }); + it('returns error if fallthrough variation is too high', function(done) { + var rule = { id: 'id', clauses: [{ attribute: 'key', op: 'in', values: ['other'] }], variation: 99 }; + var flag = makeFlagWithRules([rule], { variation: 99 }); + var user = { key: 'x' }; + evaluate.evaluate(flag, user, featureStore, function(err, detail, events) { + expect(err).toEqual(Error('Invalid variation index in flag')); + expect(detail).toMatchObject({ value: null, variationIndex: null, reason: { kind: 'ERROR', errorKind: 'MALFORMED_FLAG' }}); + expect(events).toMatchObject([]); + done(); + }); + }); + + it('returns error if fallthrough variation is negative', function(done) { + var rule = { id: 'id', clauses: [{ attribute: 'key', op: 'in', values: ['other'] }], variation: 99 }; + var flag = makeFlagWithRules([rule], { variation: -1 }); + var user = { key: 'x' }; + evaluate.evaluate(flag, user, featureStore, function(err, detail, events) { + expect(err).toEqual(Error('Invalid variation index in flag')); + expect(detail).toMatchObject({ value: null, variationIndex: null, reason: { kind: 'ERROR', errorKind: 'MALFORMED_FLAG' }}); + expect(events).toMatchObject([]); + done(); + }); + }); + + it('returns error if fallthrough has no variation or rollout', function(done) { + var rule = { id: 'id', clauses: [{ attribute: 'key', op: 'in', values: ['other'] }], variation: 99 }; + var flag = makeFlagWithRules([rule], { }); + var user = { key: 'x' }; + evaluate.evaluate(flag, user, featureStore, function(err, detail, events) { + expect(err).toEqual(Error('Variation/rollout object with no variation or rollout')); + expect(detail).toMatchObject({ value: null, variationIndex: null, reason: { kind: 'ERROR', errorKind: 'MALFORMED_FLAG' }}); + expect(events).toMatchObject([]); + done(); + }); + }); + + it('returns error if fallthrough has rollout with no variations', function(done) { + var rule = { id: 'id', clauses: [{ attribute: 'key', op: 'in', values: ['other'] }], variation: 99 }; + var flag = makeFlagWithRules([rule], { rollout: { variations: [] } }); + var user = { key: 'x' }; + evaluate.evaluate(flag, user, featureStore, function(err, detail, events) { + expect(err).toEqual(Error('Variation/rollout object with no variation or rollout')); + expect(detail).toMatchObject({ value: null, variationIndex: null, reason: { kind: 'ERROR', errorKind: 'MALFORMED_FLAG' }}); + expect(events).toMatchObject([]); + done(); + }); + }); + it('returns off variation if prerequisite is not found', function(done) { var flag = { key: 'feature0', @@ -223,27 +313,8 @@ describe('evaluate', function() { }); it('matches user from rules', function(done) { - var flag = { - key: 'feature0', - on: true, - rules: [ - { - id: 'id', - clauses: [ - { - attribute: 'key', - op: 'in', - values: ['userkey'] - } - ], - variation: 2 - } - ], - targets: [], - fallthrough: { variation: 0 }, - offVariation: 1, - variations: ['a', 'b', 'c'] - }; + var rule = { id: 'id', clauses: [{ attribute: 'key', op: 'in', values: ['userkey'] }], variation: 2 }; + var flag = makeFlagWithRules([rule]); var user = { key: 'userkey' }; evaluate.evaluate(flag, user, featureStore, function(err, detail, events) { expect(detail).toMatchObject({ value: 'c', variationIndex: 2, @@ -253,6 +324,54 @@ describe('evaluate', function() { }); }); + it('returns error if rule variation is too high', function(done) { + var rule = { id: 'id', clauses: [{ attribute: 'key', op: 'in', values: ['userkey'] }], variation: 99 }; + var flag = makeFlagWithRules([rule]); + var user = { key: 'userkey' }; + evaluate.evaluate(flag, user, featureStore, function(err, detail, events) { + expect(err).toEqual(Error('Invalid variation index in flag')); + expect(detail).toMatchObject({ value: null, variationIndex: null, reason: { kind: 'ERROR', errorKind: 'MALFORMED_FLAG' }}); + expect(events).toMatchObject([]); + done(); + }); + }); + + it('returns error if rule variation is negative', function(done) { + var rule = { id: 'id', clauses: [{ attribute: 'key', op: 'in', values: ['userkey'] }], variation: -1 }; + var flag = makeFlagWithRules([rule]); + var user = { key: 'userkey' }; + evaluate.evaluate(flag, user, featureStore, function(err, detail, events) { + expect(err).toEqual(Error('Invalid variation index in flag')); + expect(detail).toMatchObject({ value: null, variationIndex: null, reason: { kind: 'ERROR', errorKind: 'MALFORMED_FLAG' }}); + expect(events).toMatchObject([]); + done(); + }); + }); + + it('returns error if rule has no variation or rollout', function(done) { + var rule = { id: 'id', clauses: [{ attribute: 'key', op: 'in', values: ['userkey'] }] }; + var flag = makeFlagWithRules([rule]); + var user = { key: 'userkey' }; + evaluate.evaluate(flag, user, featureStore, function(err, detail, events) { + expect(err).toEqual(Error('Variation/rollout object with no variation or rollout')); + expect(detail).toMatchObject({ value: null, variationIndex: null, reason: { kind: 'ERROR', errorKind: 'MALFORMED_FLAG' }}); + expect(events).toMatchObject([]); + done(); + }); + }); + + it('returns error if rule has rollout with no variations', function(done) { + var rule = { id: 'id', clauses: [{ attribute: 'key', op: 'in', values: ['userkey'] }], rollout: { variations: [] } }; + var flag = makeFlagWithRules([rule]); + var user = { key: 'userkey' }; + evaluate.evaluate(flag, user, featureStore, function(err, detail, events) { + expect(err).toEqual(Error('Variation/rollout object with no variation or rollout')); + expect(detail).toMatchObject({ value: null, variationIndex: null, reason: { kind: 'ERROR', errorKind: 'MALFORMED_FLAG' }}); + expect(events).toMatchObject([]); + done(); + }); + }); + it('matches user from targets', function(done) { var flag = { key: 'feature0', From e4af191bc9a886cf66c475eea91bfdd8e05582f9 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Wed, 5 Sep 2018 17:44:52 -0700 Subject: [PATCH 38/70] prevent unhandled rejection from background flush --- event_processor.js | 2 +- index.d.ts | 8 +++++++- index.js | 10 +--------- test/event_processor-test.js | 20 ++++++++++++++++++++ 4 files changed, 29 insertions(+), 11 deletions(-) diff --git a/event_processor.js b/event_processor.js index 42bfdb2..1a8ec59 100644 --- a/event_processor.js +++ b/event_processor.js @@ -226,7 +226,7 @@ function EventProcessor(sdkKey, config, errorReporter) { } flushTimer = setInterval(function() { - ep.flush(); + ep.flush().then(function() { } , function() { }); }, config.flushInterval * 1000); flushUsersTimer = setInterval(function() { userKeysCache.removeAll(); diff --git a/index.d.ts b/index.d.ts index ab78012..6636e1c 100644 --- a/index.d.ts +++ b/index.d.ts @@ -733,7 +733,13 @@ declare module 'ldclient-node' { * These are flushed periodically (see configuration option: flushInterval) * and when the queue size limit (see configuration option: capacity) is reached. * - * @returns a Promise which resolves once flushing is finished + * @param callback + * A function which will be called when the flush completes; if omitted, you + * will receive a Promise instead + * + * @returns a Promise which resolves once flushing is finished, if you did not + * provide a callback; note that it will be rejected if the HTTP request fails, so be + * sure to provide a rejection handler if you are not using a callback */ flush: (callback?: (err: any, res: boolean) => void) => Promise; } diff --git a/index.js b/index.js index 79a97c5..65aad25 100644 --- a/index.js +++ b/index.js @@ -58,8 +58,7 @@ var newClient = function(sdkKey, config) { queue = [], requestor, updateProcessor, - eventProcessor, - flushTimer; + eventProcessor; config = configuration.validate(config); @@ -323,7 +322,6 @@ var newClient = function(sdkKey, config) { updateProcessor.close(); } config.featureStore.close(); - clearInterval(flushTimer); } client.isOffline = function() { @@ -362,10 +360,6 @@ var newClient = function(sdkKey, config) { eventProcessor.sendEvent(event); } - function backgroundFlush() { - client.flush().then(function() {}, function() {}); - } - function deprecatedMethod(oldName, newName) { client[oldName] = function() { config.logger.warn(messages.deprecated(oldName, newName)); @@ -377,8 +371,6 @@ var newClient = function(sdkKey, config) { deprecatedMethod('is_offline', 'isOffline'); deprecatedMethod('secure_mode_hash', 'secureModeHash'); - flushTimer = setInterval(backgroundFlush, config.flushInterval * 1000); - return client; }; diff --git a/test/event_processor-test.js b/test/event_processor-test.js index eb0f8f8..75646ce 100644 --- a/test/event_processor-test.js +++ b/test/event_processor-test.js @@ -481,4 +481,24 @@ describe('EventProcessor', function() { it('retries after a 503 error', function(done) { verifyRecoverableHttpError(done, 503); }); + + it('swallows errors from failed background flush', function(done) { + // This test verifies that when a background flush fails, we don't emit an unhandled + // promise rejection. Jest will fail the test if we do that. + + var config = Object.assign({}, defaultConfig, { flushInterval: 0.25 }); + ep = EventProcessor(sdkKey, config); + ep.sendEvent({ kind: 'identify', creationDate: 1000, user: user }); + + var req1 = nock(eventsUri).post('/bulk').reply(500); + var req2 = nock(eventsUri).post('/bulk').reply(500); + + // unfortunately we must wait for both the flush interval and the 1-second retry interval + var delay = 1500; + setTimeout(function() { + expect(req1.isDone()).toEqual(true); + expect(req2.isDone()).toEqual(true); + done(); + }, delay); + }); }); From 3ea8cb29aac5245208fcc92604216033aea6a75d Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Thu, 4 Oct 2018 19:27:47 -0700 Subject: [PATCH 39/70] add option to reduce front-end metadata for untracked flags --- flags_state.js | 19 +++++++++------ index.d.ts | 11 +++++++++ index.js | 3 ++- test/LDClient-test.js | 57 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 81 insertions(+), 9 deletions(-) diff --git a/flags_state.js b/flags_state.js index 5a7a2eb..ba8b620 100644 --- a/flags_state.js +++ b/flags_state.js @@ -4,21 +4,24 @@ function FlagsStateBuilder(valid) { var flagValues = {}; var flagMetadata = {}; - builder.addFlag = function(flag, value, variation, reason) { + builder.addFlag = function(flag, value, variation, reason, detailsOnlyIfTracked) { flagValues[flag.key] = value; - var meta = { - version: flag.version, - trackEvents: flag.trackEvents - }; + var meta = {}; + if (!detailsOnlyIfTracked || flag.trackEvents || flag.debugEventsUntilDate) { + meta.version = flag.version; + if (reason) { + meta.reason = reason; + } + } if (variation !== undefined && variation !== null) { meta.variation = variation; } + if (flag.trackEvents) { + meta.trackEvents = true; + } if (flag.debugEventsUntilDate !== undefined && flag.debugEventsUntilDate !== null) { meta.debugEventsUntilDate = flag.debugEventsUntilDate; } - if (reason) { - meta.reason = reason; - } flagMetadata[flag.key] = meta; }; diff --git a/index.d.ts b/index.d.ts index 6636e1c..2b526ed 100644 --- a/index.d.ts +++ b/index.d.ts @@ -538,6 +538,17 @@ declare module 'ldclient-node' { * client-side SDK. By default, all flags are included. */ clientSideOnly?: boolean; + /** + * True if evaluation reason data should be captured in the state object (see LDClient.variationDetail). + * By default, it is not. + */ + withReasons?: boolean; + /** + * True if any flag metadata that is normally only used for event generation - such as flag versions and + * evaluation reasons - should be omitted for any flag that does not have event tracking or debugging turned on. + * This reduces the size of the JSON data if you are passing the flag state to the front end. + */ + detailsOnlyForTrackedFlags?: boolean; }; /** diff --git a/index.js b/index.js index 65aad25..3446b41 100644 --- a/index.js +++ b/index.js @@ -289,6 +289,7 @@ var newClient = function(sdkKey, config) { var builder = FlagsStateBuilder(true); var clientOnly = options.clientSideOnly; var withReasons = options.withReasons; + var detailsOnlyIfTracked = options.detailsOnlyForTrackedFlags; config.featureStore.all(dataKind.features, function(flags) { async.forEachOf(flags, function(flag, key, iterateeCb) { if (clientOnly && !flag.clientSide) { @@ -299,7 +300,7 @@ var newClient = function(sdkKey, config) { if (err != null) { maybeReportError(new Error('Error for feature flag "' + flag.key + '" while evaluating all flags: ' + err)); } - builder.addFlag(flag, detail.value, detail.variationIndex, withReasons ? detail.reason : null); + builder.addFlag(flag, detail.value, detail.variationIndex, withReasons ? detail.reason : null, detailsOnlyIfTracked); setImmediate(iterateeCb); }); } diff --git a/test/LDClient-test.js b/test/LDClient-test.js index a18023f..b2d2e42 100644 --- a/test/LDClient-test.js +++ b/test/LDClient-test.js @@ -496,6 +496,63 @@ describe('LDClient', function() { }); }); + it('can omit details for untracked flags', function(done) { + var flag1 = { + key: 'flag1', + version: 100, + offVariation: 0, + variations: ['value1'] + }; + var flag2 = { + key: 'flag2', + version: 200, + offVariation: 0, + variations: ['value2'], + trackEvents: true + }; + var flag3 = { + key: 'flag3', + version: 300, + offVariation: 0, + variations: ['value3'], + debugEventsUntilDate: 1000 + }; + var client = createOnlineClientWithFlags({ flag1: flag1, flag2: flag2, flag3: flag3 }); + var user = { key: 'user' }; + client.on('ready', function() { + client.allFlagsState(user, { withReasons: true, detailsOnlyForTrackedFlags: true }, function(err, state) { + expect(err).toBeNull(); + expect(state.valid).toEqual(true); + expect(state.allValues()).toEqual({flag1: 'value1', flag2: 'value2', flag3: 'value3'}); + expect(state.getFlagValue('flag1')).toEqual('value1'); + expect(state.toJSON()).toEqual({ + flag1: 'value1', + flag2: 'value2', + flag3: 'value3', + $flagsState: { + flag1: { + variation: 0 + }, + flag2: { + version: 200, + variation: 0, + reason: { kind: 'OFF' }, + trackEvents: true + }, + flag3: { + version: 300, + variation: 0, + reason: { kind: 'OFF' }, + debugEventsUntilDate: 1000 + } + }, + $valid: true + }); + done(); + }); + }); + }); + it('should not overflow the call stack when evaluating a huge number of flags', function(done) { var flagCount = 5000; var flags = {}; From 2aee263154f05ff5297c2de81568565ce27b1a56 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Fri, 5 Oct 2018 10:49:53 -0700 Subject: [PATCH 40/70] add unit tests for default value bug --- test/LDClient-test.js | 74 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 73 insertions(+), 1 deletion(-) diff --git a/test/LDClient-test.js b/test/LDClient-test.js index a18023f..ec33599 100644 --- a/test/LDClient-test.js +++ b/test/LDClient-test.js @@ -111,7 +111,6 @@ describe('LDClient', function() { function createOnlineClientWithFlags(flagsMap) { var store = InMemoryFeatureStore(); var allData = {}; - var dummyUri = 'bad'; allData[dataKind.features.namespace] = flagsMap; store.init(allData); return LDClient.init('secret', { @@ -122,6 +121,19 @@ describe('LDClient', function() { }); } + function createOnlineClientWithFlagsInUninitializedStore(flagsMap) { + var store = InMemoryFeatureStore(); + for (var key in flagsMap) { + store.upsert(dataKind.features, flagsMap[key]); + } + return LDClient.init('secret', { + featureStore: store, + eventProcessor: eventProcessor, + updateProcessor: updateProcessor, + logger: logger + }); + } + it('evaluates a flag with variation()', function(done) { var flag = { key: 'flagkey', @@ -155,6 +167,35 @@ describe('LDClient', function() { }); }); + it('returns default from variation() if client and store are not initialized', function(done) { + var flag = { + key: 'flagkey', + version: 1, + on: false, + offVariation: 0, + variations: ['value'] + }; + client = createOnlineClientWithFlagsInUninitializedStore({ flagkey: flag }); + var user = { key: 'user' }; + client.variation('flagkey', user, 'default', function(err, result) { + expect(err).toBeNull(); + expect(result).toEqual('default'); + done(); + }); + }); + + it('returns default from variation() if flag key is not specified', function(done) { + var client = createOnlineClientWithFlags({ }); + var user = { key: 'user' }; + client.on('ready', function() { + client.variation(null, user, 'default', function(err, result) { + expect(err).toBeNull(); + expect(result).toEqual('default'); + done(); + }); + }); + }); + it('returns default from variation() for flag that evaluates to null', function(done) { var flag = { key: 'flagkey', @@ -206,6 +247,37 @@ describe('LDClient', function() { }); }); + it('returns default from variationDetail() if client and store are not initialized', function(done) { + var flag = { + key: 'flagkey', + version: 1, + on: false, + offVariation: 0, + variations: ['value'] + }; + client = createOnlineClientWithFlagsInUninitializedStore({ flagkey: flag }); + var user = { key: 'user' }; + client.variationDetail('flagkey', user, 'default', function(err, result) { + expect(err).toBeNull(); + expect(result).toMatchObject({ value: 'default', variationIndex: null, + reason: { kind: 'ERROR', errorKind: 'CLIENT_NOT_READY' } }); + done(); + }); + }); + + it('returns default from variation() if flag key is not specified', function(done) { + var client = createOnlineClientWithFlags({ }); + var user = { key: 'user' }; + client.on('ready', function() { + client.variationDetail(null, user, 'default', function(err, result) { + expect(err).toBeNull(); + expect(result).toMatchObject({ value: 'default', variationIndex: null, + reason: { kind: 'ERROR', errorKind: 'FLAG_NOT_FOUND' } }); + done(); + }); + }); + }); + it('returns default from variationDetail() for flag that evaluates to null', function(done) { var flag = { key: 'flagkey', From 6d4feeaa856818119d99ef9cd284436d24134014 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Fri, 5 Oct 2018 12:58:43 -0700 Subject: [PATCH 41/70] refactor LDClient tests and add some new ones --- test/LDClient-evaluation-test.js | 465 +++++++++++++++++++++ test/LDClient-events-test.js | 192 +++++++++ test/LDClient-test.js | 666 +++---------------------------- test/stubs.js | 65 +++ 4 files changed, 782 insertions(+), 606 deletions(-) create mode 100644 test/LDClient-evaluation-test.js create mode 100644 test/LDClient-events-test.js create mode 100644 test/stubs.js diff --git a/test/LDClient-evaluation-test.js b/test/LDClient-evaluation-test.js new file mode 100644 index 0000000..12c0f2b --- /dev/null +++ b/test/LDClient-evaluation-test.js @@ -0,0 +1,465 @@ +var InMemoryFeatureStore = require('../feature_store'); +var LDClient = require('../index.js'); +var dataKind = require('../versioned_data_kind'); +var messages = require('../messages'); +var stubs = require('./stubs'); + +describe('LDClient', () => { + + var defaultUser = { key: 'user' }; + + var updateProcessor = { + start: callback => { + setImmediate(callback, updateProcessor.error); + } + }; + + function createClientWithFlagsInUninitializedStore(flagsMap) { + var store = InMemoryFeatureStore(); + for (var key in flagsMap) { + store.upsert(dataKind.features, flagsMap[key]); + } + return stubs.createClient({ featureStore: store }, {}); + } + + describe('variation()', () => { + it('evaluates an existing flag', done => { + var flag = { + key: 'flagkey', + version: 1, + on: true, + targets: [], + fallthrough: { variation: 1 }, + variations: ['a', 'b'], + trackEvents: true + }; + var client = stubs.createClient({}, { flagkey: flag }); + client.on('ready', () => { + client.variation(flag.key, defaultUser, 'c', (err, result) => { + expect(err).toBeNull(); + expect(result).toEqual('b'); + done(); + }); + }); + }); + + it('returns default for unknown flag', done => { + var client = stubs.createClient({}, {}); + client.on('ready', () => { + client.variation('flagkey', defaultUser, 'default', (err, result) => { + expect(err).toBeNull(); + expect(result).toEqual('default'); + done(); + }); + }); + }); + + it('returns default if client is offline', done => { + var flag = { + key: 'flagkey', + version: 1, + on: false, + offVariation: 0, + variations: ['value'] + }; + var logger = stubs.stubLogger(); + client = stubs.createClient({ offline: true, logger: logger }, { flagkey: flag }); + client.variation('flagkey', defaultUser, 'default', (err, result) => { + expect(err).toBeNull(); + expect(result).toEqual('default'); + expect(logger.info).toHaveBeenCalled(); + done(); + }); + }); + + it('returns default if client and store are not initialized', done => { + var flag = { + key: 'flagkey', + version: 1, + on: false, + offVariation: 0, + variations: ['value'] + }; + var client = createClientWithFlagsInUninitializedStore({ flagkey: flag }); + client.variation('flagkey', defaultUser, 'default', (err, result) => { + expect(err).toBeNull(); + expect(result).toEqual('default'); + done(); + }); + }); + + it('returns value from store if store is initialized but client is not', done => { + var flag = { + key: 'flagkey', + version: 1, + on: false, + offVariation: 0, + variations: ['value'] + }; + var logger = stubs.stubLogger(); + var updateProcessor = stubs.stubUpdateProcessor(); + updateProcessor.shouldInitialize = false; + client = stubs.createClient({ updateProcessor: updateProcessor, logger: logger }, { flagkey: flag }); + client.variation('flagkey', defaultUser, 'default', (err, result) => { + expect(err).toBeNull(); + expect(result).toEqual('value'); + expect(logger.warn).toHaveBeenCalled(); + done(); + }); + }); + + it('returns default if flag key is not specified', done => { + var client = stubs.createClient({}, {}); + client.on('ready', () => { + client.variation(null, defaultUser, 'default', (err, result) => { + expect(err).toBeNull(); + expect(result).toEqual('default'); + done(); + }); + }); + }); + + it('returns default for flag that evaluates to null', done => { + var flag = { + key: 'flagkey', + on: false, + offVariation: null + }; + var client = stubs.createClient({}, { flagkey: flag }); + client.on('ready', () => { + client.variation(flag.key, defaultUser, 'default', (err, result) => { + expect(err).toBeNull(); + expect(result).toEqual('default'); + done(); + }); + }); + }); + + it('allows deprecated method toggle()', done => { + var flag = { + key: 'flagkey', + on: false, + offVariation: 0, + variations: [true] + }; + var logger = stubs.stubLogger(); + var client = stubs.createClient({ logger: logger }, { flagkey: flag }); + client.on('ready', () => { + client.toggle(flag.key, defaultUser, false, (err, result) => { + expect(err).toBeNull(); + expect(result).toEqual(true); + expect(logger.warn).toHaveBeenCalled(); + done(); + }); + }); + }); + }); + + describe('variationDetail()', () => { + it('evaluates an existing flag', done => { + var flag = { + key: 'flagkey', + version: 1, + on: true, + targets: [], + fallthrough: { variation: 1 }, + variations: ['a', 'b'], + trackEvents: true + }; + var client = stubs.createClient({}, { flagkey: flag }); + client.on('ready', () => { + client.variationDetail(flag.key, defaultUser, 'c', (err, result) => { + expect(err).toBeNull(); + expect(result).toMatchObject({ value: 'b', variationIndex: 1, reason: { kind: 'FALLTHROUGH' } }); + done(); + }); + }); + }); + + it('returns default for unknown flag', done => { + var client = stubs.createClient({}, { }); + client.on('ready', () => { + client.variationDetail('flagkey', defaultUser, 'default', (err, result) => { + expect(err).toBeNull(); + expect(result).toMatchObject({ value: 'default', variationIndex: null, + reason: { kind: 'ERROR', errorKind: 'FLAG_NOT_FOUND' } }); + done(); + }); + }); + }); + + it('returns default if client is offline', done => { + var flag = { + key: 'flagkey', + version: 1, + on: false, + offVariation: 0, + variations: ['value'] + }; + var logger = stubs.stubLogger(); + client = stubs.createClient({ offline: true, logger: logger }, { flagkey: flag }); + client.variationDetail('flagkey', defaultUser, 'default', (err, result) => { + expect(err).toBeNull(); + expect(result).toMatchObject({ value: 'default', variationIndex: null, + reason: { kind: 'ERROR', errorKind: 'CLIENT_NOT_READY' }}); + expect(logger.info).toHaveBeenCalled(); + done(); + }); + }); + + it('returns default if client and store are not initialized', done => { + var flag = { + key: 'flagkey', + version: 1, + on: false, + offVariation: 0, + variations: ['value'] + }; + client = createClientWithFlagsInUninitializedStore({ flagkey: flag }); + client.variationDetail('flagkey', defaultUser, 'default', (err, result) => { + expect(err).toBeNull(); + expect(result).toMatchObject({ value: 'default', variationIndex: null, + reason: { kind: 'ERROR', errorKind: 'CLIENT_NOT_READY' } }); + done(); + }); + }); + + it('returns value from store if store is initialized but client is not', done => { + var flag = { + key: 'flagkey', + version: 1, + on: false, + offVariation: 0, + variations: ['value'] + }; + var logger = stubs.stubLogger(); + var updateProcessor = stubs.stubUpdateProcessor(); + updateProcessor.shouldInitialize = false; + client = stubs.createClient({ updateProcessor: updateProcessor, logger: logger }, { flagkey: flag }); + client.variationDetail('flagkey', defaultUser, 'default', (err, result) => { + expect(err).toBeNull(); + expect(result).toMatchObject({ value: 'value', variationIndex: 0, reason: { kind: 'OFF' }}) + expect(logger.warn).toHaveBeenCalled(); + done(); + }); + }); + + it('returns default if flag key is not specified', done => { + var client = stubs.createClient({}, { }); + client.on('ready', () => { + client.variationDetail(null, defaultUser, 'default', (err, result) => { + expect(err).toBeNull(); + expect(result).toMatchObject({ value: 'default', variationIndex: null, + reason: { kind: 'ERROR', errorKind: 'FLAG_NOT_FOUND' } }); + done(); + }); + }); + }); + + it('returns default for flag that evaluates to null', done => { + var flag = { + key: 'flagkey', + on: false, + offVariation: null + }; + var client = stubs.createClient({}, { flagkey: flag }); + client.on('ready', () => { + client.variationDetail(flag.key, defaultUser, 'default', (err, result) => { + expect(err).toBeNull(); + expect(result).toMatchObject({ value: 'default', variationIndex: null, reason: { kind: 'OFF' } }); + done(); + }); + }); + }); + }); + + describe('allFlags()', () => { + it('evaluates flags', done => { + var flag = { + key: 'feature', + version: 1, + offVariation: 1, + variations: ['a', 'b'] + }; + var logger = stubs.stubLogger(); + var client = stubs.createClient({ logger: logger }, { feature: flag }); + client.on('ready', () => { + client.allFlags(defaultUser, (err, results) => { + expect(err).toBeNull(); + expect(results).toEqual({feature: 'b'}); + expect(logger.warn).toHaveBeenCalledTimes(1); // deprecation warning + done(); + }); + }); + }); + + it('returns empty map in offline mode and logs a message', done => { + var flag = { + key: 'flagkey', + on: false, + offVariation: null + }; + var logger = stubs.stubLogger(); + var client = stubs.createClient({ offline: true, logger: logger }, { flagkey: flag }); + client.on('ready', () => { + client.allFlags(defaultUser, (err, result) => { + expect(result).toEqual({}); + expect(logger.info).toHaveBeenCalledTimes(1); + done(); + }); + }); + }); + + it('allows deprecated method all_flags', done => { + var logger = stubs.stubLogger(); + var client = stubs.createClient({ logger: logger }, {}); + client.on('ready', () => { + client.all_flags(defaultUser, (err, result) => { + expect(result).toEqual({}); + expect(logger.warn).toHaveBeenCalledWith(messages.deprecated('all_flags', 'allFlags')); + done(); + }); + }); + }); + + it('does not overflow the call stack when evaluating a huge number of flags', done => { + var flagCount = 5000; + var flags = {}; + for (var i = 0; i < flagCount; i++) { + var key = 'feature' + i; + var flag = { + key: key, + version: 1, + on: false + }; + flags[key] = flag; + } + var client = stubs.createClient({}, flags); + client.on('ready', () => { + client.allFlags(defaultUser, (err, result) => { + expect(err).toEqual(null); + expect(Object.keys(result).length).toEqual(flagCount); + done(); + }); + }); + }); + }); + + describe('allFlagsState()', () => { + it('captures flag state', done => { + var flag = { + key: 'feature', + version: 100, + offVariation: 1, + variations: ['a', 'b'], + trackEvents: true, + debugEventsUntilDate: 1000 + }; + var client = stubs.createClient({}, { feature: flag }); + client.on('ready', () => { + client.allFlagsState(defaultUser, {}, (err, state) => { + expect(err).toBeNull(); + expect(state.valid).toEqual(true); + expect(state.allValues()).toEqual({feature: 'b'}); + expect(state.getFlagValue('feature')).toEqual('b'); + expect(state.toJSON()).toEqual({ + feature: 'b', + $flagsState: { + feature: { + version: 100, + variation: 1, + trackEvents: true, + debugEventsUntilDate: 1000 + } + }, + $valid: true + }); + done(); + }); + }); + }); + + it('can filter for only client-side flags', done => { + var flag1 = { key: 'server-side-1', on: false, offVariation: 0, variations: ['a'], clientSide: false }; + var flag2 = { key: 'server-side-2', on: false, offVariation: 0, variations: ['b'], clientSide: false }; + var flag3 = { key: 'client-side-1', on: false, offVariation: 0, variations: ['value1'], clientSide: true }; + var flag4 = { key: 'client-side-2', on: false, offVariation: 0, variations: ['value2'], clientSide: true }; + var client = stubs.createClient({}, { + 'server-side-1': flag1, 'server-side-2': flag2, 'client-side-1': flag3, 'client-side-2': flag4 + }); + client.on('ready', () => { + client.allFlagsState(defaultUser, { clientSideOnly: true }, (err, state) => { + expect(err).toBeNull(); + expect(state.valid).toEqual(true); + expect(state.allValues()).toEqual({ 'client-side-1': 'value1', 'client-side-2': 'value2' }); + done(); + }); + }); + }); + + it('can omit options parameter', done => { + var flag = { key: 'key', on: false, offVariation: 0, variations: ['value'] }; + var client = stubs.createClient({}, { 'key': flag }); + client.on('ready', () => { + client.allFlagsState(defaultUser, (err, state) => { + expect(err).toBeNull(); + expect(state.valid).toEqual(true); + expect(state.allValues()).toEqual({ 'key': 'value' }); + done(); + }); + }); + }); + + it('can include reasons', done => { + var flag = { + key: 'feature', + version: 100, + offVariation: 1, + variations: ['a', 'b'], + trackEvents: true, + debugEventsUntilDate: 1000 + }; + var client = stubs.createClient({}, { feature: flag }); + client.on('ready', () => { + client.allFlagsState(defaultUser, { withReasons: true }, (err, state) => { + expect(err).toBeNull(); + expect(state.valid).toEqual(true); + expect(state.allValues()).toEqual({feature: 'b'}); + expect(state.getFlagValue('feature')).toEqual('b'); + expect(state.toJSON()).toEqual({ + feature: 'b', + $flagsState: { + feature: { + version: 100, + variation: 1, + reason: { kind: 'OFF' }, + trackEvents: true, + debugEventsUntilDate: 1000 + } + }, + $valid: true + }); + done(); + }); + }); + }); + + it('returns empty state in offline mode and logs a message', done => { + var flag = { + key: 'flagkey', + on: false, + offVariation: null + }; + var logger = stubs.stubLogger(); + var client = stubs.createClient({ offline: true, logger: logger }, { flagkey: flag }); + client.on('ready', () => { + client.allFlagsState(defaultUser, {}, (err, state) => { + expect(state.valid).toEqual(false); + expect(state.allValues()).toEqual({}); + expect(logger.info).toHaveBeenCalledTimes(1); + done(); + }); + }); + }); + }); +}); diff --git a/test/LDClient-events-test.js b/test/LDClient-events-test.js new file mode 100644 index 0000000..39fb1d9 --- /dev/null +++ b/test/LDClient-events-test.js @@ -0,0 +1,192 @@ +var InMemoryFeatureStore = require('../feature_store'); +var LDClient = require('../index.js'); +var dataKind = require('../versioned_data_kind'); +var messages = require('../messages'); +var stubs = require('./stubs'); + +describe('LDClient - analytics events', () => { + + var eventProcessor; + var defaultUser = { key: 'user' }; + + beforeEach(() => { + eventProcessor = stubs.stubEventProcessor(); + }); + + describe('feature event', () => { + it('generates event for existing feature', done => { + var flag = { + key: 'flagkey', + version: 1, + on: true, + targets: [], + fallthrough: { variation: 1 }, + variations: ['a', 'b'], + trackEvents: true + }; + var client = stubs.createClient({ eventProcessor: eventProcessor }, { flagkey: flag }); + client.on('ready', () => { + client.variation(flag.key, defaultUser, 'c', (err, result) => { + expect(eventProcessor.events).toHaveLength(1); + var e = eventProcessor.events[0]; + expect(e).toMatchObject({ + kind: 'feature', + key: 'flagkey', + version: 1, + user: defaultUser, + variation: 1, + value: 'b', + default: 'c', + trackEvents: true + }); + done(); + }); + }); + }); + + it('generates event for existing feature with reason', done => { + var flag = { + key: 'flagkey', + version: 1, + on: true, + targets: [], + fallthrough: { variation: 1 }, + variations: ['a', 'b'], + trackEvents: true + }; + var client = stubs.createClient({ eventProcessor: eventProcessor }, { flagkey: flag }); + client.on('ready', () => { + client.variationDetail(flag.key, defaultUser, 'c', (err, result) => { + expect(eventProcessor.events).toHaveLength(1); + var e = eventProcessor.events[0]; + expect(e).toMatchObject({ + kind: 'feature', + key: 'flagkey', + version: 1, + user: defaultUser, + variation: 1, + value: 'b', + default: 'c', + reason: { kind: 'FALLTHROUGH' }, + trackEvents: true + }); + done(); + }); + }); + }); + + it('generates event for unknown feature', done => { + var client = stubs.createClient({ eventProcessor: eventProcessor }, {}); + client.on('ready', () => { + client.variation('flagkey', defaultUser, 'c', (err, result) => { + expect(eventProcessor.events).toHaveLength(1); + var e = eventProcessor.events[0]; + expect(e).toMatchObject({ + kind: 'feature', + key: 'flagkey', + version: null, + user: defaultUser, + variation: null, + value: 'c', + default: 'c', + trackEvents: null + }); + done(); + }); + }); + }); + + it('generates event for existing feature when user key is missing', done => { + var flag = { + key: 'flagkey', + version: 1, + on: true, + targets: [], + fallthrough: { variation: 1 }, + variations: ['a', 'b'], + trackEvents: true + }; + var client = stubs.createClient({ eventProcessor: eventProcessor }, { flagkey: flag }); + var badUser = { name: 'Bob' }; + client.on('ready', () => { + client.variation(flag.key, badUser, 'c', (err, result) => { + expect(eventProcessor.events).toHaveLength(1); + var e = eventProcessor.events[0]; + expect(e).toMatchObject({ + kind: 'feature', + key: 'flagkey', + version: 1, + user: badUser, + variation: null, + value: 'c', + default: 'c', + trackEvents: true + }); + done(); + }); + }); + }); + + it('generates event for existing feature when user is null', done => { + var flag = { + key: 'flagkey', + version: 1, + on: true, + targets: [], + fallthrough: { variation: 1 }, + variations: ['a', 'b'], + trackEvents: true + }; + var client = stubs.createClient({ eventProcessor: eventProcessor }, { flagkey: flag }); + client.on('ready', () => { + client.variation(flag.key, null, 'c', (err, result) => { + expect(eventProcessor.events).toHaveLength(1); + var e = eventProcessor.events[0]; + expect(e).toMatchObject({ + kind: 'feature', + key: 'flagkey', + version: 1, + user: null, + variation: null, + value: 'c', + default: 'c', + trackEvents: true + }); + done(); + }); + }); + }); + }); + + it('generates an event for identify()', done => { + var client = stubs.createClient({ eventProcessor: eventProcessor }, {}); + client.on('ready', () => { + client.identify(defaultUser); + expect(eventProcessor.events).toHaveLength(1); + var e = eventProcessor.events[0]; + expect(e).toMatchObject({ + kind: 'identify', + key: defaultUser.key, + user: defaultUser + }); + done(); + }); + }); + + it('generates an event for track()', done => { + var data = { thing: 'stuff' }; + var client = stubs.createClient({ eventProcessor: eventProcessor }, {}); + client.on('ready', () => { + client.track('eventkey', defaultUser, data); + expect(eventProcessor.events).toHaveLength(1); + var e = eventProcessor.events[0]; + expect(e).toMatchObject({ + kind: 'custom', + key: 'eventkey', + user: defaultUser, + data: data + }); + done(); + }); + }); +}); diff --git a/test/LDClient-test.js b/test/LDClient-test.js index ec33599..3dbc22a 100644 --- a/test/LDClient-test.js +++ b/test/LDClient-test.js @@ -2,631 +2,88 @@ var InMemoryFeatureStore = require('../feature_store'); var LDClient = require('../index.js'); var dataKind = require('../versioned_data_kind'); var messages = require('../messages'); +var stubs = require('./stubs'); -describe('LDClient', function() { +describe('LDClient', () => { - var logger = {}; - - var eventProcessor = { - events: [], - sendEvent: function(event) { - eventProcessor.events.push(event); - }, - flush: function(callback) { - if (callback) { - setImmediate(callback); - } else { - return Promise.resolve(null); - } - }, - close: function() {} - }; - - var updateProcessor = { - start: function(callback) { - setImmediate(callback, updateProcessor.error); - } - }; - - beforeEach(function() { - logger.debug = jest.fn(); - logger.info = jest.fn(); - logger.warn = jest.fn(); - logger.error = jest.fn(); - eventProcessor.events = []; - updateProcessor.error = null; - }); - - it('should trigger the ready event in offline mode', function(done) { - var client = LDClient.init('sdk_key', {offline: true}); - client.on('ready', function() { - done(); - }); - }); - - it('returns true for isOffline in offline mode', function(done) { - var client = LDClient.init('sdk_key', {offline: true}); - client.on('ready', function() { - expect(client.isOffline()).toEqual(true); - done(); - }); - }); - - it('allows deprecated method is_offline', function(done) { - var client = LDClient.init('sdk_key', {offline: true, logger: logger}); - client.on('ready', function() { - expect(client.is_offline()).toEqual(true); - expect(logger.warn).toHaveBeenCalledWith(messages.deprecated('is_offline', 'isOffline')); - done(); - }); - }); - - it('should correctly compute the secure mode hash for a known message and secret', function() { - var client = LDClient.init('secret', {offline: true}); - var hash = client.secureModeHash({"key": "Message"}); - expect(hash).toEqual("aa747c502a898200f9e4fa21bac68136f886a0e27aec70ba06daf2e2a5cb5597"); - }); - - it('allows deprecated method secure_mode_hash', function() { - var client = LDClient.init('secret', {offline: true, logger: logger}); - var hash = client.secure_mode_hash({"key": "Message"}); - expect(hash).toEqual("aa747c502a898200f9e4fa21bac68136f886a0e27aec70ba06daf2e2a5cb5597"); - expect(logger.warn).toHaveBeenCalledWith(messages.deprecated('secure_mode_hash', 'secureModeHash')); - }); - - it('returns empty map for allFlags in offline mode and logs a message', function(done) { - var client = LDClient.init('secret', {offline: true, logger: logger}); - client.on('ready', function() { - client.allFlags({key: 'user'}, function(err, result) { - expect(result).toEqual({}); - expect(logger.info).toHaveBeenCalledTimes(1); - done(); - }); - }); - }); - - it('returns empty state for allFlagsState in offline mode and logs a message', function(done) { - var client = LDClient.init('secret', {offline: true, logger: logger}); - client.on('ready', function() { - client.allFlagsState({key: 'user'}, {}, function(err, state) { - expect(state.valid).toEqual(false); - expect(state.allValues()).toEqual({}); - expect(logger.info).toHaveBeenCalledTimes(1); - done(); - }); - }); - }); - - it('allows deprecated method all_flags', function(done) { - var client = LDClient.init('secret', {offline: true, logger: logger}); - client.on('ready', function() { - client.all_flags({key: 'user'}, function(err, result) { - expect(result).toEqual({}); - expect(logger.warn).toHaveBeenCalledWith(messages.deprecated('all_flags', 'allFlags')); - done(); - }); - }); - }); - - function createOnlineClientWithFlags(flagsMap) { - var store = InMemoryFeatureStore(); - var allData = {}; - allData[dataKind.features.namespace] = flagsMap; - store.init(allData); - return LDClient.init('secret', { - featureStore: store, - eventProcessor: eventProcessor, - updateProcessor: updateProcessor, - logger: logger - }); - } - - function createOnlineClientWithFlagsInUninitializedStore(flagsMap) { - var store = InMemoryFeatureStore(); - for (var key in flagsMap) { - store.upsert(dataKind.features, flagsMap[key]); - } - return LDClient.init('secret', { - featureStore: store, - eventProcessor: eventProcessor, - updateProcessor: updateProcessor, - logger: logger - }); - } - - it('evaluates a flag with variation()', function(done) { - var flag = { - key: 'flagkey', - version: 1, - on: true, - targets: [], - fallthrough: { variation: 1 }, - variations: ['a', 'b'], - trackEvents: true - }; - var client = createOnlineClientWithFlags({ flagkey: flag }); - var user = { key: 'user' }; - client.on('ready', function() { - client.variation(flag.key, user, 'c', function(err, result) { - expect(err).toBeNull(); - expect(result).toEqual('b'); - done(); - }); - }); - }); - - it('returns default from variation() for unknown flag', function(done) { - var client = createOnlineClientWithFlags({ }); - var user = { key: 'user' }; - client.on('ready', function() { - client.variation('flagkey', user, 'default', function(err, result) { - expect(err).toBeNull(); - expect(result).toEqual('default'); - done(); - }); - }); - }); - - it('returns default from variation() if client and store are not initialized', function(done) { - var flag = { - key: 'flagkey', - version: 1, - on: false, - offVariation: 0, - variations: ['value'] - }; - client = createOnlineClientWithFlagsInUninitializedStore({ flagkey: flag }); - var user = { key: 'user' }; - client.variation('flagkey', user, 'default', function(err, result) { - expect(err).toBeNull(); - expect(result).toEqual('default'); - done(); - }); - }); - - it('returns default from variation() if flag key is not specified', function(done) { - var client = createOnlineClientWithFlags({ }); - var user = { key: 'user' }; - client.on('ready', function() { - client.variation(null, user, 'default', function(err, result) { - expect(err).toBeNull(); - expect(result).toEqual('default'); - done(); - }); - }); - }); - - it('returns default from variation() for flag that evaluates to null', function(done) { - var flag = { - key: 'flagkey', - on: false, - offVariation: null - }; - var client = createOnlineClientWithFlags({ flagkey: flag }); - var user = { key: 'user' }; - client.on('ready', function() { - client.variation(flag.key, user, 'default', function(err, result) { - expect(err).toBeNull(); - expect(result).toEqual('default'); - done(); - }); - }); - }); - - it('evaluates a flag with variationDetail()', function(done) { - var flag = { - key: 'flagkey', - version: 1, - on: true, - targets: [], - fallthrough: { variation: 1 }, - variations: ['a', 'b'], - trackEvents: true - }; - var client = createOnlineClientWithFlags({ flagkey: flag }); - var user = { key: 'user' }; - client.on('ready', function() { - client.variationDetail(flag.key, user, 'c', function(err, result) { - expect(err).toBeNull(); - expect(result).toMatchObject({ value: 'b', variationIndex: 1, reason: { kind: 'FALLTHROUGH' } }); - done(); - }); - }); - }); - - it('returns default from variationDetail() for unknown flag', function(done) { - var client = createOnlineClientWithFlags({ }); - var user = { key: 'user' }; - client.on('ready', function() { - client.variationDetail('flagkey', user, 'default', function(err, result) { - expect(err).toBeNull(); - expect(result).toMatchObject({ value: 'default', variationIndex: null, - reason: { kind: 'ERROR', errorKind: 'FLAG_NOT_FOUND' } }); - done(); - }); - }); - }); - - it('returns default from variationDetail() if client and store are not initialized', function(done) { - var flag = { - key: 'flagkey', - version: 1, - on: false, - offVariation: 0, - variations: ['value'] - }; - client = createOnlineClientWithFlagsInUninitializedStore({ flagkey: flag }); - var user = { key: 'user' }; - client.variationDetail('flagkey', user, 'default', function(err, result) { - expect(err).toBeNull(); - expect(result).toMatchObject({ value: 'default', variationIndex: null, - reason: { kind: 'ERROR', errorKind: 'CLIENT_NOT_READY' } }); - done(); - }); - }); - - it('returns default from variation() if flag key is not specified', function(done) { - var client = createOnlineClientWithFlags({ }); - var user = { key: 'user' }; - client.on('ready', function() { - client.variationDetail(null, user, 'default', function(err, result) { - expect(err).toBeNull(); - expect(result).toMatchObject({ value: 'default', variationIndex: null, - reason: { kind: 'ERROR', errorKind: 'FLAG_NOT_FOUND' } }); + describe('ready event', () => { + it('is fired in offline mode', done => { + var client = LDClient.init('sdk_key', { offline: true }); + client.on('ready', () => { done(); }); }); }); - it('returns default from variationDetail() for flag that evaluates to null', function(done) { - var flag = { - key: 'flagkey', - on: false, - offVariation: null - }; - var client = createOnlineClientWithFlags({ flagkey: flag }); - var user = { key: 'user' }; - client.on('ready', function() { - client.variationDetail(flag.key, user, 'default', function(err, result) { - expect(err).toBeNull(); - expect(result).toMatchObject({ value: 'default', variationIndex: null, reason: { kind: 'OFF' } }); - done(); - }); - }); - }); - - it('generates an event for an existing feature', function(done) { - var flag = { - key: 'flagkey', - version: 1, - on: true, - targets: [], - fallthrough: { variation: 1 }, - variations: ['a', 'b'], - trackEvents: true - }; - var client = createOnlineClientWithFlags({ flagkey: flag }); - var user = { key: 'user' }; - client.on('ready', function() { - client.variation(flag.key, user, 'c', function(err, result) { - expect(eventProcessor.events).toHaveLength(1); - var e = eventProcessor.events[0]; - expect(e).toMatchObject({ - kind: 'feature', - key: 'flagkey', - version: 1, - user: user, - variation: 1, - value: 'b', - default: 'c', - trackEvents: true - }); - done(); - }); - }); - }); - - it('generates an event for an existing feature with reason', function(done) { - var flag = { - key: 'flagkey', - version: 1, - on: true, - targets: [], - fallthrough: { variation: 1 }, - variations: ['a', 'b'], - trackEvents: true - }; - var client = createOnlineClientWithFlags({ flagkey: flag }); - var user = { key: 'user' }; - client.on('ready', function() { - client.variationDetail(flag.key, user, 'c', function(err, result) { - expect(eventProcessor.events).toHaveLength(1); - var e = eventProcessor.events[0]; - expect(e).toMatchObject({ - kind: 'feature', - key: 'flagkey', - version: 1, - user: user, - variation: 1, - value: 'b', - default: 'c', - reason: { kind: 'FALLTHROUGH' }, - trackEvents: true - }); - done(); - }); - }); - }); - - it('generates an event for an unknown feature', function(done) { - var client = createOnlineClientWithFlags({}); - var user = { key: 'user' }; - client.on('ready', function() { - client.variation('flagkey', user, 'c', function(err, result) { - expect(eventProcessor.events).toHaveLength(1); - var e = eventProcessor.events[0]; - expect(e).toMatchObject({ - kind: 'feature', - key: 'flagkey', - version: null, - user: user, - variation: null, - value: 'c', - default: 'c', - trackEvents: null - }); - done(); - }); - }); - }); - - it('generates an event for an existing feature even if user key is missing', function(done) { - var flag = { - key: 'flagkey', - version: 1, - on: true, - targets: [], - fallthrough: { variation: 1 }, - variations: ['a', 'b'], - trackEvents: true - }; - var client = createOnlineClientWithFlags({ flagkey: flag }); - var user = { name: 'Bob' }; - client.on('ready', function() { - client.variation(flag.key, user, 'c', function(err, result) { - expect(eventProcessor.events).toHaveLength(1); - var e = eventProcessor.events[0]; - expect(e).toMatchObject({ - kind: 'feature', - key: 'flagkey', - version: 1, - user: user, - variation: null, - value: 'c', - default: 'c', - trackEvents: true - }); - done(); - }); - }); - }); - - it('generates an event for an existing feature even if user is null', function(done) { - var flag = { - key: 'flagkey', - version: 1, - on: true, - targets: [], - fallthrough: { variation: 1 }, - variations: ['a', 'b'], - trackEvents: true - }; - var client = createOnlineClientWithFlags({ flagkey: flag }); - client.on('ready', function() { - client.variation(flag.key, null, 'c', function(err, result) { - expect(eventProcessor.events).toHaveLength(1); - var e = eventProcessor.events[0]; - expect(e).toMatchObject({ - kind: 'feature', - key: 'flagkey', - version: 1, - user: null, - variation: null, - value: 'c', - default: 'c', - trackEvents: true - }); - done(); - }); - }); - }); - - it('evaluates a flag with allFlags()', function(done) { - var flag = { - key: 'feature', - version: 1, - on: true, - targets: [], - fallthrough: { variation: 1 }, - variations: ['a', 'b'] - }; - var client = createOnlineClientWithFlags({ feature: flag }); - var user = { key: 'user' }; - client.on('ready', function() { - client.allFlags(user, function(err, results) { - expect(err).toBeNull(); - expect(results).toEqual({feature: 'b'}); - expect(logger.warn).toHaveBeenCalledTimes(1); // deprecation warning - done(); - }); - }); - }); + describe('failed event', () => { + it('is fired if initialization fails', done => { + var updateProcessor = stubs.stubUpdateProcessor(); + updateProcessor.error = { status: 403 }; + var client = stubs.createClient({ updateProcessor: updateProcessor }, {}); - it('captures flag state with allFlagsState()', function(done) { - var flag = { - key: 'feature', - version: 100, - on: true, - targets: [], - fallthrough: { variation: 1 }, - variations: ['a', 'b'], - trackEvents: true, - debugEventsUntilDate: 1000 - }; - var client = createOnlineClientWithFlags({ feature: flag }); - var user = { key: 'user' }; - client.on('ready', function() { - client.allFlagsState(user, {}, function(err, state) { - expect(err).toBeNull(); - expect(state.valid).toEqual(true); - expect(state.allValues()).toEqual({feature: 'b'}); - expect(state.getFlagValue('feature')).toEqual('b'); - expect(state.toJSON()).toEqual({ - feature: 'b', - $flagsState: { - feature: { - version: 100, - variation: 1, - trackEvents: true, - debugEventsUntilDate: 1000 - } - }, - $valid: true - }); + client.on('failed', err => { + expect(err).toEqual(updateProcessor.error); done(); }); }); }); - it('can filter for only client-side flags with allFlagsState()', function(done) { - var flag1 = { key: 'server-side-1', on: false, offVariation: 0, variations: ['a'], clientSide: false }; - var flag2 = { key: 'server-side-2', on: false, offVariation: 0, variations: ['b'], clientSide: false }; - var flag3 = { key: 'client-side-1', on: false, offVariation: 0, variations: ['value1'], clientSide: true }; - var flag4 = { key: 'client-side-2', on: false, offVariation: 0, variations: ['value2'], clientSide: true }; - var client = createOnlineClientWithFlags({ - 'server-side-1': flag1, 'server-side-2': flag2, 'client-side-1': flag3, 'client-side-2': flag4 - }); - var user = { key: 'user' }; - client.on('ready', function() { - client.allFlagsState(user, { clientSideOnly: true }, function(err, state) { - expect(err).toBeNull(); - expect(state.valid).toEqual(true); - expect(state.allValues()).toEqual({ 'client-side-1': 'value1', 'client-side-2': 'value2' }); + describe('isOffline()', () => { + it('returns true in offline mode', done => { + var client = LDClient.init('sdk_key', {offline: true}); + client.on('ready', () => { + expect(client.isOffline()).toEqual(true); done(); }); }); - }); - it('can omit options parameter for allFlagsState()', function(done) { - var flag = { key: 'key', on: false, offVariation: 0, variations: ['value'] }; - var client = createOnlineClientWithFlags({ 'key': flag }); - var user = { key: 'user' }; - client.on('ready', function() { - client.allFlagsState(user, function(err, state) { - expect(err).toBeNull(); - expect(state.valid).toEqual(true); - expect(state.allValues()).toEqual({ 'key': 'value' }); + it('allows deprecated method is_offline', done => { + var logger = stubs.stubLogger(); + var client = LDClient.init('sdk_key', {offline: true, logger: logger}); + client.on('ready', () => { + expect(client.is_offline()).toEqual(true); + expect(logger.warn).toHaveBeenCalledWith(messages.deprecated('is_offline', 'isOffline')); done(); }); }); }); - it('can include reasons in allFlagsState()', function(done) { - var flag = { - key: 'feature', - version: 100, - on: true, - targets: [], - fallthrough: { variation: 1 }, - variations: ['a', 'b'], - trackEvents: true, - debugEventsUntilDate: 1000 - }; - var client = createOnlineClientWithFlags({ feature: flag }); - var user = { key: 'user' }; - client.on('ready', function() { - client.allFlagsState(user, { withReasons: true }, function(err, state) { - expect(err).toBeNull(); - expect(state.valid).toEqual(true); - expect(state.allValues()).toEqual({feature: 'b'}); - expect(state.getFlagValue('feature')).toEqual('b'); - expect(state.toJSON()).toEqual({ - feature: 'b', - $flagsState: { - feature: { - version: 100, - variation: 1, - reason: { kind: 'FALLTHROUGH' }, - trackEvents: true, - debugEventsUntilDate: 1000 - } - }, - $valid: true - }); - done(); - }); + describe('secureModeHash()', () => { + it('correctly computes hash for a known message and secret', () => { + var client = LDClient.init('secret', {offline: true}); + var hash = client.secureModeHash({"key": "Message"}); + expect(hash).toEqual("aa747c502a898200f9e4fa21bac68136f886a0e27aec70ba06daf2e2a5cb5597"); }); - }); - it('should not overflow the call stack when evaluating a huge number of flags', function(done) { - var flagCount = 5000; - var flags = {}; - for (var i = 0; i < flagCount; i++) { - var key = 'feature' + i; - var flag = { - key: key, - version: 1, - on: false - }; - flags[key] = flag; - } - var client = createOnlineClientWithFlags(flags); - client.on('ready', function() { - client.allFlags({key: 'user'}, function(err, result) { - expect(err).toEqual(null); - expect(Object.keys(result).length).toEqual(flagCount); - done(); - }); + it('allows deprecated method secure_mode_hash', () => { + var logger = stubs.stubLogger(); + var client = LDClient.init('secret', {offline: true, logger: logger}); + var hash = client.secure_mode_hash({"key": "Message"}); + expect(hash).toEqual("aa747c502a898200f9e4fa21bac68136f886a0e27aec70ba06daf2e2a5cb5597"); + expect(logger.warn).toHaveBeenCalledWith(messages.deprecated('secure_mode_hash', 'secureModeHash')); }); }); - it('should not crash when closing an offline client', function(done) { - var client = LDClient.init('sdk_key', {offline: true}); - expect(() => client.close()).not.toThrow(); - done(); - }); - - describe('waitUntilReady()', function () { - it('should resolve waitUntilReady() when ready', function(done) { - var client = LDClient.init('secret', {offline: true}); - var callback = jest.fn(); - - client.waitUntilReady().then(callback) - .then(() => { - expect(callback).toHaveBeenCalled(); - done(); - }).catch(done.error) + describe('waitUntilReady()', () => { + it('resolves when ready', done => { + var client = stubs.createClient({}, {}); + client.waitUntilReady().then(done) + .catch(done.error) }); - it('should resolve waitUntilReady() even if the client is already ready', function(done) { - var client = LDClient.init('secret', {offline: true}); - var callback = jest.fn(); - - client.waitUntilReady() - .then(() => { - client.waitUntilReady().then(callback) - .then(() => { - expect(callback).toHaveBeenCalled(); - done(); - }).catch(done.error) - }).catch(done.error) + it('resolves immediately if the client is already ready', done => { + var client = stubs.createClient({}, {}); + client.waitUntilReady().then(() => { + client.waitUntilReady().then(done) + .catch(done.error) + }).catch(done.error); }); }); - describe('waitForInitialization()', function () { - it('should resolve when ready', function(done) { + describe('waitForInitialization()', () => { + it('resolves when ready', done => { var callback = jest.fn(); - var client = createOnlineClientWithFlags({}); + var client = stubs.createClient({}, {}); client.waitForInitialization().then(callback) .then(() => { @@ -636,9 +93,9 @@ describe('LDClient', function() { }).catch(done.error) }); - it('should resolve even if the client is already ready', function(done) { + it('resolves immediately if the client is already ready', done => { var callback = jest.fn(); - var client = createOnlineClientWithFlags({}); + var client = stubs.createClient({}, {}); client.waitForInitialization() .then(() => { @@ -651,9 +108,10 @@ describe('LDClient', function() { }).catch(done.error) }); - it('should be rejected if initialization fails', function(done) { + it('is rejected if initialization fails', done => { + var updateProcessor = stubs.stubUpdateProcessor(); updateProcessor.error = { status: 403 }; - var client = createOnlineClientWithFlags({}); + var client = stubs.createClient({ updateProcessor: updateProcessor }, {}); client.waitForInitialization() .catch(err => { @@ -663,15 +121,11 @@ describe('LDClient', function() { }); }); - describe('failed event', function() { - it('should be fired if initialization fails', function(done) { - updateProcessor.error = { status: 403 }; - var client = createOnlineClientWithFlags({}); - - client.on('failed', err => { - expect(err).toEqual(updateProcessor.error); - done(); - }); + describe('close()', () => { + it('does not crash when closing an offline client', done => { + var client = LDClient.init('sdk_key', {offline: true}); + expect(() => client.close()).not.toThrow(); + done(); }); - }) + }); }); diff --git a/test/stubs.js b/test/stubs.js new file mode 100644 index 0000000..b455b3f --- /dev/null +++ b/test/stubs.js @@ -0,0 +1,65 @@ +var InMemoryFeatureStore = require('../feature_store'); +var LDClient = require('../index.js'); +var dataKind = require('../versioned_data_kind'); + +function stubEventProcessor() { + var eventProcessor = { + events: [], + sendEvent: function(event) { + eventProcessor.events.push(event); + }, + flush: function(callback) { + if (callback) { + setImmediate(callback); + } else { + return Promise.resolve(null); + } + }, + close: function() {} + }; + return eventProcessor; +} + +function stubLogger() { + return { + debug: jest.fn(), + info: jest.fn(), + warn: jest.fn(), + error: jest.fn() + }; +} + +function stubUpdateProcessor() { + var updateProcessor = { + start: function(callback) { + if (updateProcessor.shouldInitialize) { + setImmediate(callback, updateProcessor.error); + } + }, + shouldInitialize: true + }; + return updateProcessor; +} + +function createClient(overrideOptions, flagsMap) { + var store = InMemoryFeatureStore(); + if (flagsMap !== undefined) { + var allData = {}; + allData[dataKind.features.namespace] = flagsMap; + store.init(allData); + } + var defaults = { + featureStore: store, + eventProcessor: stubEventProcessor(), + updateProcessor: stubUpdateProcessor(), + logger: stubLogger() + }; + return LDClient.init('secret', Object.assign({}, defaults, overrideOptions)); +} + +module.exports = { + createClient: createClient, + stubEventProcessor: stubEventProcessor, + stubLogger: stubLogger, + stubUpdateProcessor: stubUpdateProcessor +}; From 1a6c80a244674b2a746e7c687a843650cb7d0b0c Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Fri, 5 Oct 2018 13:02:23 -0700 Subject: [PATCH 42/70] rm unused vars --- test/LDClient-evaluation-test.js | 6 ------ test/LDClient-events-test.js | 4 ---- test/LDClient-test.js | 2 -- 3 files changed, 12 deletions(-) diff --git a/test/LDClient-evaluation-test.js b/test/LDClient-evaluation-test.js index 12c0f2b..b6d25a8 100644 --- a/test/LDClient-evaluation-test.js +++ b/test/LDClient-evaluation-test.js @@ -8,12 +8,6 @@ describe('LDClient', () => { var defaultUser = { key: 'user' }; - var updateProcessor = { - start: callback => { - setImmediate(callback, updateProcessor.error); - } - }; - function createClientWithFlagsInUninitializedStore(flagsMap) { var store = InMemoryFeatureStore(); for (var key in flagsMap) { diff --git a/test/LDClient-events-test.js b/test/LDClient-events-test.js index 39fb1d9..2df637a 100644 --- a/test/LDClient-events-test.js +++ b/test/LDClient-events-test.js @@ -1,7 +1,3 @@ -var InMemoryFeatureStore = require('../feature_store'); -var LDClient = require('../index.js'); -var dataKind = require('../versioned_data_kind'); -var messages = require('../messages'); var stubs = require('./stubs'); describe('LDClient - analytics events', () => { diff --git a/test/LDClient-test.js b/test/LDClient-test.js index 3dbc22a..1c3bb05 100644 --- a/test/LDClient-test.js +++ b/test/LDClient-test.js @@ -1,6 +1,4 @@ -var InMemoryFeatureStore = require('../feature_store'); var LDClient = require('../index.js'); -var dataKind = require('../versioned_data_kind'); var messages = require('../messages'); var stubs = require('./stubs'); From 1fa81a4ba144a007f5a7932f82a966f8b42c4781 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Mon, 8 Oct 2018 12:42:39 -0700 Subject: [PATCH 43/70] fix broken event source construction --- streaming.js | 2 +- test/streaming-test.js | 37 ++++++++++++++++++------------------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/streaming.js b/streaming.js index 18a67ee..4f53488 100644 --- a/streaming.js +++ b/streaming.js @@ -16,7 +16,7 @@ function StreamProcessor(sdkKey, config, requestor, eventSourceFactory) { processor.start = function(fn) { var cb = fn || function(){}; - es = eventSourceFactory(config.streamUri + "/all", + es = new eventSourceFactory(config.streamUri + "/all", { agent: config.proxyAgent, headers: {'Authorization': sdkKey,'User-Agent': config.userAgent} diff --git a/test/streaming-test.js b/test/streaming-test.js index fea8ec5..10996d1 100644 --- a/test/streaming-test.js +++ b/test/streaming-test.js @@ -7,13 +7,12 @@ describe('StreamProcessor', function() { function fakeEventSource() { var es = { handlers: {} }; - es.initialize = function(url, options) { + es.constructor = function(url, options) { es.url = url; es.options = options; - return es; - }; - es.addEventListener = function(type, handler) { - es.handlers[type] = handler; + this.addEventListener = function(type, handler) { + es.handlers[type] = handler; + }; }; return es; } @@ -37,7 +36,7 @@ describe('StreamProcessor', function() { it('uses expected URL', function() { var config = { streamUri: 'http://test' }; var es = fakeEventSource(); - var sp = StreamProcessor(sdkKey, config, null, es.initialize); + var sp = StreamProcessor(sdkKey, config, null, es.constructor); sp.start(); expect(es.url).toEqual(config.streamUri + '/all'); }); @@ -45,7 +44,7 @@ describe('StreamProcessor', function() { it('sets expected headers', function() { var config = { streamUri: 'http://test', userAgent: 'agent' }; var es = fakeEventSource(); - var sp = StreamProcessor(sdkKey, config, null, es.initialize); + var sp = StreamProcessor(sdkKey, config, null, es.constructor); sp.start(); expect(es.options.headers['Authorization']).toEqual(sdkKey); expect(es.options.headers['User-Agent']).toEqual(config.userAgent); @@ -67,7 +66,7 @@ describe('StreamProcessor', function() { var featureStore = InMemoryFeatureStore(); var config = { featureStore: featureStore, logger: fakeLogger() }; var es = fakeEventSource(); - var sp = StreamProcessor(sdkKey, config, null, es.initialize); + var sp = StreamProcessor(sdkKey, config, null, es.constructor); sp.start(); es.handlers.put({ data: JSON.stringify(putData) }); @@ -89,7 +88,7 @@ describe('StreamProcessor', function() { var featureStore = InMemoryFeatureStore(); var config = { featureStore: featureStore, logger: fakeLogger() }; var es = fakeEventSource(); - var sp = StreamProcessor(sdkKey, config, null, es.initialize); + var sp = StreamProcessor(sdkKey, config, null, es.constructor); var cb = function(err) { expect(err).toBe(undefined); @@ -104,7 +103,7 @@ describe('StreamProcessor', function() { var featureStore = InMemoryFeatureStore(); var config = { featureStore: featureStore, logger: fakeLogger() }; var es = fakeEventSource(); - var sp = StreamProcessor(sdkKey, config, null, es.initialize); + var sp = StreamProcessor(sdkKey, config, null, es.constructor); sp.start(expectJsonError(config, done)); es.handlers.put({ data: '{not-good' }); @@ -116,7 +115,7 @@ describe('StreamProcessor', function() { var featureStore = InMemoryFeatureStore(); var config = { featureStore: featureStore, logger: fakeLogger() }; var es = fakeEventSource(); - var sp = StreamProcessor(sdkKey, config, null, es.initialize); + var sp = StreamProcessor(sdkKey, config, null, es.constructor); var patchData = { path: '/flags/flagkey', @@ -136,7 +135,7 @@ describe('StreamProcessor', function() { var featureStore = InMemoryFeatureStore(); var config = { featureStore: featureStore, logger: fakeLogger() }; var es = fakeEventSource(); - var sp = StreamProcessor(sdkKey, config, null, es.initialize); + var sp = StreamProcessor(sdkKey, config, null, es.constructor); var patchData = { path: '/segments/segkey', @@ -156,7 +155,7 @@ describe('StreamProcessor', function() { var featureStore = InMemoryFeatureStore(); var config = { featureStore: featureStore, logger: fakeLogger() }; var es = fakeEventSource(); - var sp = StreamProcessor(sdkKey, config, null, es.initialize); + var sp = StreamProcessor(sdkKey, config, null, es.constructor); sp.start(expectJsonError(config, done)); es.handlers.patch({ data: '{not-good' }); @@ -168,7 +167,7 @@ describe('StreamProcessor', function() { var featureStore = InMemoryFeatureStore(); var config = { featureStore: featureStore, logger: fakeLogger() }; var es = fakeEventSource(); - var sp = StreamProcessor(sdkKey, config, null, es.initialize); + var sp = StreamProcessor(sdkKey, config, null, es.constructor); sp.start(); @@ -192,7 +191,7 @@ describe('StreamProcessor', function() { var featureStore = InMemoryFeatureStore(); var config = { featureStore: featureStore, logger: fakeLogger() }; var es = fakeEventSource(); - var sp = StreamProcessor(sdkKey, config, null, es.initialize); + var sp = StreamProcessor(sdkKey, config, null, es.constructor); sp.start(); @@ -216,7 +215,7 @@ describe('StreamProcessor', function() { var featureStore = InMemoryFeatureStore(); var config = { featureStore: featureStore, logger: fakeLogger() }; var es = fakeEventSource(); - var sp = StreamProcessor(sdkKey, config, null, es.initialize); + var sp = StreamProcessor(sdkKey, config, null, es.constructor); sp.start(expectJsonError(config, done)); es.handlers.delete({ data: '{not-good' }); @@ -242,7 +241,7 @@ describe('StreamProcessor', function() { var featureStore = InMemoryFeatureStore(); var config = { featureStore: featureStore, logger: fakeLogger() }; var es = fakeEventSource(); - var sp = StreamProcessor(sdkKey, config, fakeRequestor, es.initialize); + var sp = StreamProcessor(sdkKey, config, fakeRequestor, es.constructor); sp.start(); @@ -277,7 +276,7 @@ describe('StreamProcessor', function() { var featureStore = InMemoryFeatureStore(); var config = { featureStore: featureStore, logger: fakeLogger() }; var es = fakeEventSource(); - var sp = StreamProcessor(sdkKey, config, fakeRequestor, es.initialize); + var sp = StreamProcessor(sdkKey, config, fakeRequestor, es.constructor); sp.start(); @@ -304,7 +303,7 @@ describe('StreamProcessor', function() { var featureStore = InMemoryFeatureStore(); var config = { featureStore: featureStore, logger: fakeLogger() }; var es = fakeEventSource(); - var sp = StreamProcessor(sdkKey, config, fakeRequestor, es.initialize); + var sp = StreamProcessor(sdkKey, config, fakeRequestor, es.constructor); sp.start(); From 8af9fd0c22fe785c9d1b063bfe35e27c3a0895ec Mon Sep 17 00:00:00 2001 From: Kevin Brackbill Date: Wed, 7 Nov 2018 14:57:17 -0800 Subject: [PATCH 44/70] Factor out caching and update queue from redis store for use in dynamodb store --- .gitignore | 3 +- feature_store_utils.js | 69 ++++++++++++++++++++++++++++++++++++++++++ redis_feature_store.js | 62 ++++++++----------------------------- 3 files changed, 83 insertions(+), 51 deletions(-) create mode 100644 feature_store_utils.js diff --git a/.gitignore b/.gitignore index 4ba85cf..5a9d795 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ junit.xml node_modules/ -npm-debug.log \ No newline at end of file +npm-debug.log +yarn.lock diff --git a/feature_store_utils.js b/feature_store_utils.js new file mode 100644 index 0000000..96dd08c --- /dev/null +++ b/feature_store_utils.js @@ -0,0 +1,69 @@ +var NodeCache = require('node-cache'); + +function cacheKey(kind, key) { + return kind.namespace + ":" + key; +} + +function StoreCache(ttl, getFallback) { + var cache = ttl ? new NodeCache({ stdTTL: ttl }) : null; + + this.get = function(kind, key, cb) { + if (cache) { + item = cache.get(cacheKey(kind, key)); + if (item) { + cb(item); + return; + } + } + + getFallback(kind, key, function (item) { + if (cache) { + cache.set(cacheKey(kind, key), item); + } + cb(item); + }); + }; + + this.set = function(kind, key, newItem) { + cache.set(cacheKey(kind, key), newItem); + }; + + this.flush = function() { + cache.flushAll(); + }; + + this.close = function() { + cache && cache.close(); + }; +} + +// queue +function UpdateQueue() { + var updateQueue = []; + this.enqueue = function(updateFn, fnArgs, cb) { + updateQueue.push(arguments); + if (updateQueue.length === 1) { + // if nothing else is in progress, we can start this one right away + executePendingUpdates(); + } + }; + function executePendingUpdates() { + if (updateQueue.length > 0) { + const entry = updateQueue[0]; + console.log(entry); + const fn = entry[0]; + const args = entry[1]; + const cb = entry[2]; + const newCb = function() { + updateQueue.shift(); + if (updateQueue.length > 0) { + setImmediate(executePendingUpdates); + } + cb && cb(); + }; + fn.apply(null, args.concat([newCb])); + } + } +} + +module.exports = { StoreCache, UpdateQueue }; diff --git a/redis_feature_store.js b/redis_feature_store.js index 7b35504..b2ca98c 100644 --- a/redis_feature_store.js +++ b/redis_feature_store.js @@ -1,7 +1,7 @@ var redis = require('redis'), - NodeCache = require( "node-cache" ), winston = require('winston'), - dataKind = require('./versioned_data_kind'); + dataKind = require('./versioned_data_kind'), +util = require('./feature_store_utils'); var noop = function(){}; @@ -12,8 +12,8 @@ function RedisFeatureStore(redisOpts, cacheTTL, prefix, logger) { var client = redis.createClient(redisOpts), store = {}, itemsPrefix = (prefix || "launchdarkly") + ":", - cache = cacheTTL ? new NodeCache({ stdTTL: cacheTTL}) : null, - updateQueue = [], + cache = new util.StoreCache(cacheTTL, doGet), + updateQueue = new util.UpdateQueue(), inited = false, checkedInit = false; @@ -55,23 +55,11 @@ function RedisFeatureStore(redisOpts, cacheTTL, prefix, logger) { return itemsPrefix + kind.namespace; } - function cacheKey(kind, key) { - return kind.namespace + ":" + key; - } - // A helper that performs a get with the redis client function doGet(kind, key, cb) { var item; cb = cb || noop; - if (cacheTTL) { - item = cache.get(cacheKey(kind, key)); - if (item) { - cb(item); - return; - } - } - if (!connected) { logger.warn('Attempted to fetch key ' + key + ' while Redis connection is down'); cb(null); @@ -79,6 +67,7 @@ function RedisFeatureStore(redisOpts, cacheTTL, prefix, logger) { } client.hget(itemsKey(kind), key, function(err, obj) { + 51 if (err) { logger.error("Error fetching key " + key + " from Redis in '" + kind.namespace + "'", err); cb(null); @@ -89,30 +78,9 @@ function RedisFeatureStore(redisOpts, cacheTTL, prefix, logger) { }); } - function executePendingUpdates() { - if (updateQueue.length > 0) { - const entry = updateQueue[0]; - const fn = entry[0]; - const args = entry[1]; - const cb = entry[2]; - const newCb = function() { - updateQueue.shift(); - if (updateQueue.length > 0) { - setImmediate(executePendingUpdates); - } - cb && cb(); - }; - fn.apply(store, args.concat([newCb])); - } - } - // Places an update operation on the queue. var serializeFn = function(updateFn, fnArgs, cb) { - updateQueue.push([updateFn, fnArgs, cb]); - if (updateQueue.length == 1) { - // if nothing else is in progress, we can start this one right away - executePendingUpdates(); - } + updateQueue.enqueue(updateFn.bind(store), fnArgs, cb); }; store.get = function(kind, key, cb) { @@ -162,9 +130,7 @@ function RedisFeatureStore(redisOpts, cacheTTL, prefix, logger) { store._init = function(allData, cb) { var multi = client.multi(); - if (cacheTTL) { - cache.flushAll(); - } + cache.flush(); for (var kindNamespace in allData) { if (Object.hasOwnProperty.call(allData, kindNamespace)) { @@ -177,9 +143,7 @@ function RedisFeatureStore(redisOpts, cacheTTL, prefix, logger) { if (Object.hasOwnProperty.call(items, key)) { stringified[key] = JSON.stringify(items[key]); } - if (cacheTTL) { - cache.set(cacheKey(kind, key), items[key]); - } + cache.set(kind, key, items[key]); } // Redis does not allow hmset() with an empty object if (Object.keys(stringified).length > 0) { @@ -244,8 +208,8 @@ function RedisFeatureStore(redisOpts, cacheTTL, prefix, logger) { updateItemWithVersioning(kind, newItem, cb, resultFn); } else { resultFn(err); - if (!err && cacheTTL) { - cache.set(cacheKey(kind, newItem.key), newItem); + if (!err) { + cache.set(kind, newItem.key, newItem); } cb(); } @@ -280,12 +244,10 @@ function RedisFeatureStore(redisOpts, cacheTTL, prefix, logger) { store.close = function() { client.quit(); - if (cacheTTL) { - cache.close(); - } + cache.close(); }; return store; } -module.exports = RedisFeatureStore; \ No newline at end of file +module.exports = RedisFeatureStore; From 38b8df3c53bc32a0ccb9e5f92b443a0ce5906d35 Mon Sep 17 00:00:00 2001 From: Kevin Brackbill Date: Wed, 7 Nov 2018 15:00:14 -0800 Subject: [PATCH 45/70] fix formatting --- feature_store_utils.js | 1 - redis_feature_store.js | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/feature_store_utils.js b/feature_store_utils.js index 96dd08c..36c4304 100644 --- a/feature_store_utils.js +++ b/feature_store_utils.js @@ -37,7 +37,6 @@ function StoreCache(ttl, getFallback) { }; } -// queue function UpdateQueue() { var updateQueue = []; this.enqueue = function(updateFn, fnArgs, cb) { diff --git a/redis_feature_store.js b/redis_feature_store.js index b2ca98c..8fc0897 100644 --- a/redis_feature_store.js +++ b/redis_feature_store.js @@ -1,7 +1,7 @@ var redis = require('redis'), winston = require('winston'), dataKind = require('./versioned_data_kind'), -util = require('./feature_store_utils'); + util = require('./feature_store_utils'); var noop = function(){}; @@ -67,7 +67,6 @@ function RedisFeatureStore(redisOpts, cacheTTL, prefix, logger) { } client.hget(itemsKey(kind), key, function(err, obj) { - 51 if (err) { logger.error("Error fetching key " + key + " from Redis in '" + kind.namespace + "'", err); cb(null); From c69ca148a6ac3a3d6e905052c4d000d6eae4c9b7 Mon Sep 17 00:00:00 2001 From: Kevin Brackbill Date: Wed, 7 Nov 2018 15:09:48 -0800 Subject: [PATCH 46/70] fix audit --- package-lock.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index e841e98..92ed44a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ldclient-node", - "version": "5.4.2", + "version": "5.5.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -3855,9 +3855,9 @@ } }, "merge": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/merge/-/merge-1.2.0.tgz", - "integrity": "sha1-dTHjnUlJwoGma4xabgJl6LBYlNo=", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/merge/-/merge-1.2.1.tgz", + "integrity": "sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ==", "dev": true }, "merge-stream": { From ed6b677f848a9a5ba76332f5ac40750bc3e48b89 Mon Sep 17 00:00:00 2001 From: Kevin Brackbill Date: Wed, 7 Nov 2018 15:11:16 -0800 Subject: [PATCH 47/70] consistency --- feature_store_utils.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/feature_store_utils.js b/feature_store_utils.js index 36c4304..1c836c3 100644 --- a/feature_store_utils.js +++ b/feature_store_utils.js @@ -17,19 +17,17 @@ function StoreCache(ttl, getFallback) { } getFallback(kind, key, function (item) { - if (cache) { - cache.set(cacheKey(kind, key), item); - } + cache && cache.set(cacheKey(kind, key), item); cb(item); }); }; this.set = function(kind, key, newItem) { - cache.set(cacheKey(kind, key), newItem); + cache && cache.set(cacheKey(kind, key), newItem); }; this.flush = function() { - cache.flushAll(); + cache && cache.flushAll(); }; this.close = function() { From 874c0af65623b66278fbf224e524e38844ba6946 Mon Sep 17 00:00:00 2001 From: Kevin Brackbill Date: Wed, 7 Nov 2018 16:45:58 -0800 Subject: [PATCH 48/70] remove yarn stuff --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 5a9d795..406e2c6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ junit.xml node_modules/ npm-debug.log -yarn.lock From da403186dca59f2e7528497987f0d8a2aada0ff2 Mon Sep 17 00:00:00 2001 From: Kevin Brackbill Date: Wed, 7 Nov 2018 16:52:37 -0800 Subject: [PATCH 49/70] make the caching into a wrapper around any feature store --- caching_store_wrapper.js | 72 ++++++++++++++++++++++++++++++++++++++++ feature_store_utils.js | 66 ------------------------------------ redis_feature_store.js | 18 +++++----- update_queue.js | 29 ++++++++++++++++ 4 files changed, 109 insertions(+), 76 deletions(-) create mode 100644 caching_store_wrapper.js delete mode 100644 feature_store_utils.js create mode 100644 update_queue.js diff --git a/caching_store_wrapper.js b/caching_store_wrapper.js new file mode 100644 index 0000000..c8dfd86 --- /dev/null +++ b/caching_store_wrapper.js @@ -0,0 +1,72 @@ +var NodeCache = require('node-cache'), + dataKind = require('./versioned_data_kind'); + +function cacheKey(kind, key) { + return kind.namespace + ":" + key; +} + +function CachingStoreWrapper(ttl, underlyingStore) { + var cache = ttl ? new NodeCache({ stdTTL: ttl }) : null; + + this.init = function(allData, cb) { + cache && cache.flushAll(); + + // populate cache with initial data + for (var kindNamespace in allData) { + if (Object.hasOwnProperty.call(allData, kindNamespace)) { + var kind = dataKind[kindNamespace]; + var items = allData[kindNamespace]; + for (var key in items) { + cache.set(kind, key, items[key]); + } + } + } + + underlyingStore.init(allData, cb); + }; + + this.initialized = function(cb) { + underlyingStore.initialized(cb); + }; + + this.all = function(kind, cb) { + underlyingStore.all(kind, cb); + }; + + this.get = function(kind, key, cb) { + if (cache) { + item = cache.get(cacheKey(kind, key)); + if (item) { + cb(item); + return; + } + } + + underlyingStore.get(kind, key, function (item) { + cache && cache.set(cacheKey(kind, key), item); + cb(item); + }); + }; + + this.upsert = function(kind, newItem, cb, resultFn) { + underlyingStore.upsert(kind, newItem, cb, function(err) { + if (!err) { + cache && cache.set(kind, newItem.key, newItem); + } + resultFn(err); + }); + }; + + this.delete = function(kind, key, version, cb) { + cache && cache.del(cacheKey(kind, key)); + underlyingStore.delete(kind, key, version, cb); + }; + + this.close = function() { + cache && cache.close(); + underlyingStore.close(); + }; +} + +module.exports = CachingStoreWrapper; + diff --git a/feature_store_utils.js b/feature_store_utils.js deleted file mode 100644 index 1c836c3..0000000 --- a/feature_store_utils.js +++ /dev/null @@ -1,66 +0,0 @@ -var NodeCache = require('node-cache'); - -function cacheKey(kind, key) { - return kind.namespace + ":" + key; -} - -function StoreCache(ttl, getFallback) { - var cache = ttl ? new NodeCache({ stdTTL: ttl }) : null; - - this.get = function(kind, key, cb) { - if (cache) { - item = cache.get(cacheKey(kind, key)); - if (item) { - cb(item); - return; - } - } - - getFallback(kind, key, function (item) { - cache && cache.set(cacheKey(kind, key), item); - cb(item); - }); - }; - - this.set = function(kind, key, newItem) { - cache && cache.set(cacheKey(kind, key), newItem); - }; - - this.flush = function() { - cache && cache.flushAll(); - }; - - this.close = function() { - cache && cache.close(); - }; -} - -function UpdateQueue() { - var updateQueue = []; - this.enqueue = function(updateFn, fnArgs, cb) { - updateQueue.push(arguments); - if (updateQueue.length === 1) { - // if nothing else is in progress, we can start this one right away - executePendingUpdates(); - } - }; - function executePendingUpdates() { - if (updateQueue.length > 0) { - const entry = updateQueue[0]; - console.log(entry); - const fn = entry[0]; - const args = entry[1]; - const cb = entry[2]; - const newCb = function() { - updateQueue.shift(); - if (updateQueue.length > 0) { - setImmediate(executePendingUpdates); - } - cb && cb(); - }; - fn.apply(null, args.concat([newCb])); - } - } -} - -module.exports = { StoreCache, UpdateQueue }; diff --git a/redis_feature_store.js b/redis_feature_store.js index 8fc0897..22e90d3 100644 --- a/redis_feature_store.js +++ b/redis_feature_store.js @@ -1,19 +1,24 @@ var redis = require('redis'), winston = require('winston'), dataKind = require('./versioned_data_kind'), - util = require('./feature_store_utils'); + CachingStoreWrapper = require('./caching_store_wrapper'); + UpdateQueue = require('./update_queue'); var noop = function(){}; function RedisFeatureStore(redisOpts, cacheTTL, prefix, logger) { + return new CachingStoreWrapper(cacheTTL, new RedisFeatureStoreNoCache(redisOpts, prefix, logger)); +} + +// TODO better name? +function RedisFeatureStoreNoCache(redisOpts, prefix, logger) { var client = redis.createClient(redisOpts), store = {}, itemsPrefix = (prefix || "launchdarkly") + ":", - cache = new util.StoreCache(cacheTTL, doGet), - updateQueue = new util.UpdateQueue(), + updateQueue = new UpdateQueue(), inited = false, checkedInit = false; @@ -129,8 +134,6 @@ function RedisFeatureStore(redisOpts, cacheTTL, prefix, logger) { store._init = function(allData, cb) { var multi = client.multi(); - cache.flush(); - for (var kindNamespace in allData) { if (Object.hasOwnProperty.call(allData, kindNamespace)) { var kind = dataKind[kindNamespace]; @@ -142,7 +145,6 @@ function RedisFeatureStore(redisOpts, cacheTTL, prefix, logger) { if (Object.hasOwnProperty.call(items, key)) { stringified[key] = JSON.stringify(items[key]); } - cache.set(kind, key, items[key]); } // Redis does not allow hmset() with an empty object if (Object.keys(stringified).length > 0) { @@ -207,9 +209,6 @@ function RedisFeatureStore(redisOpts, cacheTTL, prefix, logger) { updateItemWithVersioning(kind, newItem, cb, resultFn); } else { resultFn(err); - if (!err) { - cache.set(kind, newItem.key, newItem); - } cb(); } }); @@ -243,7 +242,6 @@ function RedisFeatureStore(redisOpts, cacheTTL, prefix, logger) { store.close = function() { client.quit(); - cache.close(); }; return store; diff --git a/update_queue.js b/update_queue.js new file mode 100644 index 0000000..7c57fa4 --- /dev/null +++ b/update_queue.js @@ -0,0 +1,29 @@ + +function UpdateQueue() { + var updateQueue = []; + this.enqueue = function(updateFn, fnArgs, cb) { + updateQueue.push(arguments); + if (updateQueue.length === 1) { + // if nothing else is in progress, we can start this one right away + executePendingUpdates(); + } + }; + function executePendingUpdates() { + if (updateQueue.length > 0) { + const entry = updateQueue[0]; + const fn = entry[0]; + const args = entry[1]; + const cb = entry[2]; + const newCb = function() { + updateQueue.shift(); + if (updateQueue.length > 0) { + setImmediate(executePendingUpdates); + } + cb && cb(); + }; + fn.apply(null, args.concat([newCb])); + } + } +} + +module.exports = UpdateQueue; From b933e277b386c11dfb46d93af65282f78ee3071c Mon Sep 17 00:00:00 2001 From: Kevin Brackbill Date: Wed, 7 Nov 2018 16:53:22 -0800 Subject: [PATCH 50/70] maybe better name? --- redis_feature_store.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/redis_feature_store.js b/redis_feature_store.js index 22e90d3..4f501ac 100644 --- a/redis_feature_store.js +++ b/redis_feature_store.js @@ -9,11 +9,10 @@ var noop = function(){}; function RedisFeatureStore(redisOpts, cacheTTL, prefix, logger) { - return new CachingStoreWrapper(cacheTTL, new RedisFeatureStoreNoCache(redisOpts, prefix, logger)); + return new CachingStoreWrapper(cacheTTL, new UncachedRedisFeatureStore(redisOpts, prefix, logger)); } -// TODO better name? -function RedisFeatureStoreNoCache(redisOpts, prefix, logger) { +function UncachedRedisFeatureStore(redisOpts, prefix, logger) { var client = redis.createClient(redisOpts), store = {}, From caea5e8ca610eaed57b8d5a525e7119a51960a07 Mon Sep 17 00:00:00 2001 From: Kevin Brackbill Date: Wed, 7 Nov 2018 16:58:01 -0800 Subject: [PATCH 51/70] Simplify things by just not adding the wrapper if a cache is not requested --- caching_store_wrapper.js | 22 ++++++++++------------ redis_feature_store.js | 6 +++++- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/caching_store_wrapper.js b/caching_store_wrapper.js index c8dfd86..b3c03be 100644 --- a/caching_store_wrapper.js +++ b/caching_store_wrapper.js @@ -6,10 +6,10 @@ function cacheKey(kind, key) { } function CachingStoreWrapper(ttl, underlyingStore) { - var cache = ttl ? new NodeCache({ stdTTL: ttl }) : null; + var cache = new NodeCache({ stdTTL: ttl }); this.init = function(allData, cb) { - cache && cache.flushAll(); + cache.flushAll(); // populate cache with initial data for (var kindNamespace in allData) { @@ -34,16 +34,14 @@ function CachingStoreWrapper(ttl, underlyingStore) { }; this.get = function(kind, key, cb) { - if (cache) { - item = cache.get(cacheKey(kind, key)); - if (item) { - cb(item); - return; - } + item = cache.get(cacheKey(kind, key)); + if (item) { + cb(item); + return; } underlyingStore.get(kind, key, function (item) { - cache && cache.set(cacheKey(kind, key), item); + cache.set(cacheKey(kind, key), item); cb(item); }); }; @@ -51,19 +49,19 @@ function CachingStoreWrapper(ttl, underlyingStore) { this.upsert = function(kind, newItem, cb, resultFn) { underlyingStore.upsert(kind, newItem, cb, function(err) { if (!err) { - cache && cache.set(kind, newItem.key, newItem); + cache.set(kind, newItem.key, newItem); } resultFn(err); }); }; this.delete = function(kind, key, version, cb) { - cache && cache.del(cacheKey(kind, key)); + cache.del(cacheKey(kind, key)); underlyingStore.delete(kind, key, version, cb); }; this.close = function() { - cache && cache.close(); + cache.close(); underlyingStore.close(); }; } diff --git a/redis_feature_store.js b/redis_feature_store.js index 4f501ac..b48ffed 100644 --- a/redis_feature_store.js +++ b/redis_feature_store.js @@ -9,7 +9,11 @@ var noop = function(){}; function RedisFeatureStore(redisOpts, cacheTTL, prefix, logger) { - return new CachingStoreWrapper(cacheTTL, new UncachedRedisFeatureStore(redisOpts, prefix, logger)); + var store = new UncachedRedisFeatureStore(redisOpts, prefix, logger); + if (cacheTTL) { + store = new CachingStoreWrapper(cacheTTL, store); + } + return store; } function UncachedRedisFeatureStore(redisOpts, prefix, logger) { From 657526ee92c8623746a915f9bd5628bdd4ce9cba Mon Sep 17 00:00:00 2001 From: Kevin Brackbill Date: Thu, 8 Nov 2018 10:17:53 -0800 Subject: [PATCH 52/70] switch param order --- caching_store_wrapper.js | 2 +- redis_feature_store.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/caching_store_wrapper.js b/caching_store_wrapper.js index b3c03be..c5ab083 100644 --- a/caching_store_wrapper.js +++ b/caching_store_wrapper.js @@ -5,7 +5,7 @@ function cacheKey(kind, key) { return kind.namespace + ":" + key; } -function CachingStoreWrapper(ttl, underlyingStore) { +function CachingStoreWrapper(underlyingStore, ttl) { var cache = new NodeCache({ stdTTL: ttl }); this.init = function(allData, cb) { diff --git a/redis_feature_store.js b/redis_feature_store.js index b48ffed..ab02c0f 100644 --- a/redis_feature_store.js +++ b/redis_feature_store.js @@ -11,7 +11,7 @@ var noop = function(){}; function RedisFeatureStore(redisOpts, cacheTTL, prefix, logger) { var store = new UncachedRedisFeatureStore(redisOpts, prefix, logger); if (cacheTTL) { - store = new CachingStoreWrapper(cacheTTL, store); + store = new CachingStoreWrapper(store, cacheTTL); } return store; } From c46a0dd2c5074891fb47b8e89ec9227212a2b71c Mon Sep 17 00:00:00 2001 From: Kevin Brackbill Date: Thu, 8 Nov 2018 16:21:59 -0800 Subject: [PATCH 53/70] Fix caching behavior with upsert, move some more functionality to the wrapper --- caching_store_wrapper.js | 67 ++++++++++++++++++++------------ redis_feature_store.js | 82 ++++++++++------------------------------ 2 files changed, 63 insertions(+), 86 deletions(-) diff --git a/caching_store_wrapper.js b/caching_store_wrapper.js index c5ab083..6c3e856 100644 --- a/caching_store_wrapper.js +++ b/caching_store_wrapper.js @@ -1,32 +1,48 @@ var NodeCache = require('node-cache'), - dataKind = require('./versioned_data_kind'); + dataKind = require('./versioned_data_kind'), + UpdateQueue = require('./update_queue'); function cacheKey(kind, key) { return kind.namespace + ":" + key; } function CachingStoreWrapper(underlyingStore, ttl) { - var cache = new NodeCache({ stdTTL: ttl }); + var cache = ttl ? new NodeCache({ stdTTL: ttl }) : null; + var queue = new UpdateQueue(); + var initialized; this.init = function(allData, cb) { - cache.flushAll(); + initialized = undefined; + queue.enqueue(function(cb) { + cache.flushAll(); - // populate cache with initial data - for (var kindNamespace in allData) { - if (Object.hasOwnProperty.call(allData, kindNamespace)) { - var kind = dataKind[kindNamespace]; - var items = allData[kindNamespace]; - for (var key in items) { - cache.set(kind, key, items[key]); + // populate cache with initial data + for (var kindNamespace in allData) { + if (Object.hasOwnProperty.call(allData, kindNamespace)) { + var kind = dataKind[kindNamespace]; + var items = allData[kindNamespace]; + for (var key in items) { + cache.set(kind, key, items[key]); + } } } - } - underlyingStore.init(allData, cb); + underlyingStore.init(allData, cb); + }, [], cb); }; this.initialized = function(cb) { - underlyingStore.initialized(cb); + if (initialized === undefined) { + underlyingStore.initialized(function(inited) { + initialized = inited; + cb(initialized); + }); + } else { + // if we already have a cached value for initialized, don't bother trying + // to call the underlying store until someone calls init, since it won't + // change. + cb(initialized); + } }; this.all = function(kind, cb) { @@ -34,30 +50,31 @@ function CachingStoreWrapper(underlyingStore, ttl) { }; this.get = function(kind, key, cb) { - item = cache.get(cacheKey(kind, key)); - if (item) { + item = cache && cache.get(cacheKey(kind, key)); + if (item && !item.deleted) { cb(item); return; } underlyingStore.get(kind, key, function (item) { - cache.set(cacheKey(kind, key), item); + cache && cache.set(cacheKey(kind, key), item); cb(item); }); }; - this.upsert = function(kind, newItem, cb, resultFn) { - underlyingStore.upsert(kind, newItem, cb, function(err) { - if (!err) { - cache.set(kind, newItem.key, newItem); - } - resultFn(err); - }); + this.upsert = function(kind, newItem, cb) { + queue.enqueue(function (cb) { + underlyingStore.upsertInternal(kind, newItem, function(err, attemptedWrite) { + if (attemptedWrite && !err) { + var red = cache && cache.set(cacheKey(kind, newItem.key), newItem); + } + cb(); + }); + }, [], cb); }; this.delete = function(kind, key, version, cb) { - cache.del(cacheKey(kind, key)); - underlyingStore.delete(kind, key, version, cb); + this.upsert(kind, { key: key, version: version, deleted: true }, cb); }; this.close = function() { diff --git a/redis_feature_store.js b/redis_feature_store.js index ab02c0f..b087d6c 100644 --- a/redis_feature_store.js +++ b/redis_feature_store.js @@ -2,18 +2,13 @@ var redis = require('redis'), winston = require('winston'), dataKind = require('./versioned_data_kind'), CachingStoreWrapper = require('./caching_store_wrapper'); - UpdateQueue = require('./update_queue'); var noop = function(){}; function RedisFeatureStore(redisOpts, cacheTTL, prefix, logger) { - var store = new UncachedRedisFeatureStore(redisOpts, prefix, logger); - if (cacheTTL) { - store = new CachingStoreWrapper(store, cacheTTL); - } - return store; + return new CachingStoreWrapper(new UncachedRedisFeatureStore(redisOpts, prefix, logger), cacheTTL); } function UncachedRedisFeatureStore(redisOpts, prefix, logger) { @@ -21,7 +16,6 @@ function UncachedRedisFeatureStore(redisOpts, prefix, logger) { var client = redis.createClient(redisOpts), store = {}, itemsPrefix = (prefix || "launchdarkly") + ":", - updateQueue = new UpdateQueue(), inited = false, checkedInit = false; @@ -85,11 +79,6 @@ function UncachedRedisFeatureStore(redisOpts, prefix, logger) { }); } - // Places an update operation on the queue. - var serializeFn = function(updateFn, fnArgs, cb) { - updateQueue.enqueue(updateFn.bind(store), fnArgs, cb); - }; - store.get = function(kind, key, cb) { cb = cb || noop; doGet(kind, key, function(item) { @@ -131,10 +120,6 @@ function UncachedRedisFeatureStore(redisOpts, prefix, logger) { }; store.init = function(allData, cb) { - serializeFn(store._init, [allData], cb); - }; - - store._init = function(allData, cb) { var multi = client.multi(); for (var kindNamespace in allData) { @@ -166,34 +151,21 @@ function UncachedRedisFeatureStore(redisOpts, prefix, logger) { }); }; - store.delete = function(kind, key, version, cb) { - serializeFn(store._delete, [kind, key, version], cb); - }; - - store._delete = function(kind, key, version, cb) { - var deletedItem = { key: key, version: version, deleted: true }; - updateItemWithVersioning(kind, deletedItem, cb, - function(err) { - if (err) { - logger.error("Error deleting key " + key + " in '" + kind.namespace + "'", err); - } - }); - } - store.upsert = function(kind, item, cb) { - serializeFn(store._upsert, [kind, item], cb); + store.upsertInternal(kind, item, function() { cb(); }); + }; - store._upsert = function(kind, item, cb) { - updateItemWithVersioning(kind, item, cb, - function(err) { - if (err) { - logger.error("Error upserting key " + key + " in '" + kind.namespace + "'", err); - } - }); + store.upsertInternal = function(kind, item, cb) { + updateItemWithVersioning(kind, item, function(err, attemptedWrite) { + if (err) { + logger.error("Error upserting key " + key + " in '" + kind.namespace + "'", err); + } + cb(err, attemptedWrite); + }); } - function updateItemWithVersioning(kind, newItem, cb, resultFn) { + function updateItemWithVersioning(kind, newItem, cb) { client.watch(itemsKey(kind)); var multi = client.multi(); // test_transaction_hook is instrumentation, set only by the unit tests @@ -202,7 +174,7 @@ function UncachedRedisFeatureStore(redisOpts, prefix, logger) { doGet(kind, newItem.key, function(oldItem) { if (oldItem && oldItem.version >= newItem.version) { multi.discard(); - cb(); + cb(null, false); } else { multi.hset(itemsKey(kind), newItem.key, JSON.stringify(newItem)); multi.exec(function(err, replies) { @@ -211,8 +183,7 @@ function UncachedRedisFeatureStore(redisOpts, prefix, logger) { logger.debug("Concurrent modification detected, retrying"); updateItemWithVersioning(kind, newItem, cb, resultFn); } else { - resultFn(err); - cb(); + cb(err, true); } }); } @@ -222,25 +193,14 @@ function UncachedRedisFeatureStore(redisOpts, prefix, logger) { store.initialized = function(cb) { cb = cb || noop; - if (inited) { - // Once we've determined that we're initialized, we can never become uninitialized again - cb(true); - } - else if (checkedInit) { - // We don't want to hit Redis for this question more than once; if we've already checked there - // and it wasn't populated, we'll continue to say we're uninited until init() has been called - cb(false); - } - else { - var inited = false; - client.exists(itemsKey(dataKind.features), function(err, obj) { - if (!err && obj) { - inited = true; - } - checkedInit = true; - cb(inited); - }); - } + var inited = false; + client.exists(itemsKey(dataKind.features), function(err, obj) { + if (!err && obj) { + inited = true; + } + checkedInit = true; + cb(inited); + }); }; store.close = function() { From 4133909aecbb3398cc64c1ec50c0d270c44a360e Mon Sep 17 00:00:00 2001 From: Kevin Brackbill Date: Fri, 9 Nov 2018 11:21:18 -0800 Subject: [PATCH 54/70] clean up init logic --- redis_feature_store.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/redis_feature_store.js b/redis_feature_store.js index b087d6c..0b2133b 100644 --- a/redis_feature_store.js +++ b/redis_feature_store.js @@ -15,9 +15,7 @@ function UncachedRedisFeatureStore(redisOpts, prefix, logger) { var client = redis.createClient(redisOpts), store = {}, - itemsPrefix = (prefix || "launchdarkly") + ":", - inited = false, - checkedInit = false; + itemsPrefix = (prefix || "launchdarkly") + ":"; logger = (logger || new winston.Logger({ @@ -144,8 +142,6 @@ function UncachedRedisFeatureStore(redisOpts, prefix, logger) { multi.exec(function(err, replies) { if (err) { logger.error("Error initializing Redis store", err); - } else { - inited = true; } cb(); }); @@ -193,13 +189,8 @@ function UncachedRedisFeatureStore(redisOpts, prefix, logger) { store.initialized = function(cb) { cb = cb || noop; - var inited = false; client.exists(itemsKey(dataKind.features), function(err, obj) { - if (!err && obj) { - inited = true; - } - checkedInit = true; - cb(inited); + cb(Boolean(!err && obj)); }); }; From a1b90543aac3b49d1fdaadcb33507afc25bcb0ef Mon Sep 17 00:00:00 2001 From: Kevin Brackbill Date: Fri, 9 Nov 2018 15:53:58 -0800 Subject: [PATCH 55/70] Implement more correct init logic, caching 'all' calls, and other minor cleanups --- caching_store_wrapper.js | 85 ++++++++++++++++++++++++++++------------ redis_feature_store.js | 9 +---- 2 files changed, 62 insertions(+), 32 deletions(-) diff --git a/caching_store_wrapper.js b/caching_store_wrapper.js index 6c3e856..a601d34 100644 --- a/caching_store_wrapper.js +++ b/caching_store_wrapper.js @@ -6,52 +6,77 @@ function cacheKey(kind, key) { return kind.namespace + ":" + key; } +function allCacheKey(kind) { + return "$all:" + kind.namespace; +} + +var initializedKey = "$checkedInit"; + + function CachingStoreWrapper(underlyingStore, ttl) { var cache = ttl ? new NodeCache({ stdTTL: ttl }) : null; var queue = new UpdateQueue(); - var initialized; + var initialized = false; this.init = function(allData, cb) { - initialized = undefined; - queue.enqueue(function(cb) { - cache.flushAll(); - - // populate cache with initial data - for (var kindNamespace in allData) { - if (Object.hasOwnProperty.call(allData, kindNamespace)) { - var kind = dataKind[kindNamespace]; - var items = allData[kindNamespace]; - for (var key in items) { - cache.set(kind, key, items[key]); + if (cache) { + queue.enqueue(function(cb) { + cache.del(initializedKey); + cache.flushAll(); + + // populate cache with initial data + for (var kindNamespace in allData) { + if (Object.hasOwnProperty.call(allData, kindNamespace)) { + var kind = dataKind[kindNamespace]; + var items = allData[kindNamespace]; + cache.set(allCacheKey(kind), items); + for (var key in items) { + cache.set(cacheKey(kind, key), items[key]); + } } } - } - underlyingStore.init(allData, cb); - }, [], cb); + underlyingStore.init(allData, cb); + }, [], cb); + } }; this.initialized = function(cb) { - if (initialized === undefined) { + if (initialized) { + cb(initialized); + } else if (cache && cache.get(initializedKey)) { + return false; + } else { underlyingStore.initialized(function(inited) { initialized = inited; + if (!initialized) { + cache && cache.set(initializedKey, true); + } cb(initialized); }); - } else { - // if we already have a cached value for initialized, don't bother trying - // to call the underlying store until someone calls init, since it won't - // change. - cb(initialized); } }; this.all = function(kind, cb) { - underlyingStore.all(kind, cb); + var items = cache && cache.get(allCacheKey(kind)); + if (items) { + cb(items); + return; + } + + underlyingStore.all(kind, function(items) { + cache.set(allCacheKey(kind), items) + cb(items); + }); }; this.get = function(kind, key, cb) { - item = cache && cache.get(cacheKey(kind, key)); - if (item && !item.deleted) { + var item = cache && cache.get(cacheKey(kind, key)); + if (item) { + if (item.deleted) { + cb(null); + return; + } cb(item); return; } @@ -64,9 +89,10 @@ function CachingStoreWrapper(underlyingStore, ttl) { this.upsert = function(kind, newItem, cb) { queue.enqueue(function (cb) { + flushAllCaches(); underlyingStore.upsertInternal(kind, newItem, function(err, attemptedWrite) { if (attemptedWrite && !err) { - var red = cache && cache.set(cacheKey(kind, newItem.key), newItem); + cache && cache.set(cacheKey(kind, newItem.key), newItem); } cb(); }); @@ -81,6 +107,15 @@ function CachingStoreWrapper(underlyingStore, ttl) { cache.close(); underlyingStore.close(); }; + + function flushAllCaches() { + if (!cache) { + return; + } + for (var kindNamespace in dataKind) { + cache.del(allCacheKey(dataKind[kindNamespace])); + } + } } module.exports = CachingStoreWrapper; diff --git a/redis_feature_store.js b/redis_feature_store.js index 0b2133b..6c23bd6 100644 --- a/redis_feature_store.js +++ b/redis_feature_store.js @@ -8,10 +8,10 @@ var noop = function(){}; function RedisFeatureStore(redisOpts, cacheTTL, prefix, logger) { - return new CachingStoreWrapper(new UncachedRedisFeatureStore(redisOpts, prefix, logger), cacheTTL); + return new CachingStoreWrapper(new redisFeatureStoreInternal(redisOpts, prefix, logger), cacheTTL); } -function UncachedRedisFeatureStore(redisOpts, prefix, logger) { +function redisFeatureStoreInternal(redisOpts, prefix, logger) { var client = redis.createClient(redisOpts), store = {}, @@ -147,11 +147,6 @@ function UncachedRedisFeatureStore(redisOpts, prefix, logger) { }); }; - store.upsert = function(kind, item, cb) { - store.upsertInternal(kind, item, function() { cb(); }); - - }; - store.upsertInternal = function(kind, item, cb) { updateItemWithVersioning(kind, item, function(err, attemptedWrite) { if (err) { From bfa9e124bd258800b4a25364f74bc66746124b1e Mon Sep 17 00:00:00 2001 From: Kevin Brackbill Date: Fri, 9 Nov 2018 15:56:42 -0800 Subject: [PATCH 56/70] undo change to gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 406e2c6..4ba85cf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ junit.xml node_modules/ -npm-debug.log +npm-debug.log \ No newline at end of file From 43c556603894dada9dcb0efd6265a852ffe4589d Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Fri, 9 Nov 2018 17:29:24 -0800 Subject: [PATCH 57/70] add tests for CachingStoreWrapper + misc bug fixes --- caching_store_wrapper.js | 66 +++--- redis_feature_store.js | 4 +- test/caching_store_wrapper-test.js | 362 +++++++++++++++++++++++++++++ 3 files changed, 400 insertions(+), 32 deletions(-) create mode 100644 test/caching_store_wrapper-test.js diff --git a/caching_store_wrapper.js b/caching_store_wrapper.js index a601d34..2ca0732 100644 --- a/caching_store_wrapper.js +++ b/caching_store_wrapper.js @@ -19,33 +19,37 @@ function CachingStoreWrapper(underlyingStore, ttl) { var initialized = false; this.init = function(allData, cb) { - if (cache) { - queue.enqueue(function(cb) { - cache.del(initializedKey); - cache.flushAll(); - - // populate cache with initial data - for (var kindNamespace in allData) { - if (Object.hasOwnProperty.call(allData, kindNamespace)) { - var kind = dataKind[kindNamespace]; - var items = allData[kindNamespace]; - cache.set(allCacheKey(kind), items); - for (var key in items) { - cache.set(cacheKey(kind, key), items[key]); + queue.enqueue(function(cb) { + underlyingStore.init(allData, function() { + initialized = true; + + if (cache) { + cache.del(initializedKey); + cache.flushAll(); + + // populate cache with initial data + for (var kindNamespace in allData) { + if (Object.hasOwnProperty.call(allData, kindNamespace)) { + var kind = dataKind[kindNamespace]; + var items = allData[kindNamespace]; + cache.set(allCacheKey(kind), items); + for (var key in items) { + cache.set(cacheKey(kind, key), items[key]); + } } } } - underlyingStore.init(allData, cb); - }, [], cb); - } + cb(); + }); + }, [], cb); }; this.initialized = function(cb) { if (initialized) { - cb(initialized); + cb(true); } else if (cache && cache.get(initializedKey)) { - return false; + cb(false); } else { underlyingStore.initialized(function(inited) { initialized = inited; @@ -65,34 +69,36 @@ function CachingStoreWrapper(underlyingStore, ttl) { } underlyingStore.all(kind, function(items) { - cache.set(allCacheKey(kind), items) + cache && cache.set(allCacheKey(kind), items); cb(items); }); }; this.get = function(kind, key, cb) { - var item = cache && cache.get(cacheKey(kind, key)); - if (item) { - if (item.deleted) { - cb(null); + if (cache) { + var item = cache.get(cacheKey(kind, key)); + if (item !== undefined) { + cb(itemOnlyIfNotDeleted(item)); return; } - cb(item); - return; } - underlyingStore.get(kind, key, function (item) { + underlyingStore.get(kind, key, function(item) { cache && cache.set(cacheKey(kind, key), item); - cb(item); + cb(itemOnlyIfNotDeleted(item)); }); }; + function itemOnlyIfNotDeleted(item) { + return (!item || item.deleted) ? null : item; + } + this.upsert = function(kind, newItem, cb) { queue.enqueue(function (cb) { flushAllCaches(); - underlyingStore.upsertInternal(kind, newItem, function(err, attemptedWrite) { - if (attemptedWrite && !err) { - cache && cache.set(cacheKey(kind, newItem.key), newItem); + underlyingStore.upsertInternal(kind, newItem, function(err, updatedItem) { + if (!err) { + cache && cache.set(cacheKey(kind, newItem.key), updatedItem); } cb(); }); diff --git a/redis_feature_store.js b/redis_feature_store.js index 6c23bd6..1c9f01d 100644 --- a/redis_feature_store.js +++ b/redis_feature_store.js @@ -165,7 +165,7 @@ function redisFeatureStoreInternal(redisOpts, prefix, logger) { doGet(kind, newItem.key, function(oldItem) { if (oldItem && oldItem.version >= newItem.version) { multi.discard(); - cb(null, false); + cb(null, oldItem); } else { multi.hset(itemsKey(kind), newItem.key, JSON.stringify(newItem)); multi.exec(function(err, replies) { @@ -174,7 +174,7 @@ function redisFeatureStoreInternal(redisOpts, prefix, logger) { logger.debug("Concurrent modification detected, retrying"); updateItemWithVersioning(kind, newItem, cb, resultFn); } else { - cb(err, true); + cb(err, newItem); } }); } diff --git a/test/caching_store_wrapper-test.js b/test/caching_store_wrapper-test.js new file mode 100644 index 0000000..db8addc --- /dev/null +++ b/test/caching_store_wrapper-test.js @@ -0,0 +1,362 @@ +var CachingStoreWrapper = require('../caching_store_wrapper'); +var features = require('../versioned_data_kind').features; + +function MockCore() { + const c = { + data: { features: {} }, + inited: false, + initQueriedCount: 0, + + init: function(newData, cb) { + c.data = newData; + cb(); + }, + + get: function(kind, key, cb) { + cb(c.data[kind.namespace][key]); + }, + + all: function(kind, cb) { + cb(c.data[kind.namespace]); + }, + + upsertInternal: function(kind, item, cb) { + const oldItem = c.data[kind.namespace][item.key]; + if (oldItem && oldItem.version >= item.version) { + cb(null, oldItem); + } else { + c.data[kind.namespace][item.key] = item; + cb(null, item); + } + }, + + initialized: function(cb) { + c.initQueriedCount++; + cb(c.inited); + }, + + forceSet: function(kind, item) { + c.data[kind.namespace][item.key] = item; + }, + + forceRemove: function(kind, key) { + delete c.data[kind.namespace][key]; + } + }; + return c; +} + +const cacheSeconds = 15; + +function runCachedAndUncachedTests(name, testFn) { + describe(name, function() { + const core1 = MockCore(); + const wrapper1 = new CachingStoreWrapper(core1, cacheSeconds); + it('cached', function(done) { testFn(done, wrapper1, core1, true); }); + + const core2 = MockCore(); + const wrapper2 = new CachingStoreWrapper(core2, 0); + it('uncached', function(done) { testFn(done, wrapper2, core2, false); }); + }); +} + +function runCachedTestOnly(name, testFn) { + it(name, function(done) { + const core = MockCore(); + const wrapper = new CachingStoreWrapper(core, cacheSeconds); + testFn(done, wrapper, core); + }); +} + +describe('CachingStoreWrapper', function() { + + runCachedAndUncachedTests('get()', function(done, wrapper, core, isCached) { + const flagv1 = { key: 'flag', version: 1 }; + const flagv2 = { key: 'flag', version: 2 }; + + core.forceSet(features, flagv1); + + wrapper.get(features, flagv1.key, function(item) { + expect(item).toEqual(flagv1); + + core.forceSet(features, flagv2); // Make a change that bypasses the cache + + wrapper.get(features, flagv1.key, function(item) { + // If cached, it should return the cached value rather than calling the underlying getter + expect(item).toEqual(isCached ? flagv1 : flagv2); + + done(); + }); + }); + }); + + runCachedAndUncachedTests('get() with deleted item', function(done, wrapper, core, isCached) { + const flagv1 = { key: 'flag', version: 1, deleted: true }; + const flagv2 = { key: 'flag', version: 2, deleted: false }; + + core.forceSet(features, flagv1); + + wrapper.get(features, flagv1.key, function(item) { + expect(item).toBe(null); + + core.forceSet(features, flagv2); // Make a change that bypasses the cache + + wrapper.get(features, flagv2.key, function(item) { + // If cached, the deleted state should persist in the cache + expect(item).toEqual(isCached ? null : flagv2); + + done(); + }); + }); + }); + + runCachedAndUncachedTests('get() with missing item', function(done, wrapper, core, isCached) { + const flag = { key: 'flag', version: 1 }; + + wrapper.get(features, flag.key, function(item) { + expect(item).toBe(null); + + core.forceSet(features, flag); + + wrapper.get(features, flag.key, function(item) { + // If cached, the previous null result should persist in the cache + expect(item).toEqual(isCached ? null : flag); + + done(); + }); + }); + }); + + runCachedTestOnly('cached get() uses values from init()', function(done, wrapper, core) { + const flagv1 = { key: 'flag', version: 1 }; + const flagv2 = { key: 'flag', version: 2 }; + + const allData = { features: { 'flag': flagv1 } }; + + wrapper.init(allData, function() { + expect(core.data).toEqual(allData); + + core.forceSet(features, flagv2); + + wrapper.get(features, flagv1.key, function(item) { + expect(item).toEqual(flagv1); + + done(); + }); + }); + }); + + runCachedAndUncachedTests('all()', function(done, wrapper, core, isCached) { + const flag1 = { key: 'flag1', version: 1 }; + const flag2 = { key: 'flag2', version: 1 }; + + core.forceSet(features, flag1); + core.forceSet(features, flag2); + + wrapper.all(features, function(items) { + expect(items).toEqual({ 'flag1': flag1, 'flag2': flag2 }); + + core.forceRemove(features, flag2.key); + + wrapper.all(features, function(items) { + if (isCached) { + expect(items).toEqual({ 'flag1': flag1, 'flag2': flag2 }); + } else { + expect(items).toEqual({ 'flag1': flag1 }); + } + + done(); + }); + }); + }); + + runCachedTestOnly('cached all() uses values from init()', function(done, wrapper, core) { + const flag1 = { key: 'flag1', version: 1 }; + const flag2 = { key: 'flag2', version: 1 }; + + const allData = { features: { flag1: flag1, flag2: flag2 } }; + + wrapper.init(allData, function() { + core.forceRemove(features, flag2.key); + + wrapper.all(features, function(items) { + expect(items).toEqual({ flag1: flag1, flag2: flag2 }); + + done(); + }); + }); + }); + + runCachedTestOnly('cached all() uses fresh values if there has been an update', function(done, wrapper, core) { + const flag1v1 = { key: 'flag1', version: 1 }; + const flag1v2 = { key: 'flag1', version: 2 }; + const flag2v1 = { key: 'flag2', version: 1 }; + const flag2v2 = { key: 'flag2', version: 2 }; + + const allData = { features: { flag1: flag1v1, flag2: flag2v2 } }; + + wrapper.init(allData, function() { + expect(core.data).toEqual(allData); + + // make a change to flag1 using the wrapper - this should flush the cache + wrapper.upsert(features, flag1v2, function() { + // make a change to flag2 that bypasses the cache + core.forceSet(features, flag2v2); + + // we should now see both changes since the cache was flushed + wrapper.all(features, function(items) { + expect(items).toEqual({ flag1: flag1v2, flag2: flag2v2 }); + + done(); + }); + }); + }); + }); + + runCachedAndUncachedTests('upsert() - successful', function(done, wrapper, core, isCached) { + const flagv1 = { key: 'flag', version: 1 }; + const flagv2 = { key: 'flag', version: 2 }; + + wrapper.upsert(features, flagv1, function() { + expect(core.data[features.namespace][flagv1.key]).toEqual(flagv1); + + wrapper.upsert(features, flagv2, function() { + expect(core.data[features.namespace][flagv1.key]).toEqual(flagv2); + + // if we have a cache, verify that the new item is now cached by writing a different value + // to the underlying data - get() should still return the cached item + if (isCached) { + const flagv3 = { key: 'flag', version: 3 }; + core.forceSet(features, flagv3); + } + + wrapper.get(features, flagv1.key, function(item) { + expect(item).toEqual(flagv2); + + done(); + }); + }); + }); + }); + + runCachedTestOnly('cached upsert() - unsuccessful', function(done, wrapper, core) { + const flagv1 = { key: 'flag', version: 1 }; + const flagv2 = { key: 'flag', version: 2 }; + + core.forceSet(features, flagv2); // this is now in the underlying data, but not in the cache + + wrapper.upsert(features, flagv1, function() { + expect(core.data[features.namespace][flagv1.key]).toEqual(flagv2); // value in store remains the same + + // the cache should now contain flagv2 - check this by making another change that bypasses + // the cache, and verifying that get() uses the cached value instead + const flagv3 = { key: 'flag', version: 3 }; + core.forceSet(features, flagv3); + + wrapper.get(features, flagv1.key, function(item) { + expect(item).toEqual(flagv2); + + done(); + }); + }); + }); + + runCachedAndUncachedTests('delete()', function(done, wrapper, core, isCached) { + const flagv1 = { key: 'flag', version: 1 }; + const flagv2 = { key: 'flag', version: 2, deleted: true }; + const flagv3 = { key: 'flag', version: 3 }; + + core.forceSet(features, flagv1); + + wrapper.get(features, flagv1.key, function(item) { + expect(item).toEqual(flagv1); + + wrapper.delete(features, flagv1.key, flagv2.version); + + expect(core.data[features.namespace][flagv1.key]).toEqual(flagv2); + + // make a change to the flag that bypasses the cache + core.forceSet(features, flagv3); + + wrapper.get(features, flagv1.key, function(item) { + expect(item).toEqual(isCached ? null : flagv3); + + done(); + }); + }); + }); + + describe('initialized()', function() { + it('calls underlying initialized() only if not already inited', function(done) { + const core = MockCore(); + const wrapper = new CachingStoreWrapper(core, 0); + + wrapper.initialized(function(value) { + expect(value).toEqual(false); + expect(core.initQueriedCount).toEqual(1); + + core.inited = true; + + wrapper.initialized(function(value) { + expect(value).toEqual(true); + expect(core.initQueriedCount).toEqual(2); + + core.inited = false; // this should have no effect since we already returned true + + wrapper.initialized(function(value) { + expect(value).toEqual(true); + expect(core.initQueriedCount).toEqual(2); + + done(); + }); + }); + }); + }); + + it('will not call initialized() if init() has been called', function(done) { + const core = MockCore(); + const wrapper = new CachingStoreWrapper(core, 0); + + wrapper.initialized(function(value) { + expect(value).toEqual(false); + expect(core.initQueriedCount).toEqual(1); + + const allData = { features: {} }; + wrapper.init(allData, function() { + wrapper.initialized(function(value) { + expect(value).toEqual(true); + expect(core.initQueriedCount).toEqual(1); + + done(); + }); + }); + }); + }); + + it('can cache false result', function(done) { + const core = MockCore(); + const wrapper = new CachingStoreWrapper(core, 1); // cache TTL = 1 second + + wrapper.initialized(function(value) { + expect(value).toEqual(false); + expect(core.initQueriedCount).toEqual(1); + + core.inited = true; + + wrapper.initialized(function(value) { + expect(value).toEqual(false); + expect(core.initQueriedCount).toEqual(1); + + setTimeout(function() { + wrapper.initialized(function(value) { + expect(value).toEqual(true); + expect(core.initQueriedCount).toEqual(2); + + done(); + }); + }, 1100); + }); + }); + }); + }); +}); From 5f14c1543cbd5433c5128ea297bfb6287cdafb02 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Fri, 9 Nov 2018 18:11:32 -0800 Subject: [PATCH 58/70] basic tests for UpdateQueue --- test/update_queue-test.js | 61 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 test/update_queue-test.js diff --git a/test/update_queue-test.js b/test/update_queue-test.js new file mode 100644 index 0000000..7770bce --- /dev/null +++ b/test/update_queue-test.js @@ -0,0 +1,61 @@ +var UpdateQueue = require('../update_queue'); + +describe('UpdateQueue', function() { + it('executes task immediately if there are no pending tasks', function(done) { + const q = new UpdateQueue(); + + var updated = false; + const updateFn = function(a, b, cb) { + expect(a).toEqual(1); + expect(b).toEqual(2); + updated = true; + cb(); + }; + + q.enqueue(updateFn, [1, 2], function() { + expect(updated).toEqual(true); + done(); + }); + }); + + it('serializes async tasks in the order submitted', function(done) { + const q = new UpdateQueue(); + + var progress = []; + + // This simulates a condition in which events are being received asynchronously and each + // event triggers an asynchronous task. We want to make sure that the tasks are executed in + // the order submitted, even if one is submitted during the execution of the previous one. + const taskFn = function(i, cb) { + progress.push('start ' + i); + // assume that we're doing something asynchronous here - make sure it takes a little time + setTimeout(cb, 20); + }; + + const expected = [ + 'submit 1', + 'start 1', // note, this one executes immediately because there was nothing pening + 'submit 2', + 'submit 3', + 'end 1', + 'start 2', + 'end 2', + 'start 3', + 'end 3' + ]; + + for (var i = 1; i <= 3; i++) { + const j = i; + setImmediate(function() { + progress.push('submit ' + j); + q.enqueue(taskFn, [j], function() { + progress.push('end ' + j); + if (j >= 3) { + expect(progress).toEqual(expected); + done(); + } + }); + }); + }; + }); +}); \ No newline at end of file From 773e11ecf53919a9ab33134b20b4ef09d259f467 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Fri, 9 Nov 2018 19:11:12 -0800 Subject: [PATCH 59/70] typo --- test/update_queue-test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/update_queue-test.js b/test/update_queue-test.js index 7770bce..b182855 100644 --- a/test/update_queue-test.js +++ b/test/update_queue-test.js @@ -34,7 +34,7 @@ describe('UpdateQueue', function() { const expected = [ 'submit 1', - 'start 1', // note, this one executes immediately because there was nothing pening + 'start 1', // note, this one executes immediately because there was nothing pending 'submit 2', 'submit 3', 'end 1', @@ -58,4 +58,4 @@ describe('UpdateQueue', function() { }); }; }); -}); \ No newline at end of file +}); From 02f516add7046f67dcb656574b8361eefe04fe52 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Fri, 9 Nov 2018 20:30:08 -0800 Subject: [PATCH 60/70] add some more feature store test coverage + misc Redis fixes --- caching_store_wrapper.js | 2 + redis_feature_store.js | 13 ++- test/feature_store-test.js | 4 +- test/feature_store_test_base.js | 163 ++++++++++++++++++++++++++++++- test/redis_feature_store-test.js | 66 +++++-------- 5 files changed, 197 insertions(+), 51 deletions(-) diff --git a/caching_store_wrapper.js b/caching_store_wrapper.js index 2ca0732..2824bd7 100644 --- a/caching_store_wrapper.js +++ b/caching_store_wrapper.js @@ -18,6 +18,8 @@ function CachingStoreWrapper(underlyingStore, ttl) { var queue = new UpdateQueue(); var initialized = false; + this.underlyingStore = underlyingStore; + this.init = function(allData, cb) { queue.enqueue(function(cb) { underlyingStore.init(allData, function() { diff --git a/redis_feature_store.js b/redis_feature_store.js index 1c9f01d..eedf438 100644 --- a/redis_feature_store.js +++ b/redis_feature_store.js @@ -15,7 +15,8 @@ function redisFeatureStoreInternal(redisOpts, prefix, logger) { var client = redis.createClient(redisOpts), store = {}, - itemsPrefix = (prefix || "launchdarkly") + ":"; + itemsPrefix = (prefix || "launchdarkly") + ":", + initedKey = itemsPrefix + "$inited"; logger = (logger || new winston.Logger({ @@ -139,6 +140,8 @@ function redisFeatureStoreInternal(redisOpts, prefix, logger) { } } + multi.set(initedKey, ""); + multi.exec(function(err, replies) { if (err) { logger.error("Error initializing Redis store", err); @@ -159,8 +162,8 @@ function redisFeatureStoreInternal(redisOpts, prefix, logger) { function updateItemWithVersioning(kind, newItem, cb) { client.watch(itemsKey(kind)); var multi = client.multi(); - // test_transaction_hook is instrumentation, set only by the unit tests - var prepare = store.test_transaction_hook || function(prepareCb) { prepareCb(); }; + // testUpdateHook is instrumentation, used only by the unit tests + var prepare = store.testUpdateHook || function(prepareCb) { prepareCb(); }; prepare(function() { doGet(kind, newItem.key, function(oldItem) { if (oldItem && oldItem.version >= newItem.version) { @@ -172,7 +175,7 @@ function redisFeatureStoreInternal(redisOpts, prefix, logger) { if (!err && replies === null) { // This means the EXEC failed because someone modified the watched key logger.debug("Concurrent modification detected, retrying"); - updateItemWithVersioning(kind, newItem, cb, resultFn); + updateItemWithVersioning(kind, newItem, cb); } else { cb(err, newItem); } @@ -184,7 +187,7 @@ function redisFeatureStoreInternal(redisOpts, prefix, logger) { store.initialized = function(cb) { cb = cb || noop; - client.exists(itemsKey(dataKind.features), function(err, obj) { + client.exists(initedKey, function(err, obj) { cb(Boolean(!err && obj)); }); }; diff --git a/test/feature_store-test.js b/test/feature_store-test.js index 4ca19ce..71ab1db 100644 --- a/test/feature_store-test.js +++ b/test/feature_store-test.js @@ -1,8 +1,8 @@ var InMemoryFeatureStore = require('../feature_store'); -var allFeatureStoreTests = require('./feature_store_test_base'); +var testBase = require('./feature_store_test_base'); describe('InMemoryFeatureStore', function() { - allFeatureStoreTests(function() { + testBase.baseFeatureStoreTests(function() { return new InMemoryFeatureStore(); }) }); diff --git a/test/feature_store_test_base.js b/test/feature_store_test_base.js index 5bb874e..a11eca0 100644 --- a/test/feature_store_test_base.js +++ b/test/feature_store_test_base.js @@ -1,6 +1,17 @@ var dataKind = require('../versioned_data_kind'); -function allFeatureStoreTests(makeStore) { +// The following tests should be run on every feature store implementation. If this type of +// store supports caching, the tests should be run once with caching enabled and once with +// caching disabled. +// +// Parameters: +// - makeStore(): creates an instance of the feature store. +// - clearExistingData(callback): if specified, will be called before each test to clear any +// storage that the store instances may be sharing. +// - isCached: true if the instances returned by makeStore() have caching enabled. If +// applicable, + +function baseFeatureStoreTests(makeStore, clearExistingData, isCached) { var feature1 = { key: 'foo', version: 10 @@ -10,6 +21,14 @@ function allFeatureStoreTests(makeStore) { version: 10 }; + beforeEach(function(done) { + if (clearExistingData) { + clearExistingData(done); + } else { + done(); + } + }); + function initedStore(cb) { var store = makeStore(); var initData = {}; @@ -31,6 +50,70 @@ function allFeatureStoreTests(makeStore) { }); }); + it('init() completely replaces previous data', function(done) { + var store = makeStore(); + var flags = { + first: { key: 'thing', version: 1 }, + second: { key: 'stuff', version: 1 } + }; + var segments = { first: { key: 'thing', version: 2 } }; + var initData = {}; + initData[dataKind.features.namespace] = flags; + initData[dataKind.segments.namespace] = segments; + + store.init(initData, function() { + store.all(dataKind.features, function(items) { + expect(items).toEqual(flags); + store.all(dataKind.segments, function(items) { + expect(items).toEqual(segments); + + var newFlags = { first: { key: 'thing', version: 3 } }; + var newSegments = { first: { key: 'thing', version: 4 } }; + var initData = {}; + initData[dataKind.features.namespace] = newFlags; + initData[dataKind.segments.namespace] = newSegments; + + store.init(initData, function() { + store.all(dataKind.features, function(items) { + expect(items).toEqual(newFlags); + store.all(dataKind.segments, function(items) { + expect(items).toEqual(newSegments); + + done(); + }) + }) + }); + }); + }); + }); + }); + + if (!isCached && clearExistingData) { + function testInitStateDetection(desc, initData) { + it(desc, function(done) { + var store1 = makeStore(); + var store2 = makeStore(); + + store1.initialized(function(result) { + expect(result).toBe(false); + + store2.init(initData, function() { + store1.initialized(function(result) { + expect(result).toBe(true); + done(); + }); + }); + }); + }); + } + + testInitStateDetection('can detect if another instance has initialized the store', + { features: { foo: feature1 } }); + + testInitStateDetection('can detect if another instance has initialized the store, even with empty data', + { features: {} }); + } + it('gets existing feature', function(done) { initedStore(function(store) { store.get(dataKind.features, feature1.key, function(result) { @@ -165,4 +248,80 @@ function allFeatureStoreTests(makeStore) { }); } -module.exports = allFeatureStoreTests; +// The following tests require that the feature store can be instrumented in such a way as to run +// some test code in the middle of an upsert operation. +// +// Parameters: +// - makeStore(): creates a normal feature store. +// - makeStoreWithHook(hook): creates a feature store that operates on the same underlying data as +// the first store. This store will call the hook function (passing a callback) immediately before +// it attempts to make any update. + +function concurrentModificationTests(makeStore, makeStoreWithHook) { + + var flagKey = 'flag'; + var initialVersion = 1; + + var competingStore = makeStore(); + + function makeFlagWithVersion(v) { + return { key: flagKey, version: v }; + } + + function withInitedStore(store, cb) { + var allData = { features: {} }; + allData['features'][flagKey] = makeFlagWithVersion(initialVersion); + store.init(allData, cb); + } + + function writeCompetingVersions(flagVersionsToWrite) { + var i = 0; + return function(callback) { + if (i < flagVersionsToWrite.length) { + var newFlag = makeFlagWithVersion(flagVersionsToWrite[i]); + i++; + competingStore.upsert(dataKind.features, newFlag, callback); + } else { + callback(); + } + }; + } + + it('handles upsert race condition against other client with lower version', function(done) { + var myDesiredVersion = 10; + var competingStoreVersions = [ 2, 3, 4 ]; // proves that we can retry multiple times if necessary + + var myStore = makeStoreWithHook(writeCompetingVersions(competingStoreVersions)); + + withInitedStore(myStore, function() { + myStore.upsert(dataKind.features, makeFlagWithVersion(myDesiredVersion), function() { + myStore.get(dataKind.features, flagKey, function(result) { + expect(result.version).toEqual(myDesiredVersion); + done(); + }); + }); + }); + }); + + it('handles upsert race condition against other client with higher version', function(done) { + var myDesiredVersion = 2; + var competingStoreVersion = 3; + + var myStore = makeStoreWithHook(writeCompetingVersions([ competingStoreVersion ])); + + withInitedStore(myStore, function() { + myStore.upsert(dataKind.features, makeFlagWithVersion(myDesiredVersion), function() { + myStore.get(dataKind.features, flagKey, function(result) { + expect(result.version).toEqual(competingStoreVersion); + done(); + }); + }); + }); + }); +} + +module.exports = { + baseFeatureStoreTests: baseFeatureStoreTests, + concurrentModificationTests: concurrentModificationTests +}; + diff --git a/test/redis_feature_store-test.js b/test/redis_feature_store-test.js index 282d9dd..1ba8837 100644 --- a/test/redis_feature_store-test.js +++ b/test/redis_feature_store-test.js @@ -1,54 +1,36 @@ var RedisFeatureStore = require('../redis_feature_store'); -var allFeatureStoreTests = require('./feature_store_test_base'); +var testBase = require('./feature_store_test_base'); var dataKind = require('../versioned_data_kind'); var redis = require('redis'); describe('RedisFeatureStore', function() { var redisOpts = { url: 'redis://localhost:6379' }; - function makeStore() { - return new RedisFeatureStore(redisOpts, 30000); + var extraRedisClient = redis.createClient(redisOpts); + + function makeCachedStore() { + return new RedisFeatureStore(redisOpts, 30); + } + + function makeUncachedStore() { + return new RedisFeatureStore(redisOpts, 0); } - allFeatureStoreTests(makeStore); - - it('handles upsert race condition against external client correctly', function(done) { - var store = makeStore(); - var otherClient = redis.createClient(redisOpts); - - var feature1 = { - key: 'foo', - version: 1 - }; - var intermediateVer = { key: feature1.key, version: feature1.version }; - var finalVer = { key: feature1.key, version: 10 }; - - var initData = {}; - initData[dataKind.features.namespace] = { - 'foo': feature1 - }; - - store.init(initData, function() { - var tries = 0; - // This function will be called in between the WATCH and the update transaction. - // We're testing that the store will detect this concurrent modification and will - // transparently retry the update. - store.test_transaction_hook = function(cb) { - if (tries < 3) { - tries++; - intermediateVer.version++; - otherClient.hset("launchdarkly:features", "foo", JSON.stringify(intermediateVer), cb); - } else { - cb(); - } - }; - store.upsert(dataKind.features, finalVer, function() { - store.get(dataKind.features, feature1.key, function(result) { - otherClient.quit(); - expect(result).toEqual(finalVer); - done(); - }); - }); + function clearExistingData(callback) { + extraRedisClient.flushdb(callback); + } + + testBase.baseFeatureStoreTests(makeCachedStore, clearExistingData, true); + testBase.baseFeatureStoreTests(makeUncachedStore, clearExistingData, false); + + testBase.concurrentModificationTests(makeUncachedStore, + function(hook) { + var store = makeCachedStore(); + store.underlyingStore.testUpdateHook = hook; + return store; }); + + afterAll(function() { + extraRedisClient.quit(); }); }); From d72bb162e9ffe14b23572a9ef565a6c96d0fa571 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Mon, 12 Nov 2018 12:15:25 -0800 Subject: [PATCH 61/70] fix invalid data in feature store unit test --- test/feature_store_test_base.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/feature_store_test_base.js b/test/feature_store_test_base.js index a11eca0..f253e0b 100644 --- a/test/feature_store_test_base.js +++ b/test/feature_store_test_base.js @@ -53,10 +53,10 @@ function baseFeatureStoreTests(makeStore, clearExistingData, isCached) { it('init() completely replaces previous data', function(done) { var store = makeStore(); var flags = { - first: { key: 'thing', version: 1 }, - second: { key: 'stuff', version: 1 } + first: { key: 'first', version: 1 }, + second: { key: 'second', version: 1 } }; - var segments = { first: { key: 'thing', version: 2 } }; + var segments = { first: { key: 'first', version: 2 } }; var initData = {}; initData[dataKind.features.namespace] = flags; initData[dataKind.segments.namespace] = segments; @@ -67,8 +67,8 @@ function baseFeatureStoreTests(makeStore, clearExistingData, isCached) { store.all(dataKind.segments, function(items) { expect(items).toEqual(segments); - var newFlags = { first: { key: 'thing', version: 3 } }; - var newSegments = { first: { key: 'thing', version: 4 } }; + var newFlags = { first: { key: 'first', version: 3 } }; + var newSegments = { first: { key: 'first', version: 4 } }; var initData = {}; initData[dataKind.features.namespace] = newFlags; initData[dataKind.segments.namespace] = newSegments; From b9d1986a2beefcde479965cf1ad77124ebb3be16 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Mon, 12 Nov 2018 15:03:50 -0800 Subject: [PATCH 62/70] make internal feature store API more consistent, add comment --- caching_store_wrapper.js | 16 ++++++++---- redis_feature_store.js | 8 +++--- test.js | 41 ++++++++++++++++++++++++++++++ test/caching_store_wrapper-test.js | 8 +++--- 4 files changed, 60 insertions(+), 13 deletions(-) create mode 100644 test.js diff --git a/caching_store_wrapper.js b/caching_store_wrapper.js index 2824bd7..9a65ff6 100644 --- a/caching_store_wrapper.js +++ b/caching_store_wrapper.js @@ -12,7 +12,13 @@ function allCacheKey(kind) { var initializedKey = "$checkedInit"; - +/* + CachingStoreWrapper provides commonly needed functionality for implementations of an + SDK feature store. The underlyingStore must implement a simplified interface for + querying and updating the data store (see redis_feature_store.js for an example) + while CachingStoreWrapper adds optional caching of stored items and of the + initialized state, and ensures that asynchronous operations are serialized correctly. +*/ function CachingStoreWrapper(underlyingStore, ttl) { var cache = ttl ? new NodeCache({ stdTTL: ttl }) : null; var queue = new UpdateQueue(); @@ -22,7 +28,7 @@ function CachingStoreWrapper(underlyingStore, ttl) { this.init = function(allData, cb) { queue.enqueue(function(cb) { - underlyingStore.init(allData, function() { + underlyingStore.initInternal(allData, function() { initialized = true; if (cache) { @@ -53,7 +59,7 @@ function CachingStoreWrapper(underlyingStore, ttl) { } else if (cache && cache.get(initializedKey)) { cb(false); } else { - underlyingStore.initialized(function(inited) { + underlyingStore.initializedInternal(function(inited) { initialized = inited; if (!initialized) { cache && cache.set(initializedKey, true); @@ -70,7 +76,7 @@ function CachingStoreWrapper(underlyingStore, ttl) { return; } - underlyingStore.all(kind, function(items) { + underlyingStore.getAllInternal(kind, function(items) { cache && cache.set(allCacheKey(kind), items); cb(items); }); @@ -85,7 +91,7 @@ function CachingStoreWrapper(underlyingStore, ttl) { } } - underlyingStore.get(kind, key, function(item) { + underlyingStore.getInternal(kind, key, function(item) { cache && cache.set(cacheKey(kind, key), item); cb(itemOnlyIfNotDeleted(item)); }); diff --git a/redis_feature_store.js b/redis_feature_store.js index eedf438..aedbd6c 100644 --- a/redis_feature_store.js +++ b/redis_feature_store.js @@ -78,7 +78,7 @@ function redisFeatureStoreInternal(redisOpts, prefix, logger) { }); } - store.get = function(kind, key, cb) { + store.getInternal = function(kind, key, cb) { cb = cb || noop; doGet(kind, key, function(item) { if (item && !item.deleted) { @@ -89,7 +89,7 @@ function redisFeatureStoreInternal(redisOpts, prefix, logger) { }); }; - store.all = function(kind, cb) { + store.getAllInternal = function(kind, cb) { cb = cb || noop; if (!connected) { logger.warn('Attempted to fetch all keys while Redis connection is down'); @@ -118,7 +118,7 @@ function redisFeatureStoreInternal(redisOpts, prefix, logger) { }); }; - store.init = function(allData, cb) { + store.initInternal = function(allData, cb) { var multi = client.multi(); for (var kindNamespace in allData) { @@ -185,7 +185,7 @@ function redisFeatureStoreInternal(redisOpts, prefix, logger) { }); } - store.initialized = function(cb) { + store.initializedInternal = function(cb) { cb = cb || noop; client.exists(initedKey, function(err, obj) { cb(Boolean(!err && obj)); diff --git a/test.js b/test.js new file mode 100644 index 0000000..bccf6b5 --- /dev/null +++ b/test.js @@ -0,0 +1,41 @@ + +var LaunchDarkly = require('ldclient-node'); + +var config = { + baseUri: 'https://ld-stg.global.ssl.fastly.net', + streamUri: 'https://stream-stg.launchdarkly.com', + eventsUri: 'https://events-stg.launchdarkly.comx', + stream: true +}; + +// TODO : Enter your LaunchDarkly SDK key here +var ldclient = LaunchDarkly.init("sdk-1bac0f17-f688-4b56-a699-57094f34703b", config); + +user = { + "firstName":"Bob", + "lastName":"Loblaw", + "key":"bob@example.com", + "custom":{ + "groups":"beta_testers" + } +}; + +// ldclient.on('error', function(e) { +// console.log("*** " + e); +// }); + +ldclient.once('ready', function() { + function doit() { + ldclient.variation("YOUR_FEATURE_FLAG_KEY", user, false, function(err, showFeature) { + if (showFeature) { + // application code to show the feature + console.log("Showing your feature to " + user.key ); + } else { + // the code to run if the feature is off + console.log("Not showing your feature to " + user.key); + } + }); + setTimeout(doit, 1000); + } + setTimeout(doit, 1000); +}); diff --git a/test/caching_store_wrapper-test.js b/test/caching_store_wrapper-test.js index db8addc..83dcd55 100644 --- a/test/caching_store_wrapper-test.js +++ b/test/caching_store_wrapper-test.js @@ -7,16 +7,16 @@ function MockCore() { inited: false, initQueriedCount: 0, - init: function(newData, cb) { + initInternal: function(newData, cb) { c.data = newData; cb(); }, - get: function(kind, key, cb) { + getInternal: function(kind, key, cb) { cb(c.data[kind.namespace][key]); }, - all: function(kind, cb) { + getAllInternal: function(kind, cb) { cb(c.data[kind.namespace]); }, @@ -30,7 +30,7 @@ function MockCore() { } }, - initialized: function(cb) { + initializedInternal: function(cb) { c.initQueriedCount++; cb(c.inited); }, From 469ea5f07d0f7622a41211162387405a70d7e60c Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Mon, 12 Nov 2018 15:11:28 -0800 Subject: [PATCH 63/70] use published tunnel package instead of fork --- package-lock.json | 5 +++-- package.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 92ed44a..45308a6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5845,8 +5845,9 @@ "dev": true }, "tunnel": { - "version": "https://github.com/launchdarkly/node-tunnel/tarball/d860e57650cce1ea655d00854c81babe6b47e02c", - "integrity": "sha1-DxkgfzcgRtPUaCGDy+INSgR8zdk=" + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" }, "tunnel-agent": { "version": "0.6.0", diff --git a/package.json b/package.json index 8c00a3d..9ab7c3f 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "request": "2.87.0", "request-etag": "^2.0.3", "semver": "5.5.0", - "tunnel": "https://github.com/launchdarkly/node-tunnel/tarball/d860e57650cce1ea655d00854c81babe6b47e02c", + "tunnel": "0.0.6", "winston": "2.4.1" }, "engines": { From 281b090e5d86277cb6a7eaa3ee66e50068060ab1 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Mon, 12 Nov 2018 15:18:40 -0800 Subject: [PATCH 64/70] rm test code --- test.js | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 test.js diff --git a/test.js b/test.js deleted file mode 100644 index bccf6b5..0000000 --- a/test.js +++ /dev/null @@ -1,41 +0,0 @@ - -var LaunchDarkly = require('ldclient-node'); - -var config = { - baseUri: 'https://ld-stg.global.ssl.fastly.net', - streamUri: 'https://stream-stg.launchdarkly.com', - eventsUri: 'https://events-stg.launchdarkly.comx', - stream: true -}; - -// TODO : Enter your LaunchDarkly SDK key here -var ldclient = LaunchDarkly.init("sdk-1bac0f17-f688-4b56-a699-57094f34703b", config); - -user = { - "firstName":"Bob", - "lastName":"Loblaw", - "key":"bob@example.com", - "custom":{ - "groups":"beta_testers" - } -}; - -// ldclient.on('error', function(e) { -// console.log("*** " + e); -// }); - -ldclient.once('ready', function() { - function doit() { - ldclient.variation("YOUR_FEATURE_FLAG_KEY", user, false, function(err, showFeature) { - if (showFeature) { - // application code to show the feature - console.log("Showing your feature to " + user.key ); - } else { - // the code to run if the feature is off - console.log("Not showing your feature to " + user.key); - } - }); - setTimeout(doit, 1000); - } - setTimeout(doit, 1000); -}); From 74657e8370805c1a2ecac65b28060f5d4198d20c Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Tue, 13 Nov 2018 12:25:49 -0800 Subject: [PATCH 65/70] filter out deleted items in wrapper's all() --- caching_store_wrapper.js | 11 +++++++++-- test/caching_store_wrapper-test.js | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/caching_store_wrapper.js b/caching_store_wrapper.js index 9a65ff6..ec71f54 100644 --- a/caching_store_wrapper.js +++ b/caching_store_wrapper.js @@ -77,8 +77,15 @@ function CachingStoreWrapper(underlyingStore, ttl) { } underlyingStore.getAllInternal(kind, function(items) { - cache && cache.set(allCacheKey(kind), items); - cb(items); + var filteredItems = {}; + Object.keys(items).forEach(function(key) { + var item = items[key]; + if (item && !item.deleted) { + filteredItems[key] = item; + } + }); + cache && cache.set(allCacheKey(kind), filteredItems); + cb(filteredItems); }); }; diff --git a/test/caching_store_wrapper-test.js b/test/caching_store_wrapper-test.js index 83dcd55..fd6169c 100644 --- a/test/caching_store_wrapper-test.js +++ b/test/caching_store_wrapper-test.js @@ -170,6 +170,30 @@ describe('CachingStoreWrapper', function() { }); }); + runCachedAndUncachedTests('all() with deleted item', function(done, wrapper, core, isCached) { + const flag1 = { key: 'flag1', version: 1 }; + const flag2 = { key: 'flag2', version: 1, deleted: true }; + + core.forceSet(features, flag1); + core.forceSet(features, flag2); + + wrapper.all(features, function(items) { + expect(items).toEqual({ 'flag1': flag1 }); + + core.forceRemove(features, flag1.key); + + wrapper.all(features, function(items) { + if (isCached) { + expect(items).toEqual({ 'flag1': flag1 }); + } else { + expect(items).toEqual({ }); + } + + done(); + }); + }); + }); + runCachedTestOnly('cached all() uses values from init()', function(done, wrapper, core) { const flag1 = { key: 'flag1', version: 1 }; const flag2 = { key: 'flag2', version: 1 }; From 0c0b1122f4e2f07992963e69209b34a32c5acc7b Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Tue, 13 Nov 2018 12:28:51 -0800 Subject: [PATCH 66/70] remove redundant filtering --- redis_feature_store.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/redis_feature_store.js b/redis_feature_store.js index aedbd6c..009aae1 100644 --- a/redis_feature_store.js +++ b/redis_feature_store.js @@ -106,11 +106,8 @@ function redisFeatureStoreInternal(redisOpts, prefix, logger) { items = obj; for (var key in items) { - if (Object.hasOwnProperty.call(items,key)) { - var item = JSON.parse(items[key]); - if (!item.deleted) { - results[key] = item; - } + if (Object.hasOwnProperty.call(items, key)) { + results[key] = JSON.parse(items[key]); } } cb(results); From bbacd128821a1fb0a3a8ef96296d276814145b87 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Wed, 14 Nov 2018 18:39:44 -0800 Subject: [PATCH 67/70] fix error handling when getting all items from store --- caching_store_wrapper.js | 4 ++++ test/caching_store_wrapper-test.js | 17 ++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/caching_store_wrapper.js b/caching_store_wrapper.js index ec71f54..0929dff 100644 --- a/caching_store_wrapper.js +++ b/caching_store_wrapper.js @@ -77,6 +77,10 @@ function CachingStoreWrapper(underlyingStore, ttl) { } underlyingStore.getAllInternal(kind, function(items) { + if (items === null || items === undefined) { + cb(items); + return; + } var filteredItems = {}; Object.keys(items).forEach(function(key) { var item = items[key]; diff --git a/test/caching_store_wrapper-test.js b/test/caching_store_wrapper-test.js index fd6169c..64179b0 100644 --- a/test/caching_store_wrapper-test.js +++ b/test/caching_store_wrapper-test.js @@ -6,6 +6,8 @@ function MockCore() { data: { features: {} }, inited: false, initQueriedCount: 0, + getAllError: false, + upsertError: null, initInternal: function(newData, cb) { c.data = newData; @@ -17,10 +19,14 @@ function MockCore() { }, getAllInternal: function(kind, cb) { - cb(c.data[kind.namespace]); + cb(c.getAllError ? null : c.data[kind.namespace]); }, upsertInternal: function(kind, item, cb) { + if (c.upsertError) { + cb(upsertError, null); + return; + } const oldItem = c.data[kind.namespace][item.key]; if (oldItem && oldItem.version >= item.version) { cb(null, oldItem); @@ -194,6 +200,15 @@ describe('CachingStoreWrapper', function() { }); }); + runCachedAndUncachedTests('all() error condition', function(done, wrapper, core, isCached) { + core.getAllError = true; + + wrapper.all(features, function(items) { + expect(items).toBe(null); + done(); + }); + }); + runCachedTestOnly('cached all() uses values from init()', function(done, wrapper, core) { const flag1 = { key: 'flag1', version: 1 }; const flag2 = { key: 'flag2', version: 1 }; From 99e5852a6c532a4a2db916b32c413e3ca1941203 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Wed, 14 Nov 2018 18:54:10 -0800 Subject: [PATCH 68/70] fix error in close of uncached store --- caching_store_wrapper.js | 2 +- test/caching_store_wrapper-test.js | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/caching_store_wrapper.js b/caching_store_wrapper.js index 0929dff..246eda4 100644 --- a/caching_store_wrapper.js +++ b/caching_store_wrapper.js @@ -129,7 +129,7 @@ function CachingStoreWrapper(underlyingStore, ttl) { }; this.close = function() { - cache.close(); + cache && cache.close(); underlyingStore.close(); }; diff --git a/test/caching_store_wrapper-test.js b/test/caching_store_wrapper-test.js index 64179b0..9b3a9da 100644 --- a/test/caching_store_wrapper-test.js +++ b/test/caching_store_wrapper-test.js @@ -8,6 +8,7 @@ function MockCore() { initQueriedCount: 0, getAllError: false, upsertError: null, + closed: false, initInternal: function(newData, cb) { c.data = newData; @@ -41,6 +42,10 @@ function MockCore() { cb(c.inited); }, + close: function() { + c.closed = true; + }, + forceSet: function(kind, item) { c.data[kind.namespace][item.key] = item; }, @@ -398,4 +403,12 @@ describe('CachingStoreWrapper', function() { }); }); }); + + describe('close()', function() { + runCachedAndUncachedTests('closes underlying store', function(done, wrapper, core) { + wrapper.close(); + expect(core.closed).toBe(true); + done(); + }); + }); }); From 92297bca8d3256b2aceed270fbab59e398ff498f Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Wed, 14 Nov 2018 18:56:15 -0800 Subject: [PATCH 69/70] add test for upsert error --- test/caching_store_wrapper-test.js | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/test/caching_store_wrapper-test.js b/test/caching_store_wrapper-test.js index 9b3a9da..e39d68a 100644 --- a/test/caching_store_wrapper-test.js +++ b/test/caching_store_wrapper-test.js @@ -25,7 +25,7 @@ function MockCore() { upsertInternal: function(kind, item, cb) { if (c.upsertError) { - cb(upsertError, null); + cb(c.upsertError, null); return; } const oldItem = c.data[kind.namespace][item.key]; @@ -283,6 +283,34 @@ describe('CachingStoreWrapper', function() { }); }); + runCachedAndUncachedTests('upsert() - error', function(done, wrapper, core, isCached) { + const flagv1 = { key: 'flag', version: 1 }; + const flagv2 = { key: 'flag', version: 2 }; + + wrapper.upsert(features, flagv1, function() { + expect(core.data[features.namespace][flagv1.key]).toEqual(flagv1); + + core.upsertError = new Error('sorry'); + + wrapper.upsert(features, flagv2, function() { + expect(core.data[features.namespace][flagv1.key]).toEqual(flagv1); + + // if we have a cache, verify that the old item is still cached by writing a different value + // to the underlying data - get() should still return the cached item + if (isCached) { + const flagv3 = { key: 'flag', version: 3 }; + core.forceSet(features, flagv3); + wrapper.get(features, flagv1.key, function(item) { + expect(item).toEqual(flagv1); + done(); + }); + } else { + done(); + } + }); + }); + }); + runCachedTestOnly('cached upsert() - unsuccessful', function(done, wrapper, core) { const flagv1 = { key: 'flag', version: 1 }; const flagv2 = { key: 'flag', version: 2 }; From ca32313452b2669a9ab1349e92167f511b19ca87 Mon Sep 17 00:00:00 2001 From: Eli Bishop Date: Wed, 14 Nov 2018 19:28:58 -0800 Subject: [PATCH 70/70] update package.lock --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 45308a6..a42cde1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ldclient-node", - "version": "5.5.0", + "version": "5.6.0", "lockfileVersion": 1, "requires": true, "dependencies": {