si-funciona 2.3.1 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -23,6 +23,7 @@ const simplestRatio = function () {
|
|
|
23
23
|
let commonDivisor = numbers.reduce((num1, num2) => (0, _greatestCommonDivisor.default)(num1, num2), 0)
|
|
24
24
|
// Set to positive so that when we divide the numbers they retain their +/-
|
|
25
25
|
commonDivisor = Math.abs(commonDivisor)
|
|
26
|
-
|
|
26
|
+
// Simplify the numbers, handle zero
|
|
27
|
+
return numbers.map(num => commonDivisor === 0 ? 0 : num / commonDivisor)
|
|
27
28
|
}
|
|
28
29
|
var _default = exports.default = simplestRatio
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0,require("core-js/stable");var _greatestCommonDivisor=_interopRequireDefault(require("./greatestCommonDivisor"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const simplestRatio=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(0===t.length)return[];let o=t.reduce(((e,t)=>(0,_greatestCommonDivisor.default)(e,t)),0);return o=Math.abs(o),t.map((e=>e/o))};var _default=exports.default=simplestRatio;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0,require("core-js/stable");var _greatestCommonDivisor=_interopRequireDefault(require("./greatestCommonDivisor"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const simplestRatio=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(0===t.length)return[];let o=t.reduce(((e,t)=>(0,_greatestCommonDivisor.default)(e,t)),0);return o=Math.abs(o),t.map((e=>0===o?0:e/o))};var _default=exports.default=simplestRatio;
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"general",
|
|
14
14
|
"typescript"
|
|
15
15
|
],
|
|
16
|
-
"version": "2.3.
|
|
16
|
+
"version": "2.3.2",
|
|
17
17
|
"license": "GPL-3.0-or-later",
|
|
18
18
|
"bugs": {
|
|
19
19
|
"url": "https://github.com/jheagle/si-funciona/issues"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"watch:test": "gulp watchTest"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"npm": "^12.0.
|
|
33
|
+
"npm": "^12.0.2"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"collect-your-stuff": "^1.2.6",
|