Skip to content

Commit 5dd5ae4

Browse files
committed
remove unneeded utils.
1 parent 5e9ceb8 commit 5dd5ae4

File tree

2 files changed

+1
-64
lines changed

2 files changed

+1
-64
lines changed

packages/firestore/src/util/bundle_builder_impl.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ export class BundleBuilder {
6060
this.databaseId = firestore._databaseId;
6161
}
6262

63-
add(documentSnapshot: DocumentSnapshot): BundleBuilder;
64-
add(queryName: string, querySnapshot: QuerySnapshot): BundleBuilder;
65-
6663
/**
6764
* Adds a Firestore document snapshot or query snapshot to the bundle.
6865
* Both the documents data and the query read time will be included in the bundle.
@@ -168,7 +165,7 @@ export class BundleBuilder {
168165
structuredQuery: queryTarget.queryTarget.structuredQuery,
169166
limitType: null
170167
};
171-
168+
172169
this.namedQueries.set(name, {
173170
name,
174171
bundledQuery,

packages/firestore/src/util/bundle_builder_validation_utils.ts

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
* limitations under the License.
1616
*/
1717

18-
import { FieldPath } from '../lite-api/field_path';
19-
import { Timestamp } from '../lite-api/timestamp';
2018

2119
/**
2220
* Validates that 'value' is a string.
@@ -51,18 +49,6 @@ export function invalidArgumentMessage(
5149
return `${formatArgumentName(arg)} is not a valid ${expectedType}.`;
5250
}
5351

54-
/**
55-
* Formats the given word as plural conditionally given the preceding number.
56-
*
57-
* @private
58-
* @internal
59-
* @param num The number to use for formatting.
60-
* @param str The string to format.
61-
*/
62-
function formatPlural(num: number, str: string): string {
63-
return `${num} ${str}` + (num === 1 ? '' : 's');
64-
}
65-
6652
/**
6753
* Creates a descriptive name for the provided argument name or index.
6854
*
@@ -76,49 +62,3 @@ function formatArgumentName(arg: string | number): string {
7662
? `Value for argument "${arg}"`
7763
: `Element at index ${arg}`;
7864
}
79-
80-
/**
81-
* Verifies that 'args' has at least 'minSize' elements.
82-
*
83-
* @private
84-
* @internal
85-
* @param funcName The function name to use in the error message.
86-
* @param args The array (or array-like structure) to verify.
87-
* @param minSize The minimum number of elements to enforce.
88-
* @throws if the expectation is not met.
89-
*/
90-
export function validateMinNumberOfArguments(
91-
funcName: string,
92-
args: IArguments | unknown[],
93-
minSize: number
94-
): void {
95-
if (args.length < minSize) {
96-
throw new Error(
97-
`Function "${funcName}()" requires at least ` +
98-
`${formatPlural(minSize, 'argument')}.`
99-
);
100-
}
101-
}
102-
103-
/**
104-
* Verifies that 'args' has at most 'maxSize' elements.
105-
*
106-
* @private
107-
* @internal
108-
* @param funcName The function name to use in the error message.
109-
* @param args The array (or array-like structure) to verify.
110-
* @param maxSize The maximum number of elements to enforce.
111-
* @throws if the expectation is not met.
112-
*/
113-
export function validateMaxNumberOfArguments(
114-
funcName: string,
115-
args: IArguments,
116-
maxSize: number
117-
): void {
118-
if (args.length > maxSize) {
119-
throw new Error(
120-
`Function "${funcName}()" accepts at most ` +
121-
`${formatPlural(maxSize, 'argument')}.`
122-
);
123-
}
124-
}

0 commit comments

Comments
 (0)