1.1.0 • Published 4 years ago

mortgage-utils v1.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

@fullbeaker/mortgage-utils

This package houses mortgage specific utility functions that can be used in any mortgage related project/package.

Functions

parseDailyRatesTag

This function parses a string with a {{ rate() }} tag. It fetches the daily rates from Mortech and replaces the rate tag with todays rates. This function is asyncronous, and projects using this function must have axios^0.21.1 installed.

const result = await parseDailyRatesTag(
  'Todays rates are {{ rate(VA,30,low) }}',
)
result.parsedText // 'Todays rates are 2.25% (2.42% APR)'
result.rate // 2.25

getPlaceholdersForRatesTag

Replaces a rate tag in a string with a span element with class 'tag-placeholder'

getPlaceholderForRatesTag('Rates as low as {{ rate(VA,30) }}')
// Rates as low as <span class='tag-placeholder'></span>% (<span class='tag-placeholder'></span>% APR)
1.1.0

4 years ago