@firebase/util 1.6.1 → 1.6.2-canary.b60cf76e1

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.
@@ -774,7 +774,7 @@ function getGlobal() {
774
774
  *
775
775
  * catch (e) {
776
776
  * assert(e.message === "Could not find file: foo.txt.");
777
- * if (e.code === 'service/file-not-found') {
777
+ * if ((e as FirebaseError)?.code === 'service/file-not-found') {
778
778
  * console.log("Could not read file: " + e['file']);
779
779
  * }
780
780
  * }
@@ -1761,6 +1761,34 @@ const stringLength = function (str) {
1761
1761
  return p;
1762
1762
  };
1763
1763
 
1764
+ /**
1765
+ * @license
1766
+ * Copyright 2022 Google LLC
1767
+ *
1768
+ * Licensed under the Apache License, Version 2.0 (the "License");
1769
+ * you may not use this file except in compliance with the License.
1770
+ * You may obtain a copy of the License at
1771
+ *
1772
+ * http://www.apache.org/licenses/LICENSE-2.0
1773
+ *
1774
+ * Unless required by applicable law or agreed to in writing, software
1775
+ * distributed under the License is distributed on an "AS IS" BASIS,
1776
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1777
+ * See the License for the specific language governing permissions and
1778
+ * limitations under the License.
1779
+ */
1780
+ /**
1781
+ * Copied from https://stackoverflow.com/a/2117523
1782
+ * Generates a new uuid.
1783
+ * @public
1784
+ */
1785
+ const uuidv4 = function () {
1786
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
1787
+ const r = (Math.random() * 16) | 0, v = c === 'x' ? r : (r & 0x3) | 0x8;
1788
+ return v.toString(16);
1789
+ });
1790
+ };
1791
+
1764
1792
  /**
1765
1793
  * @license
1766
1794
  * Copyright 2019 Google LLC
@@ -1914,5 +1942,5 @@ function getModularInstance(service) {
1914
1942
  // Overriding the constant (we should be the only ones doing this)
1915
1943
  CONSTANTS.NODE_CLIENT = true;
1916
1944
 
1917
- export { CONSTANTS, 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, getGlobal, getModularInstance, getUA, isAdmin, isBrowser, isBrowserExtension, isElectron, isEmpty, isIE, isIndexedDBAvailable, isMobileCordova, isNode, isNodeSdk, isReactNative, isSafari, isUWP, isValidFormat, isValidTimestamp, issuedAtTime, jsonEval, map, ordinal, querystring, querystringDecode, safeGet, stringLength, stringToByteArray, stringify, validateArgCount, validateCallback, validateContextObject, validateIndexedDBOpenable, validateNamespace };
1945
+ export { CONSTANTS, 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, getGlobal, getModularInstance, getUA, isAdmin, isBrowser, isBrowserExtension, isElectron, isEmpty, isIE, isIndexedDBAvailable, isMobileCordova, isNode, isNodeSdk, isReactNative, isSafari, isUWP, isValidFormat, isValidTimestamp, issuedAtTime, jsonEval, map, ordinal, querystring, querystringDecode, safeGet, stringLength, stringToByteArray, stringify, uuidv4, validateArgCount, validateCallback, validateContextObject, validateIndexedDBOpenable, validateNamespace };
1918
1946
  //# sourceMappingURL=index.node.esm.js.map