From 08313601d01b357151106a4c2fa235fedfd32d38 Mon Sep 17 00:00:00 2001 From: Bryan Mikaelian Date: Tue, 1 Sep 2020 14:25:10 -0400 Subject: [PATCH 1/7] Replace utils/clone with lodash.cloneDeep --- lib/analytics.ts | 5 +- lib/cookie.ts | 6 +-- lib/entity.ts | 4 +- lib/memory.ts | 7 +-- lib/utils/clone.js | 70 --------------------------- package.json | 1 + test/clone.test.ts | 116 --------------------------------------------- 7 files changed, 13 insertions(+), 196 deletions(-) delete mode 100644 lib/utils/clone.js delete mode 100644 test/clone.test.ts diff --git a/lib/analytics.ts b/lib/analytics.ts index d053d1d6..a4d4689c 100644 --- a/lib/analytics.ts +++ b/lib/analytics.ts @@ -8,6 +8,8 @@ import { SegmentIntegration } from './types'; +import cloneDeep from 'lodash.clonedeep' + var _analytics = global.analytics; /* @@ -27,7 +29,6 @@ var DestinationMiddlewareChain = require('./middleware') var Page = require('segmentio-facade').Page; var Track = require('segmentio-facade').Track; var bindAll = require('bind-all'); -var clone = require('./utils/clone'); var extend = require('extend'); var cookie = require('./cookie'); var metrics = require('./metrics'); @@ -583,7 +584,7 @@ Analytics.prototype.page = function( (name = category), (category = null); /* eslint-enable no-unused-expressions, no-sequences */ - properties = clone(properties) || {}; + properties = cloneDeep(properties) || {}; if (name) properties.name = name; if (category) properties.category = category; diff --git a/lib/cookie.ts b/lib/cookie.ts index 8d74834d..671b27d7 100644 --- a/lib/cookie.ts +++ b/lib/cookie.ts @@ -1,13 +1,13 @@ 'use strict'; import { CookieOptions } from './types'; +import cloneDeep from 'lodash.clonedeep' /** * Module dependencies. */ var bindAll = require('bind-all'); -var clone = require('./utils/clone'); var cookie = require('@segment/cookie'); var debug = require('debug')('analytics.js:cookie'); var defaults = require('@ndhoule/defaults'); @@ -65,7 +65,7 @@ Cookie.prototype.options = function(options?: CookieOptions) { Cookie.prototype.set = function(key: string, value?: object | string): boolean { try { value = window.JSON.stringify(value); - cookie(key, value === 'null' ? null : value, clone(this._options)); + cookie(key, value === 'null' ? null : value, cloneDeep(this._options)); return true; } catch (e) { return false; @@ -92,7 +92,7 @@ Cookie.prototype.get = function(key: string): object { Cookie.prototype.remove = function(key: string): boolean { try { - cookie(key, null, clone(this._options)); + cookie(key, null, cloneDeep(this._options)); return true; } catch (e) { return false; diff --git a/lib/entity.ts b/lib/entity.ts index cfdb7e31..52b85ad8 100644 --- a/lib/entity.ts +++ b/lib/entity.ts @@ -1,12 +1,12 @@ 'use strict'; import { InitOptions } from './types'; +import cloneDeep from 'lodash.clonedeep' /* * Module dependencies. */ -var clone = require('./utils/clone'); var cookie = require('./cookie'); var debug = require('debug')('analytics:entity'); var defaults = require('@ndhoule/defaults'); @@ -198,7 +198,7 @@ Entity.prototype._getTraits = function(): object { var ret = this._options.persist ? store.get(this._options.localStorage.key) : this._traits; - return ret ? isodateTraverse(clone(ret)) : {}; + return ret ? isodateTraverse(cloneDeep(ret)) : {}; }; /** diff --git a/lib/memory.ts b/lib/memory.ts index a28e8770..41f85dda 100644 --- a/lib/memory.ts +++ b/lib/memory.ts @@ -4,8 +4,9 @@ * Module Dependencies. */ +import cloneDeep from 'lodash.clonedeep' + var bindAll = require('bind-all'); -var clone = require('./utils/clone'); /** * HOP. @@ -32,7 +33,7 @@ function Memory() { */ Memory.prototype.set = function(key: string, value: unknown): boolean { - this.store[key] = clone(value); + this.store[key] = cloneDeep(value); return true; }; @@ -42,7 +43,7 @@ Memory.prototype.set = function(key: string, value: unknown): boolean { Memory.prototype.get = function(key: string): unknown | undefined { if (!has.call(this.store, key)) return; - return clone(this.store[key]); + return cloneDeep(this.store[key]); }; /** diff --git a/lib/utils/clone.js b/lib/utils/clone.js deleted file mode 100644 index 217ced7b..00000000 --- a/lib/utils/clone.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict'; - -var type = require('component-type'); - -/** - * Deeply clone an object. - * - * @param {*} obj Any object. - * - * COPYRIGHT: https://github.com/ndhoule/clone/blob/master/LICENSE.md - * The MIT License (MIT) - * Copyright (c) 2015 Nathan Houle - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -var clone = function clone(obj) { - var t = type(obj); - - var copy; - if (t === 'object') { - copy = {}; - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - copy[key] = clone(obj[key]); - } - } - return copy; - } - - if (t === 'array') { - copy = new Array(obj.length); - for (var i = 0, l = obj.length; i < l; i++) { - copy[i] = clone(obj[i]); - } - return copy; - } - - if (t === 'regexp') { - // from millermedeiros/amd-utils - MIT - var flags = ''; - flags += obj.multiline ? 'm' : ''; - flags += obj.global ? 'g' : ''; - flags += obj.ignoreCase ? 'i' : ''; - return new RegExp(obj.source, flags); - } - - if (t === 'date') { - return new Date(obj.getTime()); - } - - // string, number, boolean, etc. - return obj; -}; - -module.exports = clone; diff --git a/package.json b/package.json index 043975f9..0bdbf495 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,7 @@ "inherits": "^2.0.1", "install": "^0.7.3", "is": "^3.1.0", + "lodash.clonedeep": "^4.5.0", "new-date": "^1.0.0", "next-tick": "^0.2.2", "package-json-versionify": "^1.0.4", diff --git a/test/clone.test.ts b/test/clone.test.ts deleted file mode 100644 index 85ac3fd7..00000000 --- a/test/clone.test.ts +++ /dev/null @@ -1,116 +0,0 @@ -'use strict'; - -var assert = require('proclaim'); -var clone = require('../build/utils/clone'); - -describe('clone', function() { - it('should be a function', function() { - assert.equal(typeof clone, 'function'); - }); - - it('should have an arity of 1', function() { - assert.equal(clone.length, 1); - }); - - describe('object', function() { - it('should return an object with the same contents as the input', function() { - var input = { a: 1, b: 2, c: 3 }; - var cloned = clone(input); - - assert.deepEqual(cloned, input); - }); - - it('should deeply clone nested objects', function() { - var date = new Date(); - var input = { - a: { - b: [1, 2, date, { hello: 'world' }] - } - }; - var cloned = clone(input); - - assert.deepEqual(cloned, input); - - assert.deepEqual(cloned, input); - assert.notStrictEqual(cloned.a, input.a); - assert.notStrictEqual(cloned.a.b, input.a.b); - assert.notStrictEqual(cloned.a.b[2], input.a.b[2]); - assert.strictEqual(cloned.a.b[2].getTime(), (input.a.b[2] as Date).getTime()); - assert.deepEqual(cloned.a.b[3], input.a.b[3]); - assert.notStrictEqual(cloned.a.b[3], input.a.b[3]); - }); - - it('object with functions', function() { - var func = function() { - return 'original'; - }; - var input = { func: func }; - var cloned = clone(input); - - assert.strictEqual(cloned.func, func); - }); - }); - - describe('array', function() { - it('should return an array with the same contents as the input', function() { - var input = [1, 2, 3, '4']; - var cloned = clone(input); - - assert.deepEqual(cloned, input); - }); - - it('should deeply clone nested complex data structures', function() { - var input = [{}]; - var cloned = clone(input); - - assert.notStrictEqual(cloned[0], input[0]); - assert.deepEqual(cloned[0], input[0]); - }); - - it('should return a new array object', function() { - var input = [1, 2, 3, '4']; - var cloned = clone(input); - - assert.notStrictEqual(cloned, input); - }); - }); - - describe('regexp', function() { - it('regexp', function() { - var input = /hello/i; - var cloned = clone(input); - - assert.strictEqual(cloned.toString(), input.toString()); - }); - - it('should return a new regexp object', function() { - var input = /hello/i; - var cloned = clone(input); - - assert.notStrictEqual(cloned, input); - }); - }); - - describe('date', function() { - it('should return a date with the same time as the input date', function() { - var input = new Date(); - var cloned = clone(input); - - assert.strictEqual(cloned.getTime(), input.getTime()); - }); - - it('should return a new date object', function() { - var input = new Date(); - var cloned = clone(input); - - assert.notStrictEqual(cloned, input); - }); - }); - - describe('other data types', function() { - it('should pass other data types through untouched', function() { - assert.strictEqual(clone('a'), 'a'); - assert.strictEqual(clone({ a: 1 }).a, 1); - }); - }); -}); From 9bd22535e37406395cc19ca2a30555b9defd6a8c Mon Sep 17 00:00:00 2001 From: Bryan Mikaelian Date: Tue, 1 Sep 2020 14:34:11 -0400 Subject: [PATCH 2/7] Replace utils/map with Array.prototype.map --- lib/normalize.ts | 5 +- lib/utils/map.js | 66 -------------------- test/map.test.ts | 153 ----------------------------------------------- 3 files changed, 2 insertions(+), 222 deletions(-) delete mode 100644 lib/utils/map.js delete mode 100644 test/map.test.ts diff --git a/lib/normalize.ts b/lib/normalize.ts index 359e728b..c102edcc 100644 --- a/lib/normalize.ts +++ b/lib/normalize.ts @@ -10,7 +10,6 @@ var debug = require('debug')('analytics.js:normalize'); var defaults = require('@ndhoule/defaults'); var each = require('./utils/each'); var includes = require('@ndhoule/includes'); -var map = require('./utils/map'); var type = require('component-type'); var uuid = require('uuid/v4'); var md5 = require('spark-md5').hash; @@ -45,9 +44,9 @@ interface NormalizedMessage { } function normalize(msg: Message, list: Array): NormalizedMessage { - var lower = map(function(s) { + var lower = list?.map(function(s) { return s.toLowerCase(); - }, list); + }); var opts: Message = msg.options || {}; var integrations = opts.integrations || {}; var providers = opts.providers || {}; diff --git a/lib/utils/map.js b/lib/utils/map.js deleted file mode 100644 index 4da3b573..00000000 --- a/lib/utils/map.js +++ /dev/null @@ -1,66 +0,0 @@ -'use strict'; - -/* - * The MIT License (MIT) - * Copyright (c) 2015 Nathan Houle - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -/* - * Module dependencies. - */ - -var each = require('./each'); - -/** - * Produce a new array by passing each value in the input `collection` through a transformative - * `iterator` function. The `iterator` function is passed three arguments: - * `(value, index, collection)`. - * - * @name map - * @api public - * @param {Function} iterator The transformer function to invoke per iteration. - * @param {Array} collection The collection to iterate over. - * @return {Array} A new array containing the results of each `iterator` invocation. - * @example - * var square = function(x) { return x * x; }; - * - * map(square, [1, 2, 3]); - * //=> [1, 4, 9] - */ -var map = function map(iterator, collection) { - if (typeof iterator !== 'function') { - throw new TypeError( - 'Expected a function but received a ' + typeof iterator - ); - } - - var result = []; - - each(function(val, i, collection) { - result.push(iterator(val, i, collection)); - }, collection); - - return result; -}; - -/* - * Exports. - */ - -module.exports = map; diff --git a/test/map.test.ts b/test/map.test.ts deleted file mode 100644 index 641f0043..00000000 --- a/test/map.test.ts +++ /dev/null @@ -1,153 +0,0 @@ -/* global describe, it, beforeEach */ - -'use strict'; - -/** - * Module dependencies. - */ - -var assert = require('proclaim'); -var keys = require('@ndhoule/keys'); -var sinon = require('sinon'); -var map = require('../build/utils/map'); - -describe('map', function() { - var identity; - var square; - - beforeEach(function() { - identity = sinon.spy(function(val) { - return val; - }); - square = function(a) { - return a * a; - }; - }); - - it('should be a function', function() { - assert.equal(typeof map, 'function', 'should be equal'); - }); - - it('should have an arity of 2', function() { - assert.equal(map.length, 2, 'should be equal'); - }); - - it('should return a new array', function() { - var numbers = [1, 2, 3]; - var newNumbers = map(identity, numbers); - - assert.deepEqual(newNumbers, numbers, 'should be equal'); - assert.notEqual(newNumbers, numbers, 'should not be equal'); - }); - - it('should call the input function once for each item in the collection', function() { - map(identity, [1, 2, 3]); - - assert.isTrue(identity.calledThrice, 'should have been called three times'); - }); - - it('should return an array containing the results of calling the input function', function() { - assert.deepEqual(map(square, [1, 2, 3]), [1, 4, 9], 'should be equal'); - }); - - it('should pass the input function three arguments: value, index, and array', function() { - var array = ['a', 'b', 'c']; - map(identity, array); - - assert.isTrue(identity.calledWith('a', 0, array), 'should be true'); - assert.isTrue(identity.calledWith('b', 1, array), 'should be true'); - assert.isTrue(identity.calledWith('c', 2, array), 'should be true'); - }); - - it('should iterate over arrays in indexed order', function() { - var array = ['a', 'b', 'c']; - var result = map(identity, array); - - assert.deepEqual(result, ['a', 'b', 'c'], 'should be equal'); - }); - - it('should ignore enumerable properties on arrays', function() { - var array = ['a', 'b', 'c']; - // @ts-ignore - array.a = 'spam'; - map(identity, array); - - assert.isTrue(identity.calledWith('a', 0, array), 'should be true'); - assert.isTrue(identity.calledWith('b', 1, array), 'should be true'); - assert.isTrue(identity.calledWith('c', 2, array), 'should be true'); - assert.isTrue( - identity.neverCalledWith('spam', 'a', array), - 'should be true' - ); - }); - - it('should map over objects (without any guarantee of order)', function() { - var obj = { a: 1, b: 2, c: 3 }; - var ks = keys(obj); - map(identity, obj); - - assert.isTrue( - identity.firstCall.calledWith(obj[ks[0]], ks[0], obj), - 'should be true' - ); - assert.isTrue( - identity.secondCall.calledWith(obj[ks[1]], ks[1], obj), - 'should be true' - ); - assert.isTrue( - identity.thirdCall.calledWith(obj[ks[2]], ks[2], obj), - 'should be true' - ); - }); - - it('should ignore inherited properties', function() { - var parent = { z: 4 }; - var child = Object.create(parent); - child.a = 1; - child.b = 2; - child.c = 3; - map(identity, child); - - assert.isTrue(identity.neverCalledWith(4, 'z', child), 'should be true'); - }); - - it('should ignore non-enumerable properties', function() { - var obj = Object.create(null, { - a: { value: 1, enumerable: false }, - b: { value: 2, enumerable: false }, - c: { value: 3, enumerable: true } - }); - map(identity, obj); - - assert.isTrue(identity.calledOnce, 'should be true'); - assert.isTrue(identity.calledWith(3, 'c', obj), 'should be true'); - }); - - it('should handle strings', function() { - var str = 'spam'; - map(identity, str); - - assert.isTrue(identity.calledWith('s', 0, str), 'should be true'); - assert.isTrue(identity.calledWith('p', 1, str), 'should be true'); - assert.isTrue(identity.calledWith('a', 2, str), 'should be true'); - assert.isTrue(identity.calledWith('m', 3, str), 'should be true'); - }); - - it('should throw an error when passed a non-function as its `fn` argument', function() { - assert['throws']( - function() { - map('omg', []); - }, - 'Expected a function but received a string', - 'should have thrown an exception' - ); - - assert['throws']( - function() { - map('omg', [1, 2, 3]); - }, - 'Expected a function but received a string', - 'should have thrown an exception' - ); - }); -}); From 181bf2f9d0dc6c4e87dd9773901fe39b0f4cc07d Mon Sep 17 00:00:00 2001 From: Bryan Mikaelian Date: Tue, 1 Sep 2020 15:02:34 -0400 Subject: [PATCH 3/7] Replace utils/each with Array.prototype.forEach in normalize.ts --- lib/normalize.ts | 15 +++++++-------- lib/types.ts | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/normalize.ts b/lib/normalize.ts index c102edcc..691ff91c 100644 --- a/lib/normalize.ts +++ b/lib/normalize.ts @@ -8,7 +8,6 @@ import { Message } from './types'; var debug = require('debug')('analytics.js:normalize'); var defaults = require('@ndhoule/defaults'); -var each = require('./utils/each'); var includes = require('@ndhoule/includes'); var type = require('component-type'); var uuid = require('uuid/v4'); @@ -58,25 +57,25 @@ function normalize(msg: Message, list: Array): NormalizedMessage { debug('<-', msg); // integrations. - each(function(value: string, key: string) { + Object.keys(opts).forEach(key => { if (!integration(key)) return; - if (!has.call(integrations, key)) integrations[key] = value; + if (!has.call(integrations, key)) integrations[key] = opts[key]; delete opts[key]; - }, opts); + }); // providers. delete opts.providers; - each(function(value: string, key: string) { + Object.keys(providers).forEach(key => { if (!integration(key)) return; if (type(integrations[key]) === 'object') return; if (has.call(integrations, key) && typeof providers[key] === 'boolean') return; - integrations[key] = value; - }, providers); + integrations[key] = providers[key] as string; + }); // move all toplevel options to msg // and the rest to context. - each(function(_value: any, key: string | number) { + Object.keys(opts).forEach(key => { if (includes(key, toplevel)) { ret[key] = opts[key]; } else { diff --git a/lib/types.ts b/lib/types.ts index 7970ef4f..a4b217bc 100644 --- a/lib/types.ts +++ b/lib/types.ts @@ -73,7 +73,7 @@ export interface SegmentOpts { export interface Message { options?: unknown; integrations?: { [key: string]: string }; - providers?: { [key: string]: string }; + providers?: { [key: string]: string | boolean }; context?: unknown; messageId?: string; } From e86aafc265d500b8a17341cc5fc845ef9e4661ac Mon Sep 17 00:00:00 2001 From: Bryan Mikaelian Date: Tue, 1 Sep 2020 16:12:55 -0400 Subject: [PATCH 4/7] Replace utils/each with Array.prototype.forEach in analytics.ts Also removes @ndhoule/keys --- lib/analytics.ts | 93 ++++++++++++++++++++++++------------------ lib/types.ts | 24 ++++++++++- package.json | 3 ++ test/analytics.test.ts | 1 + yarn.lock | 19 ++++++++- 5 files changed, 99 insertions(+), 41 deletions(-) diff --git a/lib/analytics.ts b/lib/analytics.ts index a4d4689c..a7cdf70f 100644 --- a/lib/analytics.ts +++ b/lib/analytics.ts @@ -70,8 +70,9 @@ function Analytics() { this.log = debug('analytics.js'); bindAll(this); - var self = this; - this.on('initialize', function(settings, options) { + + const self = this; + this.on('initialize', function(_, options) { if (options.initialPageview) self.page(); self._parseQuery(window.location.search); }); @@ -170,13 +171,16 @@ Analytics.prototype.init = Analytics.prototype.initialize = function( // clean unknown integrations from settings var self = this; - each(function(_opts: unknown, name: string | number) { - var Integration = self.Integrations[name]; - if (!Integration) delete settings[name]; - }, settings); + Object.keys(settings).forEach(key => { + var Integration = self.Integrations[key]; + if (!Integration) delete settings[key]; + }); // add integrations - each(function(opts: unknown, name: string | number) { + Object.keys(settings).forEach(key => { + const opts = settings[key] + const name = key + // Don't load disabled integrations if (options.integrations) { if ( @@ -187,13 +191,13 @@ Analytics.prototype.init = Analytics.prototype.initialize = function( } } - var Integration = self.Integrations[name]; - var clonedOpts = {}; + const Integration = self.Integrations[name]; + const clonedOpts = {}; extend(true, clonedOpts, opts); // deep clone opts - var integration = new Integration(clonedOpts); + const integration = new Integration(clonedOpts); self.log('initialize %o - %o', name, opts); self.add(integration); - }, settings); + }); var integrations = this._integrations; @@ -220,14 +224,15 @@ Analytics.prototype.init = Analytics.prototype.initialize = function( // initialize integrations, passing ready // create a list of any integrations that did not initialize - this will be passed with all events for replay support: this.failedInitializations = []; - var initialPageSkipped = false; - each(function(integration) { + let initialPageSkipped = false; + Object.keys(integrations).forEach(key => { + const integration = integrations[key] if ( options.initialPageview && integration.options.initialPageview === false ) { // We've assumed one initial pageview, so make sure we don't count the first page call. - var page = integration.page; + let page = integration.page; integration.page = function() { if (initialPageSkipped) { return page.apply(this, arguments); @@ -247,7 +252,7 @@ Analytics.prototype.init = Analytics.prototype.initialize = function( }); integration.initialize(); } catch (e) { - var integrationName = integration.name; + let integrationName = integration.name; metrics.increment('analytics_js.integration.invoke.error', { method: 'initialize', integration_name: integration.name @@ -258,7 +263,7 @@ Analytics.prototype.init = Analytics.prototype.initialize = function( integration.ready(); } - }, integrations); + }); // backwards compat with angular plugin and used for init logic checks this.initialized = true; @@ -467,37 +472,44 @@ Analytics.prototype.track = function( */ Analytics.prototype.trackClick = Analytics.prototype.trackLink = function( - links: Element | Array, + links: Element | Array | JQuery, event: any, properties?: any ): SegmentAnalytics { + let elements: Array = [] if (!links) return this; // always arrays, handles jquery - if (type(links) === 'element') links = [links]; + if (links instanceof Element) { + elements = [links] + } else if ("toArray" in links) { + elements = links.toArray() + } else { + elements = links as Array + } - var self = this; - each(function(el) { + elements.forEach(el => { if (type(el) !== 'element') { throw new TypeError('Must pass HTMLElement to `analytics.trackLink`.'); } - on(el, 'click', function(e) { - var ev = is.fn(event) ? event(el) : event; - var props = is.fn(properties) ? properties(el) : properties; - var href = + on(el, 'click', (e) => { + const ev = is.fn(event) ? event(el) : event; + const props = is.fn(properties) ? properties(el) : properties; + const href = el.getAttribute('href') || el.getAttributeNS('http://www.w3.org/1999/xlink', 'href') || el.getAttribute('xlink:href'); - self.track(ev, props); + this.track(ev, props); + // @ts-ignore if (href && el.target !== '_blank' && !isMeta(e)) { prevent(e); - self._callback(function() { + this._callback(function() { window.location.href = href; }); } }); - }, links); + }); return this; }; @@ -523,18 +535,19 @@ Analytics.prototype.trackSubmit = Analytics.prototype.trackForm = function( // always arrays, handles jquery if (type(forms) === 'element') forms = [forms]; - var self = this; - each(function(el: { submit: () => void }) { + const elements = forms as Array + + elements.forEach((el: { submit: () => void }) => { if (type(el) !== 'element') throw new TypeError('Must pass HTMLElement to `analytics.trackForm`.'); - function handler(e) { + const handler = (e) => { prevent(e); - var ev = is.fn(event) ? event(el) : event; - var props = is.fn(properties) ? properties(el) : properties; - self.track(ev, props); + const ev = is.fn(event) ? event(el) : event; + const props = is.fn(properties) ? properties(el) : properties; + this.track(ev, props); - self._callback(function() { + this._callback(function() { el.submit(); }); } @@ -547,7 +560,7 @@ Analytics.prototype.trackSubmit = Analytics.prototype.trackForm = function( } else { on(el, 'submit', handler); } - }, forms); + }); return this; }; @@ -797,9 +810,11 @@ Analytics.prototype._invoke = function( return this; function applyIntegrationMiddlewares(facade) { - var failedInitializations = self.failedInitializations || []; - each(function(integration, name) { - var facadeCopy = extend(true, new Facade({}), facade); + let failedInitializations = self.failedInitializations || []; + Object.keys(self._integrations).forEach(key => { + const integration = self._integrations[key] + const { name } = integration + const facadeCopy = extend(true, new Facade({}), facade); if (!facadeCopy.enabled(name)) return; // Check if an integration failed to initialize. @@ -883,7 +898,7 @@ Analytics.prototype._invoke = function( ); } } - }, self._integrations); + }); } }; diff --git a/lib/types.ts b/lib/types.ts index a4b217bc..ba80a426 100644 --- a/lib/types.ts +++ b/lib/types.ts @@ -1,8 +1,30 @@ export interface SegmentAnalytics { - Integrations: { [name: string]: unknown }; + Integrations: { [name: string]: (options: SegmentOpts) => void }; options: InitOptions; require: any VERSION: any + + // Analytics.JS Methods + page: ( + category?: string, + name?: string, + properties?: any, + options?: any, + fn?: unknown + ) => void + + // Private fields + _options: (options: Object) => void + _sourceMiddlewares: unknown + _integrationMiddlewares: unknown + _destinationMiddlewares: unknown + _integrations: unknown + _readied: boolean + _timeout: number + _user: unknown + log: (args: string) => void + on: (event: string, callback: (settings: unknown, options: InitOptions) => void) => void + _parseQuery: (queryString: string) => void } export interface IntegrationsSettings { diff --git a/package.json b/package.json index 0bdbf495..27b955f1 100644 --- a/package.json +++ b/package.json @@ -67,8 +67,11 @@ "@codeceptjs/mock-request": "^0.3.0", "@segment/analytics.js-integration": "^3.2.2", "@segment/eslint-config": "^4.0.0", + "@types/component-emitter": "^1.2.9", + "@types/debug": "^4.1.5", "@types/express": "^4.17.6", "@types/lodash": "^4.14.161", + "@types/jquery": "^3.5.1", "@types/mocha": "^7.0.2", "@types/node": "^14.0.6", "@types/node-fetch": "^2.5.7", diff --git a/test/analytics.test.ts b/test/analytics.test.ts index e42d90a5..c6917dc4 100644 --- a/test/analytics.test.ts +++ b/test/analytics.test.ts @@ -8,6 +8,7 @@ var bind = require('component-event').bind; var createIntegration = require('@segment/analytics.js-integration'); var extend = require('@ndhoule/extend'); var type = require('component-type'); +// @ts-ignore var jQuery = require('jquery'); var pageDefaults = require('../build/pageDefaults'); var sinon = require('sinon'); diff --git a/yarn.lock b/yarn.lock index 791df4a4..b6722b46 100644 --- a/yarn.lock +++ b/yarn.lock @@ -793,6 +793,11 @@ resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== +"@types/component-emitter@^1.2.9": + version "1.2.9" + resolved "https://registry.yarnpkg.com/@types/component-emitter/-/component-emitter-1.2.9.tgz#a17785a0fa86d934ac8b762bd496c65ff9e47c84" + integrity sha512-xaESaDSXQLIGYpXJJ+ubBsDrsbI07Wv9zzDa7qb1RFnQUTeBZjZH9QfEaRn1AkvPdVK2d66vl4sR001vK+lR+g== + "@types/connect@*": version "3.4.33" resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.33.tgz#31610c901eca573b8713c3330abc6e6b9f588546" @@ -800,7 +805,7 @@ dependencies: "@types/node" "*" -"@types/debug@^4.1.4": +"@types/debug@^4.1.5": version "4.1.5" resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.5.tgz#b14efa8852b7768d898906613c23f688713e02cd" integrity sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ== @@ -874,6 +879,13 @@ resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.161.tgz#a21ca0777dabc6e4f44f3d07f37b765f54188b18" integrity sha512-EP6O3Jkr7bXvZZSZYlsgt5DIjiGr0dXP1/jVEwVLTFgg0d+3lWVQkRavYVQszV7dYUwvg0B8R0MBDpcmXg7XIA== +"@types/jquery@^3.5.1": + version "3.5.1" + resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-3.5.1.tgz#cebb057acf5071c40e439f30e840c57a30d406c3" + integrity sha512-Tyctjh56U7eX2b9udu3wG853ASYP0uagChJcQJXLUXEU6C/JiW5qt5dl8ao01VRj1i5pgXPAf8f1mq4+FDLRQg== + dependencies: + "@types/sizzle" "*" + "@types/mime@*": version "2.0.2" resolved "https://registry.yarnpkg.com/@types/mime/-/mime-2.0.2.tgz#857a118d8634c84bba7ae14088e4508490cd5da5" @@ -967,6 +979,11 @@ "@types/express-serve-static-core" "*" "@types/mime" "*" +"@types/sizzle@*": + version "2.3.2" + resolved "https://registry.yarnpkg.com/@types/sizzle/-/sizzle-2.3.2.tgz#a811b8c18e2babab7d542b3365887ae2e4d9de47" + integrity sha512-7EJYyKTL7tFR8+gDbB6Wwz/arpGa0Mywk1TJbNzKzHtzbwVmY4HR9WqS5VV7dsBUKQmPNr192jHr/VpBluj/hg== + "@types/tough-cookie@*": version "4.0.0" resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.0.tgz#fef1904e4668b6e5ecee60c52cc6a078ffa6697d" From 6d2057b7e6a3a0b4682be266c5be7145b715012e Mon Sep 17 00:00:00 2001 From: Bryan Mikaelian Date: Wed, 2 Sep 2020 15:56:48 -0400 Subject: [PATCH 5/7] Remove unusued modules and lib/utils --- lib/analytics.ts | 9 +-- lib/utils/each.js | 163 ---------------------------------------- package.json | 1 - test/analytics.test.ts | 9 +-- test/each.test.ts | 167 ----------------------------------------- 5 files changed, 7 insertions(+), 342 deletions(-) delete mode 100644 lib/utils/each.js delete mode 100644 test/each.test.ts diff --git a/lib/analytics.ts b/lib/analytics.ts index a7cdf70f..64794f22 100644 --- a/lib/analytics.ts +++ b/lib/analytics.ts @@ -34,12 +34,9 @@ var cookie = require('./cookie'); var metrics = require('./metrics'); var debug = require('debug'); var defaults = require('@ndhoule/defaults'); -var each = require('./utils/each'); -var foldl = require('@ndhoule/foldl'); var group = require('./group'); var is = require('is'); var isMeta = require('@segment/is-meta'); -var keys = require('@ndhoule/keys'); var memory = require('./memory'); var nextTick = require('next-tick'); var normalize = require('./normalize'); @@ -207,7 +204,7 @@ Analytics.prototype.init = Analytics.prototype.initialize = function( // make ready callback var readyCallCount = 0; - var integrationCount = keys(integrations).length; + var integrationCount = Object.keys(integrations).length; var ready = function() { readyCallCount++; if (readyCallCount >= integrationCount) { @@ -609,7 +606,7 @@ Analytics.prototype.page = function( // Mirror user overrides to `options.context.page` (but exclude custom properties) // (Any page defaults get applied in `this.normalize` for consistency.) // Weird, yeah--moving special props to `context.page` will fix this in the long term. - var overrides = pick(keys(defs), properties); + var overrides = pick(Object.keys(defs), properties); if (!is.empty(overrides)) { options = options || {}; options.context = options.context || {}; @@ -973,7 +970,7 @@ Analytics.prototype.normalize = function(msg: { context: { page }; anonymousId: string; }): object { - msg = normalize(msg, keys(this._integrations)); + msg = normalize(msg, Object.keys(this._integrations)); if (msg.anonymousId) user.anonymousId(msg.anonymousId); msg.anonymousId = user.anonymousId(); diff --git a/lib/utils/each.js b/lib/utils/each.js deleted file mode 100644 index 6895cfa3..00000000 --- a/lib/utils/each.js +++ /dev/null @@ -1,163 +0,0 @@ -'use strict'; - -/* - * The MIT License (MIT) - * Copyright (c) 2015 Nathan Houle - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -/* - * Module dependencies. - */ - -var keys = require('@ndhoule/keys'); - -var objToString = Object.prototype.toString; - -/** - * Tests if a value is a number. - * - * @name isNumber - * @api private - * @param {*} val The value to test. - * @return {boolean} Returns `true` if `val` is a number, otherwise `false`. - */ - -var isNumber = function isNumber(val) { - var type = typeof val; - return ( - type === 'number' || - (type === 'object' && objToString.call(val) === '[object Number]') - ); -}; - -/** - * Tests if a value is an array. - * - * @name isArray - * @api private - * @param {*} val The value to test. - * @return {boolean} Returns `true` if the value is an array, otherwise `false`. - */ - -var isArray = - typeof Array.isArray === 'function' - ? Array.isArray - : function isArray(val) { - return objToString.call(val) === '[object Array]'; - }; - -/** - * Tests if a value is array-like. Array-like means the value is not a function and has a numeric - * `.length` property. - * - * @name isArrayLike - * @api private - * @param {*} val - * @return {boolean} - */ - -var isArrayLike = function isArrayLike(val) { - return ( - val != null && - (isArray(val) || (val !== 'function' && isNumber(val.length))) - ); -}; - -/** - * Internal implementation of `each`. Works on arrays and array-like data structures. - * - * @name arrayEach - * @api private - * @param {Function(value, key, collection)} iterator The function to invoke per iteration. - * @param {Array} array The array(-like) structure to iterate over. - * @return {undefined} - */ -var arrayEach = function arrayEach(iterator, array) { - for (var i = 0; i < array.length; i += 1) { - // Break iteration early if `iterator` returns `false` - if (iterator(array[i], i, array) === false) { - break; - } - } -}; - -/** - * Internal implementation of `each`. Works on objects. - * - * @name baseEach - * @api private - * @param {Function(value, key, collection)} iterator The function to invoke per iteration. - * @param {Object} object The object to iterate over. - * @return {undefined} - */ -var baseEach = function baseEach(iterator, object) { - var ks = keys(object); - - for (var i = 0; i < ks.length; i += 1) { - // Break iteration early if `iterator` returns `false` - if (iterator(object[ks[i]], ks[i], object) === false) { - break; - } - } -}; - -/** - * Iterate over an input collection, invoking an `iterator` function for each element in the - * collection and passing to it three arguments: `(value, index, collection)`. The `iterator` - * function can end iteration early by returning `false`. - * - * @name each - * @api public - * @param {Function(value, key, collection)} iterator The function to invoke per iteration. - * @param {Array|Object|string} collection The collection to iterate over. - * @return {undefined} Because `each` is run only for side effects, always returns `undefined`. - * @example - * var log = console.log.bind(console); - * - * each(log, ['a', 'b', 'c']); - * //-> 'a', 0, ['a', 'b', 'c'] - * //-> 'b', 1, ['a', 'b', 'c'] - * //-> 'c', 2, ['a', 'b', 'c'] - * //=> undefined - * - * each(log, 'tim'); - * //-> 't', 2, 'tim' - * //-> 'i', 1, 'tim' - * //-> 'm', 0, 'tim' - * //=> undefined - * - * // Note: Iteration order not guaranteed across environments - * each(log, { name: 'tim', occupation: 'enchanter' }); - * //-> 'tim', 'name', { name: 'tim', occupation: 'enchanter' } - * //-> 'enchanter', 'occupation', { name: 'tim', occupation: 'enchanter' } - * //=> undefined - */ -var each = function each(iterator, collection) { - return (isArrayLike(collection) ? arrayEach : baseEach).call( - this, - iterator, - collection - ); -}; - -/* - * Exports. - */ - -module.exports = each; diff --git a/package.json b/package.json index 27b955f1..5aca1a5d 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,6 @@ "@ndhoule/defaults": "^2.0.1", "@ndhoule/extend": "^2.0.0", "@ndhoule/includes": "^2.0.1", - "@ndhoule/keys": "^2.0.0", "@ndhoule/pick": "^2.0.0", "@segment/canonical": "^1.0.0", "@segment/cookie": "^1.1.5", diff --git a/test/analytics.test.ts b/test/analytics.test.ts index c6917dc4..e379d111 100644 --- a/test/analytics.test.ts +++ b/test/analytics.test.ts @@ -8,13 +8,10 @@ var bind = require('component-event').bind; var createIntegration = require('@segment/analytics.js-integration'); var extend = require('@ndhoule/extend'); var type = require('component-type'); -// @ts-ignore -var jQuery = require('jquery'); var pageDefaults = require('../build/pageDefaults'); var sinon = require('sinon'); var tick = require('next-tick'); var trigger = require('compat-trigger-event'); - var Identify = Facade.Identify; var cookie = Analytics.cookie; var group = analytics.group(); @@ -1642,12 +1639,14 @@ describe('Analytics', function() { link = document.createElement('a'); link.href = '#'; document.body.appendChild(link); + (window as any).jQuery = require('jquery') }); afterEach(function() { window.location.hash = ''; if (wrap) document.body.removeChild(wrap); document.body.removeChild(link); + (window as any).jQuery = null }); it('should trigger a track on an element click', function() { @@ -1760,11 +1759,11 @@ describe('Analytics', function() { var submit; before(function() { - window.jQuery = jQuery; + (window as any).jQuery = require('jquery') }); after(function() { - window.jQuery = null; + (window as any).jQuery = null; }); beforeEach(function() { diff --git a/test/each.test.ts b/test/each.test.ts deleted file mode 100644 index c44ca6ce..00000000 --- a/test/each.test.ts +++ /dev/null @@ -1,167 +0,0 @@ -/* global describe it xit beforeEach */ -/* eslint no-new-wrappers: 0 */ - -'use strict'; - -/** - * Module dependencies. - */ - -var assert = require('assert'); -var keys = require('@ndhoule/keys'); -var sinon = require('sinon'); -var each = require('../build/utils/each'); - -/** - * Locals. - */ - -var es5It = typeof Object.create === 'function' ? it : xit; - -/** - * Tests. - */ - -describe('each', function() { - var identity; - - beforeEach(function() { - identity = sinon.spy(function(val) { - return val; - }); - }); - - it('should be a function', function() { - assert.equal(typeof each, 'function'); - }); - - it('should have an arity of 2', function() { - assert.equal(each.length, 2); - }); - - it('should invoke the `iterator` for each value in the collection, passing `value`, `key`, and `collection`', function() { - var elems = ['zero', 'one', 'two']; - each(identity, elems); - - assert(identity.calledWithExactly('zero', 0, elems)); - assert(identity.calledWithExactly('one', 1, elems)); - assert(identity.calledWithExactly('two', 2, elems)); - }); - - it('should iterate in left-to-right order', function() { - var elems = [1, 0, 7, 14]; - each(identity, elems); - - assert(identity.firstCall.calledWithExactly(1, 0, elems)); - assert(identity.secondCall.calledWithExactly(0, 1, elems)); - assert(identity.thirdCall.calledWithExactly(7, 2, elems)); - assert(identity.lastCall.calledWithExactly(14, 3, elems)); - }); - - it('should return `undefined`', function() { - assert(each(identity, [1, 2, 3]) === undefined); - }); - - it('should exit early when the provided callback returns `false`', function() { - each(identity, [1, 2, 3, false, 4]); - - assert.equal(identity.callCount, 4); - assert(identity.calledWith(1)); - assert(identity.calledWith(2)); - assert(identity.calledWith(3)); - assert(identity.calledWith(false)); - }); - - it('should pass the original collection, allowing mutation', function() { - var elems = [5, 4, 3, 2, 1]; - each(function(val, i, coll) { - coll[i] = 'omg'; - }, elems); - - assert.deepEqual(elems, ['omg', 'omg', 'omg', 'omg', 'omg']); - }); - - it('should work on arrays', function() { - var elems = ['a', 'b', 'c', 'd']; - each(identity, elems); - - assert(identity.firstCall.calledWithExactly('a', 0, elems)); - assert(identity.secondCall.calledWithExactly('b', 1, elems)); - assert(identity.thirdCall.calledWithExactly('c', 2, elems)); - assert(identity.lastCall.calledWithExactly('d', 3, elems)); - }); - - it('should work on objects (with no guarantee of iteration order)', function() { - var elems = { - a: 1, - b: 2, - c: 3 - }; - // Compensate for object iteration being platform-specific by getting - // this platform's iteration order - var iter = keys(elems); - each(identity, elems); - - assert( - identity.firstCall.calledWithExactly(elems[iter[0]], iter[0], elems) - ); - assert( - identity.secondCall.calledWithExactly(elems[iter[1]], iter[1], elems) - ); - assert( - identity.thirdCall.calledWithExactly(elems[iter[2]], iter[2], elems) - ); - }); - - es5It('should work on strings', function() { - var string = 'tim'; - each(identity, string); - - assert(identity.firstCall.calledWithExactly('t', 0, string)); - assert(identity.secondCall.calledWithExactly('i', 1, string)); - assert(identity.thirdCall.calledWithExactly('m', 2, string)); - }); - - es5It('should work on string objects', function() { - var string = new String('tim'); - each(identity, string); - - assert(identity.firstCall.calledWithExactly('t', 0, string)); - assert(identity.secondCall.calledWithExactly('i', 1, string)); - assert(identity.thirdCall.calledWithExactly('m', 2, string)); - }); - - es5It('should ignore inherited properties', function() { - var parent = { - enchanter: 'Tim' - }; - var child = Object.create(parent); - child.a = 1; - each(identity, child); - - assert(identity.calledOnce); - assert(identity.calledWith(1, 'a', child)); - assert(!identity.calledWith('Tim', 'enchanter')); - }); - - es5It('should ignore non-enumerable properties', function() { - var obj = Object.create(null, { - a: { - value: 1, - enumerable: false - }, - b: { - value: 2, - enumerable: false - }, - c: { - value: 3, - enumerable: true - } - }); - each(identity, obj); - - assert(identity.calledOnce); - assert(identity.calledWith(3, 'c', obj)); - }); -}); From aa3669ac4024c82e2d06738b8835c6884f5c76d7 Mon Sep 17 00:00:00 2001 From: Bryan Mikaelian Date: Wed, 2 Sep 2020 16:15:13 -0400 Subject: [PATCH 6/7] Update history --- HISTORY.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/HISTORY.md b/HISTORY.md index 7bf7d684..8a62c116 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,10 @@ +# 4.1.0 / 2020-09-14 + +- Replaces `utils/clone` with `lodash.deepclone` +- Replaces `utils/map` with `Array.prototype.map` +- Replaces `utils/each` with `Array.prototype.each` +- Removes the `utils` directory and tests + # 4.0.4 / 2020-09-11 - Change the arguments of the main methods to be optional in the typedef to match the documentation. (#203) From 39232a9cd84c921c9adb9a1342a59845038ce9c3 Mon Sep 17 00:00:00 2001 From: Bryan Mikaelian Date: Mon, 14 Sep 2020 12:34:59 -0400 Subject: [PATCH 7/7] RIP JS. Update linter for TS --- .eslintrc | 24 +++++- package.json | 6 +- yarn.lock | 211 +++++++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 223 insertions(+), 18 deletions(-) diff --git a/.eslintrc b/.eslintrc index 6000292e..ad099e82 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,3 +1,25 @@ { - "extends": ["@segment/eslint-config/browser/legacy", "prettier"] + "parser": "@typescript-eslint/parser", + "plugins": [ + "@typescript-eslint" + ], + "extends": [ + "@segment/eslint-config/browser/legacy", + "prettier", + "plugin:@typescript-eslint/recommended" + ], + "rules": { + "no-use-before-define": "warn", + "no-var": "warn", + "prefer-const": "warn", + "prefer-rest-params": "warn", + "prefer-spread": "warn", + "strict": "warn", + "@typescript-eslint/adjacent-overload-signatures": "warn", + "@typescript-eslint/ban-ts-comment": "warn", + "@typescript-eslint/ban-types": "warn", + "@typescript-eslint/no-empty-function": "warn", + "@typescript-eslint/no-this-alias": "warn", + "@typescript-eslint/no-var-requires": "warn" + } } diff --git a/package.json b/package.json index 5aca1a5d..19275f73 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "main": "build/index.js", "scripts": { "test": "make test", - "lint": "eslint \"./{lib,test}/**/*.js\"", + "lint": "eslint \"./{lib,test}/**/*.ts\"", "format": "prettier-eslint --write --list-different \"./{lib,test,test-e2e}/**/*.{ts,js,json,md}\"", "precommit": "lint-staged", "np": "np --no-publish", @@ -69,11 +69,13 @@ "@types/component-emitter": "^1.2.9", "@types/debug": "^4.1.5", "@types/express": "^4.17.6", - "@types/lodash": "^4.14.161", "@types/jquery": "^3.5.1", + "@types/lodash": "^4.14.161", "@types/mocha": "^7.0.2", "@types/node": "^14.0.6", "@types/node-fetch": "^2.5.7", + "@typescript-eslint/eslint-plugin": "^4.1.0", + "@typescript-eslint/parser": "^4.1.0", "assert": "1.5.0", "browserify": "16.5.2", "browserify-istanbul": "^3.0.1", diff --git a/yarn.lock b/yarn.lock index b6722b46..ab7dfc18 100644 --- a/yarn.lock +++ b/yarn.lock @@ -323,6 +323,27 @@ version "2.0.0" resolved "https://registry.yarnpkg.com/@ndhoule/rest/-/rest-2.0.0.tgz#0346b02a964a513ed2ba24d164f01d34f2107a0f" +"@nodelib/fs.scandir@2.1.3": + version "2.1.3" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz#3a582bdb53804c6ba6d146579c46e52130cf4a3b" + integrity sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw== + dependencies: + "@nodelib/fs.stat" "2.0.3" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.3", "@nodelib/fs.stat@^2.0.2": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz#34dc5f4cabbc720f4e60f75a747e7ecd6c175bd3" + integrity sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA== + +"@nodelib/fs.walk@^1.2.3": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz#011b9202a70a6366e436ca5c065844528ab04976" + integrity sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ== + dependencies: + "@nodelib/fs.scandir" "2.1.3" + fastq "^1.6.0" + "@pollyjs/adapter-puppeteer@^4.0.4": version "4.3.0" resolved "https://registry.yarnpkg.com/@pollyjs/adapter-puppeteer/-/adapter-puppeteer-4.3.0.tgz#9104172b2da360d0ab36429622b4c6730dea2a65" @@ -805,7 +826,7 @@ dependencies: "@types/node" "*" -"@types/debug@^4.1.5": +"@types/debug@^4.1.4", "@types/debug@^4.1.5": version "4.1.5" resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.5.tgz#b14efa8852b7768d898906613c23f688713e02cd" integrity sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ== @@ -857,6 +878,13 @@ resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.0.tgz#9140779736aa2655635ee756e2467d787cfe8a2a" integrity sha512-c3Xy026kOF7QOTn00hbIllV1dLR9hG9NkSrLQgCVs8NF6sBU+VGWjD3wLPhmh1TYAc7ugCFsvHYMN4VcBN1U1A== +"@types/jquery@^3.5.1": + version "3.5.1" + resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-3.5.1.tgz#cebb057acf5071c40e439f30e840c57a30d406c3" + integrity sha512-Tyctjh56U7eX2b9udu3wG853ASYP0uagChJcQJXLUXEU6C/JiW5qt5dl8ao01VRj1i5pgXPAf8f1mq4+FDLRQg== + dependencies: + "@types/sizzle" "*" + "@types/js-yaml@^3.12.1": version "3.12.5" resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-3.12.5.tgz#136d5e6a57a931e1cce6f9d8126aa98a9c92a6bb" @@ -879,13 +907,6 @@ resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.161.tgz#a21ca0777dabc6e4f44f3d07f37b765f54188b18" integrity sha512-EP6O3Jkr7bXvZZSZYlsgt5DIjiGr0dXP1/jVEwVLTFgg0d+3lWVQkRavYVQszV7dYUwvg0B8R0MBDpcmXg7XIA== -"@types/jquery@^3.5.1": - version "3.5.1" - resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-3.5.1.tgz#cebb057acf5071c40e439f30e840c57a30d406c3" - integrity sha512-Tyctjh56U7eX2b9udu3wG853ASYP0uagChJcQJXLUXEU6C/JiW5qt5dl8ao01VRj1i5pgXPAf8f1mq4+FDLRQg== - dependencies: - "@types/sizzle" "*" - "@types/mime@*": version "2.0.2" resolved "https://registry.yarnpkg.com/@types/mime/-/mime-2.0.2.tgz#857a118d8634c84bba7ae14088e4508490cd5da5" @@ -1003,6 +1024,19 @@ dependencies: "@types/node" "*" +"@typescript-eslint/eslint-plugin@^4.1.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.1.0.tgz#7d309f60815ff35e9627ad85e41928d7b7fd443f" + integrity sha512-U+nRJx8XDUqJxYF0FCXbpmD9nWt/xHDDG0zsw1vrVYAmEAuD/r49iowfurjSL2uTA2JsgtpsyG7mjO7PHf2dYw== + dependencies: + "@typescript-eslint/experimental-utils" "4.1.0" + "@typescript-eslint/scope-manager" "4.1.0" + debug "^4.1.1" + functional-red-black-tree "^1.0.1" + regexpp "^3.0.0" + semver "^7.3.2" + tsutils "^3.17.1" + "@typescript-eslint/experimental-utils@1.13.0": version "1.13.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-1.13.0.tgz#b08c60d780c0067de2fb44b04b432f540138301e" @@ -1012,6 +1046,18 @@ "@typescript-eslint/typescript-estree" "1.13.0" eslint-scope "^4.0.0" +"@typescript-eslint/experimental-utils@4.1.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.1.0.tgz#263d7225645c09a411c8735eeffd417f50f49026" + integrity sha512-paEYLA37iqRIDPeQwAmoYSiZ3PiHsaAc3igFeBTeqRHgPnHjHLJ9OGdmP6nwAkF65p2QzEsEBtpjNUBWByNWzA== + dependencies: + "@types/json-schema" "^7.0.3" + "@typescript-eslint/scope-manager" "4.1.0" + "@typescript-eslint/types" "4.1.0" + "@typescript-eslint/typescript-estree" "4.1.0" + eslint-scope "^5.0.0" + eslint-utils "^2.0.0" + "@typescript-eslint/parser@^1.10.2": version "1.13.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-1.13.0.tgz#61ac7811ea52791c47dc9fd4dd4a184fae9ac355" @@ -1022,6 +1068,29 @@ "@typescript-eslint/typescript-estree" "1.13.0" eslint-visitor-keys "^1.0.0" +"@typescript-eslint/parser@^4.1.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.1.0.tgz#9b0409411725f14cd7faa81a664e5051225961db" + integrity sha512-hM/WNCQTzDHgS0Ke3cR9zPndL3OTKr9OoN9CL3UqulsAjYDrglSwIIgswSmHBcSbOzLmgaMARwrQEbIumIglvQ== + dependencies: + "@typescript-eslint/scope-manager" "4.1.0" + "@typescript-eslint/types" "4.1.0" + "@typescript-eslint/typescript-estree" "4.1.0" + debug "^4.1.1" + +"@typescript-eslint/scope-manager@4.1.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.1.0.tgz#9e389745ee9cfe12252ed1e9958808abd6b3a683" + integrity sha512-HD1/u8vFNnxwiHqlWKC/Pigdn0Mvxi84Y6GzbZ5f5sbLrFKu0al02573Er+D63Sw67IffVUXR0uR8rpdfdk+vA== + dependencies: + "@typescript-eslint/types" "4.1.0" + "@typescript-eslint/visitor-keys" "4.1.0" + +"@typescript-eslint/types@4.1.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.1.0.tgz#edbd3fec346f34e13ce7aa176b03b497a32c496a" + integrity sha512-rkBqWsO7m01XckP9R2YHVN8mySOKKY2cophGM8K5uDK89ArCgahItQYdbg/3n8xMxzu2elss+an1TphlUpDuJw== + "@typescript-eslint/typescript-estree@1.13.0": version "1.13.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.13.0.tgz#8140f17d0f60c03619798f1d628b8434913dc32e" @@ -1030,6 +1099,28 @@ lodash.unescape "4.0.1" semver "5.5.0" +"@typescript-eslint/typescript-estree@4.1.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.1.0.tgz#394046ead25164494218c0e3d6b960695ea967f6" + integrity sha512-r6et57qqKAWU173nWyw31x7OfgmKfMEcjJl9vlJEzS+kf9uKNRr4AVTRXfTCwebr7bdiVEkfRY5xGnpPaNPe4Q== + dependencies: + "@typescript-eslint/types" "4.1.0" + "@typescript-eslint/visitor-keys" "4.1.0" + debug "^4.1.1" + globby "^11.0.1" + is-glob "^4.0.1" + lodash "^4.17.15" + semver "^7.3.2" + tsutils "^3.17.1" + +"@typescript-eslint/visitor-keys@4.1.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.1.0.tgz#b2d528c9484e7eda1aa4f86ccf0432fb16e4d545" + integrity sha512-+taO0IZGCtCEsuNTTF2Q/5o8+fHrlml8i9YsZt2AiDCdYEJzYlsmRY991l/6f3jNXFyAWepdQj7n8Na6URiDRQ== + dependencies: + "@typescript-eslint/types" "4.1.0" + eslint-visitor-keys "^2.0.0" + "@wdio/config@5.22.4": version "5.22.4" resolved "https://registry.yarnpkg.com/@wdio/config/-/config-5.22.4.tgz#053d4ba0a8b0dae6be740b1b7b9ab25abac2799e" @@ -1435,6 +1526,11 @@ array-union@^1.0.1: dependencies: array-uniq "^1.0.1" +array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + array-uniq@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" @@ -3078,6 +3174,13 @@ diffie-hellman@^5.0.0: miller-rabin "^4.0.0" randombytes "^2.0.0" +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + dlv@^1.1.0: version "1.1.2" resolved "https://registry.yarnpkg.com/dlv/-/dlv-1.1.2.tgz#270f6737b30d25b6657a7e962c784403f85137e5" @@ -3452,6 +3555,14 @@ eslint-scope@^4.0.0, eslint-scope@^4.0.3: esrecurse "^4.1.0" estraverse "^4.1.1" +eslint-scope@^5.0.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" + integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== + dependencies: + esrecurse "^4.3.0" + estraverse "^4.1.1" + eslint-scope@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.0.tgz#d0f971dfe59c69e0cada684b23d49dbf82600ce5" @@ -3467,7 +3578,7 @@ eslint-utils@^1.3.1: dependencies: eslint-visitor-keys "^1.1.0" -eslint-utils@^2.1.0: +eslint-utils@^2.0.0, eslint-utils@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== @@ -3483,6 +3594,11 @@ eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== +eslint-visitor-keys@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8" + integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== + eslint@^5.0.0: version "5.16.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.16.0.tgz#a1e3ac1aae4a3fbd8296fcf8f7ab7314cbb6abea" @@ -3620,11 +3736,18 @@ esrecurse@^4.1.0: dependencies: estraverse "^4.1.0" +esrecurse@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" -estraverse@^5.1.0: +estraverse@^5.1.0, estraverse@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== @@ -3819,6 +3942,18 @@ fast-deep-equal@^3.1.1: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== +fast-glob@^3.1.1: + version "3.2.4" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.4.tgz#d20aefbf99579383e7f3cc66529158c9b98554d3" + integrity sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.0" + merge2 "^1.3.0" + micromatch "^4.0.2" + picomatch "^2.2.1" + fast-json-stable-stringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" @@ -3828,6 +3963,13 @@ fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.4: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= +fastq@^1.6.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.8.0.tgz#550e1f9f59bbc65fe185cb6a9b4d95357107f481" + integrity sha512-SMIZoZdLh/fgofivvIkmknUXyPnvxRE3DhtZ5Me3Mrsk5gyPL42F0xr51TdRXskBxHfMp+07bcYzfsYEsSQA9Q== + dependencies: + reusify "^1.0.4" + fd-slicer@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" @@ -4173,7 +4315,7 @@ glob-parent@^3.1.0: is-glob "^3.1.0" path-dirname "^1.0.0" -glob-parent@^5.0.0, glob-parent@~5.1.0: +glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@~5.1.0: version "5.1.1" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== @@ -4250,6 +4392,18 @@ globals@^9.18.0: resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== +globby@^11.0.1: + version "11.0.1" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.1.tgz#9a2bf107a068f3ffeabc49ad702c79ede8cfd357" + integrity sha512-iH9RmgwCmUJHi2z5o2l3eTtGBtXek1OYlHrbcxOYugyHLmAsZrPj43OtHThd62Buh/Vv6VyCBD2bdyWcGNQqoQ== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.1.1" + ignore "^5.1.4" + merge2 "^1.3.0" + slash "^3.0.0" + globby@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" @@ -4683,7 +4837,7 @@ ignore@^4.0.6: resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== -ignore@^5.1.2: +ignore@^5.1.2, ignore@^5.1.4: version "5.1.8" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== @@ -6262,6 +6416,11 @@ merge-stream@^2.0.0: resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== +merge2@^1.3.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + messageformat-formatters@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/messageformat-formatters/-/messageformat-formatters-2.0.1.tgz#0492c1402a48775f751c9b17c0354e92be012b08" @@ -7760,7 +7919,7 @@ regexpp@^2.0.1: resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== -regexpp@^3.1.0: +regexpp@^3.0.0, regexpp@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2" integrity sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q== @@ -7964,6 +8123,11 @@ retry@^0.10.0: resolved "https://registry.yarnpkg.com/retry/-/retry-0.10.1.tgz#e76388d217992c252750241d3d3956fed98d8ff4" integrity sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q= +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + rfdc@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.1.4.tgz#ba72cc1367a0ccd9cf81a870b3b58bd3ad07f8c2" @@ -8028,6 +8192,11 @@ run-async@^2.4.0: resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== +run-parallel@^1.1.9: + version "1.1.9" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.1.9.tgz#c9dd3a7cf9f4b2c4b6244e173a6ed866e61dd679" + integrity sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q== + rxjs@^6.3.3, rxjs@^6.5.2, rxjs@^6.5.3, rxjs@^6.5.4, rxjs@^6.6.0: version "6.6.3" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.3.tgz#8ca84635c4daa900c0d3967a6ee7ac60271ee552" @@ -8150,7 +8319,7 @@ semver@^6.0.0, semver@^6.1.0, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.1.1, semver@^7.2.1: +semver@^7.1.1, semver@^7.2.1, semver@^7.3.2: version "7.3.2" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938" integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ== @@ -8295,6 +8464,11 @@ sinon@^1.7.3: samsam "1.1.2" util ">=0.10.3 <1" +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + slice-ansi@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" @@ -9462,7 +9636,7 @@ tslib@1.11.1: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35" integrity sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA== -tslib@^1, tslib@^1.10.0, tslib@^1.11.2, tslib@^1.13.0, tslib@^1.9.3: +tslib@^1, tslib@^1.10.0, tslib@^1.11.2, tslib@^1.13.0, tslib@^1.8.1, tslib@^1.9.3: version "1.13.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.13.0.tgz#c881e13cc7015894ed914862d276436fa9a47043" integrity sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q== @@ -9476,6 +9650,13 @@ tslib@^2.0.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.1.tgz#410eb0d113e5b6356490eec749603725b021b43e" integrity sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ== +tsutils@^3.17.1: + version "3.17.1" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759" + integrity sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g== + dependencies: + tslib "^1.8.1" + tty-browserify@0.0.1, tty-browserify@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.1.tgz#3f05251ee17904dfd0677546670db9651682b811"