@ehfuse/forma
Version:
Advanced React state management library with individual field subscriptions - supports both forms and general state management with useFormaState
54 lines • 2.81 kB
JavaScript
;
/**
* utils/index.ts
*
* @license MIT License
* @copyright 2025 KIM YOUNG JIN (Kim Young Jin)
* @author KIM YOUNG JIN (ehfuse@gmail.com)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.devLog = exports.devError = exports.devWarn = exports.isDevelopment = exports.setNestedValue = exports.getNestedValue = void 0;
exports.mergeActions = mergeActions;
var dotNotation_1 = require("./dotNotation");
Object.defineProperty(exports, "getNestedValue", { enumerable: true, get: function () { return dotNotation_1.getNestedValue; } });
Object.defineProperty(exports, "setNestedValue", { enumerable: true, get: function () { return dotNotation_1.setNestedValue; } });
var environment_1 = require("./environment");
Object.defineProperty(exports, "isDevelopment", { enumerable: true, get: function () { return environment_1.isDevelopment; } });
Object.defineProperty(exports, "devWarn", { enumerable: true, get: function () { return environment_1.devWarn; } });
Object.defineProperty(exports, "devError", { enumerable: true, get: function () { return environment_1.devError; } });
Object.defineProperty(exports, "devLog", { enumerable: true, get: function () { return environment_1.devLog; } });
/**
* Actions 배열을 단일 객체로 병합
* Merge actions array into single object
*
* @param actions - Actions 객체 또는 배열
* @returns 병합된 Actions 객체
*/
function mergeActions(actions) {
if (!actions)
return undefined;
// 이미 객체면 그대로 반환
if (!Array.isArray(actions))
return actions;
// 배열이면 모든 객체를 병합 (나중 것이 우선순위)
return Object.assign({}, ...actions);
}
//# sourceMappingURL=index.js.map