Socket
Socket
Sign inDemoInstall

the-math

Package Overview
Dependencies
0
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.4.0 to 1.4.1

2

dist/chain/index.d.ts

@@ -12,3 +12,3 @@ export interface IRoundOptions {

type?: 'floor' | 'ceil' | 'round';
decimal?: number;
precision?: number;
}

@@ -15,0 +15,0 @@ export interface IChainOptions {

@@ -51,3 +51,3 @@ "use strict";

roundType: ((_a = options === null || options === void 0 ? void 0 : options.round) === null || _a === void 0 ? void 0 : _a.type) || ((_b = globalOptions.round) === null || _b === void 0 ? void 0 : _b.type),
decimal: ((_c = options === null || options === void 0 ? void 0 : options.round) === null || _c === void 0 ? void 0 : _c.decimal) || ((_d = globalOptions.round) === null || _d === void 0 ? void 0 : _d.decimal)
precision: ((_c = options === null || options === void 0 ? void 0 : options.round) === null || _c === void 0 ? void 0 : _c.precision) || ((_d = globalOptions.round) === null || _d === void 0 ? void 0 : _d.precision)
};

@@ -54,0 +54,0 @@ }

export default function round(operation: {
number: number;
}, { decimal, roundType }: {
decimal?: number;
}, { precision, roundType }: {
precision?: number;
roundType?: 'floor' | 'ceil' | 'round';
}): void;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function round(operation, _a) {
var _b = _a.decimal, decimal = _b === void 0 ? 0 : _b, _c = _a.roundType, roundType = _c === void 0 ? 'round' : _c;
var _b = _a.precision, precision = _b === void 0 ? 0 : _b, _c = _a.roundType, roundType = _c === void 0 ? 'round' : _c;
if (roundType === 'floor') {
operation.number =
Math.floor(operation.number * Math.pow(10, decimal)) / Math.pow(10, decimal);
Math.floor(operation.number * Math.pow(10, precision)) / Math.pow(10, precision);
}
if (roundType === 'ceil') {
operation.number =
Math.ceil(operation.number * Math.pow(10, decimal)) / Math.pow(10, decimal);
Math.ceil(operation.number * Math.pow(10, precision)) / Math.pow(10, precision);
}
if (roundType === 'round') {
operation.number =
Math.round(operation.number * Math.pow(10, decimal)) / Math.pow(10, decimal);
Math.round(operation.number * Math.pow(10, precision)) / Math.pow(10, precision);
}
}
exports.default = round;
{
"name": "the-math",
"version": "1.4.0",
"version": "1.4.1",
"description": "Core of TheMath Calculator",

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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc