Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: config is merged incorrectly #77

Merged
merged 1 commit into from
Dec 24, 2024

Conversation

TitusKirch
Copy link
Contributor

Resolves #76

As a suggestion to solve the problem, I have created a custom defu. Here are the results and the matching test code.

Current result:

{
  "main": {
    "showTitle": true,
    "padded": false,
    "pm": [
      "npm",
      "pnpm",
      "npm",
      "pnpm",
      "bun",
      "yarn"
    ]
  }
}

After fix:

{
  "main": {
    "showTitle": true,
    "padded": false,
    "pm": [
      "npm",
      "pnpm"
    ]
  }
}

The test code:

const defaultConfig = {
  main: {
    showTitle: true,
    padded: true,
    pm: ['npm', 'pnpm', 'bun', 'yarn'],
  }
};
const localConfig = {
  main: {
    padded: false,
    pm: ['npm', 'pnpm'],
  }
};

const current = defu(localConfig, defaultConfig);
const afterFix = customDefu(localConfig, defaultConfig);
console.info('current', current);
console.info('afterFix', afterFix);

Copy link

vercel bot commented Dec 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
shadcn-docs-nuxt ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 23, 2024 7:24pm

@ZTL-UwU ZTL-UwU merged commit 9d0e5e6 into ZTL-UwU:main Dec 24, 2024
4 checks passed
@ZTL-UwU
Copy link
Owner

ZTL-UwU commented Dec 24, 2024

Thanks!

@TitusKirch TitusKirch deleted the fix/config-is-merged-incorrectly branch December 24, 2024 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: config is merged incorrectly
2 participants