MCPcopy Create free account
hub / github.com/chhoumann/MetaEdit / assertWritableKey

Method assertWritableKey

src/metaController.ts:667–671  ·  view source on GitHub ↗

* Throw if `key` is a reserved object-machinery name that can never be written * as a frontmatter property (see isReservedFrontmatterKey). Centralizes * the refusal so every dynamic `frontmatter[key] = value` sink in the controller * - `addYamlProp`, `updatePropertyInFile`, `u

(key: string)

Source from the content-addressed store, hash-verified

665 * the change (or polluting the prototype) while reporting success.
666 */
667 private assertWritableKey(key: string): void {
668 if (isReservedFrontmatterKey(key)) {
669 throw new Error(`"${key}" is a reserved property name and cannot be written to frontmatter.`);
670 }
671 }
672
673 private async updateMultipleInFile(properties: Property[], file: TFile): Promise<void> {
674 // Refuse a batch with ANY reserved YAML key BEFORE the write starts. This

Callers 5

addYamlPropMethod · 0.95
updatePropertyInFileMethod · 0.95
updateMultipleInFileMethod · 0.95

Calls 1

isReservedFrontmatterKeyFunction · 0.90

Tested by

no test coverage detected