Your IP : 216.73.216.74


Current Path : /usr/local/lib/node_modules/@google/gemini-cli/node_modules/es-toolkit/dist/compat/math/
Upload File :
Current File : //usr/local/lib/node_modules/@google/gemini-cli/node_modules/es-toolkit/dist/compat/math/add.mjs

import { toNumber } from '../util/toNumber.mjs';
import { toString } from '../util/toString.mjs';

function add(value, other) {
    if (value === undefined && other === undefined) {
        return 0;
    }
    if (value === undefined || other === undefined) {
        return value ?? other;
    }
    if (typeof value === 'string' || typeof other === 'string') {
        value = toString(value);
        other = toString(other);
    }
    else {
        value = toNumber(value);
        other = toNumber(other);
    }
    return value + other;
}

export { add };