Skip to content

Commit

Permalink
Cast last value to string before diff
Browse files Browse the repository at this point in the history
  • Loading branch information
acurrieclark committed Apr 5, 2023
1 parent a948330 commit 4618ea6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/actions/bind-string-deferred.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function bindStringDeferred<T extends Record<string, any>>(
store.change(
(doc) => {
const lastValue = getByPath(doc, path as Path<Extend<T>>);
const patches = getStringPatches(lastValue, node.value);
const patches = getStringPatches(String(lastValue), node.value);

patches.forEach((p) => {
p.path.unshift(...path.split("."));
Expand Down
2 changes: 1 addition & 1 deletion src/actions/bind-string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function bindString<T extends Record<string, any>>(
store.change(
(doc) => {
const lastValue = getByPath(doc, path as Path<Extend<T>>);
const patches = getStringPatches(lastValue, node.value);
const patches = getStringPatches(String(lastValue), node.value);

patches.forEach((p) => {
p.path.unshift(...path.split("."));
Expand Down
2 changes: 1 addition & 1 deletion src/actions/bind-text-deferred.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function bindTextDeferred<T extends Record<string, any>>(
store.change(
(doc) => {
const lastValue = getByPath(doc, path as Path<Extend<T>>);
const patches = getTextPatches(lastValue, node.value);
const patches = getTextPatches(String(lastValue), node.value);

patches.forEach((p) => {
p.path.unshift(...path.split("."));
Expand Down
2 changes: 1 addition & 1 deletion src/actions/bind-text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function bindText<T extends Record<string, any>>(
store.change(
(doc) => {
const lastValue = getByPath(doc, path as Path<Extend<T>>);
const patches = getTextPatches(lastValue, node.value);
const patches = getTextPatches(String(lastValue), node.value);

patches.forEach((p) => {
p.path.unshift(...path.split("."));
Expand Down

0 comments on commit 4618ea6

Please sign in to comment.