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

construct sometimes converts integers with letters into an array instead of an object #389

Open
schinwald opened this issue Mar 22, 2024 · 0 comments

Comments

@schinwald
Copy link

When using construct I am getting unexpected behaviour, which is causing data to get lost. It happens specifically when there is a number followed by a letter somewhere in the middle of a path to be constructed (in the case below 2fa). It works fine in the root though.

import { construct } from "radash";

const good = construct({ '2fa.enabled': true })
console.log(good)
/**
 * {
 *   '2fa': {
 *     enabled: true
 *   }
 * }
 */

const bad = construct({ 'email.2fa.enabled': true })
console.log(bad)
/**
 * {
 *   email: []
 * }
 */
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

No branches or pull requests

1 participant