@firebase/util 1.9.7 → 1.10.0-canary.1c8dbee46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +18 -7
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm2017.js +18 -8
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +17 -7
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +17 -6
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/node-esm/index.node.esm.js +18 -8
- package/dist/node-esm/index.node.esm.js.map +1 -1
- package/dist/node-esm/src/deferred.d.ts +1 -1
- package/dist/node-esm/src/environment.d.ts +9 -2
- package/dist/node-esm/src/errors.d.ts +1 -1
- package/dist/node-esm/src/json.d.ts +1 -1
- package/dist/src/deferred.d.ts +1 -1
- package/dist/src/environment.d.ts +9 -2
- package/dist/src/errors.d.ts +1 -1
- package/dist/src/json.d.ts +1 -1
- package/dist/util-public.d.ts +13 -5
- package/dist/util.d.ts +13 -5
- package/package.json +2 -2
|
@@ -20,7 +20,7 @@ export declare class Deferred<R> {
|
|
|
20
20
|
resolve: (value?: unknown) => void;
|
|
21
21
|
constructor();
|
|
22
22
|
/**
|
|
23
|
-
* Our API internals are not
|
|
23
|
+
* Our API internals are not promisified and cannot because our callback APIs have subtle expectations around
|
|
24
24
|
* invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback
|
|
25
25
|
* and returns a node-style callback which will resolve or reject the Deferred's promise.
|
|
26
26
|
*/
|
|
@@ -34,13 +34,20 @@ export declare function isMobileCordova(): boolean;
|
|
|
34
34
|
*/
|
|
35
35
|
export declare function isNode(): boolean;
|
|
36
36
|
/**
|
|
37
|
-
* Detect Browser Environment
|
|
37
|
+
* Detect Browser Environment.
|
|
38
|
+
* Note: This will return true for certain test frameworks that are incompletely
|
|
39
|
+
* mimicking a browser, and should not lead to assuming all browser APIs are
|
|
40
|
+
* available.
|
|
38
41
|
*/
|
|
39
42
|
export declare function isBrowser(): boolean;
|
|
40
43
|
/**
|
|
41
|
-
* Detect Web Worker context
|
|
44
|
+
* Detect Web Worker context.
|
|
42
45
|
*/
|
|
43
46
|
export declare function isWebWorker(): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Detect Cloudflare Worker context.
|
|
49
|
+
*/
|
|
50
|
+
export declare function isCloudflareWorker(): boolean;
|
|
44
51
|
export declare function isBrowserExtension(): boolean;
|
|
45
52
|
/**
|
|
46
53
|
* Detect React Native.
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
export declare function jsonEval(str: string): unknown;
|
|
24
24
|
/**
|
|
25
25
|
* Returns JSON representing a javascript object.
|
|
26
|
-
* @param {*} data
|
|
26
|
+
* @param {*} data JavaScript object to be stringified.
|
|
27
27
|
* @return {string} The JSON contents of the object.
|
|
28
28
|
*/
|
|
29
29
|
export declare function stringify(data: unknown): string;
|
package/dist/src/deferred.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export declare class Deferred<R> {
|
|
|
20
20
|
resolve: (value?: unknown) => void;
|
|
21
21
|
constructor();
|
|
22
22
|
/**
|
|
23
|
-
* Our API internals are not
|
|
23
|
+
* Our API internals are not promisified and cannot because our callback APIs have subtle expectations around
|
|
24
24
|
* invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback
|
|
25
25
|
* and returns a node-style callback which will resolve or reject the Deferred's promise.
|
|
26
26
|
*/
|
|
@@ -34,13 +34,20 @@ export declare function isMobileCordova(): boolean;
|
|
|
34
34
|
*/
|
|
35
35
|
export declare function isNode(): boolean;
|
|
36
36
|
/**
|
|
37
|
-
* Detect Browser Environment
|
|
37
|
+
* Detect Browser Environment.
|
|
38
|
+
* Note: This will return true for certain test frameworks that are incompletely
|
|
39
|
+
* mimicking a browser, and should not lead to assuming all browser APIs are
|
|
40
|
+
* available.
|
|
38
41
|
*/
|
|
39
42
|
export declare function isBrowser(): boolean;
|
|
40
43
|
/**
|
|
41
|
-
* Detect Web Worker context
|
|
44
|
+
* Detect Web Worker context.
|
|
42
45
|
*/
|
|
43
46
|
export declare function isWebWorker(): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Detect Cloudflare Worker context.
|
|
49
|
+
*/
|
|
50
|
+
export declare function isCloudflareWorker(): boolean;
|
|
44
51
|
export declare function isBrowserExtension(): boolean;
|
|
45
52
|
/**
|
|
46
53
|
* Detect React Native.
|
package/dist/src/errors.d.ts
CHANGED
package/dist/src/json.d.ts
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
export declare function jsonEval(str: string): unknown;
|
|
24
24
|
/**
|
|
25
25
|
* Returns JSON representing a javascript object.
|
|
26
|
-
* @param {*} data
|
|
26
|
+
* @param {*} data JavaScript object to be stringified.
|
|
27
27
|
* @return {string} The JSON contents of the object.
|
|
28
28
|
*/
|
|
29
29
|
export declare function stringify(data: unknown): string;
|
package/dist/util-public.d.ts
CHANGED
|
@@ -274,7 +274,7 @@ export declare class Deferred<R> {
|
|
|
274
274
|
resolve: (value?: unknown) => void;
|
|
275
275
|
constructor();
|
|
276
276
|
/**
|
|
277
|
-
* Our API internals are not
|
|
277
|
+
* Our API internals are not promisified and cannot because our callback APIs have subtle expectations around
|
|
278
278
|
* invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback
|
|
279
279
|
* and returns a node-style callback which will resolve or reject the Deferred's promise.
|
|
280
280
|
*/
|
|
@@ -324,7 +324,7 @@ export declare type ErrorFn = (error: Error) => void;
|
|
|
324
324
|
*
|
|
325
325
|
* Usage:
|
|
326
326
|
*
|
|
327
|
-
* //
|
|
327
|
+
* // TypeScript string literals for type-safe codes
|
|
328
328
|
* type Err =
|
|
329
329
|
* 'unknown' |
|
|
330
330
|
* 'object-not-found'
|
|
@@ -575,12 +575,20 @@ export declare function getUA(): string;
|
|
|
575
575
|
export declare const isAdmin: (token: string) => boolean;
|
|
576
576
|
|
|
577
577
|
/**
|
|
578
|
-
* Detect Browser Environment
|
|
578
|
+
* Detect Browser Environment.
|
|
579
|
+
* Note: This will return true for certain test frameworks that are incompletely
|
|
580
|
+
* mimicking a browser, and should not lead to assuming all browser APIs are
|
|
581
|
+
* available.
|
|
579
582
|
*/
|
|
580
583
|
export declare function isBrowser(): boolean;
|
|
581
584
|
|
|
582
585
|
export declare function isBrowserExtension(): boolean;
|
|
583
586
|
|
|
587
|
+
/**
|
|
588
|
+
* Detect Cloudflare Worker context.
|
|
589
|
+
*/
|
|
590
|
+
export declare function isCloudflareWorker(): boolean;
|
|
591
|
+
|
|
584
592
|
/** Detects Electron apps. */
|
|
585
593
|
export declare function isElectron(): boolean;
|
|
586
594
|
|
|
@@ -660,7 +668,7 @@ export declare const isValidFormat: (token: string) => boolean;
|
|
|
660
668
|
export declare const isValidTimestamp: (token: string) => boolean;
|
|
661
669
|
|
|
662
670
|
/**
|
|
663
|
-
* Detect Web Worker context
|
|
671
|
+
* Detect Web Worker context.
|
|
664
672
|
*/
|
|
665
673
|
export declare function isWebWorker(): boolean;
|
|
666
674
|
|
|
@@ -886,7 +894,7 @@ export declare class Sha1 {
|
|
|
886
894
|
|
|
887
895
|
/**
|
|
888
896
|
* Returns JSON representing a javascript object.
|
|
889
|
-
* @param {*} data
|
|
897
|
+
* @param {*} data JavaScript object to be stringified.
|
|
890
898
|
* @return {string} The JSON contents of the object.
|
|
891
899
|
*/
|
|
892
900
|
export declare function stringify(data: unknown): string;
|
package/dist/util.d.ts
CHANGED
|
@@ -274,7 +274,7 @@ export declare class Deferred<R> {
|
|
|
274
274
|
resolve: (value?: unknown) => void;
|
|
275
275
|
constructor();
|
|
276
276
|
/**
|
|
277
|
-
* Our API internals are not
|
|
277
|
+
* Our API internals are not promisified and cannot because our callback APIs have subtle expectations around
|
|
278
278
|
* invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback
|
|
279
279
|
* and returns a node-style callback which will resolve or reject the Deferred's promise.
|
|
280
280
|
*/
|
|
@@ -324,7 +324,7 @@ export declare type ErrorFn = (error: Error) => void;
|
|
|
324
324
|
*
|
|
325
325
|
* Usage:
|
|
326
326
|
*
|
|
327
|
-
* //
|
|
327
|
+
* // TypeScript string literals for type-safe codes
|
|
328
328
|
* type Err =
|
|
329
329
|
* 'unknown' |
|
|
330
330
|
* 'object-not-found'
|
|
@@ -575,12 +575,20 @@ export declare function getUA(): string;
|
|
|
575
575
|
export declare const isAdmin: (token: string) => boolean;
|
|
576
576
|
|
|
577
577
|
/**
|
|
578
|
-
* Detect Browser Environment
|
|
578
|
+
* Detect Browser Environment.
|
|
579
|
+
* Note: This will return true for certain test frameworks that are incompletely
|
|
580
|
+
* mimicking a browser, and should not lead to assuming all browser APIs are
|
|
581
|
+
* available.
|
|
579
582
|
*/
|
|
580
583
|
export declare function isBrowser(): boolean;
|
|
581
584
|
|
|
582
585
|
export declare function isBrowserExtension(): boolean;
|
|
583
586
|
|
|
587
|
+
/**
|
|
588
|
+
* Detect Cloudflare Worker context.
|
|
589
|
+
*/
|
|
590
|
+
export declare function isCloudflareWorker(): boolean;
|
|
591
|
+
|
|
584
592
|
/** Detects Electron apps. */
|
|
585
593
|
export declare function isElectron(): boolean;
|
|
586
594
|
|
|
@@ -660,7 +668,7 @@ export declare const isValidFormat: (token: string) => boolean;
|
|
|
660
668
|
export declare const isValidTimestamp: (token: string) => boolean;
|
|
661
669
|
|
|
662
670
|
/**
|
|
663
|
-
* Detect Web Worker context
|
|
671
|
+
* Detect Web Worker context.
|
|
664
672
|
*/
|
|
665
673
|
export declare function isWebWorker(): boolean;
|
|
666
674
|
|
|
@@ -906,7 +914,7 @@ export declare class Sha1 {
|
|
|
906
914
|
|
|
907
915
|
/**
|
|
908
916
|
* Returns JSON representing a javascript object.
|
|
909
|
-
* @param {*} data
|
|
917
|
+
* @param {*} data JavaScript object to be stringified.
|
|
910
918
|
* @return {string} The JSON contents of the object.
|
|
911
919
|
*/
|
|
912
920
|
export declare function stringify(data: unknown): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firebase/util",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0-canary.1c8dbee46",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
|
|
6
6
|
"main": "dist/index.node.cjs.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"test": "run-p --npm-path npm lint test:all",
|
|
37
37
|
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all",
|
|
38
38
|
"test:all": "run-p --npm-path npm test:browser test:node",
|
|
39
|
-
"test:browser": "karma start
|
|
39
|
+
"test:browser": "karma start",
|
|
40
40
|
"test:node": "TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha test/**/*.test.* --config ../../config/mocharc.node.js",
|
|
41
41
|
"trusted-type-check": "tsec -p tsconfig.json --noEmit",
|
|
42
42
|
"api-report": "api-extractor run --local --verbose",
|