Skip to content

Conversation

@TrySound
Copy link
Owner

@TrySound TrySound commented Dec 29, 2024

Here changed default behavior to fail when closing quote is missing.
Optionally loose flag can be enabled to parse even with missing quotes.

tokenizeArgs('command \"arg')
// throws
// Unexpected end of string. Closing quote is missing.

tokenizeArgs('command \"arg', { loose: true })
// ['command', 'arg']

Here added strict option to throw when closing quote is not found.

```js
tokenizeArgs('command \"arg', { strict: true })
// throws
// Unexpected end of string. Closing quote is missing.
```
@TrySound TrySound changed the title Add strict option Tokenize strictly by default Dec 29, 2024
@TrySound TrySound merged commit 27ca46d into main Dec 29, 2024
3 checks passed
@TrySound TrySound deleted the strict branch December 29, 2024 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants