diff --git a/.gitignore b/.gitignore index badd1c1..ff54286 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -dist node_modules -.rpt2_cache -test-build +.ts-tmp +build/test diff --git a/README.md b/README.md index 814a449..13b1b8e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # IndexedDB with usability. -This is a tiny (~1.16k) library that mostly mirrors the IndexedDB API, but with small improvements that make a big difference to usability. +This is a tiny (~1.03k brotli'd) library that mostly mirrors the IndexedDB API, but with small improvements that make a big difference to usability. 1. [Installation](#installation) 1. [Changes](#changes) @@ -47,7 +47,7 @@ Or, use it directly via unpkg: # Changes -This is a rewrite from 3.x with substantial changes. [See details](changes.md). +[See details of (potentially) breaking changes](changes.md). # API @@ -230,7 +230,7 @@ while (cursor) { ## Async iterators -Async iterator support isn't included by default (Edge doesn't support them). To include them, import `idb/with-async-ittr.js` instead of `idb` (this increases the library size to ~1.38k): +Async iterator support isn't included by default (Edge doesn't support them). To include them, import `idb/with-async-ittr.js` instead of `idb` (this increases the library size to ~1.25k brotli'd): ```js import { openDB } from 'idb/with-async-ittr.js'; diff --git a/build/cjs/async-iterators.d.ts b/build/cjs/async-iterators.d.ts new file mode 100644 index 0000000..ebd7e42 --- /dev/null +++ b/build/cjs/async-iterators.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=async-iterators.d.ts.map \ No newline at end of file diff --git a/build/cjs/async-iterators.d.ts.map b/build/cjs/async-iterators.d.ts.map new file mode 100644 index 0000000..64ac85b --- /dev/null +++ b/build/cjs/async-iterators.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"async-iterators.d.ts","sourceRoot":"","sources":["../../src/async-iterators.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/build/cjs/async-iterators.js b/build/cjs/async-iterators.js index 599332a..ecde056 100644 --- a/build/cjs/async-iterators.js +++ b/build/cjs/async-iterators.js @@ -1,56 +1,56 @@ 'use strict'; -var __chunk_1 = require('./chunk.js'); +var wrapIdbValue = require('./wrap-idb-value.js'); -const advanceMethodProps = ['continue', 'continuePrimaryKey', 'advance']; -const methodMap = {}; -const advanceResults = new WeakMap(); -const ittrProxiedCursorToOriginalProxy = new WeakMap(); -const cursorIteratorTraps = { - get(target, prop) { - if (!advanceMethodProps.includes(prop)) - return target[prop]; - let cachedFunc = methodMap[prop]; - if (!cachedFunc) { - cachedFunc = methodMap[prop] = function (...args) { - advanceResults.set(this, ittrProxiedCursorToOriginalProxy.get(this)[prop](...args)); - }; - } - return cachedFunc; - }, -}; -async function* iterate(...args) { - // tslint:disable-next-line:no-this-assignment - let cursor = this; - if (!(cursor instanceof IDBCursor)) { - cursor = await cursor.openCursor(...args); - } - if (!cursor) - return; - cursor = cursor; - const proxiedCursor = new Proxy(cursor, cursorIteratorTraps); - ittrProxiedCursorToOriginalProxy.set(proxiedCursor, cursor); - // Map this double-proxy back to the original, so other cursor methods work. - __chunk_1.reverseTransformCache.set(proxiedCursor, __chunk_1.unwrap(cursor)); - while (cursor) { - yield proxiedCursor; - // If one of the advancing methods was not called, call continue(). - cursor = await (advanceResults.get(proxiedCursor) || cursor.continue()); - advanceResults.delete(proxiedCursor); - } -} -function isIteratorProp(target, prop) { - return ((prop === Symbol.asyncIterator && - __chunk_1.instanceOfAny(target, [IDBIndex, IDBObjectStore, IDBCursor])) || - (prop === 'iterate' && __chunk_1.instanceOfAny(target, [IDBIndex, IDBObjectStore]))); -} -__chunk_1.addTraps(oldTraps => ({ - get(target, prop, receiver) { - if (isIteratorProp(target, prop)) - return iterate; - return oldTraps.get(target, prop, receiver); - }, - has(target, prop) { - return isIteratorProp(target, prop) || oldTraps.has(target, prop); - }, +const advanceMethodProps = ['continue', 'continuePrimaryKey', 'advance']; +const methodMap = {}; +const advanceResults = new WeakMap(); +const ittrProxiedCursorToOriginalProxy = new WeakMap(); +const cursorIteratorTraps = { + get(target, prop) { + if (!advanceMethodProps.includes(prop)) + return target[prop]; + let cachedFunc = methodMap[prop]; + if (!cachedFunc) { + cachedFunc = methodMap[prop] = function (...args) { + advanceResults.set(this, ittrProxiedCursorToOriginalProxy.get(this)[prop](...args)); + }; + } + return cachedFunc; + }, +}; +async function* iterate(...args) { + // tslint:disable-next-line:no-this-assignment + let cursor = this; + if (!(cursor instanceof IDBCursor)) { + cursor = await cursor.openCursor(...args); + } + if (!cursor) + return; + cursor = cursor; + const proxiedCursor = new Proxy(cursor, cursorIteratorTraps); + ittrProxiedCursorToOriginalProxy.set(proxiedCursor, cursor); + // Map this double-proxy back to the original, so other cursor methods work. + wrapIdbValue.reverseTransformCache.set(proxiedCursor, wrapIdbValue.unwrap(cursor)); + while (cursor) { + yield proxiedCursor; + // If one of the advancing methods was not called, call continue(). + cursor = await (advanceResults.get(proxiedCursor) || cursor.continue()); + advanceResults.delete(proxiedCursor); + } +} +function isIteratorProp(target, prop) { + return ((prop === Symbol.asyncIterator && + wrapIdbValue.instanceOfAny(target, [IDBIndex, IDBObjectStore, IDBCursor])) || + (prop === 'iterate' && wrapIdbValue.instanceOfAny(target, [IDBIndex, IDBObjectStore]))); +} +wrapIdbValue.addTraps(oldTraps => ({ + get(target, prop, receiver) { + if (isIteratorProp(target, prop)) + return iterate; + return oldTraps.get(target, prop, receiver); + }, + has(target, prop) { + return isIteratorProp(target, prop) || oldTraps.has(target, prop); + }, })); diff --git a/build/cjs/async-iterators.js.map b/build/cjs/async-iterators.js.map new file mode 100644 index 0000000..b807e7d --- /dev/null +++ b/build/cjs/async-iterators.js.map @@ -0,0 +1 @@ +{"version":3,"file":"async-iterators.js","sourceRoot":"","sources":["../../src/async-iterators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAQ,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG3E,MAAM,kBAAkB,GAAG,CAAC,UAAU,EAAE,oBAAoB,EAAE,SAAS,CAAC,CAAC;AACzE,MAAM,SAAS,GAA0B,EA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ACpB,mEAAmE;QACnE,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;QACxE,cAAc,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;KACtC;AACH,CAAC;AAED,SAAS,cAAc,CAAC,MAAW,EAAE,IAA8B;IACjE,OAAO,CACL,CAAC,IAAI,KAAK,MAAM,CAAC,aAAa;QAC5B,aAAa,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,cAAc,EAAE,SAAS,CAAC,CAAC,CAAC;QAC/D,CAAC,IAAI,KAAK,SAAS,IAAI,aAAa,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,CAC1E,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACpB,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ;QACxB,IAAI,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC;YAAE,OAAO,OAAO,CAAC;QACjD,OAAO,QAAQ,CAAC,GAAI,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC/C,CAAC;IACD,GAAG,CAAC,MAAM,EAAE,IAAI;QACd,OAAO,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,QAAQ,CAAC,GAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACrE,CAAC;CACF,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/build/cjs/database-extras.d.ts b/build/cjs/database-extras.d.ts new file mode 100644 index 0000000..6717a92 --- /dev/null +++ b/build/cjs/database-extras.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=database-extras.d.ts.map \ No newline at end of file diff --git a/build/cjs/database-extras.d.ts.map b/build/cjs/database-extras.d.ts.map new file mode 100644 index 0000000..46090d9 --- /dev/null +++ b/build/cjs/database-extras.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"database-extras.d.ts","sourceRoot":"","sources":["../../src/database-extras.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/build/cjs/database-extras.js.map b/build/cjs/database-extras.js.map new file mode 100644 index 0000000..c966bbd --- /dev/null +++ b/build/cjs/database-extras.js.map @@ -0,0 +1 @@ +{"version":3,"file":"database-extras.js","sourceRoot":"","sources":["../../src/database-extras.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,MAAM,WAAW,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;AACvE,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AACvD,MAAM,aAAa,GAAG,IAAI,GAAG,EAAgB,CAAC;AAE9C,SAAS,SAAS,CAChB,MAAW,EACX,IAA8B;IAE9B,IACE,CAAC,CACC,MAAM,YAAY,WAAW;QAC7B,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC;QACjB,OAAO,IAAI,KAAK,QAAQ,CACzB,EACD;QACA,OAAO;KACR;IAED,IAAI,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC;QAAE,OAAO,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAE5D,MAAM,cAAc,GAAW,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;IAC9D,MAAM,QAAQ,GAAG,IAAI,KAAK,cAAc,CAAC;IACzC,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IAEtD;IACE,4EAA4E;IAC5E,CAAC,CAAC,cAAc,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC;QACrE,CAAC,CAAC,OAAO,IAAI,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,EAClD;QACA,OAAO;KACR;IAED,MAAM,MAAM,GAAG,KAAK,WAElB,SAAiB,EACjB,GAAG,IAAW;QAEd,wEAAwE;QACxE,MAAM,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;QAC3E,IAAI,MAAM,GAAgC,EAAE,CAAC,KAAK,CAAC;QACnD,IAAI,QAAQ;YAAE,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QAClD,MAAM,SAAS,GAAI,MAAc,CAAC,cAAc,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;QAC3D,IAAI,OAAO;YAAE,MAAM,EAAE,CAAC,IAAI,CAAC;QAC3B,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;IAEF,aAAa,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAChC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACpB,GAAG,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,CAC9B,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,QAAQ,CAAC,GAAI,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC;IAClE,GAAG,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CACpB,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,QAAQ,CAAC,GAAI,CAAC,MAAM,EAAE,IAAI,CAAC;CAC3D,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/build/cjs/entry.d.ts b/build/cjs/entry.d.ts new file mode 100644 index 0000000..e9a2068 --- /dev/null +++ b/build/cjs/entry.d.ts @@ -0,0 +1,597 @@ +export interface OpenDBCallbacks { + /** + * Called if this version of the database has never been opened before. Use it to specify the + * schema for the database. + * + * @param database A database instance that you can use to add/remove stores and indexes. + * @param oldVersion Last version of the database opened by the user. + * @param newVersion Whatever new version you provided. + * @param transaction The transaction for this upgrade. This is useful if you need to get data + * from other stores as part of a migration. + */ + upgrade?(database: IDBPDatabase, oldVersion: number, newVersion: number | null, transaction: IDBPTransaction): void; + /** + * Called if there are older versions of the database open on the origin, so this version cannot + * open. + */ + blocked?(): void; + /** + * Called if this connection is blocking a future version of the database from opening. + */ + blocking?(): void; +} +/** + * Open a database. + * + * @param name Name of the database. + * @param version Schema version. + * @param callbacks Additional callbacks. + */ +export declare function openDB(name: string, version: number, { blocked, upgrade, blocking }?: OpenDBCallbacks): Promise>; +export interface DeleteDBCallbacks { + /** + * Called if there are connections to this database open, so it cannot be deleted. + */ + blocked?(): void; +} +/** + * Delete a database. + * + * @param name Name of the database. + */ +export declare function deleteDB(name: string, { blocked }?: DeleteDBCallbacks): Promise; +export { unwrap, wrap } from './wrap-idb-value'; +declare type KnownKeys = { + [K in keyof T]: string extends K ? never : number extends K ? never : K; +} extends { + [_ in keyof T]: infer U; +} ? U : never; +declare type Omit = Pick>; +export interface DBSchema { + [s: string]: DBSchemaValue; +} +interface IndexKeys { + [s: string]: IDBValidKey; +} +interface DBSchemaValue { + key: IDBValidKey; + value: any; + indexes?: IndexKeys; +} +/** + * Extract known object store names from the DB schema type. + * + * @template DBTypes DB schema type, or unknown if the DB isn't typed. + */ +export declare type StoreNames = DBTypes extends DBSchema ? KnownKeys : string; +/** + * Extract database value types from the DB schema type. + * + * @template DBTypes DB schema type, or unknown if the DB isn't typed. + * @template StoreName Names of the object stores to get the types of. + */ +export declare type StoreValue> = DBTypes extends DBSchema ? DBTypes[StoreName]['value'] : any; +/** + * Extract database key types from the DB schema type. + * + * @template DBTypes DB schema type, or unknown if the DB isn't typed. + * @template StoreName Names of the object stores to get the types of. + */ +export declare type StoreKey> = DBTypes extends DBSchema ? DBTypes[StoreName]['key'] : IDBValidKey; +/** + * Extract the names of indexes in certain object stores from the DB schema type. + * + * @template DBTypes DB schema type, or unknown if the DB isn't typed. + * @template StoreName Names of the object stores to get the types of. + */ +export declare type IndexNames> = DBTypes extends DBSchema ? keyof DBTypes[StoreName]['indexes'] : string; +/** + * Extract the types of indexes in certain object stores from the DB schema type. + * + * @template DBTypes DB schema type, or unknown if the DB isn't typed. + * @template StoreName Names of the object stores to get the types of. + * @template IndexName Names of the indexes to get the types of. + */ +export declare type IndexKey, IndexName extends IndexNames> = DBTypes extends DBSchema ? IndexName extends keyof DBTypes[StoreName]['indexes'] ? DBTypes[StoreName]['indexes'][IndexName] : IDBValidKey : IDBValidKey; +declare type CursorSource[], StoreName extends StoreNames, IndexName extends IndexNames | unknown> = IndexName extends IndexNames ? IDBPIndex : IDBPObjectStore; +declare type CursorKey, IndexName extends IndexNames | unknown> = IndexName extends IndexNames ? IndexKey : StoreKey; +declare type IDBPDatabaseExtends = Omit; +/** + * A variation of DOMStringList with precise string types + */ +export interface TypedDOMStringList extends DOMStringList { + contains(string: T): boolean; + item(index: number): T | null; + [index: number]: T; + [Symbol.iterator](): IterableIterator; +} +export interface IDBPDatabase extends IDBPDatabaseExtends { + /** + * The names of stores in the database. + */ + readonly objectStoreNames: TypedDOMStringList>; + /** + * Creates a new object store. + * + * Throws a "InvalidStateError" DOMException if not called within an upgrade transaction. + */ + createObjectStore>(name: Name, optionalParameters?: IDBObjectStoreParameters): IDBPObjectStore[], Name>; + /** + * Deletes the object store with the given name. + * + * Throws a "InvalidStateError" DOMException if not called within an upgrade transaction. + */ + deleteObjectStore(name: StoreNames): void; + /** + * Start a new transaction. + * + * @param storeNames The object store(s) this transaction needs. + * @param mode + */ + transaction>(storeNames: Name, mode?: IDBTransactionMode): IDBPTransaction; + transaction[]>(storeNames: Names, mode?: IDBTransactionMode): IDBPTransaction; + /** + * Add a value to a store. + * + * Rejects if an item of a given key already exists in the store. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param value + * @param key + */ + add>(storeName: Name, value: StoreValue, key?: StoreKey | IDBKeyRange): Promise>; + /** + * Deletes all records in a store. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + */ + clear(name: StoreNames): Promise; + /** + * Retrieves the number of records matching the given query in a store. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param key + */ + count>(storeName: Name, key?: StoreKey | IDBKeyRange): Promise; + /** + * Retrieves the number of records matching the given query in an index. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param indexName Name of the index within the store. + * @param key + */ + countFromIndex, IndexName extends IndexNames>(storeName: Name, indexName: IndexName, key?: IndexKey | IDBKeyRange): Promise; + /** + * Deletes records in a store matching the given query. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param key + */ + delete>(storeName: Name, key: StoreKey | IDBKeyRange): Promise; + /** + * Retrieves the value of the first record in a store matching the query. + * + * Resolves with undefined if no match is found. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param query + */ + get>(storeName: Name, query: StoreKey | IDBKeyRange): Promise | undefined>; + /** + * Retrieves the value of the first record in an index matching the query. + * + * Resolves with undefined if no match is found. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param indexName Name of the index within the store. + * @param query + */ + getFromIndex, IndexName extends IndexNames>(storeName: Name, indexName: IndexName, query: IndexKey | IDBKeyRange): Promise | undefined>; + /** + * Retrieves all values in a store that match the query. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param query + * @param count Maximum number of values to return. + */ + getAll>(storeName: Name, query?: StoreKey | IDBKeyRange, count?: number): Promise[]>; + /** + * Retrieves all values in an index that match the query. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param indexName Name of the index within the store. + * @param query + * @param count Maximum number of values to return. + */ + getAllFromIndex, IndexName extends IndexNames>(storeName: Name, indexName: IndexName, query?: IndexKey | IDBKeyRange, count?: number): Promise[]>; + /** + * Retrieves the keys of records in a store matching the query. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param query + * @param count Maximum number of keys to return. + */ + getAllKeys>(storeName: Name, query?: StoreKey | IDBKeyRange, count?: number): Promise[]>; + /** + * Retrieves the keys of records in an index matching the query. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param indexName Name of the index within the store. + * @param query + * @param count Maximum number of keys to return. + */ + getAllKeysFromIndex, IndexName extends IndexNames>(storeName: Name, indexName: IndexName, query?: IndexKey | IDBKeyRange, count?: number): Promise[]>; + /** + * Retrieves the key of the first record in a store that matches the query. + * + * Resolves with undefined if no match is found. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param query + */ + getKey>(storeName: Name, query: StoreKey | IDBKeyRange): Promise | undefined>; + /** + * Retrieves the key of the first record in an index that matches the query. + * + * Resolves with undefined if no match is found. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param indexName Name of the index within the store. + * @param query + */ + getKeyFromIndex, IndexName extends IndexNames>(storeName: Name, indexName: IndexName, query: IndexKey | IDBKeyRange): Promise | undefined>; + /** + * Put an item in the database. + * + * Replaces any item with the same key. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param value + * @param key + */ + put>(storeName: Name, value: StoreValue, key?: StoreKey | IDBKeyRange): Promise>; +} +declare type IDBPTransactionExtends = Omit; +export interface IDBPTransaction[] = StoreNames[]> extends IDBPTransactionExtends { + /** + * The names of stores in scope for this transaction. + */ + readonly objectStoreNames: TxStores; + /** + * The transaction's connection. + */ + readonly db: IDBPDatabase; + /** + * Promise for the completion of this transaction. + */ + readonly done: Promise; + /** + * The associated object store, if the transaction covers a single store, otherwise undefined. + */ + readonly store: TxStores[1] extends undefined ? IDBPObjectStore : undefined; + /** + * Returns an IDBObjectStore in the transaction's scope. + */ + objectStore(name: StoreName): IDBPObjectStore; +} +declare type IDBPObjectStoreExtends = Omit; +export interface IDBPObjectStore[] = StoreNames[], StoreName extends StoreNames = StoreNames> extends IDBPObjectStoreExtends { + /** + * The names of indexes in the store. + */ + readonly indexNames: IndexNames[]; + /** + * The name of the store to newName. Can be set during an upgrade transaction. + */ + name: StoreName; + /** + * The associated transaction. + */ + readonly transaction: IDBPTransaction; + /** + * Add a value to the store. + * + * Rejects if an item of a given key already exists in the store. + */ + add(value: StoreValue, key?: StoreKey | IDBKeyRange): Promise>; + /** + * Deletes all records in store. + */ + clear(): Promise; + /** + * Retrieves the number of records matching the given query. + */ + count(key?: StoreKey | IDBKeyRange): Promise; + /** + * Creates a new index in store. + * + * Throws an "InvalidStateError" DOMException if not called within an upgrade transaction. + */ + createIndex>(name: IndexName, keyPath: string | string[], options?: IDBIndexParameters): IDBPIndex; + /** + * Deletes records in store matching the given query. + */ + delete(key: StoreKey | IDBKeyRange): Promise; + /** + * Retrieves the value of the first record matching the query. + * + * Resolves with undefined if no match is found. + */ + get(query: StoreKey | IDBKeyRange): Promise | undefined>; + /** + * Retrieves all values that match the query. + * + * @param query + * @param count Maximum number of values to return. + */ + getAll(query?: StoreKey | IDBKeyRange, count?: number): Promise[]>; + /** + * Retrieves the keys of records matching the query. + * + * @param query + * @param count Maximum number of keys to return. + */ + getAllKeys(query?: StoreKey | IDBKeyRange, count?: number): Promise[]>; + /** + * Retrieves the key of the first record that matches the query. + * + * Resolves with undefined if no match is found. + */ + getKey(query: StoreKey | IDBKeyRange): Promise | undefined>; + /** + * Get a query of a given name. + */ + index>(name: IndexName): IDBPIndex; + /** + * Opens a cursor over the records matching the query. + * + * Resolves with null if no matches are found. + * + * @param query If null, all records match. + * @param direction + */ + openCursor(query?: StoreKey | IDBKeyRange, direction?: IDBCursorDirection): Promise | null>; + /** + * Opens a cursor over the keys matching the query. + * + * Resolves with null if no matches are found. + * + * @param query If null, all records match. + * @param direction + */ + openKeyCursor(query?: StoreKey | IDBKeyRange, direction?: IDBCursorDirection): Promise | null>; + /** + * Put an item in the store. + * + * Replaces any item with the same key. + */ + put(value: StoreValue, key?: StoreKey | IDBKeyRange): Promise>; + /** + * Iterate over the store. + */ + [Symbol.asyncIterator](): AsyncIterableIterator>; + /** + * Iterate over the records matching the query. + * + * @param query If null, all records match. + * @param direction + */ + iterate(query?: StoreKey | IDBKeyRange, direction?: IDBCursorDirection): AsyncIterableIterator>; +} +declare type IDBPIndexExtends = Omit; +export interface IDBPIndex[] = StoreNames[], StoreName extends StoreNames = StoreNames, IndexName extends IndexNames = IndexNames> extends IDBPIndexExtends { + /** + * The IDBObjectStore the index belongs to. + */ + readonly objectStore: IDBPObjectStore; + /** + * Retrieves the number of records matching the given query. + */ + count(key?: IndexKey | IDBKeyRange): Promise; + /** + * Retrieves the value of the first record matching the query. + * + * Resolves with undefined if no match is found. + */ + get(query: IndexKey | IDBKeyRange): Promise | undefined>; + /** + * Retrieves all values that match the query. + * + * @param query + * @param count Maximum number of values to return. + */ + getAll(query?: IndexKey | IDBKeyRange, count?: number): Promise[]>; + /** + * Retrieves the keys of records matching the query. + * + * @param query + * @param count Maximum number of keys to return. + */ + getAllKeys(query?: IndexKey | IDBKeyRange, count?: number): Promise[]>; + /** + * Retrieves the key of the first record that matches the query. + * + * Resolves with undefined if no match is found. + */ + getKey(query: IndexKey | IDBKeyRange): Promise | undefined>; + /** + * Opens a cursor over the records matching the query. + * + * Resolves with null if no matches are found. + * + * @param query If null, all records match. + * @param direction + */ + openCursor(query?: IndexKey | IDBKeyRange, direction?: IDBCursorDirection): Promise | null>; + /** + * Opens a cursor over the keys matching the query. + * + * Resolves with null if no matches are found. + * + * @param query If null, all records match. + * @param direction + */ + openKeyCursor(query?: IndexKey | IDBKeyRange, direction?: IDBCursorDirection): Promise | null>; + /** + * Iterate over the index. + */ + [Symbol.asyncIterator](): AsyncIterableIterator>; + /** + * Iterate over the records matching the query. + * + * Resolves with null if no matches are found. + * + * @param query If null, all records match. + * @param direction + */ + iterate(query?: IndexKey | IDBKeyRange, direction?: IDBCursorDirection): AsyncIterableIterator>; +} +declare type IDBPCursorExtends = Omit; +export interface IDBPCursor[] = StoreNames[], StoreName extends StoreNames = StoreNames, IndexName extends IndexNames | unknown = unknown> extends IDBPCursorExtends { + /** + * The key of the current index or object store item. + */ + readonly key: CursorKey; + /** + * The key of the current object store item. + */ + readonly primaryKey: StoreKey; + /** + * Returns the IDBObjectStore or IDBIndex the cursor was opened from. + */ + readonly source: CursorSource; + /** + * Advances the cursor a given number of records. + * + * Resolves to null if no matching records remain. + */ + advance(this: T, count: number): Promise; + /** + * Advance the cursor by one record (unless 'key' is provided). + * + * Resolves to null if no matching records remain. + * + * @param key Advance to the index or object store with a key equal to or greater than this value. + */ + continue(this: T, key?: CursorKey): Promise; + /** + * Advance the cursor by given keys. + * + * The operation is 'and' – both keys must be satisfied. + * + * Resolves to null if no matching records remain. + * + * @param key Advance to the index or object store with a key equal to or greater than this value. + * @param primaryKey and where the object store has a key equal to or greater than this value. + */ + continuePrimaryKey(this: T, key: CursorKey, primaryKey: StoreKey): Promise; + /** + * Delete the current record. + */ + delete(): Promise; + /** + * Updated the current record. + */ + update(value: StoreValue): Promise>; + /** + * Iterate over the cursor. + */ + [Symbol.asyncIterator](): AsyncIterableIterator>; +} +declare type IDBPCursorIteratorValueExtends[] = StoreNames[], StoreName extends StoreNames = StoreNames, IndexName extends IndexNames | unknown = unknown> = Omit, 'advance' | 'continue' | 'continuePrimaryKey'>; +export interface IDBPCursorIteratorValue[] = StoreNames[], StoreName extends StoreNames = StoreNames, IndexName extends IndexNames | unknown = unknown> extends IDBPCursorIteratorValueExtends { + /** + * Advances the cursor a given number of records. + */ + advance(this: T, count: number): void; + /** + * Advance the cursor by one record (unless 'key' is provided). + * + * @param key Advance to the index or object store with a key equal to or greater than this value. + */ + continue(this: T, key?: CursorKey): void; + /** + * Advance the cursor by given keys. + * + * The operation is 'and' – both keys must be satisfied. + * + * @param key Advance to the index or object store with a key equal to or greater than this value. + * @param primaryKey and where the object store has a key equal to or greater than this value. + */ + continuePrimaryKey(this: T, key: CursorKey, primaryKey: StoreKey): void; +} +export interface IDBPCursorWithValue[] = StoreNames[], StoreName extends StoreNames = StoreNames, IndexName extends IndexNames | unknown = unknown> extends IDBPCursor { + /** + * The value of the current item. + */ + readonly value: StoreValue; + /** + * Iterate over the cursor. + */ + [Symbol.asyncIterator](): AsyncIterableIterator>; +} +declare type IDBPCursorWithValueIteratorValueExtends[] = StoreNames[], StoreName extends StoreNames = StoreNames, IndexName extends IndexNames | unknown = unknown> = Omit, 'advance' | 'continue' | 'continuePrimaryKey'>; +export interface IDBPCursorWithValueIteratorValue[] = StoreNames[], StoreName extends StoreNames = StoreNames, IndexName extends IndexNames | unknown = unknown> extends IDBPCursorWithValueIteratorValueExtends { + /** + * Advances the cursor a given number of records. + */ + advance(this: T, count: number): void; + /** + * Advance the cursor by one record (unless 'key' is provided). + * + * @param key Advance to the index or object store with a key equal to or greater than this value. + */ + continue(this: T, key?: CursorKey): void; + /** + * Advance the cursor by given keys. + * + * The operation is 'and' – both keys must be satisfied. + * + * @param key Advance to the index or object store with a key equal to or greater than this value. + * @param primaryKey and where the object store has a key equal to or greater than this value. + */ + continuePrimaryKey(this: T, key: CursorKey, primaryKey: StoreKey): void; +} +//# sourceMappingURL=entry.d.ts.map \ No newline at end of file diff --git a/build/cjs/entry.d.ts.map b/build/cjs/entry.d.ts.map new file mode 100644 index 0000000..2b5791e --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3D,SAAS,SAAS,UAAU,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,OAAO,GAAG,OAAO,CAEpE,SAAQ,uCAAuC,CAC7C,OAAO,EACP,QAAQ,EACR,SAAS,EACT,SAAS,CACV;IACD;;OAEG;IACH,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC;;;;OAIG;IACH,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,SAAS,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC,GAAG,IAAI,CAAC;IAC3E;;;;;;;OAOG;IACH,kBAAkB,CAAC,CAAC,EAClB,IAAI,EAAE,CAAC,EACP,GAAG,EAAE,SAAS,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC,EAC7C,UAAU,EAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,GACvC,IAAI,CAAC;CACT"} \ No newline at end of file diff --git a/build/cjs/entry.js.map b/build/cjs/entry.js.map new file mode 100644 index 0000000..9a5e3ca --- /dev/null +++ b/build/cjs/entry.js.map @@ -0,0 +1 @@ +{"version":3,"file":"entry.js","sourceRoot":"","sources":["../../src/entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AA8BxC;;;;;;GAMG;AACH,MAAM,UAAU,MAAM,CACpB,IAAY,EACZ,OAAe,EACf,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,KAA+B,EAAE;IAE7D,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC9C,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAmC,CAAC;IAEpE,IAAI,OAAO,EAAE;QACX,OAAO,CAAC,gBAAgB,CAAC,eAAe,EAAE,KAAK,CAAC,EAAE;YAChD,OAAO,CACL,IAAI,CAAC,OAAO,CAAC,MAAM,CAA0B,EAC7C,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,UAAU,EACf,IAAI,CAAC,OAAO,CAAC,WAAY,CAAyC,CACpE,CAAC;QACJ,CAAC,CAAC,CAAC;KACJ;IAED,IAAI,OAAO;QAAE,OAAO,CAAC,gBAAgB,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;IAClE,IAAI,QAAQ,EAAE;QACZ,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,gBAAgB,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;KACxF;IAED,OAAO,WAAW,CAAC;AACrB,CAAC;AASD;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CACtB,IAAY,EACZ,EAAE,OAAO,KAAwB,EAAE;IAEnC,MAAM,OAAO,GAAG,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC/C,IAAI,OAAO;QAAE,OAAO,CAAC,gBAAgB,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;IAClE,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;AAC7C,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC"} \ No newline at end of file diff --git a/build/cjs/index.d.ts b/build/cjs/index.d.ts new file mode 100644 index 0000000..1eca822 --- /dev/null +++ b/build/cjs/index.d.ts @@ -0,0 +1,3 @@ +export * from './entry'; +import './database-extras'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/build/cjs/index.d.ts.map b/build/cjs/index.d.ts.map new file mode 100644 index 0000000..e29230f --- /dev/null +++ b/build/cjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,mBAAmB,CAAC"} \ No newline at end of file diff --git a/build/cjs/index.js b/build/cjs/index.js index df9eadc..7db82a1 100644 --- a/build/cjs/index.js +++ b/build/cjs/index.js @@ -2,82 +2,82 @@ Object.defineProperty(exports, '__esModule', { value: true }); -var __chunk_1 = require('./chunk.js'); +var wrapIdbValue = require('./wrap-idb-value.js'); -/** - * Open a database. - * - * @param name Name of the database. - * @param version Schema version. - * @param callbacks Additional callbacks. - */ -function openDB(name, version, { blocked, upgrade, blocking } = {}) { - const request = indexedDB.open(name, version); - const openPromise = __chunk_1.wrap(request); - if (upgrade) { - request.addEventListener('upgradeneeded', event => { - upgrade(__chunk_1.wrap(request.result), event.oldVersion, event.newVersion, __chunk_1.wrap(request.transaction)); - }); - } - if (blocked) - request.addEventListener('blocked', () => blocked()); - if (blocking) { - openPromise.then(db => db.addEventListener('versionchange', blocking)).catch(() => { }); - } - return openPromise; -} -/** - * Delete a database. - * - * @param name Name of the database. - */ -function deleteDB(name, { blocked } = {}) { - const request = indexedDB.deleteDatabase(name); - if (blocked) - request.addEventListener('blocked', () => blocked()); - return __chunk_1.wrap(request).then(() => undefined); +/** + * Open a database. + * + * @param name Name of the database. + * @param version Schema version. + * @param callbacks Additional callbacks. + */ +function openDB(name, version, { blocked, upgrade, blocking } = {}) { + const request = indexedDB.open(name, version); + const openPromise = wrapIdbValue.wrap(request); + if (upgrade) { + request.addEventListener('upgradeneeded', event => { + upgrade(wrapIdbValue.wrap(request.result), event.oldVersion, event.newVersion, wrapIdbValue.wrap(request.transaction)); + }); + } + if (blocked) + request.addEventListener('blocked', () => blocked()); + if (blocking) { + openPromise.then(db => db.addEventListener('versionchange', blocking)).catch(() => { }); + } + return openPromise; +} +/** + * Delete a database. + * + * @param name Name of the database. + */ +function deleteDB(name, { blocked } = {}) { + const request = indexedDB.deleteDatabase(name); + if (blocked) + request.addEventListener('blocked', () => blocked()); + return wrapIdbValue.wrap(request).then(() => undefined); } -const readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count']; -const writeMethods = ['put', 'add', 'delete', 'clear']; -const cachedMethods = new Map(); -function getMethod(target, prop) { - if (!(target instanceof IDBDatabase && - !(prop in target) && - typeof prop === 'string')) { - return; - } - if (cachedMethods.get(prop)) - return cachedMethods.get(prop); - const targetFuncName = prop.replace(/FromIndex$/, ''); - const useIndex = prop !== targetFuncName; - const isWrite = writeMethods.includes(targetFuncName); - if ( - // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge. - !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) || - !(isWrite || readMethods.includes(targetFuncName))) { - return; - } - const method = async function (storeName, ...args) { - // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :( - const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly'); - let target = tx.store; - if (useIndex) - target = target.index(args.shift()); - const returnVal = target[targetFuncName](...args); - if (isWrite) - await tx.done; - return returnVal; - }; - cachedMethods.set(prop, method); - return method; -} -__chunk_1.addTraps(oldTraps => ({ - get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver), - has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop), +const readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count']; +const writeMethods = ['put', 'add', 'delete', 'clear']; +const cachedMethods = new Map(); +function getMethod(target, prop) { + if (!(target instanceof IDBDatabase && + !(prop in target) && + typeof prop === 'string')) { + return; + } + if (cachedMethods.get(prop)) + return cachedMethods.get(prop); + const targetFuncName = prop.replace(/FromIndex$/, ''); + const useIndex = prop !== targetFuncName; + const isWrite = writeMethods.includes(targetFuncName); + if ( + // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge. + !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) || + !(isWrite || readMethods.includes(targetFuncName))) { + return; + } + const method = async function (storeName, ...args) { + // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :( + const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly'); + let target = tx.store; + if (useIndex) + target = target.index(args.shift()); + const returnVal = target[targetFuncName](...args); + if (isWrite) + await tx.done; + return returnVal; + }; + cachedMethods.set(prop, method); + return method; +} +wrapIdbValue.addTraps(oldTraps => ({ + get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver), + has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop), })); -exports.unwrap = __chunk_1.unwrap; -exports.wrap = __chunk_1.wrap; -exports.openDB = openDB; +exports.unwrap = wrapIdbValue.unwrap; +exports.wrap = wrapIdbValue.wrap; exports.deleteDB = deleteDB; +exports.openDB = openDB; diff --git a/build/cjs/index.js.map b/build/cjs/index.js.map new file mode 100644 index 0000000..0322a8f --- /dev/null +++ b/build/cjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,mBAAmB,CAAC"} \ No newline at end of file diff --git a/build/cjs/util.d.ts b/build/cjs/util.d.ts new file mode 100644 index 0000000..56873e7 --- /dev/null +++ b/build/cjs/util.d.ts @@ -0,0 +1,4 @@ +export declare type Constructor = new (...args: any[]) => any; +export declare type Func = (...args: any[]) => any; +export declare const instanceOfAny: (object: any, constructors: Constructor[]) => boolean; +//# sourceMappingURL=util.d.ts.map \ No newline at end of file diff --git a/build/cjs/util.d.ts.map b/build/cjs/util.d.ts.map new file mode 100644 index 0000000..a84b6b7 --- /dev/null +++ b/build/cjs/util.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW,GAAG,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AACtD,oBAAY,IAAI,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAE3C,eAAO,MAAM,aAAa,uDAG+B,CAAC"} \ No newline at end of file diff --git a/build/cjs/util.js.map b/build/cjs/util.js.map new file mode 100644 index 0000000..ffab84f --- /dev/null +++ b/build/cjs/util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,MAAW,EACX,YAA2B,EAClB,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,YAAY,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/build/cjs/wrap-idb-value.d.ts b/build/cjs/wrap-idb-value.d.ts new file mode 100644 index 0000000..5d1194d --- /dev/null +++ b/build/cjs/wrap-idb-value.d.ts @@ -0,0 +1,35 @@ +import { IDBPCursor, IDBPCursorWithValue, IDBPDatabase, IDBPIndex, IDBPObjectStore, IDBPTransaction } from './entry'; +export declare const reverseTransformCache: WeakMap; +export declare function addTraps(callback: (currentTraps: ProxyHandler) => ProxyHandler): void; +/** + * Enhance an IDB object with helpers. + * + * @param value The thing to enhance. + */ +export declare function wrap(value: IDBDatabase): IDBPDatabase; +export declare function wrap(value: IDBIndex): IDBPIndex; +export declare function wrap(value: IDBObjectStore): IDBPObjectStore; +export declare function wrap(value: IDBTransaction): IDBPTransaction; +export declare function wrap(value: IDBOpenDBRequest): Promise; +export declare function wrap(value: IDBRequest): Promise; +/** + * Revert an enhanced IDB object to a plain old miserable IDB one. + * + * Will also revert a promise back to an IDBRequest. + * + * @param value The enhanced object to revert. + */ +interface Unwrap { + (value: IDBPCursorWithValue): IDBCursorWithValue; + (value: IDBPCursor): IDBCursor; + (value: IDBPDatabase): IDBDatabase; + (value: IDBPIndex): IDBIndex; + (value: IDBPObjectStore): IDBObjectStore; + (value: IDBPTransaction): IDBTransaction; + (value: Promise>): IDBOpenDBRequest; + (value: Promise): IDBOpenDBRequest; + (value: Promise): IDBRequest; +} +export declare const unwrap: Unwrap; +export {}; +//# sourceMappingURL=wrap-idb-value.d.ts.map \ No newline at end of file diff --git a/build/cjs/wrap-idb-value.d.ts.map b/build/cjs/wrap-idb-value.d.ts.map new file mode 100644 index 0000000..b7abd4a --- /dev/null +++ b/build/cjs/wrap-idb-value.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"wrap-idb-value.d.ts","sourceRoot":"","sources":["../../src/wrap-idb-value.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,eAAe,EACf,eAAe,EAChB,MAAM,SAAS,CAAC;AA6CjB,eAAO,MAAM,qBAAqB,sBAAgB,CAAC;AAiGnD,wBAAgB,QAAQ,CACtB,QAAQ,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC,GAAG,CAAC,KAAK,YAAY,CAAC,GAAG,CAAC,GAC/D,IAAI,CAEN;AA4DD;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,WAAW,GAAG,YAAY,CAAC;AACvD,wBAAgB,IAAI,CAAC,KAAK,EAAE,QAAQ,GAAG,SAAS,CAAC;AACjD,wBAAgB,IAAI,CAAC,KAAK,EAAE,cAAc,GAAG,eAAe,CAAC;AAC7D,wBAAgB,IAAI,CAAC,KAAK,EAAE,cAAc,GAAG,eAAe,CAAC;AAC7D,wBAAgB,IAAI,CAClB,KAAK,EAAE,gBAAgB,GACtB,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAAC;AACrC,wBAAgB,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAqB1D;;;;;;GAMG;AACH,UAAU,MAAM;IACd,CAAC,KAAK,EAAE,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,kBAAkB,CAAC;IACrE,CAAC,KAAK,EAAE,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC;IACnD,CAAC,KAAK,EAAE,YAAY,GAAG,WAAW,CAAC;IACnC,CAAC,KAAK,EAAE,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,QAAQ,CAAC;IACjD,CAAC,KAAK,EAAE,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,cAAc,CAAC;IACxD,CAAC,KAAK,EAAE,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,cAAc,CAAC;IACnD,CAAC,CAAC,SAAS,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC;IACnE,CAAC,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,gBAAgB,CAAC;IACjD,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;CACvC;AACD,eAAO,MAAM,MAAM,EAAE,MACa,CAAC"} \ No newline at end of file diff --git a/build/cjs/chunk.js b/build/cjs/wrap-idb-value.js similarity index 97% rename from build/cjs/chunk.js rename to build/cjs/wrap-idb-value.js index b88dade..ce607c5 100644 --- a/build/cjs/chunk.js +++ b/build/cjs/wrap-idb-value.js @@ -2,186 +2,186 @@ const instanceOfAny = (object, constructors) => constructors.some(c => object instanceof c); -let idbProxyableTypes; -let cursorAdvanceMethods; -// This is a function to prevent it throwing up in node environments. -function getIdbProxyableTypes() { - return (idbProxyableTypes || - (idbProxyableTypes = [ - IDBDatabase, - IDBObjectStore, - IDBIndex, - IDBCursor, - IDBTransaction, - ])); -} -// This is a function to prevent it throwing up in node environments. -function getCursorAdvanceMethods() { - return (cursorAdvanceMethods || - (cursorAdvanceMethods = [ - IDBCursor.prototype.advance, - IDBCursor.prototype.continue, - IDBCursor.prototype.continuePrimaryKey, - ])); -} -const cursorRequestMap = new WeakMap(); -const transactionDoneMap = new WeakMap(); -const transactionStoreNamesMap = new WeakMap(); -const transformCache = new WeakMap(); -const reverseTransformCache = new WeakMap(); -function promisifyRequest(request) { - const promise = new Promise((resolve, reject) => { - const unlisten = () => { - request.removeEventListener('success', success); - request.removeEventListener('error', error); - }; - const success = () => { - resolve(wrap(request.result)); - unlisten(); - }; - const error = () => { - reject(request.error); - unlisten(); - }; - request.addEventListener('success', success); - request.addEventListener('error', error); - }); - promise - .then(value => { - // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval - // (see wrapFunction). - if (value instanceof IDBCursor) { - cursorRequestMap.set(value, request); - } - // Catching to avoid "Uncaught Promise exceptions" - }) - .catch(() => { }); - // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This - // is because we create many promises from a single IDBRequest. - reverseTransformCache.set(promise, request); - return promise; -} -function cacheDonePromiseForTransaction(tx) { - // Early bail if we've already created a done promise for this transaction. - if (transactionDoneMap.has(tx)) - return; - const done = new Promise((resolve, reject) => { - const unlisten = () => { - tx.removeEventListener('complete', complete); - tx.removeEventListener('error', error); - tx.removeEventListener('abort', error); - }; - const complete = () => { - resolve(); - unlisten(); - }; - const error = () => { - reject(tx.error); - unlisten(); - }; - tx.addEventListener('complete', complete); - tx.addEventListener('error', error); - tx.addEventListener('abort', error); - }); - // Cache it for later retrieval. - transactionDoneMap.set(tx, done); -} -let idbProxyTraps = { - get(target, prop, receiver) { - if (target instanceof IDBTransaction) { - // Special handling for transaction.done. - if (prop === 'done') - return transactionDoneMap.get(target); - // Polyfill for objectStoreNames because of Edge. - if (prop === 'objectStoreNames') { - return target.objectStoreNames || transactionStoreNamesMap.get(target); - } - // Make tx.store return the only store in the transaction, or undefined if there are many. - if (prop === 'store') { - return receiver.objectStoreNames[1] - ? undefined - : receiver.objectStore(receiver.objectStoreNames[0]); - } - } - // Else transform whatever we get back. - return wrap(target[prop]); - }, - has(target, prop) { - if (target instanceof IDBTransaction && - (prop === 'done' || prop === 'store')) { - return true; - } - return prop in target; - }, -}; -function addTraps(callback) { - idbProxyTraps = callback(idbProxyTraps); -} -function wrapFunction(func) { - // Due to expected object equality (which is enforced by the caching in `wrap`), we - // only create one new func per func. - // Edge doesn't support objectStoreNames (booo), so we polyfill it here. - if (func === IDBDatabase.prototype.transaction && - !('objectStoreNames' in IDBTransaction.prototype)) { - return function (storeNames, ...args) { - const tx = func.call(unwrap(this), storeNames, ...args); - transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]); - return wrap(tx); - }; - } - // Cursor methods are special, as the behaviour is a little more different to standard IDB. In - // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the - // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense - // with real promises, so each advance methods returns a new promise for the cursor object, or - // undefined if the end of the cursor has been reached. - if (getCursorAdvanceMethods().includes(func)) { - return function (...args) { - // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use - // the original object. - func.apply(unwrap(this), args); - return wrap(cursorRequestMap.get(this)); - }; - } - return function (...args) { - // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use - // the original object. - return wrap(func.apply(unwrap(this), args)); - }; -} -function transformCachableValue(value) { - if (typeof value === 'function') - return wrapFunction(value); - // This doesn't return, it just creates a 'done' promise for the transaction, - // which is later returned for transaction.done (see idbObjectHandler). - if (value instanceof IDBTransaction) - cacheDonePromiseForTransaction(value); - if (instanceOfAny(value, getIdbProxyableTypes())) - return new Proxy(value, idbProxyTraps); - // Return the same value back if we're not going to transform it. - return value; -} -function wrap(value) { - // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because - // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached. - if (value instanceof IDBRequest) - return promisifyRequest(value); - // If we've already transformed this value before, reuse the transformed value. - // This is faster, but it also provides object equality. - if (transformCache.has(value)) - return transformCache.get(value); - const newValue = transformCachableValue(value); - // Not all types are transformed. - // These may be primitive types, so they can't be WeakMap keys. - if (newValue !== value) { - transformCache.set(value, newValue); - reverseTransformCache.set(newValue, value); - } - return newValue; -} +let idbProxyableTypes; +let cursorAdvanceMethods; +// This is a function to prevent it throwing up in node environments. +function getIdbProxyableTypes() { + return (idbProxyableTypes || + (idbProxyableTypes = [ + IDBDatabase, + IDBObjectStore, + IDBIndex, + IDBCursor, + IDBTransaction, + ])); +} +// This is a function to prevent it throwing up in node environments. +function getCursorAdvanceMethods() { + return (cursorAdvanceMethods || + (cursorAdvanceMethods = [ + IDBCursor.prototype.advance, + IDBCursor.prototype.continue, + IDBCursor.prototype.continuePrimaryKey, + ])); +} +const cursorRequestMap = new WeakMap(); +const transactionDoneMap = new WeakMap(); +const transactionStoreNamesMap = new WeakMap(); +const transformCache = new WeakMap(); +const reverseTransformCache = new WeakMap(); +function promisifyRequest(request) { + const promise = new Promise((resolve, reject) => { + const unlisten = () => { + request.removeEventListener('success', success); + request.removeEventListener('error', error); + }; + const success = () => { + resolve(wrap(request.result)); + unlisten(); + }; + const error = () => { + reject(request.error); + unlisten(); + }; + request.addEventListener('success', success); + request.addEventListener('error', error); + }); + promise + .then(value => { + // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval + // (see wrapFunction). + if (value instanceof IDBCursor) { + cursorRequestMap.set(value, request); + } + // Catching to avoid "Uncaught Promise exceptions" + }) + .catch(() => { }); + // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This + // is because we create many promises from a single IDBRequest. + reverseTransformCache.set(promise, request); + return promise; +} +function cacheDonePromiseForTransaction(tx) { + // Early bail if we've already created a done promise for this transaction. + if (transactionDoneMap.has(tx)) + return; + const done = new Promise((resolve, reject) => { + const unlisten = () => { + tx.removeEventListener('complete', complete); + tx.removeEventListener('error', error); + tx.removeEventListener('abort', error); + }; + const complete = () => { + resolve(); + unlisten(); + }; + const error = () => { + reject(tx.error); + unlisten(); + }; + tx.addEventListener('complete', complete); + tx.addEventListener('error', error); + tx.addEventListener('abort', error); + }); + // Cache it for later retrieval. + transactionDoneMap.set(tx, done); +} +let idbProxyTraps = { + get(target, prop, receiver) { + if (target instanceof IDBTransaction) { + // Special handling for transaction.done. + if (prop === 'done') + return transactionDoneMap.get(target); + // Polyfill for objectStoreNames because of Edge. + if (prop === 'objectStoreNames') { + return target.objectStoreNames || transactionStoreNamesMap.get(target); + } + // Make tx.store return the only store in the transaction, or undefined if there are many. + if (prop === 'store') { + return receiver.objectStoreNames[1] + ? undefined + : receiver.objectStore(receiver.objectStoreNames[0]); + } + } + // Else transform whatever we get back. + return wrap(target[prop]); + }, + has(target, prop) { + if (target instanceof IDBTransaction && + (prop === 'done' || prop === 'store')) { + return true; + } + return prop in target; + }, +}; +function addTraps(callback) { + idbProxyTraps = callback(idbProxyTraps); +} +function wrapFunction(func) { + // Due to expected object equality (which is enforced by the caching in `wrap`), we + // only create one new func per func. + // Edge doesn't support objectStoreNames (booo), so we polyfill it here. + if (func === IDBDatabase.prototype.transaction && + !('objectStoreNames' in IDBTransaction.prototype)) { + return function (storeNames, ...args) { + const tx = func.call(unwrap(this), storeNames, ...args); + transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]); + return wrap(tx); + }; + } + // Cursor methods are special, as the behaviour is a little more different to standard IDB. In + // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the + // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense + // with real promises, so each advance methods returns a new promise for the cursor object, or + // undefined if the end of the cursor has been reached. + if (getCursorAdvanceMethods().includes(func)) { + return function (...args) { + // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use + // the original object. + func.apply(unwrap(this), args); + return wrap(cursorRequestMap.get(this)); + }; + } + return function (...args) { + // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use + // the original object. + return wrap(func.apply(unwrap(this), args)); + }; +} +function transformCachableValue(value) { + if (typeof value === 'function') + return wrapFunction(value); + // This doesn't return, it just creates a 'done' promise for the transaction, + // which is later returned for transaction.done (see idbObjectHandler). + if (value instanceof IDBTransaction) + cacheDonePromiseForTransaction(value); + if (instanceOfAny(value, getIdbProxyableTypes())) + return new Proxy(value, idbProxyTraps); + // Return the same value back if we're not going to transform it. + return value; +} +function wrap(value) { + // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because + // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached. + if (value instanceof IDBRequest) + return promisifyRequest(value); + // If we've already transformed this value before, reuse the transformed value. + // This is faster, but it also provides object equality. + if (transformCache.has(value)) + return transformCache.get(value); + const newValue = transformCachableValue(value); + // Not all types are transformed. + // These may be primitive types, so they can't be WeakMap keys. + if (newValue !== value) { + transformCache.set(value, newValue); + reverseTransformCache.set(newValue, value); + } + return newValue; +} const unwrap = (value) => reverseTransformCache.get(value); -exports.wrap = wrap; exports.addTraps = addTraps; exports.instanceOfAny = instanceOfAny; exports.reverseTransformCache = reverseTransformCache; exports.unwrap = unwrap; +exports.wrap = wrap; diff --git a/build/cjs/wrap-idb-value.js.map b/build/cjs/wrap-idb-value.js.map new file mode 100644 index 0000000..209b4e3 --- /dev/null +++ b/build/cjs/wrap-idb-value.js.map @@ -0,0 +1 @@ +{"version":3,"file":"wrap-idb-value.js","sourceRoot":"","sources":["../../src/wrap-idb-value.ts"],"names":[],"mappings":"AAQA,OAAO,EAAqB,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE1D,IAAI,iBAAgC,CAAC;AACrC,IAAI,oBAA4B,CAAC;AAEjC,qEAAqE;AACrE,SAAS,oBAAoB;IAC3B,OAAO,CACL,iBAAiB;QACjB,CAAC,iBAAiB,GAAG;YACnB,WAAW;YACX,cAAc;YACd,QAAQ;YACR,SAAS;YACT,cAAc;SACf,CAAC,CACH,CAAC;AACJ,CAAC;AAED,qEAAqE;AACrE,SAAS,uBAAuB;IAC9B,OAAO,CACL,oBAAoB;QACpB,CAAC,oBAAoB,GAAG;YACtB,SAAS,CAAC,SAAS,CAAC,OAAO;YAC3B,SAAS,CAA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ACjE,OAAO,KAAK,CAAC;AACf,CAAC;AAeD,MAAM,UAAU,IAAI,CAAC,KAAU;IAC7B,gGAAgG;IAChG,2FAA2F;IAC3F,IAAI,KAAK,YAAY,UAAU;QAAE,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAEhE,+EAA+E;IAC/E,wDAAwD;IACxD,IAAI,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC;QAAE,OAAO,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAChE,MAAM,QAAQ,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAE/C,iCAAiC;IACjC,+DAA+D;IAC/D,IAAI,QAAQ,KAAK,KAAK,EAAE;QACtB,cAAc,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QACpC,qBAAqB,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;KAC5C;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAoBD,MAAM,CAAC,MAAM,MAAM,GAAW,CAAC,KAAU,EAAO,EAAE,CAChD,qBAAqB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC"} \ No newline at end of file diff --git a/build/esm/async-iterators.d.ts b/build/esm/async-iterators.d.ts index 509db18..ebd7e42 100644 --- a/build/esm/async-iterators.d.ts +++ b/build/esm/async-iterators.d.ts @@ -1 +1,2 @@ -export {}; +export {}; +//# sourceMappingURL=async-iterators.d.ts.map \ No newline at end of file diff --git a/build/esm/async-iterators.d.ts.map b/build/esm/async-iterators.d.ts.map new file mode 100644 index 0000000..64ac85b --- /dev/null +++ b/build/esm/async-iterators.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"async-iterators.d.ts","sourceRoot":"","sources":["../../src/async-iterators.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/build/esm/async-iterators.js b/build/esm/async-iterators.js index c4f54f0..4cdf58e 100644 --- a/build/esm/async-iterators.js +++ b/build/esm/async-iterators.js @@ -1,54 +1,54 @@ -import { b as addTraps, c as instanceOfAny, d as reverseTransformCache, e as unwrap } from './chunk.js'; +import { a as addTraps, i as instanceOfAny, r as reverseTransformCache, u as unwrap } from './wrap-idb-value.js'; -const advanceMethodProps = ['continue', 'continuePrimaryKey', 'advance']; -const methodMap = {}; -const advanceResults = new WeakMap(); -const ittrProxiedCursorToOriginalProxy = new WeakMap(); -const cursorIteratorTraps = { - get(target, prop) { - if (!advanceMethodProps.includes(prop)) - return target[prop]; - let cachedFunc = methodMap[prop]; - if (!cachedFunc) { - cachedFunc = methodMap[prop] = function (...args) { - advanceResults.set(this, ittrProxiedCursorToOriginalProxy.get(this)[prop](...args)); - }; - } - return cachedFunc; - }, -}; -async function* iterate(...args) { - // tslint:disable-next-line:no-this-assignment - let cursor = this; - if (!(cursor instanceof IDBCursor)) { - cursor = await cursor.openCursor(...args); - } - if (!cursor) - return; - cursor = cursor; - const proxiedCursor = new Proxy(cursor, cursorIteratorTraps); - ittrProxiedCursorToOriginalProxy.set(proxiedCursor, cursor); - // Map this double-proxy back to the original, so other cursor methods work. - reverseTransformCache.set(proxiedCursor, unwrap(cursor)); - while (cursor) { - yield proxiedCursor; - // If one of the advancing methods was not called, call continue(). - cursor = await (advanceResults.get(proxiedCursor) || cursor.continue()); - advanceResults.delete(proxiedCursor); - } -} -function isIteratorProp(target, prop) { - return ((prop === Symbol.asyncIterator && - instanceOfAny(target, [IDBIndex, IDBObjectStore, IDBCursor])) || - (prop === 'iterate' && instanceOfAny(target, [IDBIndex, IDBObjectStore]))); -} -addTraps(oldTraps => ({ - get(target, prop, receiver) { - if (isIteratorProp(target, prop)) - return iterate; - return oldTraps.get(target, prop, receiver); - }, - has(target, prop) { - return isIteratorProp(target, prop) || oldTraps.has(target, prop); - }, +const advanceMethodProps = ['continue', 'continuePrimaryKey', 'advance']; +const methodMap = {}; +const advanceResults = new WeakMap(); +const ittrProxiedCursorToOriginalProxy = new WeakMap(); +const cursorIteratorTraps = { + get(target, prop) { + if (!advanceMethodProps.includes(prop)) + return target[prop]; + let cachedFunc = methodMap[prop]; + if (!cachedFunc) { + cachedFunc = methodMap[prop] = function (...args) { + advanceResults.set(this, ittrProxiedCursorToOriginalProxy.get(this)[prop](...args)); + }; + } + return cachedFunc; + }, +}; +async function* iterate(...args) { + // tslint:disable-next-line:no-this-assignment + let cursor = this; + if (!(cursor instanceof IDBCursor)) { + cursor = await cursor.openCursor(...args); + } + if (!cursor) + return; + cursor = cursor; + const proxiedCursor = new Proxy(cursor, cursorIteratorTraps); + ittrProxiedCursorToOriginalProxy.set(proxiedCursor, cursor); + // Map this double-proxy back to the original, so other cursor methods work. + reverseTransformCache.set(proxiedCursor, unwrap(cursor)); + while (cursor) { + yield proxiedCursor; + // If one of the advancing methods was not called, call continue(). + cursor = await (advanceResults.get(proxiedCursor) || cursor.continue()); + advanceResults.delete(proxiedCursor); + } +} +function isIteratorProp(target, prop) { + return ((prop === Symbol.asyncIterator && + instanceOfAny(target, [IDBIndex, IDBObjectStore, IDBCursor])) || + (prop === 'iterate' && instanceOfAny(target, [IDBIndex, IDBObjectStore]))); +} +addTraps(oldTraps => ({ + get(target, prop, receiver) { + if (isIteratorProp(target, prop)) + return iterate; + return oldTraps.get(target, prop, receiver); + }, + has(target, prop) { + return isIteratorProp(target, prop) || oldTraps.has(target, prop); + }, })); diff --git a/build/esm/async-iterators.js.map b/build/esm/async-iterators.js.map new file mode 100644 index 0000000..b807e7d --- /dev/null +++ b/build/esm/async-iterators.js.map @@ -0,0 +1 @@ +{"version":3,"file":"async-iterators.js","sourceRoot":"","sources":["../../src/async-iterators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAQ,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG3E,MAAM,kBAAkB,GAAG,CAAC,UAAU,EAAE,oBAAoB,EAAE,SAAS,CAAC,CAAC;AACzE,MAAM,SAAS,GAA0B,EAA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pB,mEAAmE;QACnE,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;QACxE,cAAc,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;KACtC;AACH,CAAC;AAED,SAAS,cAAc,CAAC,MAAW,EAAE,IAA8B;IACjE,OAAO,CACL,CAAC,IAAI,KAAK,MAAM,CAAC,aAAa;QAC5B,aAAa,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,cAAc,EAAE,SAAS,CAAC,CAAC,CAAC;QAC/D,CAAC,IAAI,KAAK,SAAS,IAAI,aAAa,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,CAC1E,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACpB,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ;QACxB,IAAI,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC;YAAE,OAAO,OAAO,CAAC;QACjD,OAAO,QAAQ,CAAC,GAAI,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC/C,CAAC;IACD,GAAG,CAAC,MAAM,EAAE,IAAI;QACd,OAAO,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,QAAQ,CAAC,GAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACrE,CAAC;CACF,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/build/esm/database-extras.d.ts b/build/esm/database-extras.d.ts index 509db18..6717a92 100644 --- a/build/esm/database-extras.d.ts +++ b/build/esm/database-extras.d.ts @@ -1 +1,2 @@ -export {}; +export {}; +//# sourceMappingURL=database-extras.d.ts.map \ No newline at end of file diff --git a/build/esm/database-extras.d.ts.map b/build/esm/database-extras.d.ts.map new file mode 100644 index 0000000..46090d9 --- /dev/null +++ b/build/esm/database-extras.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"database-extras.d.ts","sourceRoot":"","sources":["../../src/database-extras.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/build/esm/database-extras.js.map b/build/esm/database-extras.js.map new file mode 100644 index 0000000..c966bbd --- /dev/null +++ b/build/esm/database-extras.js.map @@ -0,0 +1 @@ +{"version":3,"file":"database-extras.js","sourceRoot":"","sources":["../../src/database-extras.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,MAAM,WAAW,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;AACvE,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AACvD,MAAM,aAAa,GAAG,IAAI,GAAG,EAAgB,CAAC;AAE9C,SAAS,SAAS,CAChB,MAAW,EACX,IAA8B;IAE9B,IACE,CAAC,CACC,MAAM,YAAY,WAAW;QAC7B,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC;QACjB,OAAO,IAAI,KAAK,QAAQ,CACzB,EACD;QACA,OAAO;KACR;IAED,IAAI,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC;QAAE,OAAO,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAE5D,MAAM,cAAc,GAAW,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;IAC9D,MAAM,QAAQ,GAAG,IAAI,KAAK,cAAc,CAAC;IACzC,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IAEtD;IACE,4EAA4E;IAC5E,CAAC,CAAC,cAAc,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC;QACrE,CAAC,CAAC,OAAO,IAAI,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,EAClD;QACA,OAAO;KACR;IAED,MAAM,MAAM,GAAG,KAAK,WAElB,SAAiB,EACjB,GAAG,IAAW;QAEd,wEAAwE;QACxE,MAAM,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;QAC3E,IAAI,MAAM,GAAgC,EAAE,CAAC,KAAK,CAAC;QACnD,IAAI,QAAQ;YAAE,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QAClD,MAAM,SAAS,GAAI,MAAc,CAAC,cAAc,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;QAC3D,IAAI,OAAO;YAAE,MAAM,EAAE,CAAC,IAAI,CAAC;QAC3B,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;IAEF,aAAa,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAChC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACpB,GAAG,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,CAC9B,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,QAAQ,CAAC,GAAI,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC;IAClE,GAAG,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CACpB,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,QAAQ,CAAC,GAAI,CAAC,MAAM,EAAE,IAAI,CAAC;CAC3D,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/build/esm/entry.d.ts b/build/esm/entry.d.ts index fc50c87..e9a2068 100644 --- a/build/esm/entry.d.ts +++ b/build/esm/entry.d.ts @@ -1,596 +1,597 @@ -export interface OpenDBCallbacks { - /** - * Called if this version of the database has never been opened before. Use it to specify the - * schema for the database. - * - * @param database A database instance that you can use to add/remove stores and indexes. - * @param oldVersion Last version of the database opened by the user. - * @param newVersion Whatever new version you provided. - * @param transaction The transaction for this upgrade. This is useful if you need to get data - * from other stores as part of a migration. - */ - upgrade?(database: IDBPDatabase, oldVersion: number, newVersion: number | null, transaction: IDBPTransaction): void; - /** - * Called if there are older versions of the database open on the origin, so this version cannot - * open. - */ - blocked?(): void; - /** - * Called if this connection is blocking a future version of the database from opening. - */ - blocking?(): void; -} -/** - * Open a database. - * - * @param name Name of the database. - * @param version Schema version. - * @param callbacks Additional callbacks. - */ -export declare function openDB(name: string, version: number, { blocked, upgrade, blocking }?: OpenDBCallbacks): Promise>; -export interface DeleteDBCallbacks { - /** - * Called if there are connections to this database open, so it cannot be deleted. - */ - blocked?(): void; -} -/** - * Delete a database. - * - * @param name Name of the database. - */ -export declare function deleteDB(name: string, { blocked }?: DeleteDBCallbacks): Promise; -export { unwrap, wrap } from './wrap-idb-value'; -declare type KnownKeys = { - [K in keyof T]: string extends K ? never : number extends K ? never : K; -} extends { - [_ in keyof T]: infer U; -} ? U : never; -declare type Omit = Pick>; -export interface DBSchema { - [s: string]: DBSchemaValue; -} -interface IndexKeys { - [s: string]: IDBValidKey; -} -interface DBSchemaValue { - key: IDBValidKey; - value: any; - indexes?: IndexKeys; -} -/** - * Extract known object store names from the DB schema type. - * - * @template DBTypes DB schema type, or unknown if the DB isn't typed. - */ -export declare type StoreNames = DBTypes extends DBSchema ? KnownKeys : string; -/** - * Extract database value types from the DB schema type. - * - * @template DBTypes DB schema type, or unknown if the DB isn't typed. - * @template StoreName Names of the object stores to get the types of. - */ -export declare type StoreValue> = DBTypes extends DBSchema ? DBTypes[StoreName]['value'] : any; -/** - * Extract database key types from the DB schema type. - * - * @template DBTypes DB schema type, or unknown if the DB isn't typed. - * @template StoreName Names of the object stores to get the types of. - */ -export declare type StoreKey> = DBTypes extends DBSchema ? DBTypes[StoreName]['key'] : IDBValidKey; -/** - * Extract the names of indexes in certain object stores from the DB schema type. - * - * @template DBTypes DB schema type, or unknown if the DB isn't typed. - * @template StoreName Names of the object stores to get the types of. - */ -export declare type IndexNames> = DBTypes extends DBSchema ? keyof DBTypes[StoreName]['indexes'] : string; -/** - * Extract the types of indexes in certain object stores from the DB schema type. - * - * @template DBTypes DB schema type, or unknown if the DB isn't typed. - * @template StoreName Names of the object stores to get the types of. - * @template IndexName Names of the indexes to get the types of. - */ -export declare type IndexKey, IndexName extends IndexNames> = DBTypes extends DBSchema ? IndexName extends keyof DBTypes[StoreName]['indexes'] ? DBTypes[StoreName]['indexes'][IndexName] : IDBValidKey : IDBValidKey; -declare type CursorSource[], StoreName extends StoreNames, IndexName extends IndexNames | unknown> = IndexName extends IndexNames ? IDBPIndex : IDBPObjectStore; -declare type CursorKey, IndexName extends IndexNames | unknown> = IndexName extends IndexNames ? IndexKey : StoreKey; -declare type IDBPDatabaseExtends = Omit; -/** - * A variation of DOMStringList with precise string types - */ -export interface TypedDOMStringList extends DOMStringList { - contains(string: T): boolean; - item(index: number): T | null; - [index: number]: T; - [Symbol.iterator](): IterableIterator; -} -export interface IDBPDatabase extends IDBPDatabaseExtends { - /** - * The names of stores in the database. - */ - readonly objectStoreNames: TypedDOMStringList>; - /** - * Creates a new object store. - * - * Throws a "InvalidStateError" DOMException if not called within an upgrade transaction. - */ - createObjectStore>(name: Name, optionalParameters?: IDBObjectStoreParameters): IDBPObjectStore[], Name>; - /** - * Deletes the object store with the given name. - * - * Throws a "InvalidStateError" DOMException if not called within an upgrade transaction. - */ - deleteObjectStore(name: StoreNames): void; - /** - * Start a new transaction. - * - * @param storeNames The object store(s) this transaction needs. - * @param mode - */ - transaction>(storeNames: Name, mode?: IDBTransactionMode): IDBPTransaction; - transaction[]>(storeNames: Names, mode?: IDBTransactionMode): IDBPTransaction; - /** - * Add a value to a store. - * - * Rejects if an item of a given key already exists in the store. - * - * This is a shortcut that creates a transaction for this single action. If you need to do more - * than one action, create a transaction instead. - * - * @param storeName Name of the store. - * @param value - * @param key - */ - add>(storeName: Name, value: StoreValue, key?: StoreKey | IDBKeyRange): Promise>; - /** - * Deletes all records in a store. - * - * This is a shortcut that creates a transaction for this single action. If you need to do more - * than one action, create a transaction instead. - * - * @param storeName Name of the store. - */ - clear(name: StoreNames): Promise; - /** - * Retrieves the number of records matching the given query in a store. - * - * This is a shortcut that creates a transaction for this single action. If you need to do more - * than one action, create a transaction instead. - * - * @param storeName Name of the store. - * @param key - */ - count>(storeName: Name, key?: StoreKey | IDBKeyRange): Promise; - /** - * Retrieves the number of records matching the given query in an index. - * - * This is a shortcut that creates a transaction for this single action. If you need to do more - * than one action, create a transaction instead. - * - * @param storeName Name of the store. - * @param indexName Name of the index within the store. - * @param key - */ - countFromIndex, IndexName extends IndexNames>(storeName: Name, indexName: IndexName, key?: IndexKey | IDBKeyRange): Promise; - /** - * Deletes records in a store matching the given query. - * - * This is a shortcut that creates a transaction for this single action. If you need to do more - * than one action, create a transaction instead. - * - * @param storeName Name of the store. - * @param key - */ - delete>(storeName: Name, key: StoreKey | IDBKeyRange): Promise; - /** - * Retrieves the value of the first record in a store matching the query. - * - * Resolves with undefined if no match is found. - * - * This is a shortcut that creates a transaction for this single action. If you need to do more - * than one action, create a transaction instead. - * - * @param storeName Name of the store. - * @param query - */ - get>(storeName: Name, query: StoreKey | IDBKeyRange): Promise | undefined>; - /** - * Retrieves the value of the first record in an index matching the query. - * - * Resolves with undefined if no match is found. - * - * This is a shortcut that creates a transaction for this single action. If you need to do more - * than one action, create a transaction instead. - * - * @param storeName Name of the store. - * @param indexName Name of the index within the store. - * @param query - */ - getFromIndex, IndexName extends IndexNames>(storeName: Name, indexName: IndexName, query: IndexKey | IDBKeyRange): Promise | undefined>; - /** - * Retrieves all values in a store that match the query. - * - * This is a shortcut that creates a transaction for this single action. If you need to do more - * than one action, create a transaction instead. - * - * @param storeName Name of the store. - * @param query - * @param count Maximum number of values to return. - */ - getAll>(storeName: Name, query?: StoreKey | IDBKeyRange, count?: number): Promise[]>; - /** - * Retrieves all values in an index that match the query. - * - * This is a shortcut that creates a transaction for this single action. If you need to do more - * than one action, create a transaction instead. - * - * @param storeName Name of the store. - * @param indexName Name of the index within the store. - * @param query - * @param count Maximum number of values to return. - */ - getAllFromIndex, IndexName extends IndexNames>(storeName: Name, indexName: IndexName, query?: IndexKey | IDBKeyRange, count?: number): Promise[]>; - /** - * Retrieves the keys of records in a store matching the query. - * - * This is a shortcut that creates a transaction for this single action. If you need to do more - * than one action, create a transaction instead. - * - * @param storeName Name of the store. - * @param query - * @param count Maximum number of keys to return. - */ - getAllKeys>(storeName: Name, query?: StoreKey | IDBKeyRange, count?: number): Promise[]>; - /** - * Retrieves the keys of records in an index matching the query. - * - * This is a shortcut that creates a transaction for this single action. If you need to do more - * than one action, create a transaction instead. - * - * @param storeName Name of the store. - * @param indexName Name of the index within the store. - * @param query - * @param count Maximum number of keys to return. - */ - getAllKeysFromIndex, IndexName extends IndexNames>(storeName: Name, indexName: IndexName, query?: IndexKey | IDBKeyRange, count?: number): Promise[]>; - /** - * Retrieves the key of the first record in a store that matches the query. - * - * Resolves with undefined if no match is found. - * - * This is a shortcut that creates a transaction for this single action. If you need to do more - * than one action, create a transaction instead. - * - * @param storeName Name of the store. - * @param query - */ - getKey>(storeName: Name, query: StoreKey | IDBKeyRange): Promise | undefined>; - /** - * Retrieves the key of the first record in an index that matches the query. - * - * Resolves with undefined if no match is found. - * - * This is a shortcut that creates a transaction for this single action. If you need to do more - * than one action, create a transaction instead. - * - * @param storeName Name of the store. - * @param indexName Name of the index within the store. - * @param query - */ - getKeyFromIndex, IndexName extends IndexNames>(storeName: Name, indexName: IndexName, query: IndexKey | IDBKeyRange): Promise | undefined>; - /** - * Put an item in the database. - * - * Replaces any item with the same key. - * - * This is a shortcut that creates a transaction for this single action. If you need to do more - * than one action, create a transaction instead. - * - * @param storeName Name of the store. - * @param value - * @param key - */ - put>(storeName: Name, value: StoreValue, key?: StoreKey | IDBKeyRange): Promise>; -} -declare type IDBPTransactionExtends = Omit; -export interface IDBPTransaction[] = StoreNames[]> extends IDBPTransactionExtends { - /** - * The names of stores in scope for this transaction. - */ - readonly objectStoreNames: TxStores; - /** - * The transaction's connection. - */ - readonly db: IDBPDatabase; - /** - * Promise for the completion of this transaction. - */ - readonly done: Promise; - /** - * The associated object store, if the transaction covers a single store, otherwise undefined. - */ - readonly store: TxStores[1] extends undefined ? IDBPObjectStore : undefined; - /** - * Returns an IDBObjectStore in the transaction's scope. - */ - objectStore(name: StoreName): IDBPObjectStore; -} -declare type IDBPObjectStoreExtends = Omit; -export interface IDBPObjectStore[] = StoreNames[], StoreName extends StoreNames = StoreNames> extends IDBPObjectStoreExtends { - /** - * The names of indexes in the store. - */ - readonly indexNames: IndexNames[]; - /** - * The name of the store to newName. Can be set during an upgrade transaction. - */ - name: StoreName; - /** - * The associated transaction. - */ - readonly transaction: IDBPTransaction; - /** - * Add a value to the store. - * - * Rejects if an item of a given key already exists in the store. - */ - add(value: StoreValue, key?: StoreKey | IDBKeyRange): Promise>; - /** - * Deletes all records in store. - */ - clear(): Promise; - /** - * Retrieves the number of records matching the given query. - */ - count(key?: StoreKey | IDBKeyRange): Promise; - /** - * Creates a new index in store. - * - * Throws an "InvalidStateError" DOMException if not called within an upgrade transaction. - */ - createIndex>(name: IndexName, keyPath: string | string[], options?: IDBIndexParameters): IDBPIndex; - /** - * Deletes records in store matching the given query. - */ - delete(key: StoreKey | IDBKeyRange): Promise; - /** - * Retrieves the value of the first record matching the query. - * - * Resolves with undefined if no match is found. - */ - get(query: StoreKey | IDBKeyRange): Promise | undefined>; - /** - * Retrieves all values that match the query. - * - * @param query - * @param count Maximum number of values to return. - */ - getAll(query?: StoreKey | IDBKeyRange, count?: number): Promise[]>; - /** - * Retrieves the keys of records matching the query. - * - * @param query - * @param count Maximum number of keys to return. - */ - getAllKeys(query?: StoreKey | IDBKeyRange, count?: number): Promise[]>; - /** - * Retrieves the key of the first record that matches the query. - * - * Resolves with undefined if no match is found. - */ - getKey(query: StoreKey | IDBKeyRange): Promise | undefined>; - /** - * Get a query of a given name. - */ - index>(name: IndexName): IDBPIndex; - /** - * Opens a cursor over the records matching the query. - * - * Resolves with null if no matches are found. - * - * @param query If null, all records match. - * @param direction - */ - openCursor(query?: StoreKey | IDBKeyRange, direction?: IDBCursorDirection): Promise | null>; - /** - * Opens a cursor over the keys matching the query. - * - * Resolves with null if no matches are found. - * - * @param query If null, all records match. - * @param direction - */ - openKeyCursor(query?: StoreKey | IDBKeyRange, direction?: IDBCursorDirection): Promise | null>; - /** - * Put an item in the store. - * - * Replaces any item with the same key. - */ - put(value: StoreValue, key?: StoreKey | IDBKeyRange): Promise>; - /** - * Iterate over the store. - */ - [Symbol.asyncIterator](): AsyncIterableIterator>; - /** - * Iterate over the records matching the query. - * - * @param query If null, all records match. - * @param direction - */ - iterate(query?: StoreKey | IDBKeyRange, direction?: IDBCursorDirection): AsyncIterableIterator>; -} -declare type IDBPIndexExtends = Omit; -export interface IDBPIndex[] = StoreNames[], StoreName extends StoreNames = StoreNames, IndexName extends IndexNames = IndexNames> extends IDBPIndexExtends { - /** - * The IDBObjectStore the index belongs to. - */ - readonly objectStore: IDBPObjectStore; - /** - * Retrieves the number of records matching the given query. - */ - count(key?: IndexKey | IDBKeyRange): Promise; - /** - * Retrieves the value of the first record matching the query. - * - * Resolves with undefined if no match is found. - */ - get(query: IndexKey | IDBKeyRange): Promise | undefined>; - /** - * Retrieves all values that match the query. - * - * @param query - * @param count Maximum number of values to return. - */ - getAll(query?: IndexKey | IDBKeyRange, count?: number): Promise[]>; - /** - * Retrieves the keys of records matching the query. - * - * @param query - * @param count Maximum number of keys to return. - */ - getAllKeys(query?: IndexKey | IDBKeyRange, count?: number): Promise[]>; - /** - * Retrieves the key of the first record that matches the query. - * - * Resolves with undefined if no match is found. - */ - getKey(query: IndexKey | IDBKeyRange): Promise | undefined>; - /** - * Opens a cursor over the records matching the query. - * - * Resolves with null if no matches are found. - * - * @param query If null, all records match. - * @param direction - */ - openCursor(query?: IndexKey | IDBKeyRange, direction?: IDBCursorDirection): Promise | null>; - /** - * Opens a cursor over the keys matching the query. - * - * Resolves with null if no matches are found. - * - * @param query If null, all records match. - * @param direction - */ - openKeyCursor(query?: IndexKey | IDBKeyRange, direction?: IDBCursorDirection): Promise | null>; - /** - * Iterate over the index. - */ - [Symbol.asyncIterator](): AsyncIterableIterator>; - /** - * Iterate over the records matching the query. - * - * Resolves with null if no matches are found. - * - * @param query If null, all records match. - * @param direction - */ - iterate(query?: IndexKey | IDBKeyRange, direction?: IDBCursorDirection): AsyncIterableIterator>; -} -declare type IDBPCursorExtends = Omit; -export interface IDBPCursor[] = StoreNames[], StoreName extends StoreNames = StoreNames, IndexName extends IndexNames | unknown = unknown> extends IDBPCursorExtends { - /** - * The key of the current index or object store item. - */ - readonly key: CursorKey; - /** - * The key of the current object store item. - */ - readonly primaryKey: StoreKey; - /** - * Returns the IDBObjectStore or IDBIndex the cursor was opened from. - */ - readonly source: CursorSource; - /** - * Advances the cursor a given number of records. - * - * Resolves to null if no matching records remain. - */ - advance(this: T, count: number): Promise; - /** - * Advance the cursor by one record (unless 'key' is provided). - * - * Resolves to null if no matching records remain. - * - * @param key Advance to the index or object store with a key equal to or greater than this value. - */ - continue(this: T, key?: CursorKey): Promise; - /** - * Advance the cursor by given keys. - * - * The operation is 'and' – both keys must be satisfied. - * - * Resolves to null if no matching records remain. - * - * @param key Advance to the index or object store with a key equal to or greater than this value. - * @param primaryKey and where the object store has a key equal to or greater than this value. - */ - continuePrimaryKey(this: T, key: CursorKey, primaryKey: StoreKey): Promise; - /** - * Delete the current record. - */ - delete(): Promise; - /** - * Updated the current record. - */ - update(value: StoreValue): Promise>; - /** - * Iterate over the cursor. - */ - [Symbol.asyncIterator](): AsyncIterableIterator>; -} -declare type IDBPCursorIteratorValueExtends[] = StoreNames[], StoreName extends StoreNames = StoreNames, IndexName extends IndexNames | unknown = unknown> = Omit, 'advance' | 'continue' | 'continuePrimaryKey'>; -export interface IDBPCursorIteratorValue[] = StoreNames[], StoreName extends StoreNames = StoreNames, IndexName extends IndexNames | unknown = unknown> extends IDBPCursorIteratorValueExtends { - /** - * Advances the cursor a given number of records. - */ - advance(this: T, count: number): void; - /** - * Advance the cursor by one record (unless 'key' is provided). - * - * @param key Advance to the index or object store with a key equal to or greater than this value. - */ - continue(this: T, key?: CursorKey): void; - /** - * Advance the cursor by given keys. - * - * The operation is 'and' – both keys must be satisfied. - * - * @param key Advance to the index or object store with a key equal to or greater than this value. - * @param primaryKey and where the object store has a key equal to or greater than this value. - */ - continuePrimaryKey(this: T, key: CursorKey, primaryKey: StoreKey): void; -} -export interface IDBPCursorWithValue[] = StoreNames[], StoreName extends StoreNames = StoreNames, IndexName extends IndexNames | unknown = unknown> extends IDBPCursor { - /** - * The value of the current item. - */ - readonly value: StoreValue; - /** - * Iterate over the cursor. - */ - [Symbol.asyncIterator](): AsyncIterableIterator>; -} -declare type IDBPCursorWithValueIteratorValueExtends[] = StoreNames[], StoreName extends StoreNames = StoreNames, IndexName extends IndexNames | unknown = unknown> = Omit, 'advance' | 'continue' | 'continuePrimaryKey'>; -export interface IDBPCursorWithValueIteratorValue[] = StoreNames[], StoreName extends StoreNames = StoreNames, IndexName extends IndexNames | unknown = unknown> extends IDBPCursorWithValueIteratorValueExtends { - /** - * Advances the cursor a given number of records. - */ - advance(this: T, count: number): void; - /** - * Advance the cursor by one record (unless 'key' is provided). - * - * @param key Advance to the index or object store with a key equal to or greater than this value. - */ - continue(this: T, key?: CursorKey): void; - /** - * Advance the cursor by given keys. - * - * The operation is 'and' – both keys must be satisfied. - * - * @param key Advance to the index or object store with a key equal to or greater than this value. - * @param primaryKey and where the object store has a key equal to or greater than this value. - */ - continuePrimaryKey(this: T, key: CursorKey, primaryKey: StoreKey): void; -} +export interface OpenDBCallbacks { + /** + * Called if this version of the database has never been opened before. Use it to specify the + * schema for the database. + * + * @param database A database instance that you can use to add/remove stores and indexes. + * @param oldVersion Last version of the database opened by the user. + * @param newVersion Whatever new version you provided. + * @param transaction The transaction for this upgrade. This is useful if you need to get data + * from other stores as part of a migration. + */ + upgrade?(database: IDBPDatabase, oldVersion: number, newVersion: number | null, transaction: IDBPTransaction): void; + /** + * Called if there are older versions of the database open on the origin, so this version cannot + * open. + */ + blocked?(): void; + /** + * Called if this connection is blocking a future version of the database from opening. + */ + blocking?(): void; +} +/** + * Open a database. + * + * @param name Name of the database. + * @param version Schema version. + * @param callbacks Additional callbacks. + */ +export declare function openDB(name: string, version: number, { blocked, upgrade, blocking }?: OpenDBCallbacks): Promise>; +export interface DeleteDBCallbacks { + /** + * Called if there are connections to this database open, so it cannot be deleted. + */ + blocked?(): void; +} +/** + * Delete a database. + * + * @param name Name of the database. + */ +export declare function deleteDB(name: string, { blocked }?: DeleteDBCallbacks): Promise; +export { unwrap, wrap } from './wrap-idb-value'; +declare type KnownKeys = { + [K in keyof T]: string extends K ? never : number extends K ? never : K; +} extends { + [_ in keyof T]: infer U; +} ? U : never; +declare type Omit = Pick>; +export interface DBSchema { + [s: string]: DBSchemaValue; +} +interface IndexKeys { + [s: string]: IDBValidKey; +} +interface DBSchemaValue { + key: IDBValidKey; + value: any; + indexes?: IndexKeys; +} +/** + * Extract known object store names from the DB schema type. + * + * @template DBTypes DB schema type, or unknown if the DB isn't typed. + */ +export declare type StoreNames = DBTypes extends DBSchema ? KnownKeys : string; +/** + * Extract database value types from the DB schema type. + * + * @template DBTypes DB schema type, or unknown if the DB isn't typed. + * @template StoreName Names of the object stores to get the types of. + */ +export declare type StoreValue> = DBTypes extends DBSchema ? DBTypes[StoreName]['value'] : any; +/** + * Extract database key types from the DB schema type. + * + * @template DBTypes DB schema type, or unknown if the DB isn't typed. + * @template StoreName Names of the object stores to get the types of. + */ +export declare type StoreKey> = DBTypes extends DBSchema ? DBTypes[StoreName]['key'] : IDBValidKey; +/** + * Extract the names of indexes in certain object stores from the DB schema type. + * + * @template DBTypes DB schema type, or unknown if the DB isn't typed. + * @template StoreName Names of the object stores to get the types of. + */ +export declare type IndexNames> = DBTypes extends DBSchema ? keyof DBTypes[StoreName]['indexes'] : string; +/** + * Extract the types of indexes in certain object stores from the DB schema type. + * + * @template DBTypes DB schema type, or unknown if the DB isn't typed. + * @template StoreName Names of the object stores to get the types of. + * @template IndexName Names of the indexes to get the types of. + */ +export declare type IndexKey, IndexName extends IndexNames> = DBTypes extends DBSchema ? IndexName extends keyof DBTypes[StoreName]['indexes'] ? DBTypes[StoreName]['indexes'][IndexName] : IDBValidKey : IDBValidKey; +declare type CursorSource[], StoreName extends StoreNames, IndexName extends IndexNames | unknown> = IndexName extends IndexNames ? IDBPIndex : IDBPObjectStore; +declare type CursorKey, IndexName extends IndexNames | unknown> = IndexName extends IndexNames ? IndexKey : StoreKey; +declare type IDBPDatabaseExtends = Omit; +/** + * A variation of DOMStringList with precise string types + */ +export interface TypedDOMStringList extends DOMStringList { + contains(string: T): boolean; + item(index: number): T | null; + [index: number]: T; + [Symbol.iterator](): IterableIterator; +} +export interface IDBPDatabase extends IDBPDatabaseExtends { + /** + * The names of stores in the database. + */ + readonly objectStoreNames: TypedDOMStringList>; + /** + * Creates a new object store. + * + * Throws a "InvalidStateError" DOMException if not called within an upgrade transaction. + */ + createObjectStore>(name: Name, optionalParameters?: IDBObjectStoreParameters): IDBPObjectStore[], Name>; + /** + * Deletes the object store with the given name. + * + * Throws a "InvalidStateError" DOMException if not called within an upgrade transaction. + */ + deleteObjectStore(name: StoreNames): void; + /** + * Start a new transaction. + * + * @param storeNames The object store(s) this transaction needs. + * @param mode + */ + transaction>(storeNames: Name, mode?: IDBTransactionMode): IDBPTransaction; + transaction[]>(storeNames: Names, mode?: IDBTransactionMode): IDBPTransaction; + /** + * Add a value to a store. + * + * Rejects if an item of a given key already exists in the store. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param value + * @param key + */ + add>(storeName: Name, value: StoreValue, key?: StoreKey | IDBKeyRange): Promise>; + /** + * Deletes all records in a store. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + */ + clear(name: StoreNames): Promise; + /** + * Retrieves the number of records matching the given query in a store. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param key + */ + count>(storeName: Name, key?: StoreKey | IDBKeyRange): Promise; + /** + * Retrieves the number of records matching the given query in an index. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param indexName Name of the index within the store. + * @param key + */ + countFromIndex, IndexName extends IndexNames>(storeName: Name, indexName: IndexName, key?: IndexKey | IDBKeyRange): Promise; + /** + * Deletes records in a store matching the given query. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param key + */ + delete>(storeName: Name, key: StoreKey | IDBKeyRange): Promise; + /** + * Retrieves the value of the first record in a store matching the query. + * + * Resolves with undefined if no match is found. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param query + */ + get>(storeName: Name, query: StoreKey | IDBKeyRange): Promise | undefined>; + /** + * Retrieves the value of the first record in an index matching the query. + * + * Resolves with undefined if no match is found. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param indexName Name of the index within the store. + * @param query + */ + getFromIndex, IndexName extends IndexNames>(storeName: Name, indexName: IndexName, query: IndexKey | IDBKeyRange): Promise | undefined>; + /** + * Retrieves all values in a store that match the query. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param query + * @param count Maximum number of values to return. + */ + getAll>(storeName: Name, query?: StoreKey | IDBKeyRange, count?: number): Promise[]>; + /** + * Retrieves all values in an index that match the query. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param indexName Name of the index within the store. + * @param query + * @param count Maximum number of values to return. + */ + getAllFromIndex, IndexName extends IndexNames>(storeName: Name, indexName: IndexName, query?: IndexKey | IDBKeyRange, count?: number): Promise[]>; + /** + * Retrieves the keys of records in a store matching the query. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param query + * @param count Maximum number of keys to return. + */ + getAllKeys>(storeName: Name, query?: StoreKey | IDBKeyRange, count?: number): Promise[]>; + /** + * Retrieves the keys of records in an index matching the query. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param indexName Name of the index within the store. + * @param query + * @param count Maximum number of keys to return. + */ + getAllKeysFromIndex, IndexName extends IndexNames>(storeName: Name, indexName: IndexName, query?: IndexKey | IDBKeyRange, count?: number): Promise[]>; + /** + * Retrieves the key of the first record in a store that matches the query. + * + * Resolves with undefined if no match is found. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param query + */ + getKey>(storeName: Name, query: StoreKey | IDBKeyRange): Promise | undefined>; + /** + * Retrieves the key of the first record in an index that matches the query. + * + * Resolves with undefined if no match is found. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param indexName Name of the index within the store. + * @param query + */ + getKeyFromIndex, IndexName extends IndexNames>(storeName: Name, indexName: IndexName, query: IndexKey | IDBKeyRange): Promise | undefined>; + /** + * Put an item in the database. + * + * Replaces any item with the same key. + * + * This is a shortcut that creates a transaction for this single action. If you need to do more + * than one action, create a transaction instead. + * + * @param storeName Name of the store. + * @param value + * @param key + */ + put>(storeName: Name, value: StoreValue, key?: StoreKey | IDBKeyRange): Promise>; +} +declare type IDBPTransactionExtends = Omit; +export interface IDBPTransaction[] = StoreNames[]> extends IDBPTransactionExtends { + /** + * The names of stores in scope for this transaction. + */ + readonly objectStoreNames: TxStores; + /** + * The transaction's connection. + */ + readonly db: IDBPDatabase; + /** + * Promise for the completion of this transaction. + */ + readonly done: Promise; + /** + * The associated object store, if the transaction covers a single store, otherwise undefined. + */ + readonly store: TxStores[1] extends undefined ? IDBPObjectStore : undefined; + /** + * Returns an IDBObjectStore in the transaction's scope. + */ + objectStore(name: StoreName): IDBPObjectStore; +} +declare type IDBPObjectStoreExtends = Omit; +export interface IDBPObjectStore[] = StoreNames[], StoreName extends StoreNames = StoreNames> extends IDBPObjectStoreExtends { + /** + * The names of indexes in the store. + */ + readonly indexNames: IndexNames[]; + /** + * The name of the store to newName. Can be set during an upgrade transaction. + */ + name: StoreName; + /** + * The associated transaction. + */ + readonly transaction: IDBPTransaction; + /** + * Add a value to the store. + * + * Rejects if an item of a given key already exists in the store. + */ + add(value: StoreValue, key?: StoreKey | IDBKeyRange): Promise>; + /** + * Deletes all records in store. + */ + clear(): Promise; + /** + * Retrieves the number of records matching the given query. + */ + count(key?: StoreKey | IDBKeyRange): Promise; + /** + * Creates a new index in store. + * + * Throws an "InvalidStateError" DOMException if not called within an upgrade transaction. + */ + createIndex>(name: IndexName, keyPath: string | string[], options?: IDBIndexParameters): IDBPIndex; + /** + * Deletes records in store matching the given query. + */ + delete(key: StoreKey | IDBKeyRange): Promise; + /** + * Retrieves the value of the first record matching the query. + * + * Resolves with undefined if no match is found. + */ + get(query: StoreKey | IDBKeyRange): Promise | undefined>; + /** + * Retrieves all values that match the query. + * + * @param query + * @param count Maximum number of values to return. + */ + getAll(query?: StoreKey | IDBKeyRange, count?: number): Promise[]>; + /** + * Retrieves the keys of records matching the query. + * + * @param query + * @param count Maximum number of keys to return. + */ + getAllKeys(query?: StoreKey | IDBKeyRange, count?: number): Promise[]>; + /** + * Retrieves the key of the first record that matches the query. + * + * Resolves with undefined if no match is found. + */ + getKey(query: StoreKey | IDBKeyRange): Promise | undefined>; + /** + * Get a query of a given name. + */ + index>(name: IndexName): IDBPIndex; + /** + * Opens a cursor over the records matching the query. + * + * Resolves with null if no matches are found. + * + * @param query If null, all records match. + * @param direction + */ + openCursor(query?: StoreKey | IDBKeyRange, direction?: IDBCursorDirection): Promise | null>; + /** + * Opens a cursor over the keys matching the query. + * + * Resolves with null if no matches are found. + * + * @param query If null, all records match. + * @param direction + */ + openKeyCursor(query?: StoreKey | IDBKeyRange, direction?: IDBCursorDirection): Promise | null>; + /** + * Put an item in the store. + * + * Replaces any item with the same key. + */ + put(value: StoreValue, key?: StoreKey | IDBKeyRange): Promise>; + /** + * Iterate over the store. + */ + [Symbol.asyncIterator](): AsyncIterableIterator>; + /** + * Iterate over the records matching the query. + * + * @param query If null, all records match. + * @param direction + */ + iterate(query?: StoreKey | IDBKeyRange, direction?: IDBCursorDirection): AsyncIterableIterator>; +} +declare type IDBPIndexExtends = Omit; +export interface IDBPIndex[] = StoreNames[], StoreName extends StoreNames = StoreNames, IndexName extends IndexNames = IndexNames> extends IDBPIndexExtends { + /** + * The IDBObjectStore the index belongs to. + */ + readonly objectStore: IDBPObjectStore; + /** + * Retrieves the number of records matching the given query. + */ + count(key?: IndexKey | IDBKeyRange): Promise; + /** + * Retrieves the value of the first record matching the query. + * + * Resolves with undefined if no match is found. + */ + get(query: IndexKey | IDBKeyRange): Promise | undefined>; + /** + * Retrieves all values that match the query. + * + * @param query + * @param count Maximum number of values to return. + */ + getAll(query?: IndexKey | IDBKeyRange, count?: number): Promise[]>; + /** + * Retrieves the keys of records matching the query. + * + * @param query + * @param count Maximum number of keys to return. + */ + getAllKeys(query?: IndexKey | IDBKeyRange, count?: number): Promise[]>; + /** + * Retrieves the key of the first record that matches the query. + * + * Resolves with undefined if no match is found. + */ + getKey(query: IndexKey | IDBKeyRange): Promise | undefined>; + /** + * Opens a cursor over the records matching the query. + * + * Resolves with null if no matches are found. + * + * @param query If null, all records match. + * @param direction + */ + openCursor(query?: IndexKey | IDBKeyRange, direction?: IDBCursorDirection): Promise | null>; + /** + * Opens a cursor over the keys matching the query. + * + * Resolves with null if no matches are found. + * + * @param query If null, all records match. + * @param direction + */ + openKeyCursor(query?: IndexKey | IDBKeyRange, direction?: IDBCursorDirection): Promise | null>; + /** + * Iterate over the index. + */ + [Symbol.asyncIterator](): AsyncIterableIterator>; + /** + * Iterate over the records matching the query. + * + * Resolves with null if no matches are found. + * + * @param query If null, all records match. + * @param direction + */ + iterate(query?: IndexKey | IDBKeyRange, direction?: IDBCursorDirection): AsyncIterableIterator>; +} +declare type IDBPCursorExtends = Omit; +export interface IDBPCursor[] = StoreNames[], StoreName extends StoreNames = StoreNames, IndexName extends IndexNames | unknown = unknown> extends IDBPCursorExtends { + /** + * The key of the current index or object store item. + */ + readonly key: CursorKey; + /** + * The key of the current object store item. + */ + readonly primaryKey: StoreKey; + /** + * Returns the IDBObjectStore or IDBIndex the cursor was opened from. + */ + readonly source: CursorSource; + /** + * Advances the cursor a given number of records. + * + * Resolves to null if no matching records remain. + */ + advance(this: T, count: number): Promise; + /** + * Advance the cursor by one record (unless 'key' is provided). + * + * Resolves to null if no matching records remain. + * + * @param key Advance to the index or object store with a key equal to or greater than this value. + */ + continue(this: T, key?: CursorKey): Promise; + /** + * Advance the cursor by given keys. + * + * The operation is 'and' – both keys must be satisfied. + * + * Resolves to null if no matching records remain. + * + * @param key Advance to the index or object store with a key equal to or greater than this value. + * @param primaryKey and where the object store has a key equal to or greater than this value. + */ + continuePrimaryKey(this: T, key: CursorKey, primaryKey: StoreKey): Promise; + /** + * Delete the current record. + */ + delete(): Promise; + /** + * Updated the current record. + */ + update(value: StoreValue): Promise>; + /** + * Iterate over the cursor. + */ + [Symbol.asyncIterator](): AsyncIterableIterator>; +} +declare type IDBPCursorIteratorValueExtends[] = StoreNames[], StoreName extends StoreNames = StoreNames, IndexName extends IndexNames | unknown = unknown> = Omit, 'advance' | 'continue' | 'continuePrimaryKey'>; +export interface IDBPCursorIteratorValue[] = StoreNames[], StoreName extends StoreNames = StoreNames, IndexName extends IndexNames | unknown = unknown> extends IDBPCursorIteratorValueExtends { + /** + * Advances the cursor a given number of records. + */ + advance(this: T, count: number): void; + /** + * Advance the cursor by one record (unless 'key' is provided). + * + * @param key Advance to the index or object store with a key equal to or greater than this value. + */ + continue(this: T, key?: CursorKey): void; + /** + * Advance the cursor by given keys. + * + * The operation is 'and' – both keys must be satisfied. + * + * @param key Advance to the index or object store with a key equal to or greater than this value. + * @param primaryKey and where the object store has a key equal to or greater than this value. + */ + continuePrimaryKey(this: T, key: CursorKey, primaryKey: StoreKey): void; +} +export interface IDBPCursorWithValue[] = StoreNames[], StoreName extends StoreNames = StoreNames, IndexName extends IndexNames | unknown = unknown> extends IDBPCursor { + /** + * The value of the current item. + */ + readonly value: StoreValue; + /** + * Iterate over the cursor. + */ + [Symbol.asyncIterator](): AsyncIterableIterator>; +} +declare type IDBPCursorWithValueIteratorValueExtends[] = StoreNames[], StoreName extends StoreNames = StoreNames, IndexName extends IndexNames | unknown = unknown> = Omit, 'advance' | 'continue' | 'continuePrimaryKey'>; +export interface IDBPCursorWithValueIteratorValue[] = StoreNames[], StoreName extends StoreNames = StoreNames, IndexName extends IndexNames | unknown = unknown> extends IDBPCursorWithValueIteratorValueExtends { + /** + * Advances the cursor a given number of records. + */ + advance(this: T, count: number): void; + /** + * Advance the cursor by one record (unless 'key' is provided). + * + * @param key Advance to the index or object store with a key equal to or greater than this value. + */ + continue(this: T, key?: CursorKey): void; + /** + * Advance the cursor by given keys. + * + * The operation is 'and' – both keys must be satisfied. + * + * @param key Advance to the index or object store with a key equal to or greater than this value. + * @param primaryKey and where the object store has a key equal to or greater than this value. + */ + continuePrimaryKey(this: T, key: CursorKey, primaryKey: StoreKey): void; +} +//# sourceMappingURL=entry.d.ts.map \ No newline at end of file diff --git a/build/esm/entry.d.ts.map b/build/esm/entry.d.ts.map new file mode 100644 index 0000000..2b5791e --- /dev/null +++ b/build/esm/entry.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["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Q,uCAAuC,CAC7C,OAAO,EACP,QAAQ,EACR,SAAS,EACT,SAAS,CACV;IACD;;OAEG;IACH,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC;;;;OAIG;IACH,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,SAAS,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC,GAAG,IAAI,CAAC;IAC3E;;;;;;;OAOG;IACH,kBAAkB,CAAC,CAAC,EAClB,IAAI,EAAE,CAAC,EACP,GAAG,EAAE,SAAS,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC,EAC7C,UAAU,EAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,GACvC,IAAI,CAAC;CACT"} \ No newline at end of file diff --git a/build/esm/entry.js.map b/build/esm/entry.js.map new file mode 100644 index 0000000..9a5e3ca --- /dev/null +++ b/build/esm/entry.js.map @@ -0,0 +1 @@ +{"version":3,"file":"entry.js","sourceRoot":"","sources":["../../src/entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AA8BxC;;;;;;GAMG;AACH,MAAM,UAAU,MAAM,CACpB,IAAY,EACZ,OAAe,EACf,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,KAA+B,EAAE;IAE7D,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC9C,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAmC,CAAC;IAEpE,IAAI,OAAO,EAAE;QACX,OAAO,CAAC,gBAAgB,CAAC,eAAe,EAAE,KAAK,CAAC,EAAE;YAChD,OAAO,CACL,IAAI,CAAC,OAAO,CAAC,MAAM,CAA0B,EAC7C,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,UAAU,EACf,IAAI,CAAC,OAAO,CAAC,WAAY,CAAyC,CACpE,CAAC;QACJ,CAAC,CAAC,CAAC;KACJ;IAED,IAAI,OAAO;QAAE,OAAO,CAAC,gBAAgB,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;IAClE,IAAI,QAAQ,EAAE;QACZ,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,gBAAgB,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;KACxF;IAED,OAAO,WAAW,CAAC;AACrB,CAAC;AASD;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CACtB,IAAY,EACZ,EAAE,OAAO,KAAwB,EAAE;IAEnC,MAAM,OAAO,GAAG,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC/C,IAAI,OAAO;QAAE,OAAO,CAAC,gBAAgB,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;IAClE,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;AAC7C,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC"} \ No newline at end of file diff --git a/build/esm/index.d.ts b/build/esm/index.d.ts index 688bfb6..1eca822 100644 --- a/build/esm/index.d.ts +++ b/build/esm/index.d.ts @@ -1,2 +1,3 @@ -export * from './entry'; -import './database-extras'; +export * from './entry'; +import './database-extras'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/build/esm/index.d.ts.map b/build/esm/index.d.ts.map new file mode 100644 index 0000000..e29230f --- /dev/null +++ b/build/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,mBAAmB,CAAC"} \ No newline at end of file diff --git a/build/esm/index.js b/build/esm/index.js index 7ee4873..4cc500e 100644 --- a/build/esm/index.js +++ b/build/esm/index.js @@ -1,77 +1,77 @@ -import { a as wrap, b as addTraps } from './chunk.js'; -export { e as unwrap, a as wrap } from './chunk.js'; +import { w as wrap, a as addTraps } from './wrap-idb-value.js'; +export { u as unwrap, w as wrap } from './wrap-idb-value.js'; -/** - * Open a database. - * - * @param name Name of the database. - * @param version Schema version. - * @param callbacks Additional callbacks. - */ -function openDB(name, version, { blocked, upgrade, blocking } = {}) { - const request = indexedDB.open(name, version); - const openPromise = wrap(request); - if (upgrade) { - request.addEventListener('upgradeneeded', event => { - upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction)); - }); - } - if (blocked) - request.addEventListener('blocked', () => blocked()); - if (blocking) { - openPromise.then(db => db.addEventListener('versionchange', blocking)).catch(() => { }); - } - return openPromise; -} -/** - * Delete a database. - * - * @param name Name of the database. - */ -function deleteDB(name, { blocked } = {}) { - const request = indexedDB.deleteDatabase(name); - if (blocked) - request.addEventListener('blocked', () => blocked()); - return wrap(request).then(() => undefined); +/** + * Open a database. + * + * @param name Name of the database. + * @param version Schema version. + * @param callbacks Additional callbacks. + */ +function openDB(name, version, { blocked, upgrade, blocking } = {}) { + const request = indexedDB.open(name, version); + const openPromise = wrap(request); + if (upgrade) { + request.addEventListener('upgradeneeded', event => { + upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction)); + }); + } + if (blocked) + request.addEventListener('blocked', () => blocked()); + if (blocking) { + openPromise.then(db => db.addEventListener('versionchange', blocking)).catch(() => { }); + } + return openPromise; +} +/** + * Delete a database. + * + * @param name Name of the database. + */ +function deleteDB(name, { blocked } = {}) { + const request = indexedDB.deleteDatabase(name); + if (blocked) + request.addEventListener('blocked', () => blocked()); + return wrap(request).then(() => undefined); } -const readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count']; -const writeMethods = ['put', 'add', 'delete', 'clear']; -const cachedMethods = new Map(); -function getMethod(target, prop) { - if (!(target instanceof IDBDatabase && - !(prop in target) && - typeof prop === 'string')) { - return; - } - if (cachedMethods.get(prop)) - return cachedMethods.get(prop); - const targetFuncName = prop.replace(/FromIndex$/, ''); - const useIndex = prop !== targetFuncName; - const isWrite = writeMethods.includes(targetFuncName); - if ( - // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge. - !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) || - !(isWrite || readMethods.includes(targetFuncName))) { - return; - } - const method = async function (storeName, ...args) { - // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :( - const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly'); - let target = tx.store; - if (useIndex) - target = target.index(args.shift()); - const returnVal = target[targetFuncName](...args); - if (isWrite) - await tx.done; - return returnVal; - }; - cachedMethods.set(prop, method); - return method; -} -addTraps(oldTraps => ({ - get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver), - has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop), +const readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count']; +const writeMethods = ['put', 'add', 'delete', 'clear']; +const cachedMethods = new Map(); +function getMethod(target, prop) { + if (!(target instanceof IDBDatabase && + !(prop in target) && + typeof prop === 'string')) { + return; + } + if (cachedMethods.get(prop)) + return cachedMethods.get(prop); + const targetFuncName = prop.replace(/FromIndex$/, ''); + const useIndex = prop !== targetFuncName; + const isWrite = writeMethods.includes(targetFuncName); + if ( + // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge. + !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) || + !(isWrite || readMethods.includes(targetFuncName))) { + return; + } + const method = async function (storeName, ...args) { + // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :( + const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly'); + let target = tx.store; + if (useIndex) + target = target.index(args.shift()); + const returnVal = target[targetFuncName](...args); + if (isWrite) + await tx.done; + return returnVal; + }; + cachedMethods.set(prop, method); + return method; +} +addTraps(oldTraps => ({ + get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver), + has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop), })); -export { openDB, deleteDB }; +export { deleteDB, openDB }; diff --git a/build/esm/index.js.map b/build/esm/index.js.map new file mode 100644 index 0000000..0322a8f --- /dev/null +++ b/build/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,mBAAmB,CAAC"} \ No newline at end of file diff --git a/build/esm/util.d.ts b/build/esm/util.d.ts index aebf920..56873e7 100644 --- a/build/esm/util.d.ts +++ b/build/esm/util.d.ts @@ -1,3 +1,4 @@ -export declare type Constructor = new (...args: any[]) => any; -export declare type Func = (...args: any[]) => any; -export declare const instanceOfAny: (object: any, constructors: Constructor[]) => boolean; +export declare type Constructor = new (...args: any[]) => any; +export declare type Func = (...args: any[]) => any; +export declare const instanceOfAny: (object: any, constructors: Constructor[]) => boolean; +//# sourceMappingURL=util.d.ts.map \ No newline at end of file diff --git a/build/esm/util.d.ts.map b/build/esm/util.d.ts.map new file mode 100644 index 0000000..a84b6b7 --- /dev/null +++ b/build/esm/util.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW,GAAG,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AACtD,oBAAY,IAAI,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAE3C,eAAO,MAAM,aAAa,uDAG+B,CAAC"} \ No newline at end of file diff --git a/build/esm/util.js.map b/build/esm/util.js.map new file mode 100644 index 0000000..ffab84f --- /dev/null +++ b/build/esm/util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,MAAW,EACX,YAA2B,EAClB,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,YAAY,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/build/esm/wrap-idb-value.d.ts b/build/esm/wrap-idb-value.d.ts index fdac8d5..5d1194d 100644 --- a/build/esm/wrap-idb-value.d.ts +++ b/build/esm/wrap-idb-value.d.ts @@ -1,34 +1,35 @@ -import { IDBPCursor, IDBPCursorWithValue, IDBPDatabase, IDBPIndex, IDBPObjectStore, IDBPTransaction } from './entry'; -export declare const reverseTransformCache: WeakMap; -export declare function addTraps(callback: (currentTraps: ProxyHandler) => ProxyHandler): void; -/** - * Enhance an IDB object with helpers. - * - * @param value The thing to enhance. - */ -export declare function wrap(value: IDBDatabase): IDBPDatabase; -export declare function wrap(value: IDBIndex): IDBPIndex; -export declare function wrap(value: IDBObjectStore): IDBPObjectStore; -export declare function wrap(value: IDBTransaction): IDBPTransaction; -export declare function wrap(value: IDBOpenDBRequest): Promise; -export declare function wrap(value: IDBRequest): Promise; -/** - * Revert an enhanced IDB object to a plain old miserable IDB one. - * - * Will also revert a promise back to an IDBRequest. - * - * @param value The enhanced object to revert. - */ -interface Unwrap { - (value: IDBPCursorWithValue): IDBCursorWithValue; - (value: IDBPCursor): IDBCursor; - (value: IDBPDatabase): IDBDatabase; - (value: IDBPIndex): IDBIndex; - (value: IDBPObjectStore): IDBObjectStore; - (value: IDBPTransaction): IDBTransaction; - (value: Promise>): IDBOpenDBRequest; - (value: Promise): IDBOpenDBRequest; - (value: Promise): IDBRequest; -} -export declare const unwrap: Unwrap; -export {}; +import { IDBPCursor, IDBPCursorWithValue, IDBPDatabase, IDBPIndex, IDBPObjectStore, IDBPTransaction } from './entry'; +export declare const reverseTransformCache: WeakMap; +export declare function addTraps(callback: (currentTraps: ProxyHandler) => ProxyHandler): void; +/** + * Enhance an IDB object with helpers. + * + * @param value The thing to enhance. + */ +export declare function wrap(value: IDBDatabase): IDBPDatabase; +export declare function wrap(value: IDBIndex): IDBPIndex; +export declare function wrap(value: IDBObjectStore): IDBPObjectStore; +export declare function wrap(value: IDBTransaction): IDBPTransaction; +export declare function wrap(value: IDBOpenDBRequest): Promise; +export declare function wrap(value: IDBRequest): Promise; +/** + * Revert an enhanced IDB object to a plain old miserable IDB one. + * + * Will also revert a promise back to an IDBRequest. + * + * @param value The enhanced object to revert. + */ +interface Unwrap { + (value: IDBPCursorWithValue): IDBCursorWithValue; + (value: IDBPCursor): IDBCursor; + (value: IDBPDatabase): IDBDatabase; + (value: IDBPIndex): IDBIndex; + (value: IDBPObjectStore): IDBObjectStore; + (value: IDBPTransaction): IDBTransaction; + (value: Promise>): IDBOpenDBRequest; + (value: Promise): IDBOpenDBRequest; + (value: Promise): IDBRequest; +} +export declare const unwrap: Unwrap; +export {}; +//# sourceMappingURL=wrap-idb-value.d.ts.map \ No newline at end of file diff --git a/build/esm/wrap-idb-value.d.ts.map b/build/esm/wrap-idb-value.d.ts.map new file mode 100644 index 0000000..b7abd4a --- /dev/null +++ b/build/esm/wrap-idb-value.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"wrap-idb-value.d.ts","sourceRoot":"","sources":["../../src/wrap-idb-value.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,eAAe,EACf,eAAe,EAChB,MAAM,SAAS,CAAC;AA6CjB,eAAO,MAAM,qBAAqB,sBAAgB,CAAC;AAiGnD,wBAAgB,QAAQ,CACtB,QAAQ,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC,GAAG,CAAC,KAAK,YAAY,CAAC,GAAG,CAAC,GAC/D,IAAI,CAEN;AA4DD;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,WAAW,GAA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C,CAAC,CAAC,CAAC;CACvC;AACD,eAAO,MAAM,MAAM,EAAE,MACa,CAAC"} \ No newline at end of file diff --git a/build/esm/chunk.js b/build/esm/wrap-idb-value.js similarity index 96% rename from build/esm/chunk.js rename to build/esm/wrap-idb-value.js index c16dfdc..e1f0ff3 100644 --- a/build/esm/chunk.js +++ b/build/esm/wrap-idb-value.js @@ -1,181 +1,181 @@ const instanceOfAny = (object, constructors) => constructors.some(c => object instanceof c); -let idbProxyableTypes; -let cursorAdvanceMethods; -// This is a function to prevent it throwing up in node environments. -function getIdbProxyableTypes() { - return (idbProxyableTypes || - (idbProxyableTypes = [ - IDBDatabase, - IDBObjectStore, - IDBIndex, - IDBCursor, - IDBTransaction, - ])); -} -// This is a function to prevent it throwing up in node environments. -function getCursorAdvanceMethods() { - return (cursorAdvanceMethods || - (cursorAdvanceMethods = [ - IDBCursor.prototype.advance, - IDBCursor.prototype.continue, - IDBCursor.prototype.continuePrimaryKey, - ])); -} -const cursorRequestMap = new WeakMap(); -const transactionDoneMap = new WeakMap(); -const transactionStoreNamesMap = new WeakMap(); -const transformCache = new WeakMap(); -const reverseTransformCache = new WeakMap(); -function promisifyRequest(request) { - const promise = new Promise((resolve, reject) => { - const unlisten = () => { - request.removeEventListener('success', success); - request.removeEventListener('error', error); - }; - const success = () => { - resolve(wrap(request.result)); - unlisten(); - }; - const error = () => { - reject(request.error); - unlisten(); - }; - request.addEventListener('success', success); - request.addEventListener('error', error); - }); - promise - .then(value => { - // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval - // (see wrapFunction). - if (value instanceof IDBCursor) { - cursorRequestMap.set(value, request); - } - // Catching to avoid "Uncaught Promise exceptions" - }) - .catch(() => { }); - // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This - // is because we create many promises from a single IDBRequest. - reverseTransformCache.set(promise, request); - return promise; -} -function cacheDonePromiseForTransaction(tx) { - // Early bail if we've already created a done promise for this transaction. - if (transactionDoneMap.has(tx)) - return; - const done = new Promise((resolve, reject) => { - const unlisten = () => { - tx.removeEventListener('complete', complete); - tx.removeEventListener('error', error); - tx.removeEventListener('abort', error); - }; - const complete = () => { - resolve(); - unlisten(); - }; - const error = () => { - reject(tx.error); - unlisten(); - }; - tx.addEventListener('complete', complete); - tx.addEventListener('error', error); - tx.addEventListener('abort', error); - }); - // Cache it for later retrieval. - transactionDoneMap.set(tx, done); -} -let idbProxyTraps = { - get(target, prop, receiver) { - if (target instanceof IDBTransaction) { - // Special handling for transaction.done. - if (prop === 'done') - return transactionDoneMap.get(target); - // Polyfill for objectStoreNames because of Edge. - if (prop === 'objectStoreNames') { - return target.objectStoreNames || transactionStoreNamesMap.get(target); - } - // Make tx.store return the only store in the transaction, or undefined if there are many. - if (prop === 'store') { - return receiver.objectStoreNames[1] - ? undefined - : receiver.objectStore(receiver.objectStoreNames[0]); - } - } - // Else transform whatever we get back. - return wrap(target[prop]); - }, - has(target, prop) { - if (target instanceof IDBTransaction && - (prop === 'done' || prop === 'store')) { - return true; - } - return prop in target; - }, -}; -function addTraps(callback) { - idbProxyTraps = callback(idbProxyTraps); -} -function wrapFunction(func) { - // Due to expected object equality (which is enforced by the caching in `wrap`), we - // only create one new func per func. - // Edge doesn't support objectStoreNames (booo), so we polyfill it here. - if (func === IDBDatabase.prototype.transaction && - !('objectStoreNames' in IDBTransaction.prototype)) { - return function (storeNames, ...args) { - const tx = func.call(unwrap(this), storeNames, ...args); - transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]); - return wrap(tx); - }; - } - // Cursor methods are special, as the behaviour is a little more different to standard IDB. In - // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the - // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense - // with real promises, so each advance methods returns a new promise for the cursor object, or - // undefined if the end of the cursor has been reached. - if (getCursorAdvanceMethods().includes(func)) { - return function (...args) { - // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use - // the original object. - func.apply(unwrap(this), args); - return wrap(cursorRequestMap.get(this)); - }; - } - return function (...args) { - // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use - // the original object. - return wrap(func.apply(unwrap(this), args)); - }; -} -function transformCachableValue(value) { - if (typeof value === 'function') - return wrapFunction(value); - // This doesn't return, it just creates a 'done' promise for the transaction, - // which is later returned for transaction.done (see idbObjectHandler). - if (value instanceof IDBTransaction) - cacheDonePromiseForTransaction(value); - if (instanceOfAny(value, getIdbProxyableTypes())) - return new Proxy(value, idbProxyTraps); - // Return the same value back if we're not going to transform it. - return value; -} -function wrap(value) { - // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because - // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached. - if (value instanceof IDBRequest) - return promisifyRequest(value); - // If we've already transformed this value before, reuse the transformed value. - // This is faster, but it also provides object equality. - if (transformCache.has(value)) - return transformCache.get(value); - const newValue = transformCachableValue(value); - // Not all types are transformed. - // These may be primitive types, so they can't be WeakMap keys. - if (newValue !== value) { - transformCache.set(value, newValue); - reverseTransformCache.set(newValue, value); - } - return newValue; -} +let idbProxyableTypes; +let cursorAdvanceMethods; +// This is a function to prevent it throwing up in node environments. +function getIdbProxyableTypes() { + return (idbProxyableTypes || + (idbProxyableTypes = [ + IDBDatabase, + IDBObjectStore, + IDBIndex, + IDBCursor, + IDBTransaction, + ])); +} +// This is a function to prevent it throwing up in node environments. +function getCursorAdvanceMethods() { + return (cursorAdvanceMethods || + (cursorAdvanceMethods = [ + IDBCursor.prototype.advance, + IDBCursor.prototype.continue, + IDBCursor.prototype.continuePrimaryKey, + ])); +} +const cursorRequestMap = new WeakMap(); +const transactionDoneMap = new WeakMap(); +const transactionStoreNamesMap = new WeakMap(); +const transformCache = new WeakMap(); +const reverseTransformCache = new WeakMap(); +function promisifyRequest(request) { + const promise = new Promise((resolve, reject) => { + const unlisten = () => { + request.removeEventListener('success', success); + request.removeEventListener('error', error); + }; + const success = () => { + resolve(wrap(request.result)); + unlisten(); + }; + const error = () => { + reject(request.error); + unlisten(); + }; + request.addEventListener('success', success); + request.addEventListener('error', error); + }); + promise + .then(value => { + // Since cursoring reuses the IDBRequest (*sigh*), we cache it for later retrieval + // (see wrapFunction). + if (value instanceof IDBCursor) { + cursorRequestMap.set(value, request); + } + // Catching to avoid "Uncaught Promise exceptions" + }) + .catch(() => { }); + // This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This + // is because we create many promises from a single IDBRequest. + reverseTransformCache.set(promise, request); + return promise; +} +function cacheDonePromiseForTransaction(tx) { + // Early bail if we've already created a done promise for this transaction. + if (transactionDoneMap.has(tx)) + return; + const done = new Promise((resolve, reject) => { + const unlisten = () => { + tx.removeEventListener('complete', complete); + tx.removeEventListener('error', error); + tx.removeEventListener('abort', error); + }; + const complete = () => { + resolve(); + unlisten(); + }; + const error = () => { + reject(tx.error); + unlisten(); + }; + tx.addEventListener('complete', complete); + tx.addEventListener('error', error); + tx.addEventListener('abort', error); + }); + // Cache it for later retrieval. + transactionDoneMap.set(tx, done); +} +let idbProxyTraps = { + get(target, prop, receiver) { + if (target instanceof IDBTransaction) { + // Special handling for transaction.done. + if (prop === 'done') + return transactionDoneMap.get(target); + // Polyfill for objectStoreNames because of Edge. + if (prop === 'objectStoreNames') { + return target.objectStoreNames || transactionStoreNamesMap.get(target); + } + // Make tx.store return the only store in the transaction, or undefined if there are many. + if (prop === 'store') { + return receiver.objectStoreNames[1] + ? undefined + : receiver.objectStore(receiver.objectStoreNames[0]); + } + } + // Else transform whatever we get back. + return wrap(target[prop]); + }, + has(target, prop) { + if (target instanceof IDBTransaction && + (prop === 'done' || prop === 'store')) { + return true; + } + return prop in target; + }, +}; +function addTraps(callback) { + idbProxyTraps = callback(idbProxyTraps); +} +function wrapFunction(func) { + // Due to expected object equality (which is enforced by the caching in `wrap`), we + // only create one new func per func. + // Edge doesn't support objectStoreNames (booo), so we polyfill it here. + if (func === IDBDatabase.prototype.transaction && + !('objectStoreNames' in IDBTransaction.prototype)) { + return function (storeNames, ...args) { + const tx = func.call(unwrap(this), storeNames, ...args); + transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]); + return wrap(tx); + }; + } + // Cursor methods are special, as the behaviour is a little more different to standard IDB. In + // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the + // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense + // with real promises, so each advance methods returns a new promise for the cursor object, or + // undefined if the end of the cursor has been reached. + if (getCursorAdvanceMethods().includes(func)) { + return function (...args) { + // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use + // the original object. + func.apply(unwrap(this), args); + return wrap(cursorRequestMap.get(this)); + }; + } + return function (...args) { + // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use + // the original object. + return wrap(func.apply(unwrap(this), args)); + }; +} +function transformCachableValue(value) { + if (typeof value === 'function') + return wrapFunction(value); + // This doesn't return, it just creates a 'done' promise for the transaction, + // which is later returned for transaction.done (see idbObjectHandler). + if (value instanceof IDBTransaction) + cacheDonePromiseForTransaction(value); + if (instanceOfAny(value, getIdbProxyableTypes())) + return new Proxy(value, idbProxyTraps); + // Return the same value back if we're not going to transform it. + return value; +} +function wrap(value) { + // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because + // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached. + if (value instanceof IDBRequest) + return promisifyRequest(value); + // If we've already transformed this value before, reuse the transformed value. + // This is faster, but it also provides object equality. + if (transformCache.has(value)) + return transformCache.get(value); + const newValue = transformCachableValue(value); + // Not all types are transformed. + // These may be primitive types, so they can't be WeakMap keys. + if (newValue !== value) { + transformCache.set(value, newValue); + reverseTransformCache.set(newValue, value); + } + return newValue; +} const unwrap = (value) => reverseTransformCache.get(value); -export { wrap as a, addTraps as b, instanceOfAny as c, reverseTransformCache as d, unwrap as e }; +export { addTraps as a, instanceOfAny as i, reverseTransformCache as r, unwrap as u, wrap as w }; diff --git a/build/esm/wrap-idb-value.js.map b/build/esm/wrap-idb-value.js.map new file mode 100644 index 0000000..209b4e3 --- /dev/null +++ b/build/esm/wrap-idb-value.js.map @@ -0,0 +1 @@ +{"version":3,"file":"wrap-idb-value.js","sourceRoot":"","sources":["../../src/wrap-idb-value.ts"],"names":[],"mappings":"AAQA,OAAO,EAAqB,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE1D,IAAI,iBAAgC,CAAC;AACrC,IAAI,oBAA4B,CAAC;AAEjC,qEAAqE;AACrE,SAAS,oBAAoB;IAC3B,OAAO,CACL,iBAAiB;QACjB,CAAC,iBAAiB,GAAG;YACnB,WAAW;YACX,cAAc;YACd,QAAQ;YACR,SAAS;YACT,cAAc;SACf,CAAC,CACH,CAAC;AACJ,CAAC;AAED,qEAAqE;AACrE,SAAS,uBAAuB;IAC9B,OAAO,CACL,oBAAoB;QACpB,CAAC,oBAAoB,GAAG;YACtB,SAAS,CAAC,SAAS,CAAC,OAAO;YAC3B,SAAS,CAAC,SAAS,CAAC,QAAQ;YAC5B,SAAS,CAAC,SAAS,CAAC,kBAAkB;SACvC,CAAC,CACH,CAAC;AACJ,CAAC;AAED,MAAM,gBAAgB,GAGlB,IAAI,OAAO,EAAE,CAAC;AAClB,MAAM,kBAAkB,GAGpB,IAAI,OAAO,EAAE,CAAC;AAClB,MAAM,wBAAwB,GAG1B,IAAI,OAAO,EAAE,CAAC;AAClB,MAAM,cAAc,GAAG,IAAI,OAAO,EAAE,CAAC;AACrC,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,OAAO,EAAE,CAAC;AAEnD,SAAS,gBAAgB,CAAI,OAAsB;IACjD,MAAM,OAAO,GAAG,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACjD,MAAM,QAAQ,GAAG,GAAG,EAAE;YACpB,OAAO,CAAC,mBAAmB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YAChD,OAAO,CAAC,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAC9C,CAAC,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AU,EAAO,EAAE,CAChD,qBAAqB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC"} \ No newline at end of file diff --git a/build/iife/index-min.js b/build/iife/index-min.js index dd889b1..a0f70ad 100644 --- a/build/iife/index-min.js +++ b/build/iife/index-min.js @@ -1 +1 @@ -var idb=function(e){"use strict";const t=(e,t)=>t.some(t=>e instanceof t);let n,r;const o=new WeakMap,s=new WeakMap,a=new WeakMap,i=new WeakMap,c=new WeakMap;let u={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return s.get(e);if("objectStoreNames"===t)return e.objectStoreNames||a.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return p(e[t])},has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function d(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(r||(r=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(l(this),t),p(o.get(this))}:function(...t){return p(e.apply(l(this),t))}:function(t,...n){const r=e.call(l(this),t,...n);return a.set(r,t.sort?t.sort():[t]),p(r)}}function f(e){return"function"==typeof e?d(e):(e instanceof IDBTransaction&&function(e){if(s.has(e))return;const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",s),e.removeEventListener("abort",s)},o=()=>{t(),r()},s=()=>{n(e.error),r()};e.addEventListener("complete",o),e.addEventListener("error",s),e.addEventListener("abort",s)});s.set(e,t)}(e),t(e,n||(n=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,u):e)}function p(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",s)},o=()=>{t(p(e.result)),r()},s=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",s)});return t.then(t=>{t instanceof IDBCursor&&o.set(t,e)}).catch(()=>{}),c.set(t,e),t}(e);if(i.has(e))return i.get(e);const t=f(e);return t!==e&&(i.set(e,t),c.set(t,e)),t}const l=e=>c.get(e);const D=["get","getKey","getAll","getAllKeys","count"],v=["put","add","delete","clear"],B=new Map;function I(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(B.get(t))return B.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=v.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!D.includes(n))return;const s=async function(e,...t){const s=this.transaction(e,o?"readwrite":"readonly");let a=s.store;r&&(a=a.index(t.shift()));const i=a[n](...t);return o&&await s.done,i};return B.set(t,s),s}return u=(e=>({get:(t,n,r)=>I(t,n)||e.get(t,n,r),has:(t,n)=>!!I(t,n)||e.has(t,n)}))(u),e.openDB=function(e,t,{blocked:n,upgrade:r,blocking:o}={}){const s=indexedDB.open(e,t),a=p(s);return r&&s.addEventListener("upgradeneeded",e=>{r(p(s.result),e.oldVersion,e.newVersion,p(s.transaction))}),n&&s.addEventListener("blocked",()=>n()),o&&a.then(e=>e.addEventListener("versionchange",o)).catch(()=>{}),a},e.deleteDB=function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",()=>t()),p(n).then(()=>void 0)},e.unwrap=l,e.wrap=p,e}({}); +var idb=function(e){"use strict";let t,n;const r=new WeakMap,o=new WeakMap,s=new WeakMap,a=new WeakMap,i=new WeakMap;let c={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return o.get(e);if("objectStoreNames"===t)return e.objectStoreNames||s.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return f(e[t])},has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function u(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(n||(n=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(p(this),t),f(r.get(this))}:function(...t){return f(e.apply(p(this),t))}:function(t,...n){const r=e.call(p(this),t,...n);return s.set(r,t.sort?t.sort():[t]),f(r)}}function d(e){return"function"==typeof e?u(e):(e instanceof IDBTransaction&&function(e){if(o.has(e))return;const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",s),e.removeEventListener("abort",s)},o=()=>{t(),r()},s=()=>{n(e.error),r()};e.addEventListener("complete",o),e.addEventListener("error",s),e.addEventListener("abort",s)});o.set(e,t)}(e),n=e,(t||(t=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(e=>n instanceof e)?new Proxy(e,c):e);var n}function f(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",s)},o=()=>{t(f(e.result)),r()},s=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",s)});return t.then(t=>{t instanceof IDBCursor&&r.set(t,e)}).catch(()=>{}),i.set(t,e),t}(e);if(a.has(e))return a.get(e);const t=d(e);return t!==e&&(a.set(e,t),i.set(t,e)),t}const p=e=>i.get(e);const l=["get","getKey","getAll","getAllKeys","count"],D=["put","add","delete","clear"],v=new Map;function B(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(v.get(t))return v.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=D.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!l.includes(n))return;const s=async function(e,...t){const s=this.transaction(e,o?"readwrite":"readonly");let a=s.store;r&&(a=a.index(t.shift()));const i=a[n](...t);return o&&await s.done,i};return v.set(t,s),s}return c=(e=>({get:(t,n,r)=>B(t,n)||e.get(t,n,r),has:(t,n)=>!!B(t,n)||e.has(t,n)}))(c),e.deleteDB=function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",()=>t()),f(n).then(()=>{})},e.openDB=function(e,t,{blocked:n,upgrade:r,blocking:o}={}){const s=indexedDB.open(e,t),a=f(s);return r&&s.addEventListener("upgradeneeded",e=>{r(f(s.result),e.oldVersion,e.newVersion,f(s.transaction))}),n&&s.addEventListener("blocked",()=>n()),o&&a.then(e=>e.addEventListener("versionchange",o)).catch(()=>{}),a},e.unwrap=p,e.wrap=f,e}({}); diff --git a/build/iife/with-async-ittr-min.js b/build/iife/with-async-ittr-min.js index 74d646a..59a27a4 100644 --- a/build/iife/with-async-ittr-min.js +++ b/build/iife/with-async-ittr-min.js @@ -1 +1 @@ -var idb=function(e){"use strict";const t=(e,t)=>t.some(t=>e instanceof t);let n,r;const o=new WeakMap,s=new WeakMap,a=new WeakMap,i=new WeakMap,c=new WeakMap;let u={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return s.get(e);if("objectStoreNames"===t)return e.objectStoreNames||a.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return l(e[t])},has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function d(e){u=e(u)}function f(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(r||(r=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(D(this),t),l(o.get(this))}:function(...t){return l(e.apply(D(this),t))}:function(t,...n){const r=e.call(D(this),t,...n);return a.set(r,t.sort?t.sort():[t]),l(r)}}function p(e){return"function"==typeof e?f(e):(e instanceof IDBTransaction&&function(e){if(s.has(e))return;const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",s),e.removeEventListener("abort",s)},o=()=>{t(),r()},s=()=>{n(e.error),r()};e.addEventListener("complete",o),e.addEventListener("error",s),e.addEventListener("abort",s)});s.set(e,t)}(e),t(e,n||(n=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,u):e)}function l(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",s)},o=()=>{t(l(e.result)),r()},s=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",s)});return t.then(t=>{t instanceof IDBCursor&&o.set(t,e)}).catch(()=>{}),c.set(t,e),t}(e);if(i.has(e))return i.get(e);const t=p(e);return t!==e&&(i.set(e,t),c.set(t,e)),t}const D=e=>c.get(e);const I=["get","getKey","getAll","getAllKeys","count"],B=["put","add","delete","clear"],v=new Map;function g(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(v.get(t))return v.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=B.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!I.includes(n))return;const s=async function(e,...t){const s=this.transaction(e,o?"readwrite":"readonly");let a=s.store;r&&(a=a.index(t.shift()));const i=a[n](...t);return o&&await s.done,i};return v.set(t,s),s}d(e=>({get:(t,n,r)=>g(t,n)||e.get(t,n,r),has:(t,n)=>!!g(t,n)||e.has(t,n)}));const y=["continue","continuePrimaryKey","advance"],b={},h=new WeakMap,m=new WeakMap,w={get(e,t){if(!y.includes(t))return e[t];let n=b[t];return n||(n=b[t]=function(...e){h.set(this,m.get(this)[t](...e))}),n}};async function*E(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;t=t;const n=new Proxy(t,w);for(m.set(n,t),c.set(n,D(t));t;)yield n,t=await(h.get(n)||t.continue()),h.delete(n)}function L(e,n){return n===Symbol.asyncIterator&&t(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===n&&t(e,[IDBIndex,IDBObjectStore])}return d(e=>({get:(t,n,r)=>L(t,n)?E:e.get(t,n,r),has:(t,n)=>L(t,n)||e.has(t,n)})),e.openDB=function(e,t,{blocked:n,upgrade:r,blocking:o}={}){const s=indexedDB.open(e,t),a=l(s);return r&&s.addEventListener("upgradeneeded",e=>{r(l(s.result),e.oldVersion,e.newVersion,l(s.transaction))}),n&&s.addEventListener("blocked",()=>n()),o&&a.then(e=>e.addEventListener("versionchange",o)).catch(()=>{}),a},e.deleteDB=function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",()=>t()),l(n).then(()=>void 0)},e.unwrap=D,e.wrap=l,e}({}); +var idb=function(e){"use strict";const t=(e,t)=>t.some(t=>e instanceof t);let n,r;const o=new WeakMap,s=new WeakMap,a=new WeakMap,i=new WeakMap,c=new WeakMap;let u={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return s.get(e);if("objectStoreNames"===t)return e.objectStoreNames||a.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return l(e[t])},has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function d(e){u=e(u)}function f(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(r||(r=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(D(this),t),l(o.get(this))}:function(...t){return l(e.apply(D(this),t))}:function(t,...n){const r=e.call(D(this),t,...n);return a.set(r,t.sort?t.sort():[t]),l(r)}}function p(e){return"function"==typeof e?f(e):(e instanceof IDBTransaction&&function(e){if(s.has(e))return;const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",s),e.removeEventListener("abort",s)},o=()=>{t(),r()},s=()=>{n(e.error),r()};e.addEventListener("complete",o),e.addEventListener("error",s),e.addEventListener("abort",s)});s.set(e,t)}(e),t(e,n||(n=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,u):e)}function l(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",s)},o=()=>{t(l(e.result)),r()},s=()=>{n(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",s)});return t.then(t=>{t instanceof IDBCursor&&o.set(t,e)}).catch(()=>{}),c.set(t,e),t}(e);if(i.has(e))return i.get(e);const t=p(e);return t!==e&&(i.set(e,t),c.set(t,e)),t}const D=e=>c.get(e);const I=["get","getKey","getAll","getAllKeys","count"],B=["put","add","delete","clear"],g=new Map;function v(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(g.get(t))return g.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,o=B.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!I.includes(n))return;const s=async function(e,...t){const s=this.transaction(e,o?"readwrite":"readonly");let a=s.store;r&&(a=a.index(t.shift()));const i=a[n](...t);return o&&await s.done,i};return g.set(t,s),s}d(e=>({get:(t,n,r)=>v(t,n)||e.get(t,n,r),has:(t,n)=>!!v(t,n)||e.has(t,n)}));const y=["continue","continuePrimaryKey","advance"],b={},h=new WeakMap,m=new WeakMap,w={get(e,t){if(!y.includes(t))return e[t];let n=b[t];return n||(n=b[t]=function(...e){h.set(this,m.get(this)[t](...e))}),n}};async function*E(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;t=t;const n=new Proxy(t,w);for(m.set(n,t),c.set(n,D(t));t;)yield n,t=await(h.get(n)||t.continue()),h.delete(n)}function L(e,n){return n===Symbol.asyncIterator&&t(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===n&&t(e,[IDBIndex,IDBObjectStore])}return d(e=>({get:(t,n,r)=>L(t,n)?E:e.get(t,n,r),has:(t,n)=>L(t,n)||e.has(t,n)})),e.deleteDB=function(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",()=>t()),l(n).then(()=>{})},e.openDB=function(e,t,{blocked:n,upgrade:r,blocking:o}={}){const s=indexedDB.open(e,t),a=l(s);return r&&s.addEventListener("upgradeneeded",e=>{r(l(s.result),e.oldVersion,e.newVersion,l(s.transaction))}),n&&s.addEventListener("blocked",()=>n()),o&&a.then(e=>e.addEventListener("versionchange",o)).catch(()=>{}),a},e.unwrap=D,e.wrap=l,e}({}); diff --git a/generic-tsconfig.json b/generic-tsconfig.json new file mode 100644 index 0000000..93721f1 --- /dev/null +++ b/generic-tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ES2020", + "downlevelIteration": true, + "module": "esnext", + "strict": true, + "moduleResolution": "node", + "outDir": ".ts-tmp", + "composite": true, + "declarationMap": true, + "baseUrl": "./", + "rootDir": "./", + "allowSyntheticDefaultImports": true, + "noUnusedLocals": true, + "sourceMap": true + } +} diff --git a/lib/simple-ts.js b/lib/simple-ts.js new file mode 100644 index 0000000..4fc100b --- /dev/null +++ b/lib/simple-ts.js @@ -0,0 +1,128 @@ +/** + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { spawn } from 'child_process'; +import { relative, join, parse } from 'path'; +import { promises as fsp } from 'fs'; +import { promisify } from 'util'; + +import * as ts from 'typescript'; +import glob from 'glob'; + +const globP = promisify(glob); + +const extRe = /\.tsx?$/; + +function loadConfig(mainPath) { + const fileName = ts.findConfigFile(mainPath, ts.sys.fileExists); + if (!fileName) throw Error('tsconfig not found'); + const text = ts.sys.readFile(fileName); + const loadedConfig = ts.parseConfigFileTextToJson(fileName, text).config; + const parsedTsConfig = ts.parseJsonConfigFileContent( + loadedConfig, + ts.sys, + process.cwd(), + undefined, + fileName, + ); + return parsedTsConfig; +} + +export default function simpleTS(mainPath, { noBuild, watch } = {}) { + const config = loadConfig(mainPath); + const args = ['-b', mainPath]; + + let done = Promise.resolve(); + + if (!noBuild) { + done = new Promise(resolve => { + const proc = spawn('tsc', args, { + stdio: 'inherit', + }); + + proc.on('exit', code => { + if (code !== 0) { + throw Error('TypeScript build failed'); + } + resolve(); + }); + }); + } + + if (!noBuild && watch) { + done.then(() => { + spawn('tsc', [...args, '--watch', '--preserveWatchOutput'], { + stdio: 'inherit', + }); + }); + } + + return { + name: 'simple-ts', + async buildStart() { + await done; + const matches = await globP(config.options.outDir + '/**/*.js'); + for (const match of matches) this.addWatchFile(match); + }, + resolveId(id, importer) { + // If there isn't an importer, it's an entry point, so we don't need to resolve it relative + // to something. + if (!importer) return null; + + const tsResolve = ts.resolveModuleName( + id, + importer, + config.options, + ts.sys, + ); + + if ( + // It didn't find anything + !tsResolve.resolvedModule || + // Or if it's linking to a definition file, it's something in node_modules, + // or something local like css.d.ts + tsResolve.resolvedModule.extension === '.d.ts' + ) { + return null; + } + return tsResolve.resolvedModule.resolvedFileName; + }, + async load(id) { + if (!extRe.test(id)) return null; + + // Look for the JS equivalent in the tmp folder + const basePath = join( + config.options.outDir, + relative(process.cwd(), id), + ).replace(extRe, ''); + + const srcP = fsp.readFile(basePath + '.js', { encoding: 'utf8' }); + + // Also copy maps and definitions + const assetExtensions = ['.d.ts', '.js.map', '.d.ts.map']; + + await Promise.all( + assetExtensions.map(async extension => { + const fileName = basePath + extension; + const source = await fsp.readFile(fileName); + this.emitFile({ + type: 'asset', + source, + fileName: parse(fileName).base, + }); + }) + ); + + return srcP; + }, + }; +} diff --git a/lib/size-report.mjs b/lib/size-report.mjs new file mode 100644 index 0000000..9c8fbe0 --- /dev/null +++ b/lib/size-report.mjs @@ -0,0 +1,35 @@ +/** + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { promisify } from 'util'; +import { brotliCompress } from 'zlib'; +import { promises as fsp } from 'fs'; + +import glob from 'glob'; +import filesize from 'filesize'; + +const globP = promisify(glob); +const brCompress = promisify(brotliCompress); + +(async function() { + const paths = await globP('build/iife/*.js'); + const entries = await Promise.all( + paths.map(async path => { + const br = await brCompress(await fsp.readFile(path)); + return [path, filesize(br.length)]; + }), + ); + + for (const [path, size] of entries) { + console.log(path, size); + } +})(); diff --git a/package-lock.json b/package-lock.json index 9a836df..a08cbbe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,18 +5,18 @@ "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", - "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", + "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", "dev": true, "requires": { "@babel/highlight": "^7.0.0" } }, "@babel/highlight": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", - "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", + "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", "dev": true, "requires": { "chalk": "^2.0.0", @@ -24,22 +24,91 @@ "js-tokens": "^4.0.0" } }, + "@nodelib/fs.scandir": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", + "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.3", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", + "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", + "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.3", + "fastq": "^1.6.0" + } + }, + "@rollup/plugin-commonjs": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-11.0.1.tgz", + "integrity": "sha512-SaVUoaLDg3KnIXC5IBNIspr1APTYDzk05VaYcI6qz+0XX3ZlSCwAkfAhNSOxfd5GAdcm/63Noi4TowOY9MpcDg==", + "requires": { + "@rollup/pluginutils": "^3.0.0", + "estree-walker": "^0.6.1", + "is-reference": "^1.1.2", + "magic-string": "^0.25.2", + "resolve": "^1.11.0" + } + }, + "@rollup/pluginutils": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.0.3.tgz", + "integrity": "sha512-lxys3KlfYU8LOGu7+UL2upa3kM9q8ISo4EK+vSqqJCLk6N74HsUZbUFiElolh4BUsv0jeMGtYDzpNrtrShE6Gg==", + "requires": { + "estree-walker": "^0.6.1" + } + }, "@types/chai": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.1.7.tgz", - "integrity": "sha512-2Y8uPt0/jwjhQ6EiluT0XCri1Dbplr0ZxfFXUz+ye13gaqE8u5gL5ppao1JrUYr9cIip5S6MvQzBS7Kke7U9VA==", + "version": "4.2.7", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.7.tgz", + "integrity": "sha512-luq8meHGYwvky0O7u0eQZdA7B4Wd9owUCqvbw2m3XCrCU8mplYOujMBbvyS547AxJkC+pGnd0Cm15eNxEUNU8g==", "dev": true }, "@types/estree": { - "version": "0.0.39", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", + "version": "0.0.42", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.42.tgz", + "integrity": "sha512-K1DPVvnBCPxzD+G51/cxVIoc2X8uUVl1zpJeE6iKcgHMj4+tbat5Xu4TjV7v2QSDbIeAfLi2hIk+u2+s0MlpUQ==", + "dev": true + }, + "@types/events": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", + "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", + "dev": true + }, + "@types/glob": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", + "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", + "dev": true, + "requires": { + "@types/events": "*", + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", "dev": true }, "@types/mocha": { - "version": "5.2.6", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.6.tgz", - "integrity": "sha512-1axi39YdtBI7z957vdqXI4Ac25e7YihYQtJa+Clnxg1zTJEaIRbndt71O3sP4GAMgiAm0pY26/b9BrY4MR/PMw==", + "version": "5.2.7", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", + "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==", "dev": true }, "@types/node": { @@ -48,12 +117,31 @@ "integrity": "sha512-D5Rt+HXgEywr3RQJcGlZUCTCx1qVbCZpVk3/tOOA6spLNZdGm8BU+zRgdRYDoF1pO3RuXLxADzMrF903JlQXqg==", "dev": true }, + "@types/resolve": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-0.0.8.tgz", + "integrity": "sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "acorn": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz", - "integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz", + "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==", "dev": true }, + "aggregate-error": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", + "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, "ansi-colors": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", @@ -61,9 +149,9 @@ "dev": true }, "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, "ansi-styles": { @@ -75,6 +163,16 @@ "color-convert": "^1.9.0" } }, + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -84,28 +182,10 @@ "sprintf-js": "~1.0.2" } }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true - }, - "array-find-index": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", - "dev": true - }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true }, "assertion-error": { @@ -114,90 +194,17 @@ "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", "dev": true }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true - }, - "atob": { - "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 - }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "requires": { - "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": { - "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.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": { - "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 - } - } + "binary-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", + "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==", + "dev": true }, "brace-expansion": { "version": "1.1.11", @@ -209,6 +216,15 @@ "concat-map": "0.0.1" } }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, "browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", @@ -221,54 +237,6 @@ "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", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", - "dev": true - }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "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": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - } - } - }, - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true - }, - "camelcase-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", - "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", - "dev": true, - "requires": { - "camelcase": "^4.1.0", - "map-obj": "^2.0.0", - "quick-lru": "^1.0.0" - } - }, "chai": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", @@ -292,6 +260,17 @@ "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" + }, + "dependencies": { + "supports-color": { + "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" + } + } } }, "check-error": { @@ -300,79 +279,67 @@ "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", "dev": true }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "chokidar": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz", + "integrity": "sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A==", "dev": true, "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "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.0" - } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - } + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.1", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.2.0" } }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", "dev": true, "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" }, "dependencies": { "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { - "ansi-regex": "^3.0.0" + "ansi-regex": "^4.1.0" } } } }, - "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=", - "dev": true - }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "dev": true, - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -388,22 +355,10 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, - "colors": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.3.3.tgz", - "integrity": "sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg==", - "dev": true - }, "commander": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", - "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", - "dev": true - }, - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, "concat-map": { @@ -413,45 +368,11 @@ "dev": true }, "conditional-type-checks": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/conditional-type-checks/-/conditional-type-checks-1.0.0.tgz", - "integrity": "sha512-4fvSNAF1LZs6TPiXNO1H6vCjUcSp/IQbhzb7Vr8jhFj0YBn9wagReuBvMGG406lheiFlyxgfcF23RYMZyGvbcQ==", - "dev": true - }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/conditional-type-checks/-/conditional-type-checks-1.0.5.tgz", + "integrity": "sha512-DkfkvmjXVe4ye4llJ1JADtO3dNvqqcQM08cA9BhNt9Oe8pyRW8X1CZyBg9Qst05bDV9BJM01KLmnFh78NcJgNg==", "dev": true }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "currently-unhandled": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", - "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", - "dev": true, - "requires": { - "array-find-index": "^1.0.1" - } - }, "debug": { "version": "3.2.6", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", @@ -459,14 +380,6 @@ "dev": true, "requires": { "ms": "^2.1.1" - }, - "dependencies": { - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - } } }, "decamelize": { @@ -475,30 +388,6 @@ "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, - "decamelize-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", - "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", - "dev": true, - "requires": { - "decamelize": "^1.1.0", - "map-obj": "^1.0.0" - }, - "dependencies": { - "map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", - "dev": true - } - } - }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "dev": true - }, "deep-eql": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", @@ -517,113 +406,82 @@ "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": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "dev": true, - "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" + "del": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/del/-/del-5.1.0.tgz", + "integrity": "sha512-wH9xOVHnczo9jN2IW68BabcecVPxacIA3g/7z6vhSU/4stOKQzeCRK0yD0A24WiAAUJmmVpWqrERcTxnLo3AnA==", + "dev": true, + "requires": { + "globby": "^10.0.1", + "graceful-fs": "^4.2.2", + "is-glob": "^4.0.1", + "is-path-cwd": "^2.2.0", + "is-path-inside": "^3.0.1", + "p-map": "^3.0.0", + "rimraf": "^3.0.0", + "slash": "^3.0.0" }, "dependencies": { - "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==", + "graceful-fs": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", + "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", "dev": true } } }, - "detect-file": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", - "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", - "dev": true - }, "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true }, - "duplexer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", - "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", - "dev": true - }, - "end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "dev": true, "requires": { - "once": "^1.4.0" + "path-type": "^4.0.0" + }, + "dependencies": { + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + } } }, - "error-ex": { - "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" - } + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true }, "es-abstract": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", - "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.0.tgz", + "integrity": "sha512-yYkE07YF+6SIBmg1MsJ9dlub5L48Ek7X0qz+c/CPCHS9EBXfESorzng4cJQjJW5/pB6vDF41u7F8vUhLVDqIug==", "dev": true, "requires": { - "es-to-primitive": "^1.2.0", + "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", - "is-callable": "^1.1.4", - "is-regex": "^1.0.4", - "object-keys": "^1.0.12" + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" } }, "es-to-primitive": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", - "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", "dev": true, "requires": { "is-callable": "^1.1.4", @@ -644,431 +502,74 @@ "dev": true }, "estree-walker": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.5.2.tgz", - "integrity": "sha512-XpCnW/AE10ws/kDAs37cngSkvgIR8aN3G0MS85m7dUpuK2EREo9VJ00uvw6Dg/hXEpfsE1I1TvJOJr+Z+TL+ig==", - "dev": true + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", + "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==" }, "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "fast-glob": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.1.1.tgz", + "integrity": "sha512-nTCREpBY8w8r+boyFYAx21iL6faSsQynliPHM4Uf56SbkyohCNxpVPEH9xrF5TXKy+IsjkPUHDKiUkzBVRXn9g==", "dev": true, "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" + "@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" } }, - "expand-tilde": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", - "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "fastq": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.6.0.tgz", + "integrity": "sha512-jmxqQ3Z/nXoeyDmWAzF9kH1aGZSis6e/SbfPmJpUnyZ0ogr6iscHQaml4wsEepEWSdtmpy+eVXmCRIMpxaXqOA==", "dev": true, "requires": { - "homedir-polyfill": "^1.0.1" + "reusify": "^1.0.0" } }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "filesize": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/filesize/-/filesize-6.0.1.tgz", + "integrity": "sha512-u4AYWPgbI5GBhs6id1KdImZWn5yfyFrrQ8OWZdN7ZMfA8Bf4HcO0BGo9bmUIEV8yrp8I1xVfJ/dn90GtFNNJcg==", + "dev": true + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, "requires": { - "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": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } + "to-regex-range": "^5.0.1" } }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "flat": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", + "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==", "dev": true, "requires": { - "locate-path": "^2.0.0" + "is-buffer": "~2.0.3" } }, - "findup-sync": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", - "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.2.tgz", + "integrity": "sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==", "dev": true, - "requires": { - "detect-file": "^1.0.0", - "is-glob": "^3.1.0", - "micromatch": "^3.0.4", - "resolve-dir": "^1.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 - }, - "braces": { - "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", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "requires": { - "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": { - "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.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-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": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "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": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "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.0", - "snapdragon": "^0.8.1", - "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.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "is-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" - } - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "^2.1.0" - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "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 - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - } - } - }, - "flat": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", - "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==", - "dev": true, - "requires": { - "is-buffer": "~2.0.3" - }, - "dependencies": { - "is-buffer": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz", - "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==", - "dev": true - } - } - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "requires": { - "map-cache": "^0.2.2" - } - }, - "fs-extra": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "optional": true }, "function-bind": { "version": "1.1.1", @@ -1076,31 +577,22 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, "get-func-name": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", "dev": true }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true - }, "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -1111,63 +603,37 @@ "path-is-absolute": "^1.0.0" } }, - "global-modules": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "glob-parent": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", + "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", "dev": true, "requires": { - "global-prefix": "^1.0.1", - "is-windows": "^1.0.1", - "resolve-dir": "^1.0.0" + "is-glob": "^4.0.1" } }, - "global-prefix": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", - "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", + "globby": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.1.tgz", + "integrity": "sha512-sSs4inE1FB2YQiymcmTv6NWENryABjUNPeWhOvmn4SjtKybglsyPZxFB3U1/+L1bYi0rNZDqCLlHyLYDl1Pq5A==", "dev": true, "requires": { - "expand-tilde": "^2.0.2", - "homedir-polyfill": "^1.0.1", - "ini": "^1.3.4", - "is-windows": "^1.0.1", - "which": "^1.2.14" + "@types/glob": "^7.1.1", + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.0.3", + "glob": "^7.1.3", + "ignore": "^5.1.1", + "merge2": "^1.2.3", + "slash": "^3.0.0" } }, - "graceful-fs": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", - "dev": true - }, "growl": { "version": "1.10.5", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", "dev": true }, - "gzip-size": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-5.0.0.tgz", - "integrity": "sha512-5iI7omclyqrnWw4XbXAmGhPsABkSIDQonv2K0h61lybgofWa6iZyvrI3r2zsJH4P8Nb64fFVzlvfhs0g7BBxAA==", - "dev": true, - "requires": { - "duplexer": "^0.1.1", - "pify": "^3.0.0" - } - }, - "gzip-size-cli": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/gzip-size-cli/-/gzip-size-cli-3.0.0.tgz", - "integrity": "sha512-QrOTU2SCtiWPYiWk5hYO0hYfDb/tGn3fb+03fCzDZf3cvAlp4HtIc+tsVjk84XNmdcaOCJOLvVFq8V+QUqyWqw==", - "dev": true, - "requires": { - "gzip-size": "^5.0.0", - "meow": "^5.0.0", - "pretty-bytes": "^5.1.0" - } - }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -1184,96 +650,27 @@ "dev": true }, "has-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", - "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", "dev": true }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "dev": true, - "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - } - } - }, - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "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.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true }, - "homedir-polyfill": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", - "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", - "dev": true, - "requires": { - "parse-passwd": "^1.0.0" - } - }, - "hosted-git-info": { - "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==", + "ignore": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.4.tgz", + "integrity": "sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A==", "dev": true }, "indent-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true }, "inflight": { @@ -1287,97 +684,42 @@ } }, "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - }, - "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "dev": true - }, - "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, - "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=", + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, "requires": { - "kind-of": "^3.0.2" + "binary-extensions": "^2.0.0" } }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", + "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==", "dev": true }, - "is-builtin-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", - "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", - "dev": true, - "requires": { - "builtin-modules": "^1.0.0" - } - }, "is-callable": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", + "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", "dev": true }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, "is-date-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", "dev": true }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.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-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, "is-fullwidth-code-point": { @@ -1386,71 +728,72 @@ "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, "is-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", "dev": true }, - "is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, + "is-path-cwd": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", + "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==", + "dev": true + }, + "is-path-inside": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.2.tgz", + "integrity": "sha512-/2UGPSgmtqwo1ktx8NDHjuPwZWmHhO+gj0f93EkhLB5RgW9RZevWYYlIkS6zePc6U2WpOdQYIwHe9YC4DWEBVg==", + "dev": true + }, + "is-reference": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.1.4.tgz", + "integrity": "sha512-uJA/CDPO3Tao3GTrxYn6AwkM4nUPJiGGYu5+cB8qbC7WGFlrKZbiRo7SFKxUAEpFUfiHofWCXBUNhvYJMh+6zw==", "requires": { - "isobject": "^3.0.1" + "@types/estree": "0.0.39" }, "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true + "@types/estree": { + "version": "0.0.39", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==" } } }, "is-regex": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", - "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", "dev": true, "requires": { - "has": "^1.0.1" + "has": "^1.0.3" } }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true - }, "is-symbol": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", - "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", "dev": true, "requires": { - "has-symbols": "^1.0.0" + "has-symbols": "^1.0.1" } }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -1458,13 +801,12 @@ "dev": true }, "jest-worker": { - "version": "24.3.1", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.3.1.tgz", - "integrity": "sha512-ZCoAe/iGLzTJvWHrO8fyx3bmEQhpL16SILJmWHKe8joHhyF3z00psF1sCRT54DoHw5GJG0ZpUtGy+ylvwA4haA==", + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.9.0.tgz", + "integrity": "sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw==", "dev": true, "requires": { - "@types/node": "*", - "merge-stream": "^1.0.1", + "merge-stream": "^2.0.0", "supports-color": "^6.1.0" }, "dependencies": { @@ -1485,65 +827,20 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "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" - } - }, - "lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "dev": true, - "requires": { - "invert-kv": "^2.0.0" - } - }, - "load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", "dev": true, "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" + "argparse": "^1.0.7", + "esprima": "^4.0.0" } }, "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true }, "log-symbols": { @@ -1555,105 +852,43 @@ "chalk": "^2.0.1" } }, - "loud-rejection": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", - "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", - "dev": true, - "requires": { - "currently-unhandled": "^0.4.1", - "signal-exit": "^3.0.0" - } - }, "magic-string": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.2.tgz", - "integrity": "sha512-iLs9mPjh9IuTtRsqqhNGYcZXGei0Nh/A4xirrsqW7c+QhKVFL2vm7U09ru6cHRD22azaP/wMDgI+HCqbETMTtg==", - "dev": true, + "version": "0.25.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.5.tgz", + "integrity": "sha512-vIO/BOm9odBHBAGwv0gZPLJeO9IpwliiIc0uPeAW93rrFMJ/R3M665IAEfOU/IW3kD4S9AtEn76lfTn1Yif+9A==", "requires": { "sourcemap-codec": "^1.4.4" } }, - "map-age-cleaner": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", - "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", - "dev": true, - "requires": { - "p-defer": "^1.0.0" - } - }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, - "map-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", - "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", + "merge2": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.3.0.tgz", + "integrity": "sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw==", "dev": true }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", "dev": true, "requires": { - "object-visit": "^1.0.0" + "braces": "^3.0.1", + "picomatch": "^2.0.5" } }, - "mem": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.1.0.tgz", - "integrity": "sha512-I5u6Q1x7wxO0kdOpYBB28xueHADYps5uty/zg936CiG8NTe5sJL8EjrCuLneuDW3PlMdZBGDIn8BirEVdovZvg==", + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^1.0.0", - "p-is-promise": "^2.0.0" - } - }, - "meow": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-5.0.0.tgz", - "integrity": "sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig==", - "dev": true, - "requires": { - "camelcase-keys": "^4.0.0", - "decamelize-keys": "^1.0.0", - "loud-rejection": "^1.0.0", - "minimist-options": "^3.0.1", - "normalize-package-data": "^2.3.4", - "read-pkg-up": "^3.0.0", - "redent": "^2.0.0", - "trim-newlines": "^2.0.0", - "yargs-parser": "^10.0.0" - } - }, - "merge-stream": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz", - "integrity": "sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE=", - "dev": true, - "requires": { - "readable-stream": "^2.0.1" - } - }, - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^1.1.7" } }, "minimist": { @@ -1662,37 +897,6 @@ "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, - "minimist-options": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", - "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", - "dev": true, - "requires": { - "arrify": "^1.0.1", - "is-plain-obj": "^1.1.0" - } - }, - "mixin-deep": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", - "dev": true, - "requires": { - "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": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, "mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", @@ -1703,71 +907,104 @@ } }, "mocha": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.0.2.tgz", - "integrity": "sha512-RtTJsmmToGyeTznSOMoM6TPEk1A84FQaHIciKrRqARZx+B5ccJ5tXlmJzEKGBxZdqk9UjpRsesZTUkZmR5YnuQ==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.0.0.tgz", + "integrity": "sha512-CirsOPbO3jU86YKjjMzFLcXIb5YiGLUrjrXFHoJ3e2z9vWiaZVCZQ2+gtRGMPWF+nFhN6AWwLM/juzAQ6KRkbA==", "dev": true, "requires": { "ansi-colors": "3.2.3", "browser-stdout": "1.3.1", + "chokidar": "3.3.0", "debug": "3.2.6", "diff": "3.5.0", "escape-string-regexp": "1.0.5", - "findup-sync": "2.0.0", + "find-up": "3.0.0", "glob": "7.1.3", "growl": "1.10.5", "he": "1.2.0", - "js-yaml": "3.12.0", + "js-yaml": "3.13.1", "log-symbols": "2.2.0", "minimatch": "3.0.4", "mkdirp": "0.5.1", "ms": "2.1.1", - "node-environment-flags": "1.0.4", + "node-environment-flags": "1.0.6", "object.assign": "4.1.0", "strip-json-comments": "2.0.1", "supports-color": "6.0.0", "which": "1.3.1", "wide-align": "1.1.3", - "yargs": "12.0.5", - "yargs-parser": "11.1.1", - "yargs-unparser": "1.5.0" + "yargs": "13.3.0", + "yargs-parser": "13.1.1", + "yargs-unparser": "1.6.0" }, "dependencies": { "camelcase": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.2.0.tgz", - "integrity": "sha512-IXFsBS2pC+X0j0N/GE7Dm7j3bsEBp+oTpb7F50dwEVX7rf3IgwO9XatnegTsDtniKCUtEJH4fSU6Asw7uoVLfQ==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, - "js-yaml": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", - "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", "dev": true, "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "locate-path": "^3.0.0" } }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } }, - "supports-color": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", - "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.2.tgz", + "integrity": "sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" } }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, "yargs-parser": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", - "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", + "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", "dev": true, "requires": { "camelcase": "^5.0.0", @@ -1777,136 +1014,46 @@ } }, "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "nanomatch": { - "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": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - } - } - }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true }, "node-environment-flags": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.4.tgz", - "integrity": "sha512-M9rwCnWVLW7PX+NUWe3ejEdiLYinRpsEre9hMkU/6NS4h+EEulYaDH1gCEZ2gyXsmw+RXYDaV2JkkTNcsPDJ0Q==", - "dev": true, - "requires": { - "object.getownpropertydescriptors": "^2.0.3" - } - }, - "normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "is-builtin-module": "^1.0.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "dev": true, - "requires": { - "path-key": "^2.0.0" - } - }, - "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=", - "dev": true - }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.6.tgz", + "integrity": "sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw==", "dev": true, "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" + "object.getownpropertydescriptors": "^2.0.3", + "semver": "^5.7.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.0" - } + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true } } }, - "object-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.0.tgz", - "integrity": "sha512-6OO5X1+2tYkNyNEx6TsCxEqFfRWaqx6EtMiSbGrw8Ob8v9Ne+Hl8rBAgLBZn5wjEz3s/s6U1WXFUFOcxxAwUpg==", + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "requires": { - "isobject": "^3.0.0" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - } - } + "object-inspect": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==", + "dev": true + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true }, "object.assign": { "version": "4.1.0", @@ -1921,30 +1068,13 @@ } }, "object.getownpropertydescriptors": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", - "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.5.1" - } - }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", + "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==", "dev": true, "requires": { - "isobject": "^3.0.1" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - } + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" } }, "once": { @@ -1956,81 +1086,15 @@ "wrappy": "1" } }, - "os-locale": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", - "dev": true, - "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" - } - }, - "p-defer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", - "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", - "dev": true - }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true - }, - "p-is-promise": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.0.0.tgz", - "integrity": "sha512-pzQPhYMCAgLAKPWD2jC3Se9fEfrD9npNos0y150EeqZll7akhEgGhTW/slB6lHku8AvYGiJ+YJ5hfHKePPgFWg==", - "dev": true - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - }, - "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", "dev": true, "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" + "aggregate-error": "^3.0.0" } }, - "parse-passwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", - "dev": true - }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true - }, "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", @@ -2043,26 +1107,10 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - }, "path-parse": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true - }, - "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, - "requires": { - "pify": "^3.0.0" - } + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" }, "pathval": { "version": "1.1.0", @@ -2070,893 +1118,167 @@ "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", "dev": true }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - }, - "posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "picomatch": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.1.tgz", + "integrity": "sha512-ISBaA8xQNmwELC7eOjqFKMESB2VIqt4PPDD0nsS95b/9dZXvVKOlz9keMSnoGGKcOHXfTvDD6WMaRoSc9UuhRA==", "dev": true }, "prettier": { - "version": "1.18.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.18.2.tgz", - "integrity": "sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==", - "dev": true - }, - "pretty-bytes": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.1.0.tgz", - "integrity": "sha512-wa5+qGVg9Yt7PB6rYm3kXlKzgzgivYTLRandezh43jjRqgyDyP+9YxfJpJiLs9yKD1WeU8/OvtToWpW7255FtA==", + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", + "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", "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": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", - "dev": true - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "quick-lru": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", - "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", - "dev": true - }, - "read-pkg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", - "dev": true, - "requires": { - "load-json-file": "^4.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" - } - }, - "read-pkg-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", - "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", - "dev": true, - "requires": { - "find-up": "^2.0.0", - "read-pkg": "^3.0.0" - } - }, - "readable-stream": { - "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": { - "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" - } - }, - "redent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", - "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", - "dev": true, - "requires": { - "indent-string": "^3.0.0", - "strip-indent": "^2.0.0" - } - }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "readdirp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", + "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", "dev": true, "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" + "picomatch": "^2.0.4" } }, - "repeat-element": { - "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": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true - }, "require-directory": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true - }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", - "dev": true - }, - "resolve": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", - "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - }, - "resolve-dir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", - "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", - "dev": true, - "requires": { - "expand-tilde": "^2.0.0", - "global-modules": "^1.0.0" - } - }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true - }, - "rollup": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.6.1.tgz", - "integrity": "sha512-2giWBZjBepr/25vkds/EzpC52xySDyhX1wPGaJ69cnZJHCuYTzIJKFzJB1DTZ8C7A1FocBbG0KhS/No3whXmzw==", - "dev": true, - "requires": { - "@types/estree": "0.0.39", - "@types/node": "^11.9.5", - "acorn": "^6.1.1" - } - }, - "rollup-plugin-commonjs": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-9.2.1.tgz", - "integrity": "sha512-X0A/Cp/t+zbONFinBhiTZrfuUaVwRIp4xsbKq/2ohA2CDULa/7ONSJTelqxon+Vds2R2t2qJTqJQucKUC8GKkw==", - "dev": true, - "requires": { - "estree-walker": "^0.5.2", - "magic-string": "^0.25.1", - "resolve": "^1.10.0", - "rollup-pluginutils": "^2.3.3" - }, - "dependencies": { - "resolve": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", - "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - } - } - }, - "rollup-plugin-copy": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/rollup-plugin-copy/-/rollup-plugin-copy-0.2.3.tgz", - "integrity": "sha1-2sGrgdHyILrrmOXEwBCCUuHtu5g=", - "dev": true, - "requires": { - "colors": "^1.1.2", - "fs-extra": "^3.0.0" - }, - "dependencies": { - "fs-extra": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-3.0.1.tgz", - "integrity": "sha1-N5TzeMWLNC6n27sjCVEJxLO2IpE=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^3.0.0", - "universalify": "^0.1.0" - } - }, - "jsonfile": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-3.0.1.tgz", - "integrity": "sha1-pezG9l9T9mLEQVx2daAzHQmS7GY=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - } - } - }, - "rollup-plugin-node-resolve": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-4.0.1.tgz", - "integrity": "sha512-fSS7YDuCe0gYqKsr5OvxMloeZYUSgN43Ypi1WeRZzQcWtHgFayV5tUSPYpxuaioIIWaBXl6NrVk0T2/sKwueLg==", - "dev": true, - "requires": { - "builtin-modules": "^3.0.0", - "is-module": "^1.0.0", - "resolve": "^1.10.0" - }, - "dependencies": { - "builtin-modules": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.0.0.tgz", - "integrity": "sha512-hMIeU4K2ilbXV6Uv93ZZ0Avg/M91RaKXucQ+4me2Do1txxBDyDZWCBa5bJSLqoNTRpXTLwEzIk1KmloenDDjhg==", - "dev": true - }, - "resolve": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", - "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - } - } - }, - "rollup-plugin-terser": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-4.0.4.tgz", - "integrity": "sha512-wPANT5XKVJJ8RDUN0+wIr7UPd0lIXBo4UdJ59VmlPCtlFsE20AM+14pe+tk7YunCsWEiuzkDBY3QIkSCjtrPXg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "jest-worker": "^24.0.0", - "serialize-javascript": "^1.6.1", - "terser": "^3.14.1" - } - }, - "rollup-plugin-typescript2": { - "version": "0.20.1", - "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.20.1.tgz", - "integrity": "sha512-uxA5JQNOfmJ9rsO0yJKTObb1t4nNYUexCg9zxhEKF+NzZwljYWdfgrA06UzA24cOk8fQjGEe7Q5+Vge2vFlnnw==", - "dev": true, - "requires": { - "fs-extra": "7.0.1", - "resolve": "1.10.0", - "rollup-pluginutils": "2.4.1", - "tslib": "1.9.3" - } - }, - "rollup-pluginutils": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.4.1.tgz", - "integrity": "sha512-wesMQ9/172IJDIW/lYWm0vW0LiKe5Ekjws481R7z9WTRtmO59cqyM/2uUlxvf6yzm/fElFmHUobeQOYz46dZJw==", - "dev": true, - "requires": { - "estree-walker": "^0.6.0", - "micromatch": "^3.1.10" - }, - "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 - }, - "braces": { - "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", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "estree-walker": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.0.tgz", - "integrity": "sha512-peq1RfVAVzr3PU/jL31RaOjUKLoZJpObQWJJ+LgfcxDUifyLZ1RjPQZTl0pzj2uJ45b7A7XpyppXvxdEqzo4rw==", - "dev": true - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "requires": { - "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": { - "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.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-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": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "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": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "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.0", - "snapdragon": "^0.8.1", - "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.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "is-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" - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "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 - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - } - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "requires": { - "ret": "~0.1.10" - } - }, - "semver": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", - "dev": true - }, - "serialize-javascript": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.6.1.tgz", - "integrity": "sha512-A5MOagrPFga4YaKQSWHryl7AXvbQkEqpw4NNYMTNYUNV51bA8ABHgYFpqKx+YFFrw59xMV1qGH1R4AgoNIVgCw==", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true }, - "set-blocking": { + "require-main-filename": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, - "set-value": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", - "dev": true, + "resolve": { + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.14.2.tgz", + "integrity": "sha512-EjlOBLBO1kxsUxsKjLt7TAECyKW6fOh1VRkykQkKGzcBbjjPIxBqGh0jf7GJ3k/f5mxMqW3htMD3WdTUVtW8HQ==", "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } + "path-parse": "^1.0.6" } }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, + "rimraf": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.0.tgz", + "integrity": "sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg==", "dev": true, "requires": { - "shebang-regex": "^1.0.0" + "glob": "^7.1.3" } }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true - }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "rollup": { + "version": "1.29.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.29.0.tgz", + "integrity": "sha512-V63Iz0dSdI5qPPN5HmCN6OBRzBFhMqNWcvwgq863JtSCTU6Vdvqq6S2fYle/dSCyoPrBkIP3EIr1RVs3HTRqqg==", "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": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "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.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } + "@types/estree": "*", + "@types/node": "*", + "acorn": "^7.1.0" } }, - "snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "rollup-plugin-node-resolve": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-5.2.0.tgz", + "integrity": "sha512-jUlyaDXts7TW2CqQ4GaO5VJ4PwwaV8VUGA7+km3n6k6xtOEacf61u0VXwN80phY/evMcaS+9eIeJ9MOyDxt5Zw==", "dev": true, "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" + "@types/resolve": "0.0.8", + "builtin-modules": "^3.1.0", + "is-module": "^1.0.0", + "resolve": "^1.11.1", + "rollup-pluginutils": "^2.8.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.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": { - "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==", + "builtin-modules": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.1.0.tgz", + "integrity": "sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw==", "dev": true } } }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "dev": true, - "requires": { - "kind-of": "^3.2.0" - } - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - }, - "source-map-resolve": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", - "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "rollup-plugin-terser": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-5.1.3.tgz", + "integrity": "sha512-FuFuXE5QUJ7snyxHLPp/0LFXJhdomKlIx/aK7Tg88Yubsx/UU/lmInoJafXJ4jwVVNcORJ1wRUC5T9cy5yk0wA==", "dev": true, "requires": { - "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" + "@babel/code-frame": "^7.0.0", + "jest-worker": "^24.6.0", + "rollup-pluginutils": "^2.8.1", + "serialize-javascript": "^2.1.2", + "terser": "^4.1.0" } }, - "source-map-support": { - "version": "0.5.10", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.10.tgz", - "integrity": "sha512-YfQ3tQFTK/yzlGJuX8pTwa4tifQj4QS2Mj7UegOu8jAz59MqIiMGPXxQhVQiIMNzayuUSF/jEuVnfFF5JqybmQ==", + "rollup-pluginutils": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", + "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", "dev": true, "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } + "estree-walker": "^0.6.1" } }, - "source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "run-parallel": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", + "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", "dev": true }, - "sourcemap-codec": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.4.tgz", - "integrity": "sha512-CYAPYdBu34781kLHkaW3m6b/uUSyMOC2R61gcYMWooeuaGtjof86ZA/8T+qVPPt7np1085CR9hmMGrySwEc8Xg==", + "serialize-javascript": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-2.1.2.tgz", + "integrity": "sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ==", "dev": true }, - "spdx-correct": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, - "spdx-expression-parse": { + "slash": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true }, - "spdx-license-ids": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz", - "integrity": "sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g==", + "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 }, - "split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "source-map-support": { + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz", + "integrity": "sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==", "dev": true, "requires": { - "extend-shallow": "^3.0.0" + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" } }, + "sourcemap-codec": { + "version": "1.4.7", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.7.tgz", + "integrity": "sha512-RuN23NzhAOuUtaivhcrjXx1OPXsFeH9m5sI373/U7+tGLKihjUyboZAzOadytMjnqHp1f45RGk1IzDKCpDpSYA==" + }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.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.0" - } - } - } - }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", @@ -2965,60 +1287,36 @@ "requires": { "is-fullwidth-code-point": "^2.0.0", "strip-ansi": "^4.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "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" - } - } } }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "string.prototype.trimleft": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz", + "integrity": "sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag==", "dev": true, "requires": { - "safe-buffer": "~5.1.0" + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" } }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "string.prototype.trimright": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz", + "integrity": "sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g==", "dev": true, "requires": { - "ansi-regex": "^2.0.0" + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" } }, - "strip-bom": { - "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", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "dev": true - }, - "strip-indent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", - "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", - "dev": true + "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" + } }, "strip-json-comments": { "version": "2.0.1", @@ -3027,87 +1325,34 @@ "dev": true }, "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", + "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", "dev": true, "requires": { "has-flag": "^3.0.0" } }, "terser": { - "version": "3.17.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-3.17.0.tgz", - "integrity": "sha512-/FQzzPJmCpjAH9Xvk2paiWrFq+5M6aVOf+2KRbwhByISDX/EujxsK+BAvrhb6H+2rtrLCHK9N01wO014vrIwVQ==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.6.2.tgz", + "integrity": "sha512-6FUjJdY2i3WZAtYBtnV06OOcOfzl+4hSKYE9wgac8rkLRBToPDDrBB2AcHwQD/OKDxbnvhVy2YgOPWO2SsKWqg==", "dev": true, "requires": { - "commander": "^2.19.0", + "commander": "^2.20.0", "source-map": "~0.6.1", - "source-map-support": "~0.5.10" - }, - "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 - } - } - }, - "to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "dev": true, - "requires": { - "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": "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" + "source-map-support": "~0.5.12" } }, "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - }, - "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.0.2" - } - } + "is-number": "^7.0.0" } }, - "trim-newlines": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", - "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", - "dev": true - }, - "tslib": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", - "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", - "dev": true - }, "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -3115,126 +1360,11 @@ "dev": true }, "typescript": { - "version": "3.3.4000", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.4000.tgz", - "integrity": "sha512-jjOcCZvpkl2+z7JFn0yBOoLQyLoIkNZAs/fYJkUG6VKy6zLPHJGfQJYFHzibB6GJaF/8QrcECtlQ5cpvRHSMEA==", - "dev": 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" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "set-value": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.1", - "to-object-path": "^0.3.0" - } - } - } - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true - }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "dev": true, - "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "dev": true - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - } - } - }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true - }, - "use": { - "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", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "version": "3.7.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.4.tgz", + "integrity": "sha512-A25xv5XCtarLwXpcDNZzCGvW2D1S3/bACratYBx2sax8PefsFhlYmkQicKHvpYflFS8if4zne5zT5kpJ7pzuvw==", "dev": true }, - "validate-npm-package-license": { - "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" - } - }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -3260,33 +1390,40 @@ } }, "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", "dev": true, "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" }, "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=", + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, "requires": { - "number-is-nan": "^1.0.0" + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" } }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" + "ansi-regex": "^4.1.0" } } } @@ -3304,29 +1441,33 @@ "dev": true }, "yargs": { - "version": "12.0.5", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", - "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", + "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", "dev": true, "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.2.0", + "cliui": "^5.0.0", "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", + "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", + "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", - "string-width": "^2.0.0", + "string-width": "^3.0.0", "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^11.1.1" + "y18n": "^4.0.0", + "yargs-parser": "^13.1.1" }, "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, "camelcase": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.2.0.tgz", - "integrity": "sha512-IXFsBS2pC+X0j0N/GE7Dm7j3bsEBp+oTpb7F50dwEVX7rf3IgwO9XatnegTsDtniKCUtEJH4fSU6Asw7uoVLfQ==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, "find-up": { @@ -3338,12 +1479,6 @@ "locate-path": "^3.0.0" } }, - "get-caller-file": { - "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 - }, "locate-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", @@ -3355,9 +1490,9 @@ } }, "p-limit": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", - "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.2.tgz", + "integrity": "sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ==", "dev": true, "requires": { "p-try": "^2.0.0" @@ -3373,15 +1508,35 @@ } }, "p-try": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", - "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, "yargs-parser": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", - "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", + "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", "dev": true, "requires": { "camelcase": "^5.0.0", @@ -3390,24 +1545,15 @@ } } }, - "yargs-parser": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", - "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", - "dev": true, - "requires": { - "camelcase": "^4.1.0" - } - }, "yargs-unparser": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.5.0.tgz", - "integrity": "sha512-HK25qidFTCVuj/D1VfNiEndpLIeJN78aqgR23nL3y4N0U/91cOAzqfHlF8n2BvoNDcZmJKin3ddNSvOxSr8flw==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", + "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", "dev": true, "requires": { "flat": "^4.1.0", - "lodash": "^4.17.11", - "yargs": "^12.0.5" + "lodash": "^4.17.15", + "yargs": "^13.3.0" } } } diff --git a/package.json b/package.json index 37a004e..70806cb 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,8 @@ "module": "build/esm/index.js", "typings": "build/esm/index.d.ts", "scripts": { - "clean": "rm -rf build test-build", - "build": "npm run clean && rollup -c && gzip-size build/iife/index-min.js && gzip-size build/iife/with-async-ittr-min.js", - "dev": "npm run clean && rollup -c --watch" + "build": "rollup -c && node --experimental-modules lib/size-report.mjs", + "dev": "rollup -c --watch" }, "repository": { "type": "git", @@ -17,19 +16,21 @@ "author": "Jake Archibald", "license": "ISC", "devDependencies": { - "@types/chai": "^4.1.7", - "@types/mocha": "^5.2.6", + "@types/chai": "^4.2.7", + "@types/mocha": "^5.2.7", "chai": "^4.2.0", - "conditional-type-checks": "^1.0.0", - "gzip-size-cli": "^3.0.0", - "mocha": "^6.0.2", - "prettier": "^1.18.2", - "rollup": "^1.6.1", - "rollup-plugin-commonjs": "^9.2.1", - "rollup-plugin-copy": "^0.2.3", - "rollup-plugin-node-resolve": "^4.0.1", - "rollup-plugin-terser": "^4.0.4", - "rollup-plugin-typescript2": "^0.20.1", - "typescript": "^3.3.4000" + "conditional-type-checks": "^1.0.5", + "del": "^5.1.0", + "filesize": "^6.0.1", + "glob": "^7.1.6", + "mocha": "^7.0.0", + "prettier": "^1.19.1", + "rollup": "^1.29.0", + "rollup-plugin-node-resolve": "^5.2.0", + "rollup-plugin-terser": "^5.1.3", + "typescript": "^3.7.4" + }, + "dependencies": { + "@rollup/plugin-commonjs": "^11.0.1" } } diff --git a/rollup.config.js b/rollup.config.js index 8b4b3d7..06922cd 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,76 +1,87 @@ -import typescript from 'rollup-plugin-typescript2'; +import { promises as fsp } from 'fs'; + import { terser } from 'rollup-plugin-terser'; -import copy from 'rollup-plugin-copy'; import resolve from 'rollup-plugin-node-resolve'; -import commonjs from 'rollup-plugin-commonjs'; +import commonjs from '@rollup/plugin-commonjs'; +import del from 'del'; + +import simpleTS from './lib/simple-ts'; + +export default async function({ watch }) { + await del('build'); -const testBuild = { - plugins: [ - resolve(), - commonjs({ - namedExports: { - 'chai': ['assert'], + const main = { + plugins: [simpleTS('test', { watch })], + input: ['src/index.ts', 'src/async-iterators.ts'], + output: [ + { + dir: 'build/esm/', + format: 'esm', + entryFileNames: '[name].js', + chunkFileNames: '[name].js', }, - }), - typescript({ - tsconfig: 'test/tsconfig.json', - useTsconfigDeclarationDir: true - }), - copy({ - 'test/index.html': 'test-build/index.html', - }), - ], - input: ['test/index.ts', 'test/main.ts', 'test/open.ts', 'test/iterate.ts'], - output: { - dir: 'test-build', - format: 'esm' - }, -}; + { + dir: 'build/cjs/', + format: 'cjs', + entryFileNames: '[name].js', + chunkFileNames: '[name].js', + }, + ], + }; -const esm = { - plugins: [typescript({ useTsconfigDeclarationDir: true })], - input: ['lib/index.ts', 'lib/async-iterators.ts'], - output: [{ - dir: 'build/esm/', - format: 'esm', - entryFileNames: '[name].js', - chunkFileNames: '[name].js', - }, { - dir: 'build/cjs/', - format: 'cjs', - entryFileNames: '[name].js', - chunkFileNames: '[name].js', - }], -}; + const iffeMin = { + input: 'build/esm/index.js', + plugins: [ + terser({ + compress: { ecma: 2019 }, + }), + ], + output: { + file: 'build/iife/index-min.js', + format: 'iife', + name: 'idb', + }, + }; -const iffeMin = { - input: 'build/esm/index.js', - plugins: [ - terser({ - compress: { ecma: 6 }, - }) - ], - output: { - file: 'build/iife/index-min.js', - format: 'iife', - name: 'idb' - }, -}; + const iffeIttrMin = { + input: './with-async-ittr.js', + plugins: [ + terser({ + compress: { ecma: 2019 }, + }), + ], + output: { + file: 'build/iife/with-async-ittr-min.js', + format: 'iife', + name: 'idb', + }, + }; -const iffeIttrMin = { - input: './with-async-ittr.js', - plugins: [ - terser({ - compress: { ecma: 6 }, - }) - ], - output: { - file: 'build/iife/with-async-ittr-min.js', - format: 'iife', - name: 'idb' - }, -}; + const testBuild = { + plugins: [ + simpleTS('test', { noBuild: true }), + resolve(), + commonjs({ + namedExports: { + chai: ['assert'], + }, + }), + { + async generateBundle() { + this.emitFile({ + type: 'asset', + source: await fsp.readFile('test/index.html'), + fileName: 'index.html', + }); + }, + }, + ], + input: ['test/index.ts', 'test/main.ts', 'test/open.ts', 'test/iterate.ts'], + output: { + dir: 'build/test', + format: 'esm', + }, + }; -export default [ - testBuild, esm, iffeMin, iffeIttrMin, -]; + return [main, iffeMin, iffeIttrMin, testBuild]; +} diff --git a/lib/async-iterators.ts b/src/async-iterators.ts similarity index 100% rename from lib/async-iterators.ts rename to src/async-iterators.ts diff --git a/lib/database-extras.ts b/src/database-extras.ts similarity index 100% rename from lib/database-extras.ts rename to src/database-extras.ts diff --git a/lib/entry.ts b/src/entry.ts similarity index 100% rename from lib/entry.ts rename to src/entry.ts diff --git a/lib/index.ts b/src/index.ts similarity index 100% rename from lib/index.ts rename to src/index.ts diff --git a/src/tsconfig.json b/src/tsconfig.json new file mode 100644 index 0000000..e3ff452 --- /dev/null +++ b/src/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../generic-tsconfig.json", + "compilerOptions": { + "lib": ["esnext", "dom"] + } +} diff --git a/lib/util.ts b/src/util.ts similarity index 100% rename from lib/util.ts rename to src/util.ts diff --git a/lib/wrap-idb-value.ts b/src/wrap-idb-value.ts similarity index 100% rename from lib/wrap-idb-value.ts rename to src/wrap-idb-value.ts diff --git a/test/index.html b/test/index.html index d78c5a9..ce4630e 100644 --- a/test/index.html +++ b/test/index.html @@ -1,4 +1,4 @@ - +
diff --git a/test/iterate.ts b/test/iterate.ts index a0096a1..6aad17b 100644 --- a/test/iterate.ts +++ b/test/iterate.ts @@ -3,8 +3,8 @@ import 'mocha/mocha'; import { assert } from 'chai'; -import { IDBPDatabase, IDBPCursorWithValueIteratorValue } from '../lib/'; -import '../lib/async-iterators'; +import { IDBPDatabase, IDBPCursorWithValueIteratorValue } from '../src/'; +import '../src/async-iterators'; import { assert as typeAssert, IsExact } from 'conditional-type-checks'; import { deleteDatabase, diff --git a/test/main.ts b/test/main.ts index 6f39041..1478e3b 100644 --- a/test/main.ts +++ b/test/main.ts @@ -10,7 +10,7 @@ import { IDBPCursor, IDBPIndex, TypedDOMStringList, -} from '../lib/'; +} from '../src/'; import { assert as typeAssert, IsExact } from 'conditional-type-checks'; import { deleteDatabase, @@ -39,7 +39,7 @@ suite('IDBPDatabase', () => { > >(true); - typeAssert>(true); + typeAssert>>(true); }); test('createObjectStore', async () => { @@ -335,7 +335,7 @@ suite('IDBPDatabase', () => { const val2 = await db.getAllKeys('key-val-store'); - typeAssert>(true); + typeAssert>(true); assert.deepStrictEqual( val2, @@ -358,7 +358,7 @@ suite('IDBPDatabase', () => { const val2 = await db.getAllKeysFromIndex('object-store', 'title'); - typeAssert>(true); + typeAssert>(true); assert.deepStrictEqual(val2, [1, 2, 3, 4], 'Correct values from store'); }); @@ -688,7 +688,7 @@ suite('IDBPTransaction', () => { typeAssert< IsExact< typeof schemalessStore, - IDBPObjectStore + IDBPObjectStore > >(true); @@ -1052,7 +1052,7 @@ suite('IDBPObjectStore', () => { const val2 = await store2.getAllKeys(); - typeAssert>(true); + typeAssert>(true); assert.deepStrictEqual( val2, @@ -1548,7 +1548,7 @@ suite('IDBPIndex', () => { const val = await index.getAllKeys(); - typeAssert>(true); + typeAssert>(true); assert.deepStrictEqual(val, [1, 2, 3, 4], 'Correct values from store'); } diff --git a/test/open.ts b/test/open.ts index 6c077bb..7de138f 100644 --- a/test/open.ts +++ b/test/open.ts @@ -1,6 +1,6 @@ import 'mocha/mocha'; import { assert } from 'chai'; -import { openDB, IDBPDatabase, IDBPTransaction, wrap, unwrap } from '../lib/'; +import { openDB, IDBPDatabase, IDBPTransaction, wrap, unwrap } from '../src/'; import { assert as typeAssert, IsExact } from 'conditional-type-checks'; import { getNextVersion, diff --git a/test/tsconfig.json b/test/tsconfig.json index 1574896..196b7d3 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -1,9 +1,8 @@ { - "extends": "../tsconfig.json", + "extends": "../generic-tsconfig.json", "compilerOptions": { - "allowSyntheticDefaultImports": true, "esModuleInterop": true, - "declarationDir": "../test-build" + "lib": ["esnext", "dom"] }, - "files": ["index.ts"] + "references": [{ "path": "../src" }] } diff --git a/test/utils.ts b/test/utils.ts index 7127c5d..9709c2a 100644 --- a/test/utils.ts +++ b/test/utils.ts @@ -4,7 +4,7 @@ import { openDB, DeleteDBCallbacks, deleteDB, -} from '../lib/'; +} from '../src/'; export interface ObjectStoreValue { id: number; diff --git a/with-async-ittr-cjs.d.ts b/with-async-ittr-cjs.d.ts new file mode 100644 index 0000000..4bfa3fa --- /dev/null +++ b/with-async-ittr-cjs.d.ts @@ -0,0 +1 @@ +export * from './build/cjs/index.d.ts'; diff --git a/with-async-ittr-cjs.js b/with-async-ittr-cjs.js index 467e449..dd4a704 100644 --- a/with-async-ittr-cjs.js +++ b/with-async-ittr-cjs.js @@ -1,7 +1,2 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); - -var index_js = require('./build/cjs/index.js'); +module.exports = require('./build/cjs/index.js'); require('./build/cjs/async-iterators.js'); - -Object.keys(index_js).forEach(function (key) { exports[key] = index_js[key]; }); diff --git a/with-async-ittr.ts b/with-async-ittr.ts deleted file mode 100644 index 5f08ff8..0000000 --- a/with-async-ittr.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './lib/index'; -import './lib/async-iterators';