Skip to content

Commit

Permalink
chore(devtool): add compatibility for UTF character (#4265)
Browse files Browse the repository at this point in the history
  • Loading branch information
linghaoSu committed May 15, 2023
1 parent 220bbe3 commit 2879785
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 2879785

Please sign in to comment.