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

chore(devtool): add compatibility for UTF character #4265

Merged
merged 1 commit into from
May 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/vee-validate/src/devtools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ function encodeNodeId(form?: PrivateFormContext, stateOrField?: PathState | Priv
const fieldPath = stateOrField ? ('path' in stateOrField ? stateOrField?.path : unref(stateOrField?.name)) : '';
const idObject = { f: form?.formId, ff: fieldPath, type };

return btoa(JSON.stringify(idObject));
return btoa(encodeURIComponent(JSON.stringify(idObject)));
}

function decodeNodeId(nodeId: string): {
Expand All @@ -366,7 +366,7 @@ function decodeNodeId(nodeId: string): {
type?: 'form' | 'field' | 'pathState';
} {
try {
const idObject = JSON.parse(atob(nodeId));
const idObject = JSON.parse(decodeURIComponent(atob(nodeId)));
const form = DEVTOOLS_FORMS[idObject.f];

if (!form && idObject.ff) {
Expand Down