@equinor/fusion-framework-cli
Version:
Command-line toolkit for developing, building, and publishing Fusion Framework applications and portal templates. Provides a unified developer experience from local development to production deployment.
31 lines • 1.38 kB
JavaScript
import mergeWith from 'deepmerge';
/**
* Deeply merges two application manifests using deepmerge.
*
* This utility is intended for combining a base manifest with an override manifest,
* supporting recursive merging of nested properties. It is commonly used in scenarios
* where environment-specific or user-specific manifest customizations are required.
*
* @example
* ```ts
* export default defineAppManifest(base => mergeAppManifests(base, { prop: value }));
* ```
*
* @param base - The base manifest to merge with. Typically the default or environment-agnostic manifest.
* @param overrides - The manifest containing properties to override or extend the base manifest.
* @returns The deeply merged manifest object.
*
* @remarks
* - Maintainers: This function does not perform schema validation. Ensure validation is handled elsewhere.
* - Future: Consider adding assertions or schema checks after merging for safety.
*/
export const mergeAppManifests = (base, // The base manifest (may be partial)
overrides) => {
// Use lodash.mergeWith for deep merging of manifest objects
const manifest = mergeWith(base, overrides);
// TODO: Add assertions or schema validation here if needed
return manifest;
};
// Export as default for convenience in import statements
export default mergeAppManifests;
//# sourceMappingURL=merge-app-manifest.js.map