npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@jonstuebe/allot-utils

v0.1.10

Published

Util functions for Allot

Downloads

9

Readme

@jonstuebe/allot-utils

Util functions for Allot

Install

yarn add @jonstuebe/allot-utils date-fns date-fns-holiday-us

or with npm:

npm i @jonstuebe/allot-utils date-fns date-fns-holiday-us

API

Interfaces

Type aliases

Functions

Type aliases

Bills

Ƭ Bills: Bill[]

Defined in types.ts:16


DayOfMonthIndex

Ƭ DayOfMonthIndex: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30

Defined in types.ts:18


DayOfWeekIndex

Ƭ DayOfWeekIndex: 0 | 1 | 2 | 3 | 4 | 5 | 6

Defined in types.ts:17


MonthIndex

Ƭ MonthIndex: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11

Defined in types.ts:50


PayPeriods

Ƭ PayPeriods: PayPeriod[]

Defined in types.ts:1


Paychecks

Ƭ Paychecks: Paycheck[]

Defined in types.ts:9


YearIndexes

Ƭ YearIndexes: [MonthIndex, DayOfMonthIndex]

Defined in types.ts:51

Functions

addFutureBillDates

addFutureBillDates(bill: Bill, numDates: number): object

Defined in bill.ts:68

Parameters:

Name | Type | Default | ------ | ------ | ------ | bill | Bill | - | numDates | number | 3 |

Returns: object

  • dueDates: Date[] = getFutureBillDates(bill, numDates)

chunk

chunk(array: Array‹any›, size: number): Array‹any›

Defined in utils.ts:10

Parameters:

Name | Type | ------ | ------ | array | Array‹any› | size | number |

Returns: Array‹any›


createBill

createBill(bill: InitialBill): object

Defined in bill.ts:96

Parameters:

Name | Type | ------ | ------ | bill | InitialBill |

Returns: object

  • dueDates: never[] = []

createPaycheck

createPaycheck(paycheck: Paycheck): Paycheck

Defined in paycheck.ts:3

Parameters:

Name | Type | ------ | ------ | paycheck | Paycheck |

Returns: Paycheck


firstDayOfMonth

firstDayOfMonth(date: Date): Date

Defined in payday.ts:13

Parameters:

Name | Type | ------ | ------ | date | Date |

Returns: Date


formatCurrency

formatCurrency(amount: number, country: string, currency: string): string

Defined in utils.ts:47

Parameters:

Name | Type | Default | ------ | ------ | ------ | amount | number | - | country | string | "en-US" | currency | string | "USD" |

Returns: string


formatPayPeriodDate

formatPayPeriodDate(__namedParameters: object, formatType: string): string

Defined in payPeriod.ts:68

Parameters:

__namedParameters: object

Name | Type | ------ | ------ | end | Date | start | Date |

Default value formatType: string= "MMM do y"

Returns: string


getBillAmountForPayPeriod

getBillAmountForPayPeriod(bill: Bill, payPeriod: PayPeriod): number

Defined in bill.ts:75

Parameters:

Name | Type | ------ | ------ | bill | Bill | payPeriod | PayPeriod |

Returns: number


getBillDatesForPayPeriod

getBillDatesForPayPeriod(__namedParameters: object, __namedParameters: object): Date[]

Defined in bill.ts:84

Parameters:

__namedParameters: object

Name | Type | ------ | ------ | dueDates | Date[] |

__namedParameters: object

Name | Type | ------ | ------ | end | Date | start | Date |

Returns: Date[]


getFutureBillDates

getFutureBillDates(__namedParameters: object, numDates: number): Date[]

Defined in bill.ts:21

Parameters:

__namedParameters: object

Name | Type | ------ | ------ | due | object | startOn | Date |

Default value numDates: number= 3

Returns: Date[]


getPayPeriods

getPayPeriods(paydays: Date[]): PayPeriod[]

Defined in payPeriod.ts:54

Parameters:

Name | Type | ------ | ------ | paydays | Date[] |

Returns: PayPeriod[]


getPaydays

getPaydays(type: "weekly" | "bi_weekly" | "semi_monthly" | "monthly", startOn: Date, numPaydays: number, opts?: undefined | object): Array‹Date›

Defined in payday.ts:53

Parameters:

Name | Type | Default | ------ | ------ | ------ | type | "weekly" | "bi_weekly" | "semi_monthly" | "monthly" | - | startOn | Date | - | numPaydays | number | 12 | opts? | undefined | object | - |

Returns: Array‹Date›


getSemiMonthlyForDate

getSemiMonthlyForDate(date: Date): Date[]

Defined in payday.ts:17

Parameters:

Name | Type | ------ | ------ | date | Date |

Returns: Date[]


getSemiMonthlyForMonth

getSemiMonthlyForMonth(date: Date): Date[]

Defined in payday.ts:49

Parameters:

Name | Type | ------ | ------ | date | Date |

Returns: Date[]


isBetween

isBetween(date: Date, start: Date, end: Date, includeEqual: boolean): Boolean

Defined in utils.ts:32

Parameters:

Name | Type | Default | ------ | ------ | ------ | date | Date | - | start | Date | - | end | Date | - | includeEqual | boolean | false |

Returns: Boolean


isBillInPayPeriod

isBillInPayPeriod(bill: Bill, payPeriod: PayPeriod): boolean

Defined in bill.ts:80

Parameters:

Name | Type | ------ | ------ | bill | Bill | payPeriod | PayPeriod |

Returns: boolean


isPaycheckInPayPeriod

isPaycheckInPayPeriod(paycheck: Paycheck, payPeriod: PayPeriod): Boolean

Defined in payPeriod.ts:75

Parameters:

Name | Type | ------ | ------ | paycheck | Paycheck | payPeriod | PayPeriod |

Returns: Boolean


parseISO

parseISO(dateISO: string): Date

Defined in utils.ts:23

Parameters:

Name | Type | ------ | ------ | dateISO | string |

Returns: Date


renderTable

renderTable(payPeriods: PayPeriods): void

Defined in utils.ts:58

Parameters:

Name | Type | ------ | ------ | payPeriods | PayPeriods |

Returns: void


totalBillsInPayPeriod

totalBillsInPayPeriod(payPeriod: PayPeriod): number

Defined in payPeriod.ts:47

Parameters:

Name | Type | ------ | ------ | payPeriod | PayPeriod |

Returns: number


totalIncomeInPayPeriod

totalIncomeInPayPeriod(payPeriod: PayPeriod): number

Defined in payPeriod.ts:40

Parameters:

Name | Type | ------ | ------ | payPeriod | PayPeriod |

Returns: number


validatePayPeriod

validatePayPeriod(payPeriod: PayPeriod, bills: Bills, paychecks: Paychecks): object

Defined in payPeriod.ts:14

Parameters:

Name | Type | ------ | ------ | payPeriod | PayPeriod | bills | Bills | paychecks | Paychecks |

Returns: object

  • bills: Bill[] = bills.filter((bill: Bill) => { return isBillInPayPeriod(bill, payPeriod); })

  • paychecks: Paycheck[] = paychecks.filter((paycheck: Paycheck) => { return isPaycheckInPayPeriod(paycheck, payPeriod); })


validatePayPeriods

validatePayPeriods(payPeriods: PayPeriods, bills: Bills, paychecks: Paychecks): object[]

Defined in payPeriod.ts:30

Parameters:

Name | Type | ------ | ------ | payPeriods | PayPeriods | bills | Bills | paychecks | Paychecks |

Returns: object[]

© 2020 Jon Stuebe