You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,6 +62,26 @@ data.toJs();
62
62
*/
63
63
```
64
64
65
+
### Parsing options
66
+
67
+
The main `parse()` function takes two parameters, the input string, and an options object.
68
+
69
+
```js
70
+
parse( input, options? )
71
+
```
72
+
73
+
|Option|Type|Default|Description|
74
+
|---|---|---|---|
75
+
|`fixNulls`|Boolean|`false`|Attempt to fix missing/broken null chars in input.<br>Useful when the input was pasted from the clipboard.|
76
+
77
+
The `fixNulls` option attempts to fix the following scenarios:
78
+
79
+
- Nulls have been replaced with the Unicode replacement character �. This can happen if the serialized string was output into a HTML page.
80
+
- Nulls are missing. This usually happens if the value was copied to the clipboard. If the string byte count was larger than the content, then the following fixes are attempted, depending on the content of the string.
81
+
- If the byte count is larger by 1, and the value starts with `lambda_`, then the string is probably a serialized lambda function.
82
+
- If the byte count is larger by 2, and the value starts with an asterisk `*`, then the string is probably a protected property.
83
+
- If the byte count is larger by 2, and the other scenarios do not apply, the string is probably a private class property.
84
+
65
85
## JS Value Conversion
66
86
67
87
Use the `.toJs()` method on the output to convert to native JavaScript types.
0 commit comments