This repository was archived by the owner on Feb 8, 2020. It is now read-only.
Commit 4d6870a
feat(result): values of default params to be always strings (#121)
Changes in [Result object](https://github.com/tunnckoCore/parse-function#result)!
**Possible breaking change, if you depend on values of `result.defaults`!**
Now `result.defaults` is key/value pairs as before, but the value is always of type `string` or `undefined`!
Casting of values is delegated to the end user which before was not consistent and was actual value of the default parameter.
Example **(before)**:
```js
const result = app.parse('(a = 123) => {}')
console.log(result.defaults)
// => { a: 123 }
```
Example **(after)**:
```js
const result = app.parse('(a = 123) => {}')
// notice that `123` now is string!
console.log(result.defaults)
// => { a: '123' }
```
fixes #120, related #1101 parent 05018b6 commit 4d6870a
2 files changed
+29
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | 37 | | |
39 | 38 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
47 | 43 | | |
48 | 44 | | |
49 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| 46 | + | |
44 | 47 | | |
| 48 | + | |
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
| |||
51 | 55 | | |
52 | 56 | | |
53 | 57 | | |
| 58 | + | |
54 | 59 | | |
| 60 | + | |
55 | 61 | | |
56 | 62 | | |
57 | 63 | | |
| |||
61 | 67 | | |
62 | 68 | | |
63 | 69 | | |
| 70 | + | |
64 | 71 | | |
| 72 | + | |
65 | 73 | | |
66 | 74 | | |
67 | 75 | | |
| |||
126 | 134 | | |
127 | 135 | | |
128 | 136 | | |
129 | | - | |
| 137 | + | |
130 | 138 | | |
131 | 139 | | |
132 | 140 | | |
133 | 141 | | |
134 | 142 | | |
135 | 143 | | |
136 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
137 | 152 | | |
138 | 153 | | |
139 | 154 | | |
140 | 155 | | |
141 | 156 | | |
142 | 157 | | |
143 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
144 | 166 | | |
145 | 167 | | |
146 | 168 | | |
| |||
0 commit comments