-
Notifications
You must be signed in to change notification settings - Fork 0
helpers.API
Table of Contents generated with DocToc
helpers for jsocrud
- Source:
-
<static> convertFirstPathPart(path) → {ValidatedPath}
-
Convert the first path 'part' of a path into bracket notation
Name Type Description path
String Path (e.g. foo[2].bar)
- Source:
ValidatedPath containing the correct path, firstPathPart and pathRemainder
- Type
- ValidatedPath
-
Format a pathPart, returning it in bracket notation with previously unescaped double-quotes now escaped
Name Type Description pathPart
String Component of a jsocrud path to format in bracket notation
- Source:
Formatted first path part (in bracket notation)
- Type
- String
-
Look backwards from a position in a string to discern whether or not the character at the given position is escaped. Note: This does not look forward in the string from the given position, so be mindful of cases where that will bite you in the ass (e.g. "\\" character at index 1)
Name Type Description characterIndex
Number Index of the character to check
inputString
String Entire string to check
- Source:
True if the character is escaped else False
- Type
- Boolean
-
Parse a validated path into components
Name Type Description validatedPath
ValidatedPath Validated path data
- Source:
Path components
- Type
- Array
-
<static> validatePath(path) → {ValidatedPath}
-
Validates the given path and converts the first path part to bracket notation if necessary
Name Type Description path
String Path in an object (e.g. ["foo"][2].bar)
- Source:
Validated path data
- Type
- ValidatedPath