Skip to content

Commit 18a0645

Browse files
committed
address PR feedback
1 parent d6e9b6a commit 18a0645

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/data-connect/data-connect-api-client-internal.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ export class DataConnectApiClient {
204204
* Handles nested objects, arrays, strings, numbers, and booleans.
205205
* Ensures strings are properly escaped.
206206
*/
207-
private objectToString(data: any): string {
207+
private objectToString(data: unknown): string {
208208
if (typeof data === 'string') {
209209
const escapedString = data
210210
.replace(/\\/g, '\\\\') // Replace \ with \\
@@ -278,7 +278,7 @@ export class DataConnectApiClient {
278278
if (validator.isArray(data)) {
279279
throw new FirebaseDataConnectError(
280280
DATA_CONNECT_ERROR_CODE_MAPPING.INVALID_ARGUMENT,
281-
'`data` must be an object, not an array, for single insert.');
281+
'`data` must be an object, not an array, for single insert. For arrays, please use `insertMany` function.');
282282
}
283283
if (!validator.isNonNullObject(data)) {
284284
throw new FirebaseDataConnectError(
@@ -344,7 +344,7 @@ export class DataConnectApiClient {
344344
if (validator.isArray(data)) {
345345
throw new FirebaseDataConnectError(
346346
DATA_CONNECT_ERROR_CODE_MAPPING.INVALID_ARGUMENT,
347-
'`data` must be an object, not an array, for single upsert.');
347+
'`data` must be an object, not an array, for single upsert. For arrays, please use `upsertMany` function.');
348348
}
349349
if (!validator.isNonNullObject(data)) {
350350
throw new FirebaseDataConnectError(

test/unit/data-connect/data-connect-api-client-internal.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,8 @@ describe('DataConnectApiClient CRUD helpers', () => {
264264
extras: [1, undefined, 'hello', undefined, { a: 1, b: undefined }]
265265
};
266266

267-
const tableNames = ['movie', 'Movie', 'MOVIE', 'toybox', 'toyBox', 'ToyBox', 'TOYBOX'];
268-
const formatedTableNames = ['movie', 'movie', 'mOVIE', 'toybox', 'toyBox', 'toyBox', 'tOYBOX'];
267+
const tableNames = ['movie', 'Movie', 'MOVIE', 'mOvIE', 'toybox', 'toyBox', 'toyBOX', 'ToyBox', 'TOYBOX'];
268+
const formatedTableNames = ['movie', 'movie', 'mOVIE', 'mOvIE', 'toybox', 'toyBox', 'toyBOX', 'toyBox', 'tOYBOX'];
269269

270270
const serverErrorString = 'Server error response';
271271
const additionalErrorMessageForBulkImport =

0 commit comments

Comments
 (0)