Project Init

This commit is contained in:
Muluhabt
2026-05-29 15:23:46 +03:00
commit 2fbc557aac
67387 changed files with 6063341 additions and 0 deletions

33
node_modules/es-toolkit/dist/compat/object/assignIn.js generated vendored Normal file
View File

@@ -0,0 +1,33 @@
const require_isEqualsSameValueZero = require("../../_internal/isEqualsSameValueZero.js");
require("../util/eq.js");
const require_keysIn = require("./keysIn.js");
//#region src/compat/object/assignIn.ts
/**
* Assigns properties from multiple source objects to a target object.
*
* This function merges the properties of the source objects into the target object,
* including properties from the prototype chain. If a property in the source objects
* is equal to the corresponding property in the target object, it will not be overwritten.
*
* @param {any} object - The target object to which properties will be assigned.
* @param {...any[]} sources - The source objects whose properties will be assigned to the target object.
* @returns {any} The updated target object with properties from the source objects assigned.
*
* @example
* const target = { a: 1 };
* const result = assignIn(target, { b: 2 }, { c: 3 });
* console.log(result); // Output: { a: 1, b: 2, c: 3 }
*/
function assignIn(object, ...sources) {
for (let i = 0; i < sources.length; i++) assignInImpl(object, sources[i]);
return object;
}
function assignInImpl(object, source) {
const keys = require_keysIn.keysIn(source);
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
if (!(key in object) || !require_isEqualsSameValueZero.isEqualsSameValueZero(object[key], source[key])) object[key] = source[key];
}
}
//#endregion
exports.assignIn = assignIn;