@firebase/util 1.9.7-canary.fd8bd4b02 → 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.
- package/dist/index.cjs.js +64 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.esm2017.js +64 -6
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +66 -5
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +66 -4
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.d.ts +1 -0
- package/dist/node-esm/index.d.ts +1 -0
- package/dist/node-esm/index.node.d.ts +1 -0
- package/dist/node-esm/index.node.esm.js +64 -6
- 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 +3 -0
- package/dist/node-esm/src/errors.d.ts +1 -1
- package/dist/node-esm/src/fetch_provider.d.ts +25 -0
- package/dist/node-esm/src/json.d.ts +1 -1
- package/dist/src/deferred.d.ts +1 -1
- package/dist/src/environment.d.ts +3 -0
- package/dist/src/errors.d.ts +1 -1
- package/dist/src/fetch_provider.d.ts +25 -0
- package/dist/src/json.d.ts +1 -1
- package/dist/util-public.d.ts +32 -3
- package/dist/util.d.ts +32 -3
- package/package.json +1 -1
package/dist/index.node.cjs.js
CHANGED
|
@@ -646,7 +646,7 @@ var Deferred = /** @class */ (function () {
|
|
|
646
646
|
});
|
|
647
647
|
}
|
|
648
648
|
/**
|
|
649
|
-
* Our API internals are not
|
|
649
|
+
* Our API internals are not promisified and cannot because our callback APIs have subtle expectations around
|
|
650
650
|
* invoking promises inline, which Promises are forbidden to do. This method accepts an optional node-style callback
|
|
651
651
|
* and returns a node-style callback which will resolve or reject the Deferred's promise.
|
|
652
652
|
*/
|
|
@@ -790,6 +790,9 @@ function isNode() {
|
|
|
790
790
|
}
|
|
791
791
|
/**
|
|
792
792
|
* Detect Browser Environment
|
|
793
|
+
* Note: This will return true for certain test frameworks that are incompletely
|
|
794
|
+
* mimicking a browser, and should not lead to assuming all browser APIs are
|
|
795
|
+
* available.
|
|
793
796
|
*/
|
|
794
797
|
function isBrowser() {
|
|
795
798
|
return typeof window !== 'undefined' || isWebWorker();
|
|
@@ -1004,7 +1007,7 @@ function jsonEval(str) {
|
|
|
1004
1007
|
}
|
|
1005
1008
|
/**
|
|
1006
1009
|
* Returns JSON representing a javascript object.
|
|
1007
|
-
* @param {*} data
|
|
1010
|
+
* @param {*} data JavaScript object to be stringified.
|
|
1008
1011
|
* @return {string} The JSON contents of the object.
|
|
1009
1012
|
*/
|
|
1010
1013
|
function stringify(data) {
|
|
@@ -1616,7 +1619,7 @@ var ObserverProxy = /** @class */ (function () {
|
|
|
1616
1619
|
/**
|
|
1617
1620
|
* Subscribe function that can be used to add an Observer to the fan-out list.
|
|
1618
1621
|
*
|
|
1619
|
-
* - We require that no event is sent to a subscriber
|
|
1622
|
+
* - We require that no event is sent to a subscriber synchronously to their
|
|
1620
1623
|
* call to subscribe().
|
|
1621
1624
|
*/
|
|
1622
1625
|
ObserverProxy.prototype.subscribe = function (nextOrObserver, error, complete) {
|
|
@@ -1886,7 +1889,7 @@ function validateContextObject(fnName, argumentName, context, optional) {
|
|
|
1886
1889
|
// so it's been modified.
|
|
1887
1890
|
// Note that not all Unicode characters appear as single characters in JavaScript strings.
|
|
1888
1891
|
// fromCharCode returns the UTF-16 encoding of a character - so some Unicode characters
|
|
1889
|
-
// use 2 characters in
|
|
1892
|
+
// use 2 characters in JavaScript. All 4-byte UTF-8 characters begin with a first
|
|
1890
1893
|
// character in the range 0xD800 - 0xDBFF (the first character of a so-called surrogate
|
|
1891
1894
|
// pair).
|
|
1892
1895
|
// See http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3
|
|
@@ -2119,6 +2122,64 @@ function getModularInstance(service) {
|
|
|
2119
2122
|
}
|
|
2120
2123
|
}
|
|
2121
2124
|
|
|
2125
|
+
/**
|
|
2126
|
+
* @license
|
|
2127
|
+
* Copyright 2023 Google LLC
|
|
2128
|
+
*
|
|
2129
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2130
|
+
* you may not use this file except in compliance with the License.
|
|
2131
|
+
* You may obtain a copy of the License at
|
|
2132
|
+
*
|
|
2133
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2134
|
+
*
|
|
2135
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2136
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2137
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2138
|
+
* See the License for the specific language governing permissions and
|
|
2139
|
+
* limitations under the License.
|
|
2140
|
+
*/
|
|
2141
|
+
var FetchProvider = /** @class */ (function () {
|
|
2142
|
+
function FetchProvider() {
|
|
2143
|
+
}
|
|
2144
|
+
FetchProvider.initialize = function (fetchImpl, headersImpl, responseImpl) {
|
|
2145
|
+
this.fetchImpl = fetchImpl;
|
|
2146
|
+
if (headersImpl) {
|
|
2147
|
+
this.headersImpl = headersImpl;
|
|
2148
|
+
}
|
|
2149
|
+
if (responseImpl) {
|
|
2150
|
+
this.responseImpl = responseImpl;
|
|
2151
|
+
}
|
|
2152
|
+
};
|
|
2153
|
+
FetchProvider.fetch = function () {
|
|
2154
|
+
if (this.fetchImpl) {
|
|
2155
|
+
return this.fetchImpl;
|
|
2156
|
+
}
|
|
2157
|
+
if (typeof self !== 'undefined' && 'fetch' in self) {
|
|
2158
|
+
return self.fetch;
|
|
2159
|
+
}
|
|
2160
|
+
throw new Error('Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill');
|
|
2161
|
+
};
|
|
2162
|
+
FetchProvider.headers = function () {
|
|
2163
|
+
if (this.headersImpl) {
|
|
2164
|
+
return this.headersImpl;
|
|
2165
|
+
}
|
|
2166
|
+
if (typeof self !== 'undefined' && 'Headers' in self) {
|
|
2167
|
+
return self.Headers;
|
|
2168
|
+
}
|
|
2169
|
+
throw new Error('Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill');
|
|
2170
|
+
};
|
|
2171
|
+
FetchProvider.response = function () {
|
|
2172
|
+
if (this.responseImpl) {
|
|
2173
|
+
return this.responseImpl;
|
|
2174
|
+
}
|
|
2175
|
+
if (typeof self !== 'undefined' && 'Response' in self) {
|
|
2176
|
+
return self.Response;
|
|
2177
|
+
}
|
|
2178
|
+
throw new Error('Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill');
|
|
2179
|
+
};
|
|
2180
|
+
return FetchProvider;
|
|
2181
|
+
}());
|
|
2182
|
+
|
|
2122
2183
|
/**
|
|
2123
2184
|
* @license
|
|
2124
2185
|
* Copyright 2017 Google LLC
|
|
@@ -2142,6 +2203,7 @@ exports.CONSTANTS = CONSTANTS;
|
|
|
2142
2203
|
exports.DecodeBase64StringError = DecodeBase64StringError;
|
|
2143
2204
|
exports.Deferred = Deferred;
|
|
2144
2205
|
exports.ErrorFactory = ErrorFactory;
|
|
2206
|
+
exports.FetchProvider = FetchProvider;
|
|
2145
2207
|
exports.FirebaseError = FirebaseError;
|
|
2146
2208
|
exports.MAX_VALUE_MILLIS = MAX_VALUE_MILLIS;
|
|
2147
2209
|
exports.RANDOM_FACTOR = RANDOM_FACTOR;
|