Initial commit

This commit is contained in:
talksik
2021-12-29 01:57:42 -08:00
commit ce39a60b42
4634 changed files with 997667 additions and 0 deletions
+108
View File
@@ -0,0 +1,108 @@
# @firebase/util
## 1.4.2
### Patch Changes
- [`3281315fa`](https://github.com/firebase/firebase-js-sdk/commit/3281315fae9c6f535f9d5052ee17d60861ea569a) [#5708](https://github.com/firebase/firebase-js-sdk/pull/5708) (fixes [#1487](https://github.com/firebase/firebase-js-sdk/issues/1487)) - Update build scripts to work with the exports field
## 1.4.1
### Patch Changes
- [`2322b6023`](https://github.com/firebase/firebase-js-sdk/commit/2322b6023c628cd9f4f4172767c17d215dd91684) [#5693](https://github.com/firebase/firebase-js-sdk/pull/5693) - Add exports field to all packages
## 1.4.0
### Minor Changes
- [`a99943fe3`](https://github.com/firebase/firebase-js-sdk/commit/a99943fe3bd5279761aa29d138ec91272b06df39) [#5539](https://github.com/firebase/firebase-js-sdk/pull/5539) - Use esm2017 builds by default
### Patch Changes
- [`b835b4cba`](https://github.com/firebase/firebase-js-sdk/commit/b835b4cbabc4b7b180ae38b908c49205ce31a422) [#5506](https://github.com/firebase/firebase-js-sdk/pull/5506) - areCookiesEnabled could encounter runtime errors in certain enviornments
## 1.3.0
### Minor Changes
- [`3c6a11c8d`](https://github.com/firebase/firebase-js-sdk/commit/3c6a11c8d0b35afddb50e9c3e0c4d2e30f642131) [#5282](https://github.com/firebase/firebase-js-sdk/pull/5282) - Implement mockUserToken for Storage and fix JWT format bugs.
## 1.2.0
### Minor Changes
- [`a3cbe719b`](https://github.com/firebase/firebase-js-sdk/commit/a3cbe719b1bd733a5c4c15ee0d0e6388d512054c) [#5207](https://github.com/firebase/firebase-js-sdk/pull/5207) - Added deepEqual for comparing objects
## 1.1.0
### Minor Changes
- [`ac4ad08a2`](https://github.com/firebase/firebase-js-sdk/commit/ac4ad08a284397ec966e991dd388bb1fba857467) [#4792](https://github.com/firebase/firebase-js-sdk/pull/4792) - Add mockUserToken support for database emulator.
## 1.0.0
### Major Changes
- [`7354a0ed4`](https://github.com/firebase/firebase-js-sdk/commit/7354a0ed438f4e3df6577e4927e8c8f8f1fbbfda) [#4720](https://github.com/firebase/firebase-js-sdk/pull/4720) - Internal changes to Database and Validation APIs.
## 0.4.1
### Patch Changes
- [`de5f90501`](https://github.com/firebase/firebase-js-sdk/commit/de5f9050137acc9ed1490082e5aa429b5de3cb2a) [#4673](https://github.com/firebase/firebase-js-sdk/pull/4673) - Added a utility function and type for compat interop API
## 0.4.0
### Minor Changes
- [`ec95df3d0`](https://github.com/firebase/firebase-js-sdk/commit/ec95df3d07e5f091f2a7f7327e46417f64d04b4e) [#4610](https://github.com/firebase/firebase-js-sdk/pull/4610) - Add extractQuerystring() function which extracts the query string part of a URL, including the leading question mark (if present).
## 0.3.4
### Patch Changes
- [`9cf727fcc`](https://github.com/firebase/firebase-js-sdk/commit/9cf727fcc3d049551b16ae0698ac33dc2fe45ada) [#4001](https://github.com/firebase/firebase-js-sdk/pull/4001) - Do not merge `__proto__` in `deepExtend` to prevent `__proto__` pollution.
## 0.3.3
### Patch Changes
- [`a5768b0aa`](https://github.com/firebase/firebase-js-sdk/commit/a5768b0aa7d7ce732279931aa436e988c9f36487) [#3932](https://github.com/firebase/firebase-js-sdk/pull/3932) - Point browser field to esm build. Now you need to use default import instead of namespace import to import firebase.
Before this change
```
import * as firebase from 'firebase/app';
```
After this change
```
import firebase from 'firebase/app';
```
* [`7d916d905`](https://github.com/firebase/firebase-js-sdk/commit/7d916d905ba16816ac8ac7c8748c83831ff614ce) [#3946](https://github.com/firebase/firebase-js-sdk/pull/3946) - Write template data to a new `customData` field in`FirebaseError` instead of writing to the error object itself to avoid overwriting existing fields.
## 0.3.2
### Patch Changes
- [`fb3b095e4`](https://github.com/firebase/firebase-js-sdk/commit/fb3b095e4b7c8f57fdb3172bc039c84576abf290) [#2800](https://github.com/firebase/firebase-js-sdk/pull/2800) - Moved `calculateBackoffMillis()` exponential backoff function from remote-config to util,
where it can be shared between packages.
## 0.3.1
### Patch Changes
- [`d4ca3da0`](https://github.com/firebase/firebase-js-sdk/commit/d4ca3da0a59fcea1261ba69d7eb663bba38d3089) [#3585](https://github.com/firebase/firebase-js-sdk/pull/3585) - Extended Usage of `isIndexedDBAvailable` to Service Worker
## 0.3.0
### Minor Changes
- [`a87676b8`](https://github.com/firebase/firebase-js-sdk/commit/a87676b84b78ccc2f057a22eb947a5d13402949c) [#3472](https://github.com/firebase/firebase-js-sdk/pull/3472) - - Fix an error where an analytics PR included a change to `@firebase/util`, but
the util package was not properly included in the changeset for a patch bump.
- `@firebase/util` adds environment check methods `isIndexedDBAvailable`
`validateIndexedDBOpenable`, and `areCookiesEnabled`.
+25
View File
@@ -0,0 +1,25 @@
# @firebase/util
_NOTE: This is specifically tailored for Firebase JS SDK usage, if you are not a
member of the Firebase team, please avoid using this package_
This is a wrapper of some Webchannel Features for the Firebase JS SDK.
## Usage
**ES Modules**
```javascript
import { Deferred } from '@firebase/util';
// Do stuff with Deferred or any of the other Utils you import
```
**CommonJS Modules**
```javascript
const utils = require('@firebase/util');
// Do stuff with any of the re-exported `utils`
```
+35
View File
@@ -0,0 +1,35 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
export * from './src/assert';
export * from './src/crypt';
export * from './src/constants';
export * from './src/deepCopy';
export * from './src/deferred';
export * from './src/emulator';
export * from './src/environment';
export * from './src/errors';
export * from './src/json';
export * from './src/jwt';
export * from './src/obj';
export * from './src/query';
export * from './src/sha1';
export * from './src/subscribe';
export * from './src/validation';
export * from './src/utf8';
export * from './src/exponential_backoff';
export * from './src/formatters';
export * from './src/compat';
+1894
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+1886
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+35
View File
@@ -0,0 +1,35 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
export * from './src/assert';
export * from './src/crypt';
export * from './src/constants';
export * from './src/deepCopy';
export * from './src/deferred';
export * from './src/emulator';
export * from './src/environment';
export * from './src/errors';
export * from './src/json';
export * from './src/jwt';
export * from './src/obj';
export * from './src/query';
export * from './src/sha1';
export * from './src/subscribe';
export * from './src/validation';
export * from './src/utf8';
export * from './src/exponential_backoff';
export * from './src/formatters';
export * from './src/compat';
+35
View File
@@ -0,0 +1,35 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
export * from './src/assert';
export * from './src/crypt';
export * from './src/constants';
export * from './src/deepCopy';
export * from './src/deferred';
export * from './src/emulator';
export * from './src/environment';
export * from './src/errors';
export * from './src/json';
export * from './src/jwt';
export * from './src/obj';
export * from './src/query';
export * from './src/sha1';
export * from './src/subscribe';
export * from './src/validation';
export * from './src/utf8';
export * from './src/exponential_backoff';
export * from './src/formatters';
export * from './src/compat';
+35
View File
@@ -0,0 +1,35 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
export * from './src/assert';
export * from './src/crypt';
export * from './src/constants';
export * from './src/deepCopy';
export * from './src/deferred';
export * from './src/emulator';
export * from './src/environment';
export * from './src/errors';
export * from './src/json';
export * from './src/jwt';
export * from './src/obj';
export * from './src/query';
export * from './src/sha1';
export * from './src/subscribe';
export * from './src/validation';
export * from './src/utf8';
export * from './src/exponential_backoff';
export * from './src/formatters';
export * from './src/compat';
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
{"type":"module"}
+24
View File
@@ -0,0 +1,24 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
/**
* Throws an error if the provided assertion is falsy
*/
export declare const assert: (assertion: unknown, message: string) => void;
/**
* Returns an Error object suitable for throwing.
*/
export declare const assertionError: (message: string) => Error;
+20
View File
@@ -0,0 +1,20 @@
/**
* @license
* Copyright 2021 Google LLC
*
* 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.
*/
export interface Compat<T> {
_delegate: T;
}
export declare function getModularInstance<ExpService>(service: Compat<ExpService> | ExpService): ExpService;
+33
View File
@@ -0,0 +1,33 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
/**
* @fileoverview Firebase constants. Some of these (@defines) can be overridden at compile-time.
*/
export declare const CONSTANTS: {
/**
* @define {boolean} Whether this is the client Node.js SDK.
*/
NODE_CLIENT: boolean;
/**
* @define {boolean} Whether this is the Admin Node.js SDK.
*/
NODE_ADMIN: boolean;
/**
* Firebase SDK Version
*/
SDK_VERSION: string;
};
+60
View File
@@ -0,0 +1,60 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
interface Base64 {
byteToCharMap_: {
[key: number]: string;
} | null;
charToByteMap_: {
[key: string]: number;
} | null;
byteToCharMapWebSafe_: {
[key: number]: string;
} | null;
charToByteMapWebSafe_: {
[key: string]: number;
} | null;
ENCODED_VALS_BASE: string;
readonly ENCODED_VALS: string;
readonly ENCODED_VALS_WEBSAFE: string;
HAS_NATIVE_SUPPORT: boolean;
encodeByteArray(input: number[] | Uint8Array, webSafe?: boolean): string;
encodeString(input: string, webSafe?: boolean): string;
decodeString(input: string, webSafe: boolean): string;
decodeStringToByteArray(input: string, webSafe: boolean): number[];
init_(): void;
}
export declare const base64: Base64;
/**
* URL-safe base64 encoding
*/
export declare const base64Encode: (str: string) => string;
/**
* URL-safe base64 encoding (without "." padding in the end).
* e.g. Used in JSON Web Token (JWT) parts.
*/
export declare const base64urlEncodeWithoutPadding: (str: string) => string;
/**
* URL-safe base64 decoding
*
* NOTE: DO NOT use the global atob() function - it does NOT support the
* base64Url variant encoding.
*
* @param str To be decoded
* @return Decoded result, if possible
*/
export declare const base64Decode: (str: string) => string | null;
export {};
+35
View File
@@ -0,0 +1,35 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
/**
* Do a deep-copy of basic JavaScript Objects or Arrays.
*/
export declare function deepCopy<T>(value: T): T;
/**
* Copy properties from source to target (recursively allows extension
* of Objects and Arrays). Scalar values in the target are over-written.
* If target is undefined, an object of the appropriate type will be created
* (and returned).
*
* We recursively copy all child properties of plain Objects in the source- so
* that namespace- like dictionaries are merged.
*
* Note that the target can be a function, in which case the properties in
* the source Object are copied onto it as static properties of the Function.
*
* Note: we don't merge __proto__ to prevent prototype pollution
*/
export declare function deepExtend(target: unknown, source: unknown): unknown;
+28
View File
@@ -0,0 +1,28 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
export declare class Deferred<R> {
promise: Promise<R>;
reject: (value?: unknown) => void;
resolve: (value?: unknown) => void;
constructor();
/**
* Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around
* invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback
* and returns a node-style callback which will resolve or reject the Deferred's promise.
*/
wrapCallback(callback?: (error?: unknown, value?: unknown) => void): (error: unknown, value?: unknown) => void;
}
+47
View File
@@ -0,0 +1,47 @@
/**
* @license
* Copyright 2021 Google LLC
*
* 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.
*/
export declare type FirebaseSignInProvider = 'custom' | 'email' | 'password' | 'phone' | 'anonymous' | 'google.com' | 'facebook.com' | 'github.com' | 'twitter.com' | 'microsoft.com' | 'apple.com';
interface FirebaseIdToken {
iss: string;
aud: string;
sub: string;
iat: number;
exp: number;
user_id: string;
auth_time: number;
provider_id?: 'anonymous';
email?: string;
email_verified?: boolean;
phone_number?: string;
name?: string;
picture?: string;
firebase: {
sign_in_provider: FirebaseSignInProvider;
identities?: {
[provider in FirebaseSignInProvider]?: string[];
};
};
[claim: string]: unknown;
uid?: never;
}
export declare type EmulatorMockTokenOptions = ({
user_id: string;
} | {
sub: string;
}) & Partial<FirebaseIdToken>;
export declare function createMockUserToken(token: EmulatorMockTokenOptions, projectId?: string): string;
export {};
+84
View File
@@ -0,0 +1,84 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
/**
* Returns navigator.userAgent string or '' if it's not defined.
* @return user agent string
*/
export declare function getUA(): string;
/**
* Detect Cordova / PhoneGap / Ionic frameworks on a mobile device.
*
* Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap
* in the Ripple emulator) nor Cordova `onDeviceReady`, which would normally
* wait for a callback.
*/
export declare function isMobileCordova(): boolean;
/**
* Detect Node.js.
*
* @return true if Node.js environment is detected.
*/
export declare function isNode(): boolean;
/**
* Detect Browser Environment
*/
export declare function isBrowser(): boolean;
export declare function isBrowserExtension(): boolean;
/**
* Detect React Native.
*
* @return true if ReactNative environment is detected.
*/
export declare function isReactNative(): boolean;
/** Detects Electron apps. */
export declare function isElectron(): boolean;
/** Detects Internet Explorer. */
export declare function isIE(): boolean;
/** Detects Universal Windows Platform apps. */
export declare function isUWP(): boolean;
/**
* Detect whether the current SDK build is the Node version.
*
* @return true if it's the Node SDK build.
*/
export declare function isNodeSdk(): boolean;
/** Returns true if we are running in Safari. */
export declare function isSafari(): boolean;
/**
* This method checks if indexedDB is supported by current browser/service worker context
* @return true if indexedDB is supported by current browser/service worker context
*/
export declare function isIndexedDBAvailable(): boolean;
/**
* This method validates browser/sw context for indexedDB by opening a dummy indexedDB database and reject
* if errors occur during the database open operation.
*
* @throws exception if current browser/sw context can't run idb.open (ex: Safari iframe, Firefox
* private browsing)
*/
export declare function validateIndexedDBOpenable(): Promise<boolean>;
/**
*
* This method checks whether cookie is enabled within current browser
* @return true if cookie is enabled within current browser
*/
export declare function areCookiesEnabled(): boolean;
/**
* Polyfill for `globalThis` object.
* @returns the `globalThis` object for the given environment.
*/
export declare function getGlobal(): typeof globalThis;
+80
View File
@@ -0,0 +1,80 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
/**
* @fileoverview Standardized Firebase Error.
*
* Usage:
*
* // Typescript string literals for type-safe codes
* type Err =
* 'unknown' |
* 'object-not-found'
* ;
*
* // Closure enum for type-safe error codes
* // at-enum {string}
* var Err = {
* UNKNOWN: 'unknown',
* OBJECT_NOT_FOUND: 'object-not-found',
* }
*
* let errors: Map<Err, string> = {
* 'generic-error': "Unknown error",
* 'file-not-found': "Could not find file: {$file}",
* };
*
* // Type-safe function - must pass a valid error code as param.
* let error = new ErrorFactory<Err>('service', 'Service', errors);
*
* ...
* throw error.create(Err.GENERIC);
* ...
* throw error.create(Err.FILE_NOT_FOUND, {'file': fileName});
* ...
* // Service: Could not file file: foo.txt (service/file-not-found).
*
* catch (e) {
* assert(e.message === "Could not find file: foo.txt.");
* if (e.code === 'service/file-not-found') {
* console.log("Could not read file: " + e['file']);
* }
* }
*/
export declare type ErrorMap<ErrorCode extends string> = {
readonly [K in ErrorCode]: string;
};
export interface StringLike {
toString(): string;
}
export interface ErrorData {
[key: string]: unknown;
}
export declare class FirebaseError extends Error {
readonly code: string;
customData?: Record<string, unknown> | undefined;
readonly name = "FirebaseError";
constructor(code: string, message: string, customData?: Record<string, unknown> | undefined);
}
export declare class ErrorFactory<ErrorCode extends string, ErrorParams extends {
readonly [K in ErrorCode]?: ErrorData;
} = {}> {
private readonly service;
private readonly serviceName;
private readonly errors;
constructor(service: string, serviceName: string, errors: ErrorMap<ErrorCode>);
create<K extends ErrorCode>(code: K, ...data: K extends keyof ErrorParams ? [ErrorParams[K]] : []): FirebaseError;
}
+37
View File
@@ -0,0 +1,37 @@
/**
* @license
* Copyright 2019 Google LLC
*
* 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.
*/
/**
* The maximum milliseconds to increase to.
*
* <p>Visible for testing
*/
export declare const MAX_VALUE_MILLIS: number;
/**
* The percentage of backoff time to randomize by.
* See
* http://go/safe-client-behavior#step-1-determine-the-appropriate-retry-interval-to-handle-spike-traffic
* for context.
*
* <p>Visible for testing
*/
export declare const RANDOM_FACTOR = 0.5;
/**
* Based on the backoff method from
* https://github.com/google/closure-library/blob/master/closure/goog/math/exponentialbackoff.js.
* Extracted here so we don't need to pass metadata and a stateful ExponentialBackoff object around.
*/
export declare function calculateBackoffMillis(backoffCount: number, intervalMillis?: number, backoffFactor?: number): number;
+20
View File
@@ -0,0 +1,20 @@
/**
* @license
* Copyright 2020 Google LLC
*
* 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.
*/
/**
* Provide English ordinal letters after a number
*/
export declare function ordinal(i: number): string;
+29
View File
@@ -0,0 +1,29 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
/**
* Evaluates a JSON string into a javascript object.
*
* @param {string} str A string containing JSON.
* @return {*} The javascript object representing the specified JSON.
*/
export declare function jsonEval(str: string): unknown;
/**
* Returns JSON representing a javascript object.
* @param {*} data Javascript object to be stringified.
* @return {string} The JSON contents of the object.
*/
export declare function stringify(data: unknown): string;
+73
View File
@@ -0,0 +1,73 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
interface Claims {
[key: string]: {};
}
interface DecodedToken {
header: object;
claims: Claims;
data: object;
signature: string;
}
/**
* Decodes a Firebase auth. token into constituent parts.
*
* Notes:
* - May return with invalid / incomplete claims if there's no native base64 decoding support.
* - Doesn't check if the token is actually valid.
*/
export declare const decode: (token: string) => DecodedToken;
interface DecodedToken {
header: object;
claims: Claims;
data: object;
signature: string;
}
/**
* Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the
* token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims.
*
* Notes:
* - May return a false negative if there's no native base64 decoding support.
* - Doesn't check if the token is actually valid.
*/
export declare const isValidTimestamp: (token: string) => boolean;
/**
* Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise.
*
* Notes:
* - May return null if there's no native base64 decoding support.
* - Doesn't check if the token is actually valid.
*/
export declare const issuedAtTime: (token: string) => number | null;
/**
* Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time.
*
* Notes:
* - May return a false negative if there's no native base64 decoding support.
* - Doesn't check if the token is actually valid.
*/
export declare const isValidFormat: (token: string) => boolean;
/**
* Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion.
*
* Notes:
* - May return a false negative if there's no native base64 decoding support.
* - Doesn't check if the token is actually valid.
*/
export declare const isAdmin: (token: string) => boolean;
export {};
+30
View File
@@ -0,0 +1,30 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
export declare function contains<T extends object>(obj: T, key: string): boolean;
export declare function safeGet<T extends object, K extends keyof T>(obj: T, key: K): T[K] | undefined;
export declare function isEmpty(obj: object): obj is {};
export declare function map<K extends string, V, U>(obj: {
[key in K]: V;
}, fn: (value: V, key: K, obj: {
[key in K]: V;
}) => U, contextObj?: unknown): {
[key in K]: U;
};
/**
* Deep equal two objects. Support Arrays and Objects.
*/
export declare function deepEqual(a: object, b: object): boolean;
+33
View File
@@ -0,0 +1,33 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
/**
* Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a
* params object (e.g. {arg: 'val', arg2: 'val2'})
* Note: You must prepend it with ? when adding it to a URL.
*/
export declare function querystring(querystringParams: {
[key: string]: string | number;
}): string;
/**
* Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object
* (e.g. {arg: 'val', arg2: 'val2'})
*/
export declare function querystringDecode(querystring: string): Record<string, string>;
/**
* Extract the query string part of a URL, including the leading question mark (if present).
*/
export declare function extractQuerystring(url: string): string;
+84
View File
@@ -0,0 +1,84 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
/**
* @fileoverview SHA-1 cryptographic hash.
* Variable names follow the notation in FIPS PUB 180-3:
* http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf.
*
* Usage:
* var sha1 = new sha1();
* sha1.update(bytes);
* var hash = sha1.digest();
*
* Performance:
* Chrome 23: ~400 Mbit/s
* Firefox 16: ~250 Mbit/s
*
*/
/**
* SHA-1 cryptographic hash constructor.
*
* The properties declared here are discussed in the above algorithm document.
* @constructor
* @final
* @struct
*/
export declare class Sha1 {
/**
* Holds the previous values of accumulated variables a-e in the compress_
* function.
* @private
*/
private chain_;
/**
* A buffer holding the partially computed hash result.
* @private
*/
private buf_;
/**
* An array of 80 bytes, each a part of the message to be hashed. Referred to
* as the message schedule in the docs.
* @private
*/
private W_;
/**
* Contains data needed to pad messages less than 64 bytes.
* @private
*/
private pad_;
/**
* @private {number}
*/
private inbuf_;
/**
* @private {number}
*/
private total_;
blockSize: number;
constructor();
reset(): void;
/**
* Internal compress helper function.
* @param buf Block to compress.
* @param offset Offset of the block in the buffer.
* @private
*/
compress_(buf: number[] | Uint8Array | string, offset?: number): void;
update(bytes?: number[] | Uint8Array | string, length?: number): void;
/** @override */
digest(): number[];
}
+49
View File
@@ -0,0 +1,49 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
export declare type NextFn<T> = (value: T) => void;
export declare type ErrorFn = (error: Error) => void;
export declare type CompleteFn = () => void;
export interface Observer<T> {
next: NextFn<T>;
error: ErrorFn;
complete: CompleteFn;
}
export declare type PartialObserver<T> = Partial<Observer<T>>;
export declare type Unsubscribe = () => void;
/**
* The Subscribe interface has two forms - passing the inline function
* callbacks, or a object interface with callback properties.
*/
export interface Subscribe<T> {
(next?: NextFn<T>, error?: ErrorFn, complete?: CompleteFn): Unsubscribe;
(observer: PartialObserver<T>): Unsubscribe;
}
export interface Observable<T> {
subscribe: Subscribe<T>;
}
export declare type Executor<T> = (observer: Observer<T>) => void;
/**
* Helper to make a Subscribe function (just like Promise helps make a
* Thenable).
*
* @param executor Function which can make calls to a single Observer
* as a proxy.
* @param onNoObservers Callback when count of Observers goes to zero.
*/
export declare function createSubscribe<T>(executor: Executor<T>, onNoObservers?: Executor<T>): Subscribe<T>;
/** Turn synchronous function into one called asynchronously. */
export declare function async(fn: Function, onError?: ErrorFn): Function;
+27
View File
@@ -0,0 +1,27 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
/**
* @param {string} str
* @return {Array}
*/
export declare const stringToByteArray: (str: string) => number[];
/**
* Calculate length without actually converting; useful for doing cheaper validation.
* @param {string} str
* @return {number}
*/
export declare const stringLength: (str: string) => number;
+43
View File
@@ -0,0 +1,43 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
/**
* Check to make sure the appropriate number of arguments are provided for a public function.
* Throws an error if it fails.
*
* @param fnName The function name
* @param minCount The minimum number of arguments to allow for the function call
* @param maxCount The maximum number of argument to allow for the function call
* @param argCount The actual number of arguments provided.
*/
export declare const validateArgCount: (fnName: string, minCount: number, maxCount: number, argCount: number) => void;
/**
* Generates a string to prefix an error message about failed argument validation
*
* @param fnName The function name
* @param argName The name of the argument
* @return The prefix to add to the error thrown for validation.
*/
export declare function errorPrefix(fnName: string, argName: string): string;
/**
* @param fnName
* @param argumentNumber
* @param namespace
* @param optional
*/
export declare function validateNamespace(fnName: string, namespace: string, optional: boolean): void;
export declare function validateCallback(fnName: string, argumentName: string, callback: Function, optional: boolean): void;
export declare function validateContextObject(fnName: string, argumentName: string, context: unknown, optional: boolean): void;
+1
View File
@@ -0,0 +1 @@
export {};
+17
View File
@@ -0,0 +1,17 @@
/**
* @license
* Copyright 2021 Google LLC
*
* 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.
*/
export {};
+1
View File
@@ -0,0 +1 @@
export {};
+1
View File
@@ -0,0 +1 @@
export {};
+1
View File
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,17 @@
/**
* @license
* Copyright 2019 Google LLC
*
* 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.
*/
export {};
+17
View File
@@ -0,0 +1,17 @@
/**
* @license
* Copyright 2021 Google LLC
*
* 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.
*/
export {};
+17
View File
@@ -0,0 +1,17 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
export {};
+24
View File
@@ -0,0 +1,24 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
/**
* Throws an error if the provided assertion is falsy
*/
export declare const assert: (assertion: unknown, message: string) => void;
/**
* Returns an Error object suitable for throwing.
*/
export declare const assertionError: (message: string) => Error;
+20
View File
@@ -0,0 +1,20 @@
/**
* @license
* Copyright 2021 Google LLC
*
* 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.
*/
export interface Compat<T> {
_delegate: T;
}
export declare function getModularInstance<ExpService>(service: Compat<ExpService> | ExpService): ExpService;
+33
View File
@@ -0,0 +1,33 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
/**
* @fileoverview Firebase constants. Some of these (@defines) can be overridden at compile-time.
*/
export declare const CONSTANTS: {
/**
* @define {boolean} Whether this is the client Node.js SDK.
*/
NODE_CLIENT: boolean;
/**
* @define {boolean} Whether this is the Admin Node.js SDK.
*/
NODE_ADMIN: boolean;
/**
* Firebase SDK Version
*/
SDK_VERSION: string;
};
+60
View File
@@ -0,0 +1,60 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
interface Base64 {
byteToCharMap_: {
[key: number]: string;
} | null;
charToByteMap_: {
[key: string]: number;
} | null;
byteToCharMapWebSafe_: {
[key: number]: string;
} | null;
charToByteMapWebSafe_: {
[key: string]: number;
} | null;
ENCODED_VALS_BASE: string;
readonly ENCODED_VALS: string;
readonly ENCODED_VALS_WEBSAFE: string;
HAS_NATIVE_SUPPORT: boolean;
encodeByteArray(input: number[] | Uint8Array, webSafe?: boolean): string;
encodeString(input: string, webSafe?: boolean): string;
decodeString(input: string, webSafe: boolean): string;
decodeStringToByteArray(input: string, webSafe: boolean): number[];
init_(): void;
}
export declare const base64: Base64;
/**
* URL-safe base64 encoding
*/
export declare const base64Encode: (str: string) => string;
/**
* URL-safe base64 encoding (without "." padding in the end).
* e.g. Used in JSON Web Token (JWT) parts.
*/
export declare const base64urlEncodeWithoutPadding: (str: string) => string;
/**
* URL-safe base64 decoding
*
* NOTE: DO NOT use the global atob() function - it does NOT support the
* base64Url variant encoding.
*
* @param str To be decoded
* @return Decoded result, if possible
*/
export declare const base64Decode: (str: string) => string | null;
export {};
+35
View File
@@ -0,0 +1,35 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
/**
* Do a deep-copy of basic JavaScript Objects or Arrays.
*/
export declare function deepCopy<T>(value: T): T;
/**
* Copy properties from source to target (recursively allows extension
* of Objects and Arrays). Scalar values in the target are over-written.
* If target is undefined, an object of the appropriate type will be created
* (and returned).
*
* We recursively copy all child properties of plain Objects in the source- so
* that namespace- like dictionaries are merged.
*
* Note that the target can be a function, in which case the properties in
* the source Object are copied onto it as static properties of the Function.
*
* Note: we don't merge __proto__ to prevent prototype pollution
*/
export declare function deepExtend(target: unknown, source: unknown): unknown;
+28
View File
@@ -0,0 +1,28 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
export declare class Deferred<R> {
promise: Promise<R>;
reject: (value?: unknown) => void;
resolve: (value?: unknown) => void;
constructor();
/**
* Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around
* invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback
* and returns a node-style callback which will resolve or reject the Deferred's promise.
*/
wrapCallback(callback?: (error?: unknown, value?: unknown) => void): (error: unknown, value?: unknown) => void;
}
+47
View File
@@ -0,0 +1,47 @@
/**
* @license
* Copyright 2021 Google LLC
*
* 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.
*/
export declare type FirebaseSignInProvider = 'custom' | 'email' | 'password' | 'phone' | 'anonymous' | 'google.com' | 'facebook.com' | 'github.com' | 'twitter.com' | 'microsoft.com' | 'apple.com';
interface FirebaseIdToken {
iss: string;
aud: string;
sub: string;
iat: number;
exp: number;
user_id: string;
auth_time: number;
provider_id?: 'anonymous';
email?: string;
email_verified?: boolean;
phone_number?: string;
name?: string;
picture?: string;
firebase: {
sign_in_provider: FirebaseSignInProvider;
identities?: {
[provider in FirebaseSignInProvider]?: string[];
};
};
[claim: string]: unknown;
uid?: never;
}
export declare type EmulatorMockTokenOptions = ({
user_id: string;
} | {
sub: string;
}) & Partial<FirebaseIdToken>;
export declare function createMockUserToken(token: EmulatorMockTokenOptions, projectId?: string): string;
export {};
+84
View File
@@ -0,0 +1,84 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
/**
* Returns navigator.userAgent string or '' if it's not defined.
* @return user agent string
*/
export declare function getUA(): string;
/**
* Detect Cordova / PhoneGap / Ionic frameworks on a mobile device.
*
* Deliberately does not rely on checking `file://` URLs (as this fails PhoneGap
* in the Ripple emulator) nor Cordova `onDeviceReady`, which would normally
* wait for a callback.
*/
export declare function isMobileCordova(): boolean;
/**
* Detect Node.js.
*
* @return true if Node.js environment is detected.
*/
export declare function isNode(): boolean;
/**
* Detect Browser Environment
*/
export declare function isBrowser(): boolean;
export declare function isBrowserExtension(): boolean;
/**
* Detect React Native.
*
* @return true if ReactNative environment is detected.
*/
export declare function isReactNative(): boolean;
/** Detects Electron apps. */
export declare function isElectron(): boolean;
/** Detects Internet Explorer. */
export declare function isIE(): boolean;
/** Detects Universal Windows Platform apps. */
export declare function isUWP(): boolean;
/**
* Detect whether the current SDK build is the Node version.
*
* @return true if it's the Node SDK build.
*/
export declare function isNodeSdk(): boolean;
/** Returns true if we are running in Safari. */
export declare function isSafari(): boolean;
/**
* This method checks if indexedDB is supported by current browser/service worker context
* @return true if indexedDB is supported by current browser/service worker context
*/
export declare function isIndexedDBAvailable(): boolean;
/**
* This method validates browser/sw context for indexedDB by opening a dummy indexedDB database and reject
* if errors occur during the database open operation.
*
* @throws exception if current browser/sw context can't run idb.open (ex: Safari iframe, Firefox
* private browsing)
*/
export declare function validateIndexedDBOpenable(): Promise<boolean>;
/**
*
* This method checks whether cookie is enabled within current browser
* @return true if cookie is enabled within current browser
*/
export declare function areCookiesEnabled(): boolean;
/**
* Polyfill for `globalThis` object.
* @returns the `globalThis` object for the given environment.
*/
export declare function getGlobal(): typeof globalThis;
+80
View File
@@ -0,0 +1,80 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
/**
* @fileoverview Standardized Firebase Error.
*
* Usage:
*
* // Typescript string literals for type-safe codes
* type Err =
* 'unknown' |
* 'object-not-found'
* ;
*
* // Closure enum for type-safe error codes
* // at-enum {string}
* var Err = {
* UNKNOWN: 'unknown',
* OBJECT_NOT_FOUND: 'object-not-found',
* }
*
* let errors: Map<Err, string> = {
* 'generic-error': "Unknown error",
* 'file-not-found': "Could not find file: {$file}",
* };
*
* // Type-safe function - must pass a valid error code as param.
* let error = new ErrorFactory<Err>('service', 'Service', errors);
*
* ...
* throw error.create(Err.GENERIC);
* ...
* throw error.create(Err.FILE_NOT_FOUND, {'file': fileName});
* ...
* // Service: Could not file file: foo.txt (service/file-not-found).
*
* catch (e) {
* assert(e.message === "Could not find file: foo.txt.");
* if (e.code === 'service/file-not-found') {
* console.log("Could not read file: " + e['file']);
* }
* }
*/
export declare type ErrorMap<ErrorCode extends string> = {
readonly [K in ErrorCode]: string;
};
export interface StringLike {
toString(): string;
}
export interface ErrorData {
[key: string]: unknown;
}
export declare class FirebaseError extends Error {
readonly code: string;
customData?: Record<string, unknown> | undefined;
readonly name = "FirebaseError";
constructor(code: string, message: string, customData?: Record<string, unknown> | undefined);
}
export declare class ErrorFactory<ErrorCode extends string, ErrorParams extends {
readonly [K in ErrorCode]?: ErrorData;
} = {}> {
private readonly service;
private readonly serviceName;
private readonly errors;
constructor(service: string, serviceName: string, errors: ErrorMap<ErrorCode>);
create<K extends ErrorCode>(code: K, ...data: K extends keyof ErrorParams ? [ErrorParams[K]] : []): FirebaseError;
}
+37
View File
@@ -0,0 +1,37 @@
/**
* @license
* Copyright 2019 Google LLC
*
* 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.
*/
/**
* The maximum milliseconds to increase to.
*
* <p>Visible for testing
*/
export declare const MAX_VALUE_MILLIS: number;
/**
* The percentage of backoff time to randomize by.
* See
* http://go/safe-client-behavior#step-1-determine-the-appropriate-retry-interval-to-handle-spike-traffic
* for context.
*
* <p>Visible for testing
*/
export declare const RANDOM_FACTOR = 0.5;
/**
* Based on the backoff method from
* https://github.com/google/closure-library/blob/master/closure/goog/math/exponentialbackoff.js.
* Extracted here so we don't need to pass metadata and a stateful ExponentialBackoff object around.
*/
export declare function calculateBackoffMillis(backoffCount: number, intervalMillis?: number, backoffFactor?: number): number;
+20
View File
@@ -0,0 +1,20 @@
/**
* @license
* Copyright 2020 Google LLC
*
* 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.
*/
/**
* Provide English ordinal letters after a number
*/
export declare function ordinal(i: number): string;
+29
View File
@@ -0,0 +1,29 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
/**
* Evaluates a JSON string into a javascript object.
*
* @param {string} str A string containing JSON.
* @return {*} The javascript object representing the specified JSON.
*/
export declare function jsonEval(str: string): unknown;
/**
* Returns JSON representing a javascript object.
* @param {*} data Javascript object to be stringified.
* @return {string} The JSON contents of the object.
*/
export declare function stringify(data: unknown): string;
+73
View File
@@ -0,0 +1,73 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
interface Claims {
[key: string]: {};
}
interface DecodedToken {
header: object;
claims: Claims;
data: object;
signature: string;
}
/**
* Decodes a Firebase auth. token into constituent parts.
*
* Notes:
* - May return with invalid / incomplete claims if there's no native base64 decoding support.
* - Doesn't check if the token is actually valid.
*/
export declare const decode: (token: string) => DecodedToken;
interface DecodedToken {
header: object;
claims: Claims;
data: object;
signature: string;
}
/**
* Decodes a Firebase auth. token and checks the validity of its time-based claims. Will return true if the
* token is within the time window authorized by the 'nbf' (not-before) and 'iat' (issued-at) claims.
*
* Notes:
* - May return a false negative if there's no native base64 decoding support.
* - Doesn't check if the token is actually valid.
*/
export declare const isValidTimestamp: (token: string) => boolean;
/**
* Decodes a Firebase auth. token and returns its issued at time if valid, null otherwise.
*
* Notes:
* - May return null if there's no native base64 decoding support.
* - Doesn't check if the token is actually valid.
*/
export declare const issuedAtTime: (token: string) => number | null;
/**
* Decodes a Firebase auth. token and checks the validity of its format. Expects a valid issued-at time.
*
* Notes:
* - May return a false negative if there's no native base64 decoding support.
* - Doesn't check if the token is actually valid.
*/
export declare const isValidFormat: (token: string) => boolean;
/**
* Attempts to peer into an auth token and determine if it's an admin auth token by looking at the claims portion.
*
* Notes:
* - May return a false negative if there's no native base64 decoding support.
* - Doesn't check if the token is actually valid.
*/
export declare const isAdmin: (token: string) => boolean;
export {};
+30
View File
@@ -0,0 +1,30 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
export declare function contains<T extends object>(obj: T, key: string): boolean;
export declare function safeGet<T extends object, K extends keyof T>(obj: T, key: K): T[K] | undefined;
export declare function isEmpty(obj: object): obj is {};
export declare function map<K extends string, V, U>(obj: {
[key in K]: V;
}, fn: (value: V, key: K, obj: {
[key in K]: V;
}) => U, contextObj?: unknown): {
[key in K]: U;
};
/**
* Deep equal two objects. Support Arrays and Objects.
*/
export declare function deepEqual(a: object, b: object): boolean;
+33
View File
@@ -0,0 +1,33 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
/**
* Returns a querystring-formatted string (e.g. &arg=val&arg2=val2) from a
* params object (e.g. {arg: 'val', arg2: 'val2'})
* Note: You must prepend it with ? when adding it to a URL.
*/
export declare function querystring(querystringParams: {
[key: string]: string | number;
}): string;
/**
* Decodes a querystring (e.g. ?arg=val&arg2=val2) into a params object
* (e.g. {arg: 'val', arg2: 'val2'})
*/
export declare function querystringDecode(querystring: string): Record<string, string>;
/**
* Extract the query string part of a URL, including the leading question mark (if present).
*/
export declare function extractQuerystring(url: string): string;
+84
View File
@@ -0,0 +1,84 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
/**
* @fileoverview SHA-1 cryptographic hash.
* Variable names follow the notation in FIPS PUB 180-3:
* http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf.
*
* Usage:
* var sha1 = new sha1();
* sha1.update(bytes);
* var hash = sha1.digest();
*
* Performance:
* Chrome 23: ~400 Mbit/s
* Firefox 16: ~250 Mbit/s
*
*/
/**
* SHA-1 cryptographic hash constructor.
*
* The properties declared here are discussed in the above algorithm document.
* @constructor
* @final
* @struct
*/
export declare class Sha1 {
/**
* Holds the previous values of accumulated variables a-e in the compress_
* function.
* @private
*/
private chain_;
/**
* A buffer holding the partially computed hash result.
* @private
*/
private buf_;
/**
* An array of 80 bytes, each a part of the message to be hashed. Referred to
* as the message schedule in the docs.
* @private
*/
private W_;
/**
* Contains data needed to pad messages less than 64 bytes.
* @private
*/
private pad_;
/**
* @private {number}
*/
private inbuf_;
/**
* @private {number}
*/
private total_;
blockSize: number;
constructor();
reset(): void;
/**
* Internal compress helper function.
* @param buf Block to compress.
* @param offset Offset of the block in the buffer.
* @private
*/
compress_(buf: number[] | Uint8Array | string, offset?: number): void;
update(bytes?: number[] | Uint8Array | string, length?: number): void;
/** @override */
digest(): number[];
}
+49
View File
@@ -0,0 +1,49 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
export declare type NextFn<T> = (value: T) => void;
export declare type ErrorFn = (error: Error) => void;
export declare type CompleteFn = () => void;
export interface Observer<T> {
next: NextFn<T>;
error: ErrorFn;
complete: CompleteFn;
}
export declare type PartialObserver<T> = Partial<Observer<T>>;
export declare type Unsubscribe = () => void;
/**
* The Subscribe interface has two forms - passing the inline function
* callbacks, or a object interface with callback properties.
*/
export interface Subscribe<T> {
(next?: NextFn<T>, error?: ErrorFn, complete?: CompleteFn): Unsubscribe;
(observer: PartialObserver<T>): Unsubscribe;
}
export interface Observable<T> {
subscribe: Subscribe<T>;
}
export declare type Executor<T> = (observer: Observer<T>) => void;
/**
* Helper to make a Subscribe function (just like Promise helps make a
* Thenable).
*
* @param executor Function which can make calls to a single Observer
* as a proxy.
* @param onNoObservers Callback when count of Observers goes to zero.
*/
export declare function createSubscribe<T>(executor: Executor<T>, onNoObservers?: Executor<T>): Subscribe<T>;
/** Turn synchronous function into one called asynchronously. */
export declare function async(fn: Function, onError?: ErrorFn): Function;
+27
View File
@@ -0,0 +1,27 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
/**
* @param {string} str
* @return {Array}
*/
export declare const stringToByteArray: (str: string) => number[];
/**
* Calculate length without actually converting; useful for doing cheaper validation.
* @param {string} str
* @return {number}
*/
export declare const stringLength: (str: string) => number;
+43
View File
@@ -0,0 +1,43 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
/**
* Check to make sure the appropriate number of arguments are provided for a public function.
* Throws an error if it fails.
*
* @param fnName The function name
* @param minCount The minimum number of arguments to allow for the function call
* @param maxCount The maximum number of argument to allow for the function call
* @param argCount The actual number of arguments provided.
*/
export declare const validateArgCount: (fnName: string, minCount: number, maxCount: number, argCount: number) => void;
/**
* Generates a string to prefix an error message about failed argument validation
*
* @param fnName The function name
* @param argName The name of the argument
* @return The prefix to add to the error thrown for validation.
*/
export declare function errorPrefix(fnName: string, argName: string): string;
/**
* @param fnName
* @param argumentNumber
* @param namespace
* @param optional
*/
export declare function validateNamespace(fnName: string, namespace: string, optional: boolean): void;
export declare function validateCallback(fnName: string, argumentName: string, callback: Function, optional: boolean): void;
export declare function validateContextObject(fnName: string, argumentName: string, context: unknown, optional: boolean): void;
+1
View File
@@ -0,0 +1 @@
export {};
+17
View File
@@ -0,0 +1,17 @@
/**
* @license
* Copyright 2021 Google LLC
*
* 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.
*/
export {};
+1
View File
@@ -0,0 +1 @@
export {};
+1
View File
@@ -0,0 +1 @@
export {};
+1
View File
@@ -0,0 +1 @@
export {};
+17
View File
@@ -0,0 +1,17 @@
/**
* @license
* Copyright 2019 Google LLC
*
* 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.
*/
export {};
+17
View File
@@ -0,0 +1,17 @@
/**
* @license
* Copyright 2021 Google LLC
*
* 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.
*/
export {};
+17
View File
@@ -0,0 +1,17 @@
/**
* @license
* Copyright 2017 Google LLC
*
* 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.
*/
export {};
+94
View File
@@ -0,0 +1,94 @@
{
"_from": "@firebase/[email protected]",
"_id": "@firebase/[email protected]",
"_inBundle": false,
"_integrity": "sha512-JMiUo+9QE9lMBvEtBjqsOFdmJgObFvi7OL1A0uFGwTmlCI1ZeNPOEBrwXkgTOelVCdiMO15mAebtEyxFuQ6FsA==",
"_location": "/@firebase/util",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "@firebase/[email protected]",
"name": "@firebase/util",
"escapedName": "@firebase%2futil",
"scope": "@firebase",
"rawSpec": "1.4.2",
"saveSpec": null,
"fetchSpec": "1.4.2"
},
"_requiredBy": [
"/@firebase/component",
"/@firebase/database",
"/@firebase/database-compat",
"/@firebase/database-compat/@firebase/database-types"
],
"_resolved": "https://registry.npmjs.org/@firebase/util/-/util-1.4.2.tgz",
"_shasum": "271c63bb7cce4607f7679dc5624ef241c4cf2498",
"_spec": "@firebase/[email protected]",
"_where": "/Users/talksik/Development/nirvana-server/node_modules/@firebase/database-compat",
"author": {
"name": "Firebase",
"email": "[email protected]",
"url": "https://firebase.google.com/"
},
"browser": "dist/index.esm2017.js",
"bugs": {
"url": "https://github.com/firebase/firebase-js-sdk/issues"
},
"bundleDependencies": false,
"dependencies": {
"tslib": "^2.1.0"
},
"deprecated": false,
"description": "_NOTE: This is specifically tailored for Firebase JS SDK usage, if you are not a member of the Firebase team, please avoid using this package_",
"devDependencies": {
"rollup": "2.57.0",
"rollup-plugin-typescript2": "0.30.0",
"typescript": "4.2.2"
},
"esm5": "dist/index.esm5.js",
"exports": {
".": {
"node": {
"import": "./dist/node-esm/index.node.esm.js",
"require": "./dist/index.node.cjs.js"
},
"esm5": "./dist/index.esm5.js",
"default": "./dist/index.esm2017.js"
},
"./package.json": "./package.json"
},
"files": [
"dist"
],
"homepage": "https://github.com/firebase/firebase-js-sdk#readme",
"license": "Apache-2.0",
"main": "dist/index.node.cjs.js",
"module": "dist/index.esm2017.js",
"name": "@firebase/util",
"nyc": {
"extension": [
".ts"
],
"reportDir": "./coverage/node"
},
"repository": {
"directory": "packages/util",
"type": "git",
"url": "git+https://github.com/firebase/firebase-js-sdk.git"
},
"scripts": {
"build": "rollup -c",
"build:deps": "lerna run --scope @firebase/util --include-dependencies build",
"dev": "rollup -c -w",
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
"test": "run-p lint test:all",
"test:all": "run-p test:browser test:node",
"test:browser": "karma start --single-run",
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all",
"test:node": "TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha test/**/*.test.* --config ../../config/mocharc.node.js"
},
"typings": "dist/index.d.ts",
"version": "1.4.2"
}