Skip to content

Commit

Permalink
Change to
Browse files Browse the repository at this point in the history
  • Loading branch information
nihalbhatnagar committed Jan 31, 2025
1 parent 015d6f5 commit 7e84ede
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/api/src/OsdkObjectFrom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export namespace Osdk {
ConvertProps<Q, NEW_Q, P>
>;

readonly $cloneAndUpdate: (
readonly $clone: (
updatedObject:
| Osdk.Instance<Q, any, any>
| {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const basePropDefs = {
return get$link(this);
},
},
"$cloneAndUpdate": {
"$clone": {
value: function(
this: InternalOsdkInstance & ObjectHolder<any>,
update: Record<string, any>,
Expand Down
10 changes: 5 additions & 5 deletions packages/client/src/object/object.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ describe("OsdkObject", () => {
].sort());
});
});
describe("cloneAndUpdate", () => {
describe("clone", () => {
let employee: Osdk.Instance<
$Objects.Employee,
never,
Expand Down Expand Up @@ -258,7 +258,7 @@ describe("OsdkObject", () => {
"class" | "employeeId" | "fullName" | "office"
>;

const mergedEmployee = employee.$cloneAndUpdate(updatedEmployee);
const mergedEmployee = employee.$clone(updatedEmployee);

expectTypeOf(mergedEmployee).toEqualTypeOf(employee);

Expand All @@ -283,7 +283,7 @@ describe("OsdkObject", () => {
});

it("clones and updates an object with a record", async () => {
const mergedEmployee = employee.$cloneAndUpdate({
const mergedEmployee = employee.$clone({
"class": "Green",
"employeeId": 50031,
"fullName": "John Doe",
Expand Down Expand Up @@ -312,7 +312,7 @@ describe("OsdkObject", () => {
});

it("correctly sets title", async () => {
const mergedEmployee = employee.$cloneAndUpdate({
const mergedEmployee = employee.$clone({
"fullName": "Brad Pitt",
});

Expand All @@ -338,7 +338,7 @@ describe("OsdkObject", () => {

it("throws when merging objects with different primary keys", async () => {
expect(() =>
employee.$cloneAndUpdate({
employee.$clone({
"class": "Green",
"employeeId": 50035,
})
Expand Down

0 comments on commit 7e84ede

Please sign in to comment.