-
-
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.
- Loading branch information
1 parent
6af59f9
commit 076c872
Showing
11 changed files
with
347 additions
and
114 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions
20
docs-src/components/utils/functions/get-value-at-path.svelte
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,20 @@ | ||
<Util id="getValueAtPath" name="getValueAtPath(obj, path, defaultValue)" {example}> | ||
<p>Get a value from a given path in an object.</p> | ||
</Util> | ||
|
||
|
||
<script> | ||
import Util from '../Util.svelte'; | ||
const example = ` | ||
<script> | ||
const obj = { | ||
a: [ | ||
{ b: { c: 1 } } | ||
] | ||
}; | ||
getValueAtPath(obj, 'a[0].b.c', 123) | ||
</script> | ||
`; | ||
</script> |
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
20 changes: 20 additions & 0 deletions
20
docs-src/components/utils/functions/set-value-at-path.svelte
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,20 @@ | ||
<Util id="setValueAtPath" name="setValueAtPath(obj, path, value)" {example}> | ||
<p>Set a value for a given path in an object.</p> | ||
</Util> | ||
|
||
|
||
<script> | ||
import Util from '../Util.svelte'; | ||
const example = ` | ||
<script> | ||
const obj = { | ||
a: [ | ||
{ b: { c: 1 } } | ||
] | ||
}; | ||
setValueAtPath(obj, 'a[0].b.c', 123) | ||
</script> | ||
`; | ||
</script> |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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