@firebase/util 1.9.1 → 1.9.2-canary.36558bd2e

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.
@@ -300,7 +300,7 @@ const base64 = {
300
300
  const byte4 = haveByte4 ? charToByteMap[input.charAt(i)] : 64;
301
301
  ++i;
302
302
  if (byte1 == null || byte2 == null || byte3 == null || byte4 == null) {
303
- throw Error();
303
+ throw new DecodeBase64StringError();
304
304
  }
305
305
  const outByte1 = (byte1 << 2) | (byte2 >> 4);
306
306
  output.push(outByte1);
@@ -341,6 +341,15 @@ const base64 = {
341
341
  }
342
342
  }
343
343
  };
344
+ /**
345
+ * An error encountered while decoding base64 string.
346
+ */
347
+ class DecodeBase64StringError extends Error {
348
+ constructor() {
349
+ super(...arguments);
350
+ this.name = 'DecodeBase64StringError';
351
+ }
352
+ }
344
353
  /**
345
354
  * URL-safe base64 encoding
346
355
  */
@@ -2118,5 +2127,5 @@ function getModularInstance(service) {
2118
2127
  // Overriding the constant (we should be the only ones doing this)
2119
2128
  CONSTANTS.NODE_CLIENT = true;
2120
2129
 
2121
- 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, getDefaultAppConfig, getDefaultEmulatorHost, getDefaultEmulatorHostnameAndPort, getDefaults, getExperimentalSetting, getGlobal, getModularInstance, getUA, isAdmin, isBrowser, isBrowserExtension, isElectron, isEmpty, isIE, isIndexedDBAvailable, isMobileCordova, isNode, isNodeSdk, isReactNative, isSafari, isUWP, isValidFormat, isValidTimestamp, 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, isElectron, isEmpty, isIE, isIndexedDBAvailable, isMobileCordova, isNode, isNodeSdk, isReactNative, isSafari, isUWP, isValidFormat, isValidTimestamp, issuedAtTime, jsonEval, map, ordinal, promiseWithTimeout, querystring, querystringDecode, safeGet, stringLength, stringToByteArray, stringify, uuidv4, validateArgCount, validateCallback, validateContextObject, validateIndexedDBOpenable, validateNamespace };
2122
2131
  //# sourceMappingURL=index.node.esm.js.map