UNPKG

formbold-react

Version:

Formbold package for react.

29 lines (28 loc) 1.17 kB
"use strict"; var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.mergeConfig = void 0; /** * Merges the provided configuration object with the default configuration, * overriding any properties that are specified in the provided object. * * @param config - The configuration object to merge with the default configuration. * @returns The merged configuration object. */ var mergeConfig = function (defaultConfig, config) { var _a; if (config === void 0) { config = {}; } var errorMessages = __assign(__assign({}, defaultConfig.errorMessages), ((_a = config.errorMessages) !== null && _a !== void 0 ? _a : {})); return __assign(__assign(__assign({}, defaultConfig), config), { errorMessages: errorMessages }); }; exports.mergeConfig = mergeConfig;