Merge pull request #239 from jonathanGB/master

fix errors in CUSTOM doc
master
Evgeny Poberezkin 2016-07-20 08:31:19 +01:00 committed by GitHub
commit 167653aee0
1 changed files with 5 additions and 5 deletions

View File

@ -253,10 +253,10 @@ it.util.toHash(['a', 'b', 'c']) // { a: true, b: true, c: true }
Converts the string that is the key/index to access the property/item to the JavaScript syntax to access the property (either "." notation or "[...]" notation).
```javascript
it.util.toHash('a') // ".a"
it.util.toHash('1') // "['1']"
it.util.toHash("a'b") // "['a\\'b']"
it.util.toHash(1) // "[1]"
it.util.getProperty('a') // ".a"
it.util.getProperty('1') // "['1']"
it.util.getProperty("a'b") // "['a\\'b']"
it.util.getProperty(1) // "[1]"
```
@ -288,7 +288,7 @@ it.util.toQuotedString("a'b") // "'a\\'b'"
Returns the validation-time expression to safely access data based on the passed [relative json pointer](https://tools.ietf.org/html/draft-luff-relative-json-pointer-00) (See [examples](https://gist.github.com/geraintluff/5911303)).
```javascript
it.getData('2/test/1', it.dataLevel, it.dataPathArr)
it.util.getData('2/test/1', it.dataLevel, it.dataPathArr)
// The result depends on the current level
// if it.dataLevel is 3 the result is "data1 && data1.test && data1.test[1]"
```