Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Units do not seem to be parsed properly #16

Closed
filmaj opened this issue Nov 14, 2018 · 1 comment
Closed

Units do not seem to be parsed properly #16

filmaj opened this issue Nov 14, 2018 · 1 comment

Comments

@filmaj
Copy link

filmaj commented Nov 14, 2018

Version of package: 1.5.6
Node version: 10.9.0

➜ node
> parse=require('recipe-ingredient-parser').parse
[Function: parse]
> parse('- ½ cup coconut flour')
{ quantity: '0.5',
  unit: null,
  ingredient: '-  cup coconut flour' }
> parse('- 1 ½ teaspoon vanilla extract')
{ quantity: '1.5',
  unit: null,
  ingredient: '- 1  teaspoon vanilla extract' }

Expected behaviour: "cup" and "teaspoon" should be parsed as units.

Actual behaviour: unit seems to end up under ingredient, unit is null

@filmaj
Copy link
Author

filmaj commented Nov 18, 2018

I was able to work around this by removing the leading slash - that seems to mess things up.

@filmaj filmaj closed this as completed Nov 18, 2018
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

No branches or pull requests

1 participant