All Downloads are FREE. Search and download functionalities are using the official Maven repository.

src.app.shared.tools.object-utils.ts Maven / Gradle / Ivy

The newest version!
/*
 * SPDX-FileCopyrightText: 2017-2024 Enedis
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 */



export function addOptionalParam(obj: any, key: string, value: any, excludedValue?: any) {
    if (value != null && value !== excludedValue) {
        obj[key] = value;
    }
}

export function addOptionalArrayParam(obj: any, key: string, value: Array) {
    if (value != null && value.length > 0) {
        obj[key] = value;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy