@dereekb/firebase 13.14.0 → 13.16.0

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.
@@ -11999,7 +11999,7 @@ var IDENTIFIER_RE = /^[A-Za-z_]\w*$/;
11999
11999
  * @param source - Raw rules source.
12000
12000
  * @returns The source with line comments replaced by equal-length whitespace (so offsets are preserved).
12001
12001
  */ function stripLineComments(source) {
12002
- return source.replace(/\/\/[^\n]*/g, function(match) {
12002
+ return source.replaceAll(/\/\/[^\n]*/g, function(match) {
12003
12003
  return ' '.repeat(match.length);
12004
12004
  });
12005
12005
  }
@@ -12012,7 +12012,7 @@ var IDENTIFIER_RE = /^[A-Za-z_]\w*$/;
12012
12012
  * @param source - The (comment-stripped) source.
12013
12013
  * @returns The source with path-variable braces masked.
12014
12014
  */ function maskPathVariables(source) {
12015
- return source.replace(PATH_VARIABLE_RE, function(_match, inner) {
12015
+ return source.replaceAll(PATH_VARIABLE_RE, function(_match, inner) {
12016
12016
  return "".concat(MASK_OPEN_CHAR).concat(inner).concat(MASK_CLOSE_CHAR);
12017
12017
  });
12018
12018
  }
@@ -12023,7 +12023,7 @@ var IDENTIFIER_RE = /^[A-Za-z_]\w*$/;
12023
12023
  * @param text - Text containing masked path variables.
12024
12024
  * @returns The text with `{name}` braces restored.
12025
12025
  */ function unmaskPathVariables(text) {
12026
- return text.replace(UNMASK_RE, function(_match, inner) {
12026
+ return text.replaceAll(UNMASK_RE, function(_match, inner) {
12027
12027
  return "{".concat(inner, "}");
12028
12028
  });
12029
12029
  }
@@ -13520,9 +13520,9 @@ function fragListsToStrings(items) {
13520
13520
  break;
13521
13521
  }
13522
13522
  var str = fragsToConcreteString(item);
13523
- result = str != null ? _to_consumable_array$3(result).concat([
13523
+ result = str == null ? null : _to_consumable_array$3(result).concat([
13524
13524
  str
13525
- ]) : null;
13525
+ ]);
13526
13526
  }
13527
13527
  } catch (err) {
13528
13528
  _didIteratorError = true;
@@ -15140,9 +15140,9 @@ var identityRegistryCache = new Map();
15140
15140
  result = _object_spread({
15141
15141
  modelName: modelName1,
15142
15142
  collectionName: collectionName1
15143
- }, parentModelName != null ? {
15143
+ }, parentModelName == null ? {} : {
15144
15144
  parentModelName: parentModelName
15145
- } : {});
15145
+ });
15146
15146
  }
15147
15147
  }
15148
15148
  return result;
@@ -11997,7 +11997,7 @@ var IDENTIFIER_RE = /^[A-Za-z_]\w*$/;
11997
11997
  * @param source - Raw rules source.
11998
11998
  * @returns The source with line comments replaced by equal-length whitespace (so offsets are preserved).
11999
11999
  */ function stripLineComments(source) {
12000
- return source.replace(/\/\/[^\n]*/g, function(match) {
12000
+ return source.replaceAll(/\/\/[^\n]*/g, function(match) {
12001
12001
  return ' '.repeat(match.length);
12002
12002
  });
12003
12003
  }
@@ -12010,7 +12010,7 @@ var IDENTIFIER_RE = /^[A-Za-z_]\w*$/;
12010
12010
  * @param source - The (comment-stripped) source.
12011
12011
  * @returns The source with path-variable braces masked.
12012
12012
  */ function maskPathVariables(source) {
12013
- return source.replace(PATH_VARIABLE_RE, function(_match, inner) {
12013
+ return source.replaceAll(PATH_VARIABLE_RE, function(_match, inner) {
12014
12014
  return "".concat(MASK_OPEN_CHAR).concat(inner).concat(MASK_CLOSE_CHAR);
12015
12015
  });
12016
12016
  }
@@ -12021,7 +12021,7 @@ var IDENTIFIER_RE = /^[A-Za-z_]\w*$/;
12021
12021
  * @param text - Text containing masked path variables.
12022
12022
  * @returns The text with `{name}` braces restored.
12023
12023
  */ function unmaskPathVariables(text) {
12024
- return text.replace(UNMASK_RE, function(_match, inner) {
12024
+ return text.replaceAll(UNMASK_RE, function(_match, inner) {
12025
12025
  return "{".concat(inner, "}");
12026
12026
  });
12027
12027
  }
@@ -13518,9 +13518,9 @@ function fragListsToStrings(items) {
13518
13518
  break;
13519
13519
  }
13520
13520
  var str = fragsToConcreteString(item);
13521
- result = str != null ? _to_consumable_array$3(result).concat([
13521
+ result = str == null ? null : _to_consumable_array$3(result).concat([
13522
13522
  str
13523
- ]) : null;
13523
+ ]);
13524
13524
  }
13525
13525
  } catch (err) {
13526
13526
  _didIteratorError = true;
@@ -15138,9 +15138,9 @@ var identityRegistryCache = new Map();
15138
15138
  result = _object_spread({
15139
15139
  modelName: modelName1,
15140
15140
  collectionName: collectionName1
15141
- }, parentModelName != null ? {
15141
+ }, parentModelName == null ? {} : {
15142
15142
  parentModelName: parentModelName
15143
- } : {});
15143
+ });
15144
15144
  }
15145
15145
  }
15146
15146
  return result;
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@dereekb/firebase/eslint",
3
- "version": "13.14.0",
3
+ "version": "13.16.0",
4
4
  "peerDependencies": {
5
- "@dereekb/util": "13.14.0",
5
+ "@dereekb/util": "13.16.0",
6
6
  "@marcbachmann/cel-js": "^7.6.1",
7
7
  "@typescript-eslint/parser": "8.59.3",
8
8
  "@typescript-eslint/utils": "8.59.3"
9
9
  },
10
10
  "devDependencies": {
11
- "@dereekb/firebase": "13.14.0",
11
+ "@dereekb/firebase": "13.16.0",
12
12
  "eslint": "10.4.0",
13
13
  "firebase": "^12.12.1"
14
14
  },
package/index.cjs.js CHANGED
@@ -715,7 +715,7 @@ function _ts_generator$n(thisArg, body) {
715
715
  if (!util.objectHasNoKeys(updateData)) {
716
716
  return [
717
717
  2,
718
- params != null ? accessor.update(updateData, params) : accessor.update(updateData)
718
+ params == null ? accessor.update(updateData) : accessor.update(updateData, params)
719
719
  ];
720
720
  }
721
721
  return [
@@ -3186,7 +3186,7 @@ function documentDataWithIdAndKey(snapshot) {
3186
3186
  return [
3187
3187
  2,
3188
3188
  util.filterMaybeArrayValues(pairs.map(function(pair) {
3189
- return pair.data != null ? pair : undefined;
3189
+ return pair.data == null ? undefined : pair;
3190
3190
  }))
3191
3191
  ];
3192
3192
  }
@@ -4115,11 +4115,11 @@ function _object_spread_props$k(target, source) {
4115
4115
  */ function firestoreField(config) {
4116
4116
  var _config_defaultBeforeSave;
4117
4117
  return {
4118
- from: config.default != null ? {
4119
- default: util.asObjectCopyFactory(config.default),
4118
+ from: config.default == null ? {
4119
+ defaultInput: util.asObjectCopyFactory(config.defaultData),
4120
4120
  convert: config.fromData
4121
4121
  } : {
4122
- defaultInput: util.asObjectCopyFactory(config.defaultData),
4122
+ default: util.asObjectCopyFactory(config.default),
4123
4123
  convert: config.fromData
4124
4124
  },
4125
4125
  to: {
@@ -4183,11 +4183,11 @@ function optionalFirestoreField(config) {
4183
4183
  var transformData = inputTransformData !== null && inputTransformData !== void 0 ? inputTransformData : util.passThrough;
4184
4184
  var transformFrom = transformFromData !== null && transformFromData !== void 0 ? transformFromData : transformData;
4185
4185
  var baseTransformTo = transformToData !== null && transformToData !== void 0 ? transformToData : transformData;
4186
- var dontStoreValueIf = inputDontStoreValueIf != null ? util.isEqualToValueDecisionFunction(inputDontStoreValueIf) : null;
4187
- var transformTo = dontStoreValueIf != null ? function(value) {
4186
+ var dontStoreValueIf = inputDontStoreValueIf == null ? null : util.isEqualToValueDecisionFunction(inputDontStoreValueIf);
4187
+ var transformTo = dontStoreValueIf == null ? baseTransformTo : function(value) {
4188
4188
  var dontStoreCheck = dontStoreValueIf(value);
4189
4189
  return dontStoreCheck ? null : baseTransformTo(value);
4190
- } : baseTransformTo;
4190
+ };
4191
4191
  var loadDefaultReadValueFn; // set if a default read value is provided
4192
4192
  // setup fromData
4193
4193
  var fromData;
@@ -4202,12 +4202,12 @@ function optionalFirestoreField(config) {
4202
4202
  fromData = function fromData(x) {
4203
4203
  return transformFrom(x !== null && x !== void 0 ? x : loadDefaultReadValueFn());
4204
4204
  };
4205
- } else if (transformFrom !== util.passThrough) {
4205
+ } else if (transformFrom === util.passThrough) {
4206
+ fromData = util.passThrough;
4207
+ } else {
4206
4208
  fromData = function fromData(x) {
4207
- return x != null ? transformFrom(x) : x;
4209
+ return x == null ? x : transformFrom(x);
4208
4210
  };
4209
- } else {
4210
- fromData = util.passThrough;
4211
4211
  }
4212
4212
  // setup toData
4213
4213
  var dontStoreIf;
@@ -4220,7 +4220,12 @@ function optionalFirestoreField(config) {
4220
4220
  };
4221
4221
  }
4222
4222
  var toData;
4223
- if (dontStoreIf != null) {
4223
+ if (dontStoreIf == null) {
4224
+ toData = function toData(x) {
4225
+ var _transformTo;
4226
+ return x == null ? x : (_transformTo = transformTo(x)) !== null && _transformTo !== void 0 ? _transformTo : null;
4227
+ };
4228
+ } else {
4224
4229
  var dontStoreValue = dontStoreIf;
4225
4230
  toData = function toData(x) {
4226
4231
  var result = x;
@@ -4230,11 +4235,6 @@ function optionalFirestoreField(config) {
4230
4235
  }
4231
4236
  return result;
4232
4237
  };
4233
- } else {
4234
- toData = function toData(x) {
4235
- var _transformTo;
4236
- return x != null ? (_transformTo = transformTo(x)) !== null && _transformTo !== void 0 ? _transformTo : null : x;
4237
- };
4238
4238
  }
4239
4239
  result = firestoreField({
4240
4240
  default: null,
@@ -4745,19 +4745,19 @@ function optionalFirestoreField(config) {
4745
4745
  var inputDontStoreIf = config === null || config === void 0 ? void 0 : config.dontStoreIf;
4746
4746
  var shouldNotStoreIfEmpty = (_ref = config === null || config === void 0 ? void 0 : config.dontStoreIfEmpty) !== null && _ref !== void 0 ? _ref : false;
4747
4747
  var dontStoreIf;
4748
- if (inputDontStoreIf != null) {
4749
- dontStoreIf = shouldNotStoreIfEmpty ? function(x) {
4750
- return x.length === 0 || inputDontStoreIf(x);
4751
- } : inputDontStoreIf;
4752
- } else {
4748
+ if (inputDontStoreIf == null) {
4753
4749
  dontStoreIf = shouldNotStoreIfEmpty ? function(x) {
4754
4750
  return x.length === 0;
4755
4751
  } : undefined;
4752
+ } else {
4753
+ dontStoreIf = shouldNotStoreIfEmpty ? function(x) {
4754
+ return x.length === 0 || inputDontStoreIf(x);
4755
+ } : inputDontStoreIf;
4756
4756
  }
4757
4757
  var inputFilterUnique = (config === null || config === void 0 ? void 0 : config.filterUnique) === true ? util.unique : config === null || config === void 0 ? void 0 : config.filterUnique;
4758
- var filterUniqueValuesFn = inputFilterUnique != null ? function(x) {
4758
+ var filterUniqueValuesFn = inputFilterUnique == null ? undefined : function(x) {
4759
4759
  return inputFilterUnique(x);
4760
- } : undefined;
4760
+ };
4761
4761
  var inputTransformData = config === null || config === void 0 ? void 0 : config.transformData;
4762
4762
  var sortArrayFn = util.isMapIdentityFunction(sortFn) ? undefined : function(x) {
4763
4763
  return sortFn(x, true);
@@ -4843,7 +4843,7 @@ function optionalFirestoreField(config) {
4843
4843
  *
4844
4844
  * @__NO_SIDE_EFFECTS__
4845
4845
  */ function firestoreUniqueStringArray(config) {
4846
- var filterUnique = config != null ? util.filterUniqueTransform(config) : util.unique;
4846
+ var filterUnique = config == null ? util.unique : util.filterUniqueTransform(config);
4847
4847
  return firestoreUniqueArray(_object_spread_props$k(_object_spread$o({}, config), {
4848
4848
  filterUnique: filterUnique
4849
4849
  }));
@@ -5841,7 +5841,7 @@ function where(fieldPath, opStr, value) {
5841
5841
  switch(opStr){
5842
5842
  case 'array-contains':
5843
5843
  if (Array.isArray(value)) {
5844
- throw new Error('array-contains does not accept array values. Did you mean "array-contains-any"?');
5844
+ throw new TypeError('array-contains does not accept array values. Did you mean "array-contains-any"?');
5845
5845
  }
5846
5846
  break;
5847
5847
  case 'in':
@@ -10045,7 +10045,7 @@ function _define_property$m(obj, key, value) {
10045
10045
  {
10046
10046
  key: "getWithConverter",
10047
10047
  value: function getWithConverter(converter) {
10048
- var withConverter = converter != null ? this.documentRef.withConverter(converter) : this.documentRef.withConverter(null);
10048
+ var withConverter = converter == null ? this.documentRef.withConverter(null) : this.documentRef.withConverter(converter);
10049
10049
  return firestore.getDoc(withConverter);
10050
10050
  }
10051
10051
  },
@@ -10413,7 +10413,7 @@ function _define_property$k(obj, key, value) {
10413
10413
  {
10414
10414
  key: "getWithConverter",
10415
10415
  value: function getWithConverter(converter) {
10416
- var withConverter = converter != null ? this.documentRef.withConverter(converter) : this.documentRef.withConverter(null);
10416
+ var withConverter = converter == null ? this.documentRef.withConverter(null) : this.documentRef.withConverter(converter);
10417
10417
  return this.transaction.get(withConverter);
10418
10418
  }
10419
10419
  },
@@ -15075,7 +15075,7 @@ function _object_spread_props$8(target, source) {
15075
15075
  n: util.updateMaybeValue(a.n, inputN),
15076
15076
  e: util.updateMaybeValue(a.e, inputE),
15077
15077
  t: util.updateMaybeValue(a.t, inputT),
15078
- s: uid != null ? null : util.updateMaybeValue(a.s, inputS) // null if uid is defined
15078
+ s: uid == null ? util.updateMaybeValue(a.s, inputS) : null // null if uid is defined
15079
15079
  };
15080
15080
  }
15081
15081
  /**
@@ -16457,7 +16457,7 @@ function _object_spread_props$7(target, source) {
16457
16457
  */ function updateNotificationUserDefaultNotificationBoxRecipientConfig(a, b, limitToAllowedConfigTypes) {
16458
16458
  var _ref;
16459
16459
  var inputC = b.configs, inputF = b.f, inputBk = b.bk, inputLk = b.lk;
16460
- var c = (_ref = inputC != null ? updateNotificationBoxRecipientTemplateConfigRecord(a.c, inputC, limitToAllowedConfigTypes) : undefined) !== null && _ref !== void 0 ? _ref : a.c;
16460
+ var c = (_ref = inputC == null ? undefined : updateNotificationBoxRecipientTemplateConfigRecord(a.c, inputC, limitToAllowedConfigTypes)) !== null && _ref !== void 0 ? _ref : a.c;
16461
16461
  return _object_spread_props$7(_object_spread$9({}, updateNotificationRecipient(a, b)), {
16462
16462
  c: c,
16463
16463
  f: util.updateMaybeValue(a.f, inputF),
@@ -16478,7 +16478,7 @@ function _object_spread_props$7(target, source) {
16478
16478
  */ function updateNotificationUserNotificationBoxRecipientConfigIfChanged(a, b, limitToAllowedConfigTypes) {
16479
16479
  var _ref;
16480
16480
  var inputC = b.configs, inputRm = b.rm, inputLk = b.lk, inputBk = b.bk;
16481
- var c = (_ref = inputC != null ? updateNotificationBoxRecipientTemplateConfigRecord(a.c, inputC, limitToAllowedConfigTypes) : undefined) !== null && _ref !== void 0 ? _ref : a.c;
16481
+ var c = (_ref = inputC == null ? undefined : updateNotificationBoxRecipientTemplateConfigRecord(a.c, inputC, limitToAllowedConfigTypes)) !== null && _ref !== void 0 ? _ref : a.c;
16482
16482
  var nextConfig = _object_spread_props$7(_object_spread$9({}, updateNotificationRecipient(a, b)), {
16483
16483
  c: c,
16484
16484
  rm: util.updateMaybeValue(a.rm, inputRm),
@@ -19822,7 +19822,7 @@ function _ts_generator$2(thisArg, body) {
19822
19822
  var inputDefaultCreationType = config.defaultCreationType, inputDefaultShouldBeProcessed = config.defaultShouldBeProcessed, inputDefaultPurposeSubgroup = config.defaultPurposeSubgroup;
19823
19823
  var defaultCreationType = inputDefaultCreationType !== null && inputDefaultCreationType !== void 0 ? inputDefaultCreationType : exports.StorageFileCreationType.DIRECTLY_CREATED;
19824
19824
  var defaultShouldBeProcessed = inputDefaultShouldBeProcessed !== null && inputDefaultShouldBeProcessed !== void 0 ? inputDefaultShouldBeProcessed : false;
19825
- var defaultPurposeSubgroup = inputDefaultPurposeSubgroup != null ? inputDefaultPurposeSubgroup === true ? EMPTY_STORAGE_FILE_PURPOSE_SUBGROUP : inputDefaultPurposeSubgroup : undefined;
19825
+ var defaultPurposeSubgroup = inputDefaultPurposeSubgroup == null ? undefined : inputDefaultPurposeSubgroup === true ? EMPTY_STORAGE_FILE_PURPOSE_SUBGROUP : inputDefaultPurposeSubgroup;
19826
19826
  return function(input) {
19827
19827
  return _async_to_generator$2(function() {
19828
19828
  var _ref, _ref1, _ref2, _ref3, _ref4, _input_file, _input_storagePathRef, inputTemplate, inputAccessor, transaction, context, inputNow, displayName, uploadedBy, user, ownershipKey, purpose, purposeSubgroup, metadata, shouldBeProcessed, parentStorageFileGroup, storageFileGroupIds, flagForStorageFileGroupsSync, now, accessor, storageFileCollection, storagePath, storageFileDocument, p, pg, ct, storageFileGroupId, storageFileKey, g, gs, template;
@@ -19844,7 +19844,7 @@ function _ts_generator$2(thisArg, body) {
19844
19844
  throw new Error('createStorageFileDocumentPair() failed as neither a file, storagePathRef, or storagePath was provided.');
19845
19845
  }
19846
19846
  p = purpose !== null && purpose !== void 0 ? purpose : inputTemplate === null || inputTemplate === void 0 ? void 0 : inputTemplate.p;
19847
- pg = (_ref2 = purposeSubgroup !== null && purposeSubgroup !== void 0 ? purposeSubgroup : inputTemplate === null || inputTemplate === void 0 ? void 0 : inputTemplate.pg) !== null && _ref2 !== void 0 ? _ref2 : p != null ? defaultPurposeSubgroup : undefined;
19847
+ pg = (_ref2 = purposeSubgroup !== null && purposeSubgroup !== void 0 ? purposeSubgroup : inputTemplate === null || inputTemplate === void 0 ? void 0 : inputTemplate.pg) !== null && _ref2 !== void 0 ? _ref2 : p == null ? undefined : defaultPurposeSubgroup;
19848
19848
  ct = (_ref3 = inputTemplate === null || inputTemplate === void 0 ? void 0 : inputTemplate.ct) !== null && _ref3 !== void 0 ? _ref3 : defaultCreationType;
19849
19849
  if (ct === exports.StorageFileCreationType.FOR_STORAGE_FILE_GROUP) {
19850
19850
  if (!parentStorageFileGroup || !p) {
package/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { increment, arrayRemove, arrayUnion, onSnapshot, getDoc, deleteDoc, setDoc, updateDoc, collection, collectionGroup, doc, writeBatch, runTransaction, limit as limit$1, limitToLast as limitToLast$1, orderBy as orderBy$1, documentId, where as where$1, startAt as startAt$1, startAfter as startAfter$1, endAt as endAt$1, endBefore as endBefore$1, query, getDocs, getCountFromServer } from 'firebase/firestore';
2
- import { cachedGetter, mergeModifiers, asArray, filterUndefinedValues, objectHasNoKeys, filterFalsyAndEmptyValues, build, compareStringsNumeric, wrapUseAsyncFunction, runAsyncTasksForValues, filterMaybeArrayValues, performMakeLoop, makeWithFactory, useAsync, MAP_IDENTITY, toModelFieldConversions, makeModelMapFunctions, modifyModelMapFunctions, assignValuesToPOJOFunction, KeyValueTypleValueFilter, toModelMapFunctions, asObjectCopyFactory, isEqualToValueDecisionFunction, passThrough, filterUniqueTransform, unique, transformStringFunctionConfig, transformStringFunction, sortValuesFunctionOrMapIdentityWithSortRef, bitwiseSetDencoder, sortAscendingIndexNumberRefFunction, filterFromPOJOFunction, mapObjectMap, copyObject, modelFieldMapFunctions, latLngStringFunction, DEFAULT_LAT_LNG_STRING_VALUE, mapObjectMapFunction, filterEmptyArrayValues, transformNumberFunction, filterUniqueFunction, dateFromDateOrTimeSecondsNumber, unixDateTimeSecondsNumberFromDate, isMapIdentityFunction, chainMapSameFunctions, isDate, filterNullAndUndefinedValues, pushItemOrArrayItemsIntoArray, separateValues, convertToArray, UTF_PRIVATE_USAGE_AREA_START, UTF_8_START_CHARACTER, mergeArraysIntoArray, lastValue, flattenArrayOrValueArray, allowValueOnceFilter, asGetter, getValueFromGetter, mapIdentityFunction, performTasksFromFactoryInParallelFunction, performAsyncTasks, batch, flattenArray, calculateExpirationDate, groupValues, forEachInIterable, arrayToObject, takeFront, stringContains, isOddNumber, objectToMap, ServerErrorResponse, toReadableError, capitalizeFirstLetter, lowercaseFirstLetter, toRelativeSlashPathStartType, splitStringAtFirstCharacterOccurence, mappedUseFunction, iterableToArray, setContainsAllValues, usePromise, slashPathFactory, errorMessageContainsString, bitwiseObjectDencoder, mergeObjectsFunction, mergeObjects, forEachKeyValue, updateMaybeValue, UNSET_INDEX_NUMBER, ModelRelationUtility, filterKeysOnPOJOFunction, areEqualPOJOValuesUsingPojoFilter, filterOnlyUndefinedValues, makeModelMap, isThrottled, MS_IN_HOUR, multiValueMapBuilder, mergeSlashPaths, slashPathDetails, toAbsoluteSlashPathStartType, SLASH_PATH_FILE_TYPE_SEPARATOR, slashPathPathMatcher, decisionFunction, slashPathSubPathMatcher } from '@dereekb/util';
2
+ import { cachedGetter, mergeModifiers, asArray, filterUndefinedValues, objectHasNoKeys, filterFalsyAndEmptyValues, build, compareStringsNumeric, wrapUseAsyncFunction, runAsyncTasksForValues, filterMaybeArrayValues, performMakeLoop, makeWithFactory, useAsync, MAP_IDENTITY, toModelFieldConversions, makeModelMapFunctions, modifyModelMapFunctions, assignValuesToPOJOFunction, KeyValueTypleValueFilter, toModelMapFunctions, asObjectCopyFactory, isEqualToValueDecisionFunction, passThrough, unique, filterUniqueTransform, transformStringFunctionConfig, transformStringFunction, sortValuesFunctionOrMapIdentityWithSortRef, bitwiseSetDencoder, sortAscendingIndexNumberRefFunction, filterFromPOJOFunction, mapObjectMap, copyObject, modelFieldMapFunctions, latLngStringFunction, DEFAULT_LAT_LNG_STRING_VALUE, mapObjectMapFunction, filterEmptyArrayValues, transformNumberFunction, filterUniqueFunction, dateFromDateOrTimeSecondsNumber, unixDateTimeSecondsNumberFromDate, isMapIdentityFunction, chainMapSameFunctions, isDate, filterNullAndUndefinedValues, pushItemOrArrayItemsIntoArray, separateValues, convertToArray, UTF_PRIVATE_USAGE_AREA_START, UTF_8_START_CHARACTER, mergeArraysIntoArray, lastValue, flattenArrayOrValueArray, allowValueOnceFilter, asGetter, getValueFromGetter, mapIdentityFunction, performTasksFromFactoryInParallelFunction, performAsyncTasks, batch, flattenArray, calculateExpirationDate, groupValues, forEachInIterable, arrayToObject, takeFront, stringContains, isOddNumber, objectToMap, ServerErrorResponse, toReadableError, capitalizeFirstLetter, lowercaseFirstLetter, toRelativeSlashPathStartType, splitStringAtFirstCharacterOccurence, mappedUseFunction, iterableToArray, setContainsAllValues, usePromise, slashPathFactory, errorMessageContainsString, bitwiseObjectDencoder, mergeObjectsFunction, mergeObjects, forEachKeyValue, updateMaybeValue, UNSET_INDEX_NUMBER, ModelRelationUtility, filterKeysOnPOJOFunction, areEqualPOJOValuesUsingPojoFilter, filterOnlyUndefinedValues, makeModelMap, isThrottled, MS_IN_HOUR, multiValueMapBuilder, mergeSlashPaths, slashPathDetails, toAbsoluteSlashPathStartType, SLASH_PATH_FILE_TYPE_SEPARATOR, slashPathPathMatcher, decisionFunction, slashPathSubPathMatcher } from '@dereekb/util';
3
3
  import { filterMaybe, lazyFrom, itemAccumulator, ItemPageIterator, mappedPageItemIteration } from '@dereekb/rxjs';
4
4
  import { map, from, EMPTY, tap, combineLatest, of, Subject, filter, exhaustMap, Observable, switchMap, timer, skip, shareReplay } from 'rxjs';
5
5
  import { UNKNOWN_WEBSITE_LINK_TYPE, encodeWebsiteFileLinkToWebsiteLinkEncodedData, decodeWebsiteLinkEncodedDataToWebsiteFileLink, clearable, AbstractModelPermissionService, grantedRoleMapReader, noAccessRoleMap, fullAccessRoleMap, e164PhoneNumberType, ARKTYPE_DATE_DTO_TYPE } from '@dereekb/model';
@@ -713,7 +713,7 @@ function _ts_generator$n(thisArg, body) {
713
713
  if (!objectHasNoKeys(updateData)) {
714
714
  return [
715
715
  2,
716
- params != null ? accessor.update(updateData, params) : accessor.update(updateData)
716
+ params == null ? accessor.update(updateData) : accessor.update(updateData, params)
717
717
  ];
718
718
  }
719
719
  return [
@@ -3184,7 +3184,7 @@ function documentDataWithIdAndKey(snapshot) {
3184
3184
  return [
3185
3185
  2,
3186
3186
  filterMaybeArrayValues(pairs.map(function(pair) {
3187
- return pair.data != null ? pair : undefined;
3187
+ return pair.data == null ? undefined : pair;
3188
3188
  }))
3189
3189
  ];
3190
3190
  }
@@ -4113,11 +4113,11 @@ function _object_spread_props$k(target, source) {
4113
4113
  */ function firestoreField(config) {
4114
4114
  var _config_defaultBeforeSave;
4115
4115
  return {
4116
- from: config.default != null ? {
4117
- default: asObjectCopyFactory(config.default),
4116
+ from: config.default == null ? {
4117
+ defaultInput: asObjectCopyFactory(config.defaultData),
4118
4118
  convert: config.fromData
4119
4119
  } : {
4120
- defaultInput: asObjectCopyFactory(config.defaultData),
4120
+ default: asObjectCopyFactory(config.default),
4121
4121
  convert: config.fromData
4122
4122
  },
4123
4123
  to: {
@@ -4181,11 +4181,11 @@ function optionalFirestoreField(config) {
4181
4181
  var transformData = inputTransformData !== null && inputTransformData !== void 0 ? inputTransformData : passThrough;
4182
4182
  var transformFrom = transformFromData !== null && transformFromData !== void 0 ? transformFromData : transformData;
4183
4183
  var baseTransformTo = transformToData !== null && transformToData !== void 0 ? transformToData : transformData;
4184
- var dontStoreValueIf = inputDontStoreValueIf != null ? isEqualToValueDecisionFunction(inputDontStoreValueIf) : null;
4185
- var transformTo = dontStoreValueIf != null ? function(value) {
4184
+ var dontStoreValueIf = inputDontStoreValueIf == null ? null : isEqualToValueDecisionFunction(inputDontStoreValueIf);
4185
+ var transformTo = dontStoreValueIf == null ? baseTransformTo : function(value) {
4186
4186
  var dontStoreCheck = dontStoreValueIf(value);
4187
4187
  return dontStoreCheck ? null : baseTransformTo(value);
4188
- } : baseTransformTo;
4188
+ };
4189
4189
  var loadDefaultReadValueFn; // set if a default read value is provided
4190
4190
  // setup fromData
4191
4191
  var fromData;
@@ -4200,12 +4200,12 @@ function optionalFirestoreField(config) {
4200
4200
  fromData = function fromData(x) {
4201
4201
  return transformFrom(x !== null && x !== void 0 ? x : loadDefaultReadValueFn());
4202
4202
  };
4203
- } else if (transformFrom !== passThrough) {
4203
+ } else if (transformFrom === passThrough) {
4204
+ fromData = passThrough;
4205
+ } else {
4204
4206
  fromData = function fromData(x) {
4205
- return x != null ? transformFrom(x) : x;
4207
+ return x == null ? x : transformFrom(x);
4206
4208
  };
4207
- } else {
4208
- fromData = passThrough;
4209
4209
  }
4210
4210
  // setup toData
4211
4211
  var dontStoreIf;
@@ -4218,7 +4218,12 @@ function optionalFirestoreField(config) {
4218
4218
  };
4219
4219
  }
4220
4220
  var toData;
4221
- if (dontStoreIf != null) {
4221
+ if (dontStoreIf == null) {
4222
+ toData = function toData(x) {
4223
+ var _transformTo;
4224
+ return x == null ? x : (_transformTo = transformTo(x)) !== null && _transformTo !== void 0 ? _transformTo : null;
4225
+ };
4226
+ } else {
4222
4227
  var dontStoreValue = dontStoreIf;
4223
4228
  toData = function toData(x) {
4224
4229
  var result = x;
@@ -4228,11 +4233,6 @@ function optionalFirestoreField(config) {
4228
4233
  }
4229
4234
  return result;
4230
4235
  };
4231
- } else {
4232
- toData = function toData(x) {
4233
- var _transformTo;
4234
- return x != null ? (_transformTo = transformTo(x)) !== null && _transformTo !== void 0 ? _transformTo : null : x;
4235
- };
4236
4236
  }
4237
4237
  result = firestoreField({
4238
4238
  default: null,
@@ -4743,19 +4743,19 @@ function optionalFirestoreField(config) {
4743
4743
  var inputDontStoreIf = config === null || config === void 0 ? void 0 : config.dontStoreIf;
4744
4744
  var shouldNotStoreIfEmpty = (_ref = config === null || config === void 0 ? void 0 : config.dontStoreIfEmpty) !== null && _ref !== void 0 ? _ref : false;
4745
4745
  var dontStoreIf;
4746
- if (inputDontStoreIf != null) {
4747
- dontStoreIf = shouldNotStoreIfEmpty ? function(x) {
4748
- return x.length === 0 || inputDontStoreIf(x);
4749
- } : inputDontStoreIf;
4750
- } else {
4746
+ if (inputDontStoreIf == null) {
4751
4747
  dontStoreIf = shouldNotStoreIfEmpty ? function(x) {
4752
4748
  return x.length === 0;
4753
4749
  } : undefined;
4750
+ } else {
4751
+ dontStoreIf = shouldNotStoreIfEmpty ? function(x) {
4752
+ return x.length === 0 || inputDontStoreIf(x);
4753
+ } : inputDontStoreIf;
4754
4754
  }
4755
4755
  var inputFilterUnique = (config === null || config === void 0 ? void 0 : config.filterUnique) === true ? unique : config === null || config === void 0 ? void 0 : config.filterUnique;
4756
- var filterUniqueValuesFn = inputFilterUnique != null ? function(x) {
4756
+ var filterUniqueValuesFn = inputFilterUnique == null ? undefined : function(x) {
4757
4757
  return inputFilterUnique(x);
4758
- } : undefined;
4758
+ };
4759
4759
  var inputTransformData = config === null || config === void 0 ? void 0 : config.transformData;
4760
4760
  var sortArrayFn = isMapIdentityFunction(sortFn) ? undefined : function(x) {
4761
4761
  return sortFn(x, true);
@@ -4841,7 +4841,7 @@ function optionalFirestoreField(config) {
4841
4841
  *
4842
4842
  * @__NO_SIDE_EFFECTS__
4843
4843
  */ function firestoreUniqueStringArray(config) {
4844
- var filterUnique = config != null ? filterUniqueTransform(config) : unique;
4844
+ var filterUnique = config == null ? unique : filterUniqueTransform(config);
4845
4845
  return firestoreUniqueArray(_object_spread_props$k(_object_spread$o({}, config), {
4846
4846
  filterUnique: filterUnique
4847
4847
  }));
@@ -5839,7 +5839,7 @@ function where(fieldPath, opStr, value) {
5839
5839
  switch(opStr){
5840
5840
  case 'array-contains':
5841
5841
  if (Array.isArray(value)) {
5842
- throw new Error('array-contains does not accept array values. Did you mean "array-contains-any"?');
5842
+ throw new TypeError('array-contains does not accept array values. Did you mean "array-contains-any"?');
5843
5843
  }
5844
5844
  break;
5845
5845
  case 'in':
@@ -10043,7 +10043,7 @@ function _define_property$m(obj, key, value) {
10043
10043
  {
10044
10044
  key: "getWithConverter",
10045
10045
  value: function getWithConverter(converter) {
10046
- var withConverter = converter != null ? this.documentRef.withConverter(converter) : this.documentRef.withConverter(null);
10046
+ var withConverter = converter == null ? this.documentRef.withConverter(null) : this.documentRef.withConverter(converter);
10047
10047
  return getDoc(withConverter);
10048
10048
  }
10049
10049
  },
@@ -10411,7 +10411,7 @@ function _define_property$k(obj, key, value) {
10411
10411
  {
10412
10412
  key: "getWithConverter",
10413
10413
  value: function getWithConverter(converter) {
10414
- var withConverter = converter != null ? this.documentRef.withConverter(converter) : this.documentRef.withConverter(null);
10414
+ var withConverter = converter == null ? this.documentRef.withConverter(null) : this.documentRef.withConverter(converter);
10415
10415
  return this.transaction.get(withConverter);
10416
10416
  }
10417
10417
  },
@@ -15073,7 +15073,7 @@ function _object_spread_props$8(target, source) {
15073
15073
  n: updateMaybeValue(a.n, inputN),
15074
15074
  e: updateMaybeValue(a.e, inputE),
15075
15075
  t: updateMaybeValue(a.t, inputT),
15076
- s: uid != null ? null : updateMaybeValue(a.s, inputS) // null if uid is defined
15076
+ s: uid == null ? updateMaybeValue(a.s, inputS) : null // null if uid is defined
15077
15077
  };
15078
15078
  }
15079
15079
  /**
@@ -16455,7 +16455,7 @@ function _object_spread_props$7(target, source) {
16455
16455
  */ function updateNotificationUserDefaultNotificationBoxRecipientConfig(a, b, limitToAllowedConfigTypes) {
16456
16456
  var _ref;
16457
16457
  var inputC = b.configs, inputF = b.f, inputBk = b.bk, inputLk = b.lk;
16458
- var c = (_ref = inputC != null ? updateNotificationBoxRecipientTemplateConfigRecord(a.c, inputC, limitToAllowedConfigTypes) : undefined) !== null && _ref !== void 0 ? _ref : a.c;
16458
+ var c = (_ref = inputC == null ? undefined : updateNotificationBoxRecipientTemplateConfigRecord(a.c, inputC, limitToAllowedConfigTypes)) !== null && _ref !== void 0 ? _ref : a.c;
16459
16459
  return _object_spread_props$7(_object_spread$9({}, updateNotificationRecipient(a, b)), {
16460
16460
  c: c,
16461
16461
  f: updateMaybeValue(a.f, inputF),
@@ -16476,7 +16476,7 @@ function _object_spread_props$7(target, source) {
16476
16476
  */ function updateNotificationUserNotificationBoxRecipientConfigIfChanged(a, b, limitToAllowedConfigTypes) {
16477
16477
  var _ref;
16478
16478
  var inputC = b.configs, inputRm = b.rm, inputLk = b.lk, inputBk = b.bk;
16479
- var c = (_ref = inputC != null ? updateNotificationBoxRecipientTemplateConfigRecord(a.c, inputC, limitToAllowedConfigTypes) : undefined) !== null && _ref !== void 0 ? _ref : a.c;
16479
+ var c = (_ref = inputC == null ? undefined : updateNotificationBoxRecipientTemplateConfigRecord(a.c, inputC, limitToAllowedConfigTypes)) !== null && _ref !== void 0 ? _ref : a.c;
16480
16480
  var nextConfig = _object_spread_props$7(_object_spread$9({}, updateNotificationRecipient(a, b)), {
16481
16481
  c: c,
16482
16482
  rm: updateMaybeValue(a.rm, inputRm),
@@ -19820,7 +19820,7 @@ function _ts_generator$2(thisArg, body) {
19820
19820
  var inputDefaultCreationType = config.defaultCreationType, inputDefaultShouldBeProcessed = config.defaultShouldBeProcessed, inputDefaultPurposeSubgroup = config.defaultPurposeSubgroup;
19821
19821
  var defaultCreationType = inputDefaultCreationType !== null && inputDefaultCreationType !== void 0 ? inputDefaultCreationType : StorageFileCreationType.DIRECTLY_CREATED;
19822
19822
  var defaultShouldBeProcessed = inputDefaultShouldBeProcessed !== null && inputDefaultShouldBeProcessed !== void 0 ? inputDefaultShouldBeProcessed : false;
19823
- var defaultPurposeSubgroup = inputDefaultPurposeSubgroup != null ? inputDefaultPurposeSubgroup === true ? EMPTY_STORAGE_FILE_PURPOSE_SUBGROUP : inputDefaultPurposeSubgroup : undefined;
19823
+ var defaultPurposeSubgroup = inputDefaultPurposeSubgroup == null ? undefined : inputDefaultPurposeSubgroup === true ? EMPTY_STORAGE_FILE_PURPOSE_SUBGROUP : inputDefaultPurposeSubgroup;
19824
19824
  return function(input) {
19825
19825
  return _async_to_generator$2(function() {
19826
19826
  var _ref, _ref1, _ref2, _ref3, _ref4, _input_file, _input_storagePathRef, inputTemplate, inputAccessor, transaction, context, inputNow, displayName, uploadedBy, user, ownershipKey, purpose, purposeSubgroup, metadata, shouldBeProcessed, parentStorageFileGroup, storageFileGroupIds, flagForStorageFileGroupsSync, now, accessor, storageFileCollection, storagePath, storageFileDocument, p, pg, ct, storageFileGroupId, storageFileKey, g, gs, template;
@@ -19842,7 +19842,7 @@ function _ts_generator$2(thisArg, body) {
19842
19842
  throw new Error('createStorageFileDocumentPair() failed as neither a file, storagePathRef, or storagePath was provided.');
19843
19843
  }
19844
19844
  p = purpose !== null && purpose !== void 0 ? purpose : inputTemplate === null || inputTemplate === void 0 ? void 0 : inputTemplate.p;
19845
- pg = (_ref2 = purposeSubgroup !== null && purposeSubgroup !== void 0 ? purposeSubgroup : inputTemplate === null || inputTemplate === void 0 ? void 0 : inputTemplate.pg) !== null && _ref2 !== void 0 ? _ref2 : p != null ? defaultPurposeSubgroup : undefined;
19845
+ pg = (_ref2 = purposeSubgroup !== null && purposeSubgroup !== void 0 ? purposeSubgroup : inputTemplate === null || inputTemplate === void 0 ? void 0 : inputTemplate.pg) !== null && _ref2 !== void 0 ? _ref2 : p == null ? undefined : defaultPurposeSubgroup;
19846
19846
  ct = (_ref3 = inputTemplate === null || inputTemplate === void 0 ? void 0 : inputTemplate.ct) !== null && _ref3 !== void 0 ? _ref3 : defaultCreationType;
19847
19847
  if (ct === StorageFileCreationType.FOR_STORAGE_FILE_GROUP) {
19848
19848
  if (!parentStorageFileGroup || !p) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/firebase",
3
- "version": "13.14.0",
3
+ "version": "13.16.0",
4
4
  "sideEffects": false,
5
5
  "exports": {
6
6
  "./test": {
@@ -24,10 +24,10 @@
24
24
  }
25
25
  },
26
26
  "peerDependencies": {
27
- "@dereekb/date": "13.14.0",
28
- "@dereekb/model": "13.14.0",
29
- "@dereekb/rxjs": "13.14.0",
30
- "@dereekb/util": "13.14.0",
27
+ "@dereekb/date": "13.16.0",
28
+ "@dereekb/model": "13.16.0",
29
+ "@dereekb/rxjs": "13.16.0",
30
+ "@dereekb/util": "13.16.0",
31
31
  "@firebase/rules-unit-testing": "5.0.0",
32
32
  "@marcbachmann/cel-js": "^7.6.1",
33
33
  "@typescript-eslint/parser": "8.59.3",
@@ -1,7 +1,7 @@
1
1
  import { type StorageBucketId, type StoragePathInput, type StoragePath, type StoragePathRef, type StorageSlashPath } from '../storage';
2
2
  import { type ConfigurableStorageMetadata, type StorageAccessControlObject, type StorageAclMetadata, type StorageMakePrivateOptions, type StorageMoveOptions, type StorageSignedDownloadUrl, type StorageSignedDownloadUrlConfig, type FirebaseStorage, type StorageClientUploadBytesInput, type StorageDeleteFileOptions, type StorageDownloadUrl, type StorageMetadata, type StorageUploadInput, type StorageUploadOptions, type StorageUploadResult, type StorageUploadTask } from '../types';
3
3
  import { type ArrayOrValue, type Maybe } from '@dereekb/util';
4
- import { type Readable } from 'stream';
4
+ import { type Readable } from 'node:stream';
5
5
  /**
6
6
  * Core interface for accessing files and folders in Firebase Cloud Storage.
7
7
  *
@@ -1,4 +1,4 @@
1
- import { type Readable } from 'stream';
1
+ import { type Readable } from 'node:stream';
2
2
  import { type StorageUploadOptions } from '../types';
3
3
  import { type FirebaseStorageAccessorFile } from './accessor';
4
4
  /**
package/test/index.cjs.js CHANGED
@@ -9,7 +9,7 @@ var rxjs$1 = require('rxjs');
9
9
  var rxjs = require('@dereekb/rxjs');
10
10
  var dateFns = require('date-fns');
11
11
  var date = require('@dereekb/date');
12
- var stream = require('stream');
12
+ var node_stream = require('node:stream');
13
13
  var node_fs = require('node:fs');
14
14
 
15
15
  function _array_like_to_array$2(arr, len) {
@@ -263,7 +263,7 @@ function _ts_generator$6(thisArg, body) {
263
263
  * ```
264
264
  */ function makeTestingFirestoreAccesorDriver(driver) {
265
265
  var fuzzerKey = 0;
266
- var time = new Date().getTime();
266
+ var time = Date.now();
267
267
  var fuzzedMap = new Map();
268
268
  var collection = driver.collection, subcollection = driver.subcollection, collectionGroup = driver.collectionGroup;
269
269
  var fuzzedPathForPath = function fuzzedPathForPath(path) {
@@ -419,7 +419,7 @@ var bucketTestNameKey = 0;
419
419
  var useTestDefaultBucket = (config !== null && config !== void 0 ? config : {}).useTestDefaultBucket;
420
420
  // The default bucket is only used if another bucket is not input.
421
421
  var defaultBucket = !driver.getDefaultBucket && useTestDefaultBucket !== false || useTestDefaultBucket === true ? util.cachedGetter(function() {
422
- var time = new Date().getTime();
422
+ var time = Date.now();
423
423
  var random = Math.ceil(Math.random() * 999999) % 999999;
424
424
  return "test-bucket-".concat(time, "-").concat(random, "-").concat(bucketTestNameKey += 1);
425
425
  }) : driver.getDefaultBucket;
@@ -1063,11 +1063,11 @@ function _ts_generator$5(thisArg, body) {
1063
1063
  // MARK: Internal
1064
1064
  function rulesTestContextForConfig(rulesTestEnv, testingRulesConfig) {
1065
1065
  var rulesTestContext;
1066
- if (testingRulesConfig != null) {
1066
+ if (testingRulesConfig == null) {
1067
+ rulesTestContext = rulesTestEnv.unauthenticatedContext();
1068
+ } else {
1067
1069
  var _testingRulesConfig_tokenOptions;
1068
1070
  rulesTestContext = rulesTestEnv.authenticatedContext(testingRulesConfig.userId, (_testingRulesConfig_tokenOptions = testingRulesConfig.tokenOptions) !== null && _testingRulesConfig_tokenOptions !== void 0 ? _testingRulesConfig_tokenOptions : undefined);
1069
- } else {
1070
- rulesTestContext = rulesTestEnv.unauthenticatedContext();
1071
1071
  }
1072
1072
  return rulesTestContext;
1073
1073
  }
@@ -12234,7 +12234,7 @@ function _ts_generator(thisArg, body) {
12234
12234
  ];
12235
12235
  myText = 'This is a test string.';
12236
12236
  // Create a readable stream from the string
12237
- readableStream = stream.Readable.from(myText, {
12237
+ readableStream = node_stream.Readable.from(myText, {
12238
12238
  encoding: 'utf-8'
12239
12239
  });
12240
12240
  return [
package/test/index.esm.js CHANGED
@@ -7,7 +7,7 @@ import { firstValueFrom, filter, skip, from, first, map, switchMap } from 'rxjs'
7
7
  import { SubscriptionObject, isLoadingStateFinishedLoading, flattenAccumulatorResultItemArray, iteratorNextPageUntilPage, accumulatorCurrentPageListLoadingState, accumulatorFlattenPageListLoadingState } from '@dereekb/rxjs';
8
8
  import { addDays, startOfDay, addHours } from 'date-fns';
9
9
  import { DateRangeType } from '@dereekb/date';
10
- import { Readable } from 'stream';
10
+ import { Readable } from 'node:stream';
11
11
  import { createReadStream } from 'node:fs';
12
12
 
13
13
  function _array_like_to_array$2(arr, len) {
@@ -261,7 +261,7 @@ function _ts_generator$6(thisArg, body) {
261
261
  * ```
262
262
  */ function makeTestingFirestoreAccesorDriver(driver) {
263
263
  var fuzzerKey = 0;
264
- var time = new Date().getTime();
264
+ var time = Date.now();
265
265
  var fuzzedMap = new Map();
266
266
  var collection = driver.collection, subcollection = driver.subcollection, collectionGroup = driver.collectionGroup;
267
267
  var fuzzedPathForPath = function fuzzedPathForPath(path) {
@@ -417,7 +417,7 @@ var bucketTestNameKey = 0;
417
417
  var useTestDefaultBucket = (config !== null && config !== void 0 ? config : {}).useTestDefaultBucket;
418
418
  // The default bucket is only used if another bucket is not input.
419
419
  var defaultBucket = !driver.getDefaultBucket && useTestDefaultBucket !== false || useTestDefaultBucket === true ? cachedGetter(function() {
420
- var time = new Date().getTime();
420
+ var time = Date.now();
421
421
  var random = Math.ceil(Math.random() * 999999) % 999999;
422
422
  return "test-bucket-".concat(time, "-").concat(random, "-").concat(bucketTestNameKey += 1);
423
423
  }) : driver.getDefaultBucket;
@@ -1061,11 +1061,11 @@ function _ts_generator$5(thisArg, body) {
1061
1061
  // MARK: Internal
1062
1062
  function rulesTestContextForConfig(rulesTestEnv, testingRulesConfig) {
1063
1063
  var rulesTestContext;
1064
- if (testingRulesConfig != null) {
1064
+ if (testingRulesConfig == null) {
1065
+ rulesTestContext = rulesTestEnv.unauthenticatedContext();
1066
+ } else {
1065
1067
  var _testingRulesConfig_tokenOptions;
1066
1068
  rulesTestContext = rulesTestEnv.authenticatedContext(testingRulesConfig.userId, (_testingRulesConfig_tokenOptions = testingRulesConfig.tokenOptions) !== null && _testingRulesConfig_tokenOptions !== void 0 ? _testingRulesConfig_tokenOptions : undefined);
1067
- } else {
1068
- rulesTestContext = rulesTestEnv.unauthenticatedContext();
1069
1069
  }
1070
1070
  return rulesTestContext;
1071
1071
  }
package/test/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@dereekb/firebase/test",
3
- "version": "13.14.0",
3
+ "version": "13.16.0",
4
4
  "peerDependencies": {
5
- "@dereekb/date": "13.14.0",
6
- "@dereekb/firebase": "13.14.0",
7
- "@dereekb/model": "13.14.0",
8
- "@dereekb/rxjs": "13.14.0",
9
- "@dereekb/util": "13.14.0",
5
+ "@dereekb/date": "13.16.0",
6
+ "@dereekb/firebase": "13.16.0",
7
+ "@dereekb/model": "13.16.0",
8
+ "@dereekb/rxjs": "13.16.0",
9
+ "@dereekb/util": "13.16.0",
10
10
  "@firebase/rules-unit-testing": "5.0.0",
11
11
  "date-fns": "^4.1.0",
12
12
  "firebase": "^12.12.1",