node_modules/@google-cloud/firestore/build/src/write-batch.js
/**
 * Validates that a JavaScript object is a map of field paths to field values.
 *
 * @private
 * @param arg The argument name or argument index (for varargs methods).
 * @param obj JavaScript object to validate.
 * @param allowUndefined Whether to allow nested properties that are `undefined`.
 * @throws when the object is invalid.
 */
Validates that a JavaScript object is a map of field paths to field values.
@private
@param arg The argument name or argument index (for varargs methods).
@param obj JavaScript object to validate.
@param allowUndefined Whether to allow nested properties that are `undefined`.
@throws when the object is invalid.
Validates that a JavaScript object is a map of field paths to field values . @private @param arg The argument name or argument index ( for varargs methods ) . @param obj JavaScript object to validate . @param allowUndefined Whether to allow nested properties that are ` undefined ` . @throws when the object is invalid .
function validateUpdateMap(arg, obj, allowUndefined) {
    if (!util_1.isPlainObject(obj)) {
        throw new Error(validate_1.customObjectMessage(arg, obj));
    }
    let isEmpty = true;
    if (obj) {
        for (const prop of Object.keys(obj)) {
            isEmpty = false;
            validateFieldValue(arg, obj[prop], allowUndefined, new path_1.FieldPath(prop));
        }
    }
    if (isEmpty) {
        throw new Error('At least one field must be updated.');
    }
}
function validateUpdateMap ( arg , obj , allowUndefined ) { if ( ! util_1 . isPlainObject ( obj ) ) { throw new Error ( validate_1 . customObjectMessage ( arg , obj ) ) ; } let isEmpty = true ; if ( obj ) { for ( const prop of Object . keys ( obj ) ) { isEmpty = false ; validateFieldValue ( arg , obj [ prop ] , allowUndefined , new path_1 . FieldPath ( prop ) ) ; } } if ( isEmpty ) { throw new Error ( 'At least one field must be updated.' ) ; } }
Validates that a JavaScript object is a map of field paths to field values.
Validates that a JavaScript object is a map of field paths to field values .