Skip to content

Commit

Permalink
fix: ftd.set-value() for record with extra fields & fastn 0.4.72
Browse files Browse the repository at this point in the history
  • Loading branch information
amitu committed Jul 7, 2024
1 parent 26904de commit b0839ff
Show file tree
Hide file tree
Showing 11 changed files with 1,530 additions and 1,530 deletions.
88 changes: 44 additions & 44 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -583,10 +583,10 @@ const fastn = (function (fastn) {
if (!(value instanceof RecordInstance)) {
value = new RecordInstance(value);
}

let fields = {};
for (let key in value.#fields) {
this.#fields[key].set(value.#fields[key]);
if (this.#fields[key]) {
this.#fields[key].set(value.#fields[key]);
}
}
} else if (this.#fields[key] === undefined) {
this.#fields[key] = fastn.mutable(null);
Expand All @@ -607,8 +607,8 @@ const fastn = (function (fastn) {
if (!(key in obj.#fields)) {
throw new Error(
"RecordInstance.replace: key " +
key +
" not present in new object",
key +
" not present in new object",
);
}
this.#fields[key] = fastn.wrapMutable(obj.#fields[key]);
Expand Down
2 changes: 1 addition & 1 deletion fastn-core/fbt-tests/08-static-assets/output/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -583,10 +583,10 @@ const fastn = (function (fastn) {
if (!(value instanceof RecordInstance)) {
value = new RecordInstance(value);
}

let fields = {};
for (let key in value.#fields) {
this.#fields[key].set(value.#fields[key]);
if (this.#fields[key]) {
this.#fields[key].set(value.#fields[key]);
}
}
} else if (this.#fields[key] === undefined) {
this.#fields[key] = fastn.mutable(null);
Expand All @@ -607,8 +607,8 @@ const fastn = (function (fastn) {
if (!(key in obj.#fields)) {
throw new Error(
"RecordInstance.replace: key " +
key +
" not present in new object",
key +
" not present in new object",
);
}
this.#fields[key] = fastn.wrapMutable(obj.#fields[key]);
Expand Down
Loading

0 comments on commit b0839ff

Please sign in to comment.