Skip to content

Commit d2e8d60

Browse files
committed
Addressing review comments.
1 parent cc3146c commit d2e8d60

File tree

3 files changed

+2
-65
lines changed

3 files changed

+2
-65
lines changed

packages/firestore/src/lite-api/database.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ import { cast } from '../util/input_validation';
4141
import { logWarn } from '../util/log';
4242

4343
import { FirestoreService, removeComponents } from './components';
44+
// `import type` to avoid bundling the source for
45+
// pipelines if `useFirestorePipelines()` is not called
4446
import type { PipelineSource } from './pipeline-source';
4547
import {
4648
DEFAULT_HOST,
4749
FirestoreSettingsImpl,
4850
PrivateSettings,
4951
FirestoreSettings
5052
} from './settings';
51-
// `import type` to avoid bundling the source for
52-
// pipelines if `useFirestorePipelines()` is not called
5353

5454
export { EmulatorMockTokenOptions } from '@firebase/util';
5555

packages/firestore/src/lite-api/user_data_reader.ts

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -437,68 +437,6 @@ export function parseSetData(
437437
);
438438
}
439439

440-
export function parse(
441-
userDataReader: UserDataReader,
442-
methodName: string,
443-
targetDoc: DocumentKey,
444-
input: unknown,
445-
hasConverter: boolean,
446-
options: SetOptions = {}
447-
): ParsedSetData {
448-
const context = userDataReader.createContext(
449-
options.merge || options.mergeFields
450-
? UserDataSource.MergeSet
451-
: UserDataSource.Set,
452-
methodName,
453-
targetDoc,
454-
hasConverter
455-
);
456-
validatePlainObject('Data must be an object, but it was:', context, input);
457-
const updateData = parseObject(input, context)!;
458-
459-
let fieldMask: FieldMask | null;
460-
let fieldTransforms: FieldTransform[];
461-
462-
if (options.merge) {
463-
fieldMask = new FieldMask(context.fieldMask);
464-
fieldTransforms = context.fieldTransforms;
465-
} else if (options.mergeFields) {
466-
const validatedFieldPaths: InternalFieldPath[] = [];
467-
468-
for (const stringOrFieldPath of options.mergeFields) {
469-
const fieldPath = fieldPathFromArgument(
470-
methodName,
471-
stringOrFieldPath,
472-
targetDoc
473-
);
474-
if (!context.contains(fieldPath)) {
475-
throw new FirestoreError(
476-
Code.INVALID_ARGUMENT,
477-
`Field '${fieldPath}' is specified in your field mask but missing from your input data.`
478-
);
479-
}
480-
481-
if (!fieldMaskContains(validatedFieldPaths, fieldPath)) {
482-
validatedFieldPaths.push(fieldPath);
483-
}
484-
}
485-
486-
fieldMask = new FieldMask(validatedFieldPaths);
487-
fieldTransforms = context.fieldTransforms.filter(transform =>
488-
fieldMask!.covers(transform.field)
489-
);
490-
} else {
491-
fieldMask = null;
492-
fieldTransforms = context.fieldTransforms;
493-
}
494-
495-
return new ParsedSetData(
496-
new ObjectValue(updateData),
497-
fieldMask,
498-
fieldTransforms
499-
);
500-
}
501-
502440
export class DeleteFieldValueImpl extends FieldValue {
503441
_toFieldTransform(context: ParseContextImpl): null {
504442
if (context.dataSource === UserDataSource.MergeSet) {

packages/firestore/src/remote/internal_serializer.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ export function _internalAggregationQueryToProtoRunAggregationQueryRequest<
102102
*
103103
* @param pipeline - The Pipeline to convert to proto representation.
104104
*/
105-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
106105
export function _internalPipelineToExecutePipelineRequestProto(
107106
pipeline: Pipeline
108107
// eslint-disable-next-line @typescript-eslint/no-explicit-any

0 commit comments

Comments
 (0)