Socket
Socket
Sign inDemoInstall

broleto

Package Overview
Dependencies
0
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.7 to 0.0.8

6

dist/Boleto/index.d.ts

@@ -46,3 +46,3 @@ export declare class Boleto {

*/
expiredDays(): number;
expiredDays(): number | boolean;
/**

@@ -71,3 +71,3 @@ * Retorna o nome do banco

*/
interest(interestValue: number, expiredDays?: number | boolean, percent?: boolean, month?: boolean): number;
interest(interestValue: number, expiredDays: number, percent?: boolean, month?: boolean): number;
/**

@@ -98,3 +98,3 @@ * Calcula e retorna a multa do boleto

expired: boolean;
expiredDays: number;
expiredDays: number | boolean;
banks: string;

@@ -101,0 +101,0 @@ amount: number;

@@ -38,3 +38,4 @@ var currencyFormatter = function (value) {

var days = Math.ceil(diff / (1000 * 60 * 60 * 24));
return days;
var isPast = now.getTime() > past.getTime();
return [days, isPast];
};

@@ -329,3 +330,4 @@

return false;
return differenceForNow(expirationDate) > 0;
var _a = differenceForNow(expirationDate), days = _a[0], past = _a[1];
return Boolean(days > 0 && past);
};

@@ -340,3 +342,4 @@ /**

var expirationDate = this.expirationDate();
return this.expired() ? differenceForNow(expirationDate) : 0;
var days = differenceForNow(expirationDate)[0];
return this.expired() ? days : 0;
};

@@ -377,3 +380,2 @@ /**

Boleto.prototype.interest = function (interestValue, expiredDays, percent, month) {
if (expiredDays === void 0) { expiredDays = false; }
if (percent === void 0) { percent = true; }

@@ -384,4 +386,5 @@ if (month === void 0) { month = true; }

var expirationDate = this.expirationDate();
var days = (expiredDays === false) || (expiredDays === true)
? differenceForNow(expirationDate)
var daysDiff = differenceForNow(expirationDate)[0];
var days = typeof expiredDays !== 'number' && typeof daysDiff === 'number'
? daysDiff
: expiredDays;

@@ -388,0 +391,0 @@ return interstCalc(valueBoleto, days, interestValue, type, percent, month);

@@ -42,3 +42,4 @@ 'use strict';

var days = Math.ceil(diff / (1000 * 60 * 60 * 24));
return days;
var isPast = now.getTime() > past.getTime();
return [days, isPast];
};

@@ -333,3 +334,4 @@

return false;
return differenceForNow(expirationDate) > 0;
var _a = differenceForNow(expirationDate), days = _a[0], past = _a[1];
return Boolean(days > 0 && past);
};

@@ -344,3 +346,4 @@ /**

var expirationDate = this.expirationDate();
return this.expired() ? differenceForNow(expirationDate) : 0;
var days = differenceForNow(expirationDate)[0];
return this.expired() ? days : 0;
};

@@ -381,3 +384,2 @@ /**

Boleto.prototype.interest = function (interestValue, expiredDays, percent, month) {
if (expiredDays === void 0) { expiredDays = false; }
if (percent === void 0) { percent = true; }

@@ -388,4 +390,5 @@ if (month === void 0) { month = true; }

var expirationDate = this.expirationDate();
var days = (expiredDays === false) || (expiredDays === true)
? differenceForNow(expirationDate)
var daysDiff = differenceForNow(expirationDate)[0];
var days = typeof expiredDays !== 'number' && typeof daysDiff === 'number'
? daysDiff
: expiredDays;

@@ -392,0 +395,0 @@ return interstCalc(valueBoleto, days, interestValue, type, percent, month);

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

export declare const differenceForNow: (date: Date) => number;
export declare const differenceForNow: (date: Date) => (number | boolean)[];
{
"name": "broleto",
"version": "0.0.7",
"version": "0.0.8",
"description": "Valide e/ou obtenha dados de boletos bancário ou arrecadação de forma fácil.",

@@ -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