function cloneStringArray(values) {
    return values === undefined ? [] : [...values];
}
export function mergeInheritedStrings(inherited, current) {
    return [...cloneStringArray(inherited), ...cloneStringArray(current)];
}
function clonePackageSource(source) {
    if (typeof source === "string") {
        return source;
    }
    return {
        source: source.source,
        ...(source.extensions === undefined ? {} : { extensions: [...source.extensions] }),
        ...(source.skills === undefined ? {} : { skills: [...source.skills] }),
        ...(source.prompts === undefined ? {} : { prompts: [...source.prompts] }),
        ...(source.themes === undefined ? {} : { themes: [...source.themes] }),
        ...(source.workflows === undefined ? {} : { workflows: [...source.workflows] }),
    };
}
export function clonePackageSources(sources) {
    return sources === undefined ? [] : sources.map((source) => clonePackageSource(source));
}
//# sourceMappingURL=resource-loader-helpers.js.map