Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ingredient-math

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ingredient-math - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

9

dist/index.js

@@ -1,7 +0,1 @@

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
import { parse } from 'recipe-ingredient-parser';

@@ -30,3 +24,4 @@ import Fraction from 'fraction.js';

return ingredients.reduce(function (acc, ing) {
return _objectSpread({}, acc, _defineProperty({}, acc[ing], convertIngredient(ing)));
acc[ing] = convertIngredient(ing, servingFactor);
return acc;
}, {});

@@ -33,0 +28,0 @@ };

{
"name": "ingredient-math",
"version": "0.0.1",
"version": "0.1.0",
"description": "Library for converting ingredients based on serving size changes",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -18,3 +18,7 @@ # Ingredient Math

> convertIngredient(ingredient, servingsFactor)
// "2 teaspoons sugar"
{
quantity: "2",
unit: "teaspoons"
ingredient: "sugar"
}
```

@@ -30,5 +34,10 @@

> convertIngredient(ingredient, servingsFactor)
// "1 tablespoon sugar"
{
quantity: "3",
unit: "tablespoons"
ingredient: "sugar"
}
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc