You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The set function in the radash library is expected to update object properties, both for nested and simple keys. However, in our tests, it correctly modifies nested keys but fails to update simple keys.
Specifically, attempting to update a simple key like url does not produce the expected result, whereas updating nested keys (e.g., details.thumbnail.url) works as expected
here is a simple repro:
import { set, get } from 'radash'
async function main() {
const media = {
url: 'https://original-url.com',
details: {
thumbnail: {
url: 'https://thumbnail.com'
}
}
}
console.log('Original media object:', media)
const verifiedUrl = 'https://new-url.com'
const thumbnailVerifiedUrl = 'https://new-thumbnail-url.com'
set(media, 'url', verifiedUrl)
set(media, 'details.thumbnail.url', thumbnailVerifiedUrl)
console.log('Modified media object:', media)
console.log('Updated url:', get(media, 'url'))
console.log('Updated thumbnail url:', get(media, 'details.thumbnail.url'))
}
main()
Thanks for this amazing work
The text was updated successfully, but these errors were encountered:
The set function in the radash library is expected to update object properties, both for nested and simple keys. However, in our tests, it correctly modifies nested keys but fails to update simple keys.
Specifically, attempting to update a simple key like
url
does not produce the expected result, whereas updating nested keys (e.g.,details.thumbnail.url
) works as expectedhere is a simple repro:
Thanks for this amazing work
The text was updated successfully, but these errors were encountered: