@firebase/util 1.9.7-canary.f58d48cd4 → 1.9.7-dataconnect-preview.d986d4bf2

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.
@@ -642,7 +642,7 @@ var Deferred = /** @class */ (function () {
642
642
  });
643
643
  }
644
644
  /**
645
- * Our API internals are not promiseified and cannot because our callback APIs have subtle expectations around
645
+ * Our API internals are not promisified and cannot because our callback APIs have subtle expectations around
646
646
  * invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback
647
647
  * and returns a node-style callback which will resolve or reject the Deferred's promise.
648
648
  */
@@ -786,6 +786,9 @@ function isNode() {
786
786
  }
787
787
  /**
788
788
  * Detect Browser Environment
789
+ * Note: This will return true for certain test frameworks that are incompletely
790
+ * mimicking a browser, and should not lead to assuming all browser APIs are
791
+ * available.
789
792
  */
790
793
  function isBrowser() {
791
794
  return typeof window !== 'undefined' || isWebWorker();
@@ -1000,7 +1003,7 @@ function jsonEval(str) {
1000
1003
  }
1001
1004
  /**
1002
1005
  * Returns JSON representing a javascript object.
1003
- * @param {*} data Javascript object to be stringified.
1006
+ * @param {*} data JavaScript object to be stringified.
1004
1007
  * @return {string} The JSON contents of the object.
1005
1008
  */
1006
1009
  function stringify(data) {
@@ -1612,7 +1615,7 @@ var ObserverProxy = /** @class */ (function () {
1612
1615
  /**
1613
1616
  * Subscribe function that can be used to add an Observer to the fan-out list.
1614
1617
  *
1615
- * - We require that no event is sent to a subscriber sychronously to their
1618
+ * - We require that no event is sent to a subscriber synchronously to their
1616
1619
  * call to subscribe().
1617
1620
  */
1618
1621
  ObserverProxy.prototype.subscribe = function (nextOrObserver, error, complete) {
@@ -1882,7 +1885,7 @@ function validateContextObject(fnName, argumentName, context, optional) {
1882
1885
  // so it's been modified.
1883
1886
  // Note that not all Unicode characters appear as single characters in JavaScript strings.
1884
1887
  // fromCharCode returns the UTF-16 encoding of a character - so some Unicode characters
1885
- // use 2 characters in Javascript. All 4-byte UTF-8 characters begin with a first
1888
+ // use 2 characters in JavaScript. All 4-byte UTF-8 characters begin with a first
1886
1889
  // character in the range 0xD800 - 0xDBFF (the first character of a so-called surrogate
1887
1890
  // pair).
1888
1891
  // See http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3
@@ -2115,5 +2118,63 @@ function getModularInstance(service) {
2115
2118
  }
2116
2119
  }
2117
2120
 
2118
- 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 };
2121
+ /**
2122
+ * @license
2123
+ * Copyright 2023 Google LLC
2124
+ *
2125
+ * Licensed under the Apache License, Version 2.0 (the "License");
2126
+ * you may not use this file except in compliance with the License.
2127
+ * You may obtain a copy of the License at
2128
+ *
2129
+ * http://www.apache.org/licenses/LICENSE-2.0
2130
+ *
2131
+ * Unless required by applicable law or agreed to in writing, software
2132
+ * distributed under the License is distributed on an "AS IS" BASIS,
2133
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2134
+ * See the License for the specific language governing permissions and
2135
+ * limitations under the License.
2136
+ */
2137
+ var FetchProvider = /** @class */ (function () {
2138
+ function FetchProvider() {
2139
+ }
2140
+ FetchProvider.initialize = function (fetchImpl, headersImpl, responseImpl) {
2141
+ this.fetchImpl = fetchImpl;
2142
+ if (headersImpl) {
2143
+ this.headersImpl = headersImpl;
2144
+ }
2145
+ if (responseImpl) {
2146
+ this.responseImpl = responseImpl;
2147
+ }
2148
+ };
2149
+ FetchProvider.fetch = function () {
2150
+ if (this.fetchImpl) {
2151
+ return this.fetchImpl;
2152
+ }
2153
+ if (typeof self !== 'undefined' && 'fetch' in self) {
2154
+ return self.fetch;
2155
+ }
2156
+ throw new Error('Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill');
2157
+ };
2158
+ FetchProvider.headers = function () {
2159
+ if (this.headersImpl) {
2160
+ return this.headersImpl;
2161
+ }
2162
+ if (typeof self !== 'undefined' && 'Headers' in self) {
2163
+ return self.Headers;
2164
+ }
2165
+ throw new Error('Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill');
2166
+ };
2167
+ FetchProvider.response = function () {
2168
+ if (this.responseImpl) {
2169
+ return this.responseImpl;
2170
+ }
2171
+ if (typeof self !== 'undefined' && 'Response' in self) {
2172
+ return self.Response;
2173
+ }
2174
+ throw new Error('Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill');
2175
+ };
2176
+ return FetchProvider;
2177
+ }());
2178
+
2179
+ export { CONSTANTS, DecodeBase64StringError, Deferred, ErrorFactory, FetchProvider, 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 };
2119
2180
  //# sourceMappingURL=index.esm5.js.map