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

overwrite - handle overwrite of non-empty objects with plain values #648

Merged
merged 1 commit into from
Sep 10, 2024

Conversation

thim81
Copy link
Collaborator

@thim81 thim81 commented Aug 28, 2024

linked to #646

Result before:

/Path/to/repro/node_modules/dot-object/index.js:118
        throw new Error("Trying to redefine non-empty obj['" + k + "']")
              ^

Error: Trying to redefine non-empty obj['startDateTime']
    at DotObject._fill (/Path/to/repro/node_modules/dot-object/index.js:118:15)
    at DotObject._fill (/Path/to/repro/node_modules/dot-object/index.js:114:10)
    at DotObject.str (/Path/to/repro/node_modules/dot-object/index.js:179:10)

Result after:
image

@thim81
Copy link
Collaborator Author

thim81 commented Sep 6, 2024

@nicklloyd Do you see any risk or side-effect of this?

@nicklloyd
Copy link
Contributor

it's getting 'set' later in the flow yea? You're just removing it beforehand if it's an object?

@thim81
Copy link
Collaborator Author

thim81 commented Sep 6, 2024

it's getting 'set' later in the flow yea? You're just removing it beforehand if it's an object?

Yes, we are removing the "object" to replace it with a "string" value,

// Update property from object
return dot.str(path, newValue, objectOrArray)

since the "dotObject" library cannot handle overwriting an object, so it throws an error.

@nicklloyd
Copy link
Contributor

seems fine... can't recall if it was just bloat that kept us from using lodash... they've fixed all that with more recent version

@thim81
Copy link
Collaborator Author

thim81 commented Sep 6, 2024

Sidetrack: Do you suggest that we can/should replace DotObject with Lodash?

@thim81 thim81 merged commit f11d176 into main Sep 10, 2024
6 checks passed
@thim81 thim81 deleted the 646-oneoff-datatype branch September 10, 2024 18:03
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.

2 participants