Decompose monolithic readme into docs/ directory structure
This commit is contained in:
17
docs/values/pointer.md
Normal file
17
docs/values/pointer.md
Normal file
@@ -0,0 +1,17 @@
|
||||
[Overview](../overview.md) | [Installation](../installation.md) | [Usage](../usage.md) | [Types](../types/) | **Values** | [Syntax](../syntax/) | [TypeRegistry](../type-registry.md) | [TypeCheck](../type-check.md)
|
||||
|
||||
# Pointer
|
||||
|
||||
Use ValuePointer to perform mutable updates on existing values using [RFC6901](https://www.rfc-editor.org/rfc/rfc6901) Json Pointers.
|
||||
|
||||
```typescript
|
||||
import { ValuePointer } from "@alkdev/typebox/value";
|
||||
|
||||
const A = { x: 0, y: 0, z: 0 };
|
||||
|
||||
ValuePointer.Set(A, "/x", 1); // A' = { x: 1, y: 0, z: 0 }
|
||||
ValuePointer.Set(A, "/y", 1); // A' = { x: 1, y: 1, z: 0 }
|
||||
ValuePointer.Set(A, "/z", 1); // A' = { x: 1, y: 1, z: 1 }
|
||||
```
|
||||
|
||||
Back to [Home](../../readme.md)
|
||||
Reference in New Issue
Block a user