@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.esm2017.js
CHANGED
|
@@ -634,7 +634,7 @@ class Deferred {
|
|
|
634
634
|
});
|
|
635
635
|
}
|
|
636
636
|
/**
|
|
637
|
-
* Our API internals are not
|
|
637
|
+
* Our API internals are not promisified and cannot because our callback APIs have subtle expectations around
|
|
638
638
|
* invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback
|
|
639
639
|
* and returns a node-style callback which will resolve or reject the Deferred's promise.
|
|
640
640
|
*/
|
|
@@ -775,19 +775,29 @@ function isNode() {
|
|
|
775
775
|
}
|
|
776
776
|
}
|
|
777
777
|
/**
|
|
778
|
-
* Detect Browser Environment
|
|
778
|
+
* Detect Browser Environment.
|
|
779
|
+
* Note: This will return true for certain test frameworks that are incompletely
|
|
780
|
+
* mimicking a browser, and should not lead to assuming all browser APIs are
|
|
781
|
+
* available.
|
|
779
782
|
*/
|
|
780
783
|
function isBrowser() {
|
|
781
784
|
return typeof window !== 'undefined' || isWebWorker();
|
|
782
785
|
}
|
|
783
786
|
/**
|
|
784
|
-
* Detect Web Worker context
|
|
787
|
+
* Detect Web Worker context.
|
|
785
788
|
*/
|
|
786
789
|
function isWebWorker() {
|
|
787
790
|
return (typeof WorkerGlobalScope !== 'undefined' &&
|
|
788
791
|
typeof self !== 'undefined' &&
|
|
789
792
|
self instanceof WorkerGlobalScope);
|
|
790
793
|
}
|
|
794
|
+
/**
|
|
795
|
+
* Detect Cloudflare Worker context.
|
|
796
|
+
*/
|
|
797
|
+
function isCloudflareWorker() {
|
|
798
|
+
return (typeof navigator !== 'undefined' &&
|
|
799
|
+
navigator.userAgent === 'Cloudflare-Workers');
|
|
800
|
+
}
|
|
791
801
|
function isBrowserExtension() {
|
|
792
802
|
const runtime = typeof chrome === 'object'
|
|
793
803
|
? chrome.runtime
|
|
@@ -911,7 +921,7 @@ function areCookiesEnabled() {
|
|
|
911
921
|
*
|
|
912
922
|
* Usage:
|
|
913
923
|
*
|
|
914
|
-
* //
|
|
924
|
+
* // TypeScript string literals for type-safe codes
|
|
915
925
|
* type Err =
|
|
916
926
|
* 'unknown' |
|
|
917
927
|
* 'object-not-found'
|
|
@@ -1022,7 +1032,7 @@ function jsonEval(str) {
|
|
|
1022
1032
|
}
|
|
1023
1033
|
/**
|
|
1024
1034
|
* Returns JSON representing a javascript object.
|
|
1025
|
-
* @param {*} data
|
|
1035
|
+
* @param {*} data JavaScript object to be stringified.
|
|
1026
1036
|
* @return {string} The JSON contents of the object.
|
|
1027
1037
|
*/
|
|
1028
1038
|
function stringify(data) {
|
|
@@ -1625,7 +1635,7 @@ class ObserverProxy {
|
|
|
1625
1635
|
/**
|
|
1626
1636
|
* Subscribe function that can be used to add an Observer to the fan-out list.
|
|
1627
1637
|
*
|
|
1628
|
-
* - We require that no event is sent to a subscriber
|
|
1638
|
+
* - We require that no event is sent to a subscriber synchronously to their
|
|
1629
1639
|
* call to subscribe().
|
|
1630
1640
|
*/
|
|
1631
1641
|
subscribe(nextOrObserver, error, complete) {
|
|
@@ -1886,7 +1896,7 @@ function validateContextObject(fnName, argumentName, context, optional) {
|
|
|
1886
1896
|
// so it's been modified.
|
|
1887
1897
|
// Note that not all Unicode characters appear as single characters in JavaScript strings.
|
|
1888
1898
|
// fromCharCode returns the UTF-16 encoding of a character - so some Unicode characters
|
|
1889
|
-
// use 2 characters in
|
|
1899
|
+
// use 2 characters in JavaScript. All 4-byte UTF-8 characters begin with a first
|
|
1890
1900
|
// character in the range 0xD800 - 0xDBFF (the first character of a so-called surrogate
|
|
1891
1901
|
// pair).
|
|
1892
1902
|
// See http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3
|
|
@@ -2117,5 +2127,5 @@ function getModularInstance(service) {
|
|
|
2117
2127
|
}
|
|
2118
2128
|
}
|
|
2119
2129
|
|
|
2120
|
-
export { CONSTANTS, DecodeBase64StringError, Deferred, ErrorFactory, FirebaseError, MAX_VALUE_MILLIS, RANDOM_FACTOR, Sha1, areCookiesEnabled, assert, assertionError, async, base64, base64Decode, base64Encode, base64urlEncodeWithoutPadding, calculateBackoffMillis, contains, createMockUserToken, createSubscribe, decode, deepCopy, deepEqual, deepExtend, errorPrefix, extractQuerystring, getDefaultAppConfig, getDefaultEmulatorHost, getDefaultEmulatorHostnameAndPort, getDefaults, getExperimentalSetting, getGlobal, getModularInstance, getUA, isAdmin, isBrowser, isBrowserExtension, isElectron, isEmpty, isIE, isIndexedDBAvailable, isMobileCordova, isNode, isNodeSdk, isReactNative, isSafari, isUWP, isValidFormat, isValidTimestamp, isWebWorker, issuedAtTime, jsonEval, map, ordinal, promiseWithTimeout, querystring, querystringDecode, safeGet, stringLength, stringToByteArray, stringify, uuidv4, validateArgCount, validateCallback, validateContextObject, validateIndexedDBOpenable, validateNamespace };
|
|
2130
|
+
export { CONSTANTS, DecodeBase64StringError, Deferred, ErrorFactory, FirebaseError, MAX_VALUE_MILLIS, RANDOM_FACTOR, Sha1, areCookiesEnabled, assert, assertionError, async, base64, base64Decode, base64Encode, base64urlEncodeWithoutPadding, calculateBackoffMillis, contains, createMockUserToken, createSubscribe, decode, deepCopy, deepEqual, deepExtend, errorPrefix, extractQuerystring, getDefaultAppConfig, getDefaultEmulatorHost, getDefaultEmulatorHostnameAndPort, getDefaults, getExperimentalSetting, getGlobal, getModularInstance, getUA, isAdmin, isBrowser, isBrowserExtension, isCloudflareWorker, isElectron, isEmpty, isIE, isIndexedDBAvailable, isMobileCordova, isNode, isNodeSdk, isReactNative, isSafari, isUWP, isValidFormat, isValidTimestamp, isWebWorker, issuedAtTime, jsonEval, map, ordinal, promiseWithTimeout, querystring, querystringDecode, safeGet, stringLength, stringToByteArray, stringify, uuidv4, validateArgCount, validateCallback, validateContextObject, validateIndexedDBOpenable, validateNamespace };
|
|
2121
2131
|
//# sourceMappingURL=index.esm2017.js.map
|