Skip to content

Commit

Permalink
chore: tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
russellwheatley committed Dec 17, 2024
1 parent 7dfec74 commit 071420c
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions packages/app/lib/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,6 @@ const mapOfDeprecationReplacements = {
},
},
firestore: {
statics: {
setLogLevel: 'setLogLevel()',
Filter: 'where()',
FieldValue: 'FieldValue',
Timestamp: 'Timestamp',
GeoPoint: 'GeoPoint',
Blob: 'Bytes',
FieldPath: 'FieldPath',
},
default: {
batch: 'writeBatch()',
loadBundle: 'loadBundle()',
Expand All @@ -149,6 +140,15 @@ const mapOfDeprecationReplacements = {
settings: 'settings()',
persistentCacheIndexManager: 'getPersistentCacheIndexManager()',
},
statics: {
setLogLevel: 'setLogLevel()',
Filter: 'where()',
FieldValue: 'FieldValue',
Timestamp: 'Timestamp',
GeoPoint: 'GeoPoint',
Blob: 'Bytes',
FieldPath: 'FieldPath',
},
FirestoreCollectionReference: {
count: 'getCountFromServer()',
countFromServer: 'getCountFromServer()',
Expand Down Expand Up @@ -248,7 +248,7 @@ export function createMessage(

function getNamespace(target) {
if (target.GeoPoint) {
// target is statics. GeoPoint is a static class on Firestore
// target is statics object. GeoPoint is a static class on Firestore
return 'firestore';
}
if (target._config && target._config.namespace) {
Expand All @@ -264,7 +264,7 @@ function getNamespace(target) {

function getInstanceName(target) {
if (target.GeoPoint) {
// target is statics. GeoPoint is a static class on Firestore
// target is statics object. GeoPoint is a static class on Firestore
return 'statics';
}
if (target._config) {
Expand Down Expand Up @@ -319,11 +319,7 @@ export function createDeprecationProxy(instance) {

deprecationConsoleWarning(nameSpace, prop, instanceName, isModularMethod);

return originalMethod.apply(
target,
// Remove the modular deprecation argument from the arguments list
args.filter(arg => arg !== MODULAR_DEPRECATION_ARG),
);
return originalMethod.apply(target, filterModularArgument(args));
};
}
return Reflect.get(target, prop, receiver);
Expand Down

0 comments on commit 071420c

Please sign in to comment.