@bscotch/gcdata
Advanced tools
Comparing version 0.17.1 to 0.17.2
@@ -541,4 +541,16 @@ import { assert } from './assert.js'; | ||
updateMote('data/name', parsed.name); | ||
updateMote('data/quest_giver/item', parsed.quest_giver); | ||
updateMote('data/quest_receiver/item', parsed.quest_receiver); | ||
if (!parsed.quest_giver) { | ||
// Then we need to delete the entire quest_giver field | ||
updateMote('data/quest_giver', null); | ||
} | ||
else { | ||
updateMote('data/quest_giver/item', parsed.quest_giver); | ||
} | ||
if (!parsed.quest_receiver) { | ||
// Then we need to delete the entire quest_receiver field | ||
updateMote('data/quest_receiver', null); | ||
} | ||
else { | ||
updateMote('data/quest_receiver/item', parsed.quest_receiver); | ||
} | ||
updateMote('data/quest_start_log/text', parsed.quest_start_log); | ||
@@ -545,0 +557,0 @@ updateMote('data/wip/draft', parsed.draft); |
@@ -152,2 +152,3 @@ import { Glossary } from '@bscotch/cl2-string-server-shared'; | ||
}, "strip", import("zod").ZodTypeAny, { | ||
message: string; | ||
motes: Record<string, import("zod").objectOutputType<{ | ||
@@ -173,3 +174,2 @@ mote_id: import("zod").ZodOptional<import("zod").ZodString>; | ||
}, import("zod").ZodTypeAny, "passthrough">>; | ||
message: string; | ||
conflicts: { | ||
@@ -176,0 +176,0 @@ motes: Record<string, any>; |
@@ -7,4 +7,4 @@ import { Client, Glossary } from '@bscotch/cl2-string-server-shared'; | ||
import { gameChangerRumpusMetadataSchema, } from './types.cl2.rumpus.js'; | ||
import { changeSchema, changesSchema, isBschemaBoolean, isBschemaConst, isBschemaEnum, isBschemaNumeric, isBschemaObject, isBschemaString, } from './types.js'; | ||
import { computeTerminalPointers, resolvePointer, resolvePointerInSchema, setValueAtPointer, } from './util.js'; | ||
import { changeSchema, changesSchema, isBschemaBoolean, isBschemaConst, isBschemaEnum, isBschemaNumeric, isBschemaString, } from './types.js'; | ||
import { resolvePointer, resolvePointerInSchema, setValueAtPointer, } from './util.js'; | ||
export class Gcdata { | ||
@@ -229,13 +229,2 @@ data; | ||
} | ||
if (isBschemaObject(subschema) && value === null) { | ||
// Then we are deleting a sub-object, so we need to find each | ||
// entry by path and add a deletion for it | ||
const subdata = resolvePointer(dataPath, this.workingData.motes[moteId]); | ||
const pointers = computeTerminalPointers(subdata, dataPath); | ||
for (const pointer of pointers) { | ||
this.updateMoteData(moteId, pointer, null); | ||
} | ||
// We don't store the deletion of the sub-object itself, so we're done! | ||
return; | ||
} | ||
// Update the working data | ||
@@ -242,0 +231,0 @@ setValueAtPointer(this.working.data.motes[moteId], dataPath, value); |
@@ -13,3 +13,3 @@ # License for the Stitch Monorepo | ||
![Stitch Logo](images/stitch-logo.png The Stitch Logo, copyright and trademark Butterscotch Shenanigans, all rights reserved.) | ||
![Stitch Logo](https://img.bscotch.net/fit-in/256x256/logos/stitch.png "The Stitch Logo, copyright and trademark Butterscotch Shenanigans, all rights reserved.") | ||
@@ -16,0 +16,0 @@ Stitch™ and its logo are trademarks of Bscotch. Bscotch reserves all rights to Stitch and its logo. |
{ | ||
"name": "@bscotch/gcdata", | ||
"version": "0.17.1", | ||
"version": "0.17.2", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
78884
2646751