UNPKG

flowbite-angular

Version:

<div align="center"> <h1>flowbite-angular</h1> <p> Build websites even faster with components on top of Angular and Tailwind CSS </p> <p> <a href="https://discord.com/invite/4eeurUVvTy"> <img src="https://img.shields.io/discord/90291

75 lines (68 loc) 2 kB
/** * Check if the provided parameter is an object or not. * * @param item The unknown type parameter. * @returns true if it's an ibject ; false otherwise. */ function isObject(item) { return item !== null && typeof item === 'object' && item.constructor === Object; } /** * Function that return the cloned type of the provided generic type. * * @param source Generic object to be cloned. * @returns The clone type of the provided type. */ function cloneDeep(source) { if (!isObject(source)) { return source; } const output = {}; for (const key in source) { output[key] = cloneDeep(source[key]); } return output; } function colorToTheme(set, key) { return `${set[key].light} ${set[key].dark}`; } /** * This function is used to create themes for component's while keeping the intellisens up for TailwindCSS and other extensions. * * @param input Generic type to be created. * @returns The generic type's definition. */ function createTheme(input) { return input; } /** * Merge two objects into one. * * @param target Object to be merged. * @param source Object to be merged. * @returns The merged object. */ function mergeDeep(target, source) { if (isObject(source) && Object.keys(source).length === 0) { return cloneDeep({ ...target, ...source }); } const output = { ...target, ...source }; if (isObject(source) && isObject(target)) { for (const key in source) { if (isObject(source[key]) && key in target && isObject(target[key])) { output[key] = mergeDeep(target[key], source[key]); } else { output[key] = isObject(source[key]) ? cloneDeep(source[key]) : source[key]; } } } return output; } /** * Generated bundle index. Do not edit. */ export { cloneDeep, colorToTheme, createTheme, isObject, mergeDeep }; //# sourceMappingURL=flowbite-angular.mjs.map