@plurnk/plurnk-mimetypes-application-json
v0.2.0
Published
application/json and application/jsonc mimetype handler for plurnk-service.
Downloads
39
Readme
@plurnk/plurnk-mimetypes-application-json
application/json mimetype handler for the plurnk ecosystem.
install
npm install @plurnk/plurnk-mimetypes-application-jsonplurnk-service discovers this handler automatically via its plurnk.kind: "mimetype" declaration.
what it does
validate(content)throws on malformed JSON (viaJSON.parse). Per framework error policy, this error propagates to the caller as a contract violation.extract(content)returns the document's top-level keys asfieldsymbols. Nested keys are out of scope; a JSON document's "API surface" is its top level. Line numbers come from a single-pass scan of the raw source.- Array and scalar JSON roots have no named top-level keys → empty
Symbol[].
development
npm install
npm run build
npm testlicense
MIT.
