/** * Copyright (c) 2026 AzerothJS. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ /** * Merges an addition object onto the context. `request`, `params` and `url` are readonly * to TypeScript and writable at runtime, so a function that returns parsed request data * as its additions (`app.use((c) => readJson(c.request))`) would otherwise let a body of * `{"params":{"id":"admin"}}` replace the path params a handler authorises on. Own keys * only: an addition must never arrive from a polluted prototype. * * `__proto__` is refused for the same reason from the other side: `JSON.parse` produces it as an * OWN key, and assigning it invokes the inherited setter, which swaps the context's prototype - * its `url`/`path` accessors vanish and every key never set as an own property resolves to * whatever the body supplied. * * @param context - The live request context. * @param addition - Whatever the middleware/guard returned (non-object values are ignored). */ export declare function mergeAdditions(context: object, addition: unknown): void;