Skip to content

Commit 4c05eee

Browse files
Update reach template documentation (#370)
* Update reach template documentation * Fix spacing in docs example Co-authored-by: devin ivy <[email protected]>
1 parent fcc7ba6 commit 4c05eee

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

API.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,11 +265,10 @@ Replaces string parameters (`{name}`) with their corresponding object key values
265265
- `options` - optional [`reach()`](#reachobj-chain-options) options.
266266

267267
```javascript
268+
const template = '1+{a.b.c}=2';
269+
const obj = { a: { b: { c: 1 } } };
268270

269-
const chain = 'a.b.c';
270-
const obj = {a : {b : { c : 1}}};
271-
272-
Hoek.reachTemplate(obj, '1+{a.b.c}=2'); // returns '1+1=2'
271+
Hoek.reachTemplate(obj, template); // returns '1+1=2'
273272
```
274273

275274
#### stringify(...args)

0 commit comments

Comments
 (0)