| 155 | } |
| 156 | |
| 157 | arrayRaw(func: ObjectParserArrayRawFunc<P>): this { |
| 158 | const prop = this._property; |
| 159 | if (Array.isArray(prop)) { |
| 160 | for (let i = 0; i < prop.length; i++) { |
| 161 | func(prop[i], i, prop); |
| 162 | } |
| 163 | } else { |
| 164 | this._context.onError(new ObjectParserError(this._stack, 'Property is not an array.')); |
| 165 | } |
| 166 | return this; |
| 167 | } |
| 168 | |
| 169 | prop<L extends keyof P>(label: L, funcOrOptional?: ((prop: P[L]) => void) | boolean, optional?: boolean): IObjectParserProp<P[L]> { |
| 170 | // Figure out which argument is used for what purpose |