UNPKG

@wizard9/json-patch-apply

Version:

A library for describing, calculating, and applying patches to Javascript Objects.

40 lines (36 loc) 1.3 kB
/** This file is part of json-patch-apply. json-patch-apply is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. json-patch-apply is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with json-patch-apply. If not, see <https://www.gnu.org/licenses/>. */ import { PatchOperation } from "./common"; /** * This class is capable of patching any object. */ export declare class PatchApply { /** * Applies a set of patch operations to a given object. * @param source * @param operations */ apply<T extends object>(source: T, ...operations: PatchOperation[]): T | undefined; /** * Applies the given patch operation to the given object. * * @param source * @param patch */ private applyPatchOperation; private applyPatchToChild; private applyPatchToSelf; private getValue; private handleConflict; }