@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
package/dist/index.cjs.js
CHANGED
|
@@ -638,7 +638,7 @@ class Deferred {
|
|
|
638
638
|
});
|
|
639
639
|
}
|
|
640
640
|
/**
|
|
641
|
-
* Our API internals are not
|
|
641
|
+
* Our API internals are not promisified and cannot because our callback APIs have subtle expectations around
|
|
642
642
|
* invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback
|
|
643
643
|
* and returns a node-style callback which will resolve or reject the Deferred's promise.
|
|
644
644
|
*/
|
|
@@ -779,19 +779,29 @@ function isNode() {
|
|
|
779
779
|
}
|
|
780
780
|
}
|
|
781
781
|
/**
|
|
782
|
-
* Detect Browser Environment
|
|
782
|
+
* Detect Browser Environment.
|
|
783
|
+
* Note: This will return true for certain test frameworks that are incompletely
|
|
784
|
+
* mimicking a browser, and should not lead to assuming all browser APIs are
|
|
785
|
+
* available.
|
|
783
786
|
*/
|
|
784
787
|
function isBrowser() {
|
|
785
788
|
return typeof window !== 'undefined' || isWebWorker();
|
|
786
789
|
}
|
|
787
790
|
/**
|
|
788
|
-
* Detect Web Worker context
|
|
791
|
+
* Detect Web Worker context.
|
|
789
792
|
*/
|
|
790
793
|
function isWebWorker() {
|
|
791
794
|
return (typeof WorkerGlobalScope !== 'undefined' &&
|
|
792
795
|
typeof self !== 'undefined' &&
|
|
793
796
|
self instanceof WorkerGlobalScope);
|
|
794
797
|
}
|
|
798
|
+
/**
|
|
799
|
+
* Detect Cloudflare Worker context.
|
|
800
|
+
*/
|
|
801
|
+
function isCloudflareWorker() {
|
|
802
|
+
return (typeof navigator !== 'undefined' &&
|
|
803
|
+
navigator.userAgent === 'Cloudflare-Workers');
|
|
804
|
+
}
|
|
795
805
|
function isBrowserExtension() {
|
|
796
806
|
const runtime = typeof chrome === 'object'
|
|
797
807
|
? chrome.runtime
|
|
@@ -915,7 +925,7 @@ function areCookiesEnabled() {
|
|
|
915
925
|
*
|
|
916
926
|
* Usage:
|
|
917
927
|
*
|
|
918
|
-
* //
|
|
928
|
+
* // TypeScript string literals for type-safe codes
|
|
919
929
|
* type Err =
|
|
920
930
|
* 'unknown' |
|
|
921
931
|
* 'object-not-found'
|
|
@@ -1026,7 +1036,7 @@ function jsonEval(str) {
|
|
|
1026
1036
|
}
|
|
1027
1037
|
/**
|
|
1028
1038
|
* Returns JSON representing a javascript object.
|
|
1029
|
-
* @param {*} data
|
|
1039
|
+
* @param {*} data JavaScript object to be stringified.
|
|
1030
1040
|
* @return {string} The JSON contents of the object.
|
|
1031
1041
|
*/
|
|
1032
1042
|
function stringify(data) {
|
|
@@ -1629,7 +1639,7 @@ class ObserverProxy {
|
|
|
1629
1639
|
/**
|
|
1630
1640
|
* Subscribe function that can be used to add an Observer to the fan-out list.
|
|
1631
1641
|
*
|
|
1632
|
-
* - We require that no event is sent to a subscriber
|
|
1642
|
+
* - We require that no event is sent to a subscriber synchronously to their
|
|
1633
1643
|
* call to subscribe().
|
|
1634
1644
|
*/
|
|
1635
1645
|
subscribe(nextOrObserver, error, complete) {
|
|
@@ -1890,7 +1900,7 @@ function validateContextObject(fnName, argumentName, context, optional) {
|
|
|
1890
1900
|
// so it's been modified.
|
|
1891
1901
|
// Note that not all Unicode characters appear as single characters in JavaScript strings.
|
|
1892
1902
|
// fromCharCode returns the UTF-16 encoding of a character - so some Unicode characters
|
|
1893
|
-
// use 2 characters in
|
|
1903
|
+
// use 2 characters in JavaScript. All 4-byte UTF-8 characters begin with a first
|
|
1894
1904
|
// character in the range 0xD800 - 0xDBFF (the first character of a so-called surrogate
|
|
1895
1905
|
// pair).
|
|
1896
1906
|
// See http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3
|
|
@@ -2158,6 +2168,7 @@ exports.getUA = getUA;
|
|
|
2158
2168
|
exports.isAdmin = isAdmin;
|
|
2159
2169
|
exports.isBrowser = isBrowser;
|
|
2160
2170
|
exports.isBrowserExtension = isBrowserExtension;
|
|
2171
|
+
exports.isCloudflareWorker = isCloudflareWorker;
|
|
2161
2172
|
exports.isElectron = isElectron;
|
|
2162
2173
|
exports.isEmpty = isEmpty;
|
|
2163
2174
|
exports.isIE = isIE;
|