-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(integration): fixed typo in DataTransferObject & added json patch
- Loading branch information
Showing
6 changed files
with
39 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { ModelConstructor } from '@neuroglia/common'; | ||
import { PatchOperation } from './patch-operation'; | ||
|
||
/** | ||
* Models a JSON Patch document. | ||
*/ | ||
export class JsonPatch extends ModelConstructor { | ||
constructor(model?: any) { | ||
super(model); | ||
this.operations = (model?.operations || []).map((operation: PatchOperation) => new PatchOperation(operation)); | ||
} | ||
/** The collection of operations. */ | ||
operations: PatchOperation[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { ModelConstructor } from '@neuroglia/common'; | ||
|
||
/** | ||
* Represents a single JSON Patch operation. | ||
*/ | ||
export class PatchOperation extends ModelConstructor { | ||
constructor(model?: any) { | ||
super(model); | ||
} | ||
/** The operation type */ | ||
op: 'add' | 'remove' | 'replace' | 'move' | 'copy' | 'test'; | ||
/** The source path */ | ||
from: string; | ||
/** The target path */ | ||
path: string; | ||
/** The value */ | ||
value: any; | ||
} |