@utilix-tech/sdk 0.20.0 → 0.22.0

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.
@@ -1,2 +1,2 @@
1
- export { BASE_LABELS, BASE_PREFIXES, BYTE_UNITS, COMMON_CURRENCIES, COMMON_LOCALES, COMMON_PERMISSIONS, COMMON_RATIOS, COMMON_SIZES, COMMON_TAX_RATES, COMMON_TIP_PERCENTAGES, COMMON_VIEWPORTS, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, calculateCompoundInterest, calculateLoan, calculateSimpleInterest, calculateTax, calculateTimeValue, calculateTipSplit, compareSemver, convert, convertBytes, convertIp, coverBox, decimalToIp, decimalToIpCidr, describePermissions, fitIntoBox, formatNumber, formatValue, formatVwValue, formatWithSeparator, gcd, ipFromBinary, ipFromDecimal, ipFromHex, ipToBinary, ipToDecimal, ipToDecimalCidr, ipToHex, ipToOctal, isValid, isValidCidr, isValidIp, isValidIpv4, octalToPermissions, parseFileSize, parseInput, parseNumberString, parseSemver, permissionsToChmod, permissionsToOctal, permissionsToSymbolic, ptToPx, pxToAll, pxToViewport, remToPx, satisfiesRange, scaleByHeight, scaleByWidth, sortVersions, splitSubnet, symbolicToPermissions, validateBarcode, validateCardNumber, validateIban, validateIsbn, viewportToPx } from '../chunk-U34B5XPK.js';
1
+ export { BASE_LABELS, BASE_PREFIXES, BYTE_UNITS, COMMON_CURRENCIES, COMMON_LOCALES, COMMON_PERMISSIONS, COMMON_RATIOS, COMMON_SIZES, COMMON_TAX_RATES, COMMON_TIP_PERCENTAGES, COMMON_VIEWPORTS, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, calculateCompoundInterest, calculateLoan, calculatePercentageChange, calculateSimpleInterest, calculateTax, calculateTimeValue, calculateTipSplit, compareSemver, convert, convertAprApy, convertBytes, convertIp, coverBox, decimalToIp, decimalToIpCidr, describePermissions, fitIntoBox, formatNumber, formatValue, formatVwValue, formatWithSeparator, gcd, ipFromBinary, ipFromDecimal, ipFromHex, ipToBinary, ipToDecimal, ipToDecimalCidr, ipToHex, ipToOctal, isValid, isValidCidr, isValidIp, isValidIpv4, octalToPermissions, parseFileSize, parseInput, parseNumberString, parseSemver, permissionsToChmod, permissionsToOctal, permissionsToSymbolic, ptToPx, pxToAll, pxToViewport, remToPx, satisfiesRange, scaleByHeight, scaleByWidth, sortVersions, splitSubnet, symbolicToPermissions, validateBarcode, validateCardNumber, validateIban, validateIsbn, viewportToPx } from '../chunk-TLRSQHMP.js';
2
2
  import '../chunk-MLKGABMK.js';
@@ -21,6 +21,9 @@
21
21
  * - isbn-validator : validateIsbn
22
22
  * - tip-calculator : calculateTipSplit
23
23
  * - simple-interest-calculator : calculateSimpleInterest
24
+ * - present-value-calculator : calculateTimeValue
25
+ * - percentage-change-calculator : calculatePercentageChange
26
+ * - apr-apy-converter : convertAprApy
24
27
  */
25
28
  interface PxConvertResult {
26
29
  px: number;
@@ -429,8 +432,52 @@ interface TimeValueResult {
429
432
  declare function calculateTimeValue(amount: number, annualRatePercent: number, years: number, direction: TimeValueDirection, compoundsPerYear?: number): TimeValueResult | {
430
433
  error: string;
431
434
  };
435
+ type PercentChangeDirection = "increase" | "decrease" | "no change";
436
+ interface PercentageChangeResult {
437
+ oldValue: number;
438
+ newValue: number;
439
+ absoluteChange: number;
440
+ percentChange: number;
441
+ direction: PercentChangeDirection;
442
+ multiplier: number;
443
+ }
444
+ /**
445
+ * Percentage change from oldValue to newValue: ((new - old) / |old|) * 100.
446
+ * `absoluteChange` is the raw difference (new - old) and `multiplier` is
447
+ * new / old (how many times the original the new value is). The original
448
+ * value cannot be zero (division by zero) unless the new value is also zero.
449
+ * Pure arithmetic over user-supplied numbers.
450
+ */
451
+ declare function calculatePercentageChange(oldValue: number, newValue: number): PercentageChangeResult | {
452
+ error: string;
453
+ };
454
+ type AprApyDirection = "apr-to-apy" | "apy-to-apr";
455
+ interface AprApyResult {
456
+ direction: AprApyDirection;
457
+ compoundsPerYear: number;
458
+ apr: number;
459
+ apy: number;
460
+ aprDecimal: number;
461
+ apyDecimal: number;
462
+ difference: number;
463
+ }
464
+ /**
465
+ * Convert between a nominal annual rate (APR) and the effective annual yield
466
+ * (APY) for a given compounding frequency. With direction "apr-to-apy" the
467
+ * input rate is treated as the nominal APR and the effective APY is computed
468
+ * as (1 + apr/n)^n - 1; with "apy-to-apr" the input is the effective APY and
469
+ * the nominal APR is recovered as n * ((1 + apy)^(1/n) - 1). Both rates are
470
+ * percentages, `difference` is apy - apr in percentage points, and n is the
471
+ * number of compounding periods per year. Pure closed-form formula, no live
472
+ * rate feed.
473
+ */
474
+ declare function convertAprApy(rate: number, compoundsPerYear: number, direction: AprApyDirection): AprApyResult | {
475
+ error: string;
476
+ };
432
477
 
433
478
  type units_AmortizationRow = AmortizationRow;
479
+ type units_AprApyDirection = AprApyDirection;
480
+ type units_AprApyResult = AprApyResult;
434
481
  type units_AspectRatioResult = AspectRatioResult;
435
482
  declare const units_BASE_LABELS: typeof BASE_LABELS;
436
483
  declare const units_BASE_PREFIXES: typeof BASE_PREFIXES;
@@ -461,6 +508,8 @@ type units_IsbnResult = IsbnResult;
461
508
  type units_LoanResult = LoanResult;
462
509
  type units_NotationStyle = NotationStyle;
463
510
  type units_NumberBase = NumberBase;
511
+ type units_PercentChangeDirection = PercentChangeDirection;
512
+ type units_PercentageChangeResult = PercentageChangeResult;
464
513
  type units_Permission = Permission;
465
514
  type units_PxConvertResult = PxConvertResult;
466
515
  type units_SemverVersion = SemverVersion;
@@ -478,12 +527,14 @@ declare const units_calcAspectRatio: typeof calcAspectRatio;
478
527
  declare const units_calcSubnet: typeof calcSubnet;
479
528
  declare const units_calculateCompoundInterest: typeof calculateCompoundInterest;
480
529
  declare const units_calculateLoan: typeof calculateLoan;
530
+ declare const units_calculatePercentageChange: typeof calculatePercentageChange;
481
531
  declare const units_calculateSimpleInterest: typeof calculateSimpleInterest;
482
532
  declare const units_calculateTax: typeof calculateTax;
483
533
  declare const units_calculateTimeValue: typeof calculateTimeValue;
484
534
  declare const units_calculateTipSplit: typeof calculateTipSplit;
485
535
  declare const units_compareSemver: typeof compareSemver;
486
536
  declare const units_convert: typeof convert;
537
+ declare const units_convertAprApy: typeof convertAprApy;
487
538
  declare const units_convertBytes: typeof convertBytes;
488
539
  declare const units_convertIp: typeof convertIp;
489
540
  declare const units_coverBox: typeof coverBox;
@@ -532,7 +583,7 @@ declare const units_validateIban: typeof validateIban;
532
583
  declare const units_validateIsbn: typeof validateIsbn;
533
584
  declare const units_viewportToPx: typeof viewportToPx;
534
585
  declare namespace units {
535
- export { type units_AmortizationRow as AmortizationRow, type units_AspectRatioResult as AspectRatioResult, units_BASE_LABELS as BASE_LABELS, units_BASE_PREFIXES as BASE_PREFIXES, units_BYTE_UNITS as BYTE_UNITS, type units_BarcodeFormat as BarcodeFormat, type units_BarcodeValidationResult as BarcodeValidationResult, type units_BaseConvertResult as BaseConvertResult, type units_ByteConvertResult as ByteConvertResult, type units_ByteUnit as ByteUnit, units_COMMON_CURRENCIES as COMMON_CURRENCIES, units_COMMON_LOCALES as COMMON_LOCALES, units_COMMON_PERMISSIONS as COMMON_PERMISSIONS, units_COMMON_RATIOS as COMMON_RATIOS, units_COMMON_SIZES as COMMON_SIZES, units_COMMON_TAX_RATES as COMMON_TAX_RATES, units_COMMON_TIP_PERCENTAGES as COMMON_TIP_PERCENTAGES, units_COMMON_VIEWPORTS as COMMON_VIEWPORTS, type units_CardValidationResult as CardValidationResult, type units_CompoundInterestResult as CompoundInterestResult, type units_CompoundYearRow as CompoundYearRow, type units_Dimensions as Dimensions, type units_FilePermissions as FilePermissions, type units_FormatOptions as FormatOptions, type units_IbanValidationResult as IbanValidationResult, type units_IpConversion as IpConversion, type units_IsbnFormat as IsbnFormat, type units_IsbnResult as IsbnResult, type units_LoanResult as LoanResult, type units_NotationStyle as NotationStyle, type units_NumberBase as NumberBase, type units_Permission as Permission, type units_PxConvertResult as PxConvertResult, type units_SemverVersion as SemverVersion, type units_SimpleInterestResult as SimpleInterestResult, type units_SubnetInfo as SubnetInfo, type units_TaxDirection as TaxDirection, type units_TaxResult as TaxResult, type units_TimeValueDirection as TimeValueDirection, type units_TimeValueResult as TimeValueResult, type units_TipSplitResult as TipSplitResult, type units_ViewportConvertResult as ViewportConvertResult, units_autoFormat as autoFormat, units_bumpVersion as bumpVersion, units_calcAspectRatio as calcAspectRatio, units_calcSubnet as calcSubnet, units_calculateCompoundInterest as calculateCompoundInterest, units_calculateLoan as calculateLoan, units_calculateSimpleInterest as calculateSimpleInterest, units_calculateTax as calculateTax, units_calculateTimeValue as calculateTimeValue, units_calculateTipSplit as calculateTipSplit, units_compareSemver as compareSemver, units_convert as convert, units_convertBytes as convertBytes, units_convertIp as convertIp, units_coverBox as coverBox, units_decimalToIp as decimalToIp, units_decimalToIpCidr as decimalToIpCidr, units_describePermissions as describePermissions, units_fitIntoBox as fitIntoBox, units_formatNumber as formatNumber, units_formatValue as formatValue, units_formatVwValue as formatVwValue, units_formatWithSeparator as formatWithSeparator, units_gcd as gcd, units_ipFromBinary as ipFromBinary, units_ipFromDecimal as ipFromDecimal, units_ipFromHex as ipFromHex, units_ipToBinary as ipToBinary, units_ipToDecimal as ipToDecimal, units_ipToDecimalCidr as ipToDecimalCidr, units_ipToHex as ipToHex, units_ipToOctal as ipToOctal, units_isValid as isValid, units_isValidCidr as isValidCidr, units_isValidIp as isValidIp, units_isValidIpv4 as isValidIpv4, units_octalToPermissions as octalToPermissions, units_parseFileSize as parseFileSize, units_parseInput as parseInput, units_parseNumberString as parseNumberString, units_parseSemver as parseSemver, units_permissionsToChmod as permissionsToChmod, units_permissionsToOctal as permissionsToOctal, units_permissionsToSymbolic as permissionsToSymbolic, units_ptToPx as ptToPx, units_pxToAll as pxToAll, units_pxToViewport as pxToViewport, units_remToPx as remToPx, units_satisfiesRange as satisfiesRange, units_scaleByHeight as scaleByHeight, units_scaleByWidth as scaleByWidth, units_sortVersions as sortVersions, units_splitSubnet as splitSubnet, units_symbolicToPermissions as symbolicToPermissions, units_validateBarcode as validateBarcode, units_validateCardNumber as validateCardNumber, units_validateIban as validateIban, units_validateIsbn as validateIsbn, units_viewportToPx as viewportToPx };
586
+ export { type units_AmortizationRow as AmortizationRow, type units_AprApyDirection as AprApyDirection, type units_AprApyResult as AprApyResult, type units_AspectRatioResult as AspectRatioResult, units_BASE_LABELS as BASE_LABELS, units_BASE_PREFIXES as BASE_PREFIXES, units_BYTE_UNITS as BYTE_UNITS, type units_BarcodeFormat as BarcodeFormat, type units_BarcodeValidationResult as BarcodeValidationResult, type units_BaseConvertResult as BaseConvertResult, type units_ByteConvertResult as ByteConvertResult, type units_ByteUnit as ByteUnit, units_COMMON_CURRENCIES as COMMON_CURRENCIES, units_COMMON_LOCALES as COMMON_LOCALES, units_COMMON_PERMISSIONS as COMMON_PERMISSIONS, units_COMMON_RATIOS as COMMON_RATIOS, units_COMMON_SIZES as COMMON_SIZES, units_COMMON_TAX_RATES as COMMON_TAX_RATES, units_COMMON_TIP_PERCENTAGES as COMMON_TIP_PERCENTAGES, units_COMMON_VIEWPORTS as COMMON_VIEWPORTS, type units_CardValidationResult as CardValidationResult, type units_CompoundInterestResult as CompoundInterestResult, type units_CompoundYearRow as CompoundYearRow, type units_Dimensions as Dimensions, type units_FilePermissions as FilePermissions, type units_FormatOptions as FormatOptions, type units_IbanValidationResult as IbanValidationResult, type units_IpConversion as IpConversion, type units_IsbnFormat as IsbnFormat, type units_IsbnResult as IsbnResult, type units_LoanResult as LoanResult, type units_NotationStyle as NotationStyle, type units_NumberBase as NumberBase, type units_PercentChangeDirection as PercentChangeDirection, type units_PercentageChangeResult as PercentageChangeResult, type units_Permission as Permission, type units_PxConvertResult as PxConvertResult, type units_SemverVersion as SemverVersion, type units_SimpleInterestResult as SimpleInterestResult, type units_SubnetInfo as SubnetInfo, type units_TaxDirection as TaxDirection, type units_TaxResult as TaxResult, type units_TimeValueDirection as TimeValueDirection, type units_TimeValueResult as TimeValueResult, type units_TipSplitResult as TipSplitResult, type units_ViewportConvertResult as ViewportConvertResult, units_autoFormat as autoFormat, units_bumpVersion as bumpVersion, units_calcAspectRatio as calcAspectRatio, units_calcSubnet as calcSubnet, units_calculateCompoundInterest as calculateCompoundInterest, units_calculateLoan as calculateLoan, units_calculatePercentageChange as calculatePercentageChange, units_calculateSimpleInterest as calculateSimpleInterest, units_calculateTax as calculateTax, units_calculateTimeValue as calculateTimeValue, units_calculateTipSplit as calculateTipSplit, units_compareSemver as compareSemver, units_convert as convert, units_convertAprApy as convertAprApy, units_convertBytes as convertBytes, units_convertIp as convertIp, units_coverBox as coverBox, units_decimalToIp as decimalToIp, units_decimalToIpCidr as decimalToIpCidr, units_describePermissions as describePermissions, units_fitIntoBox as fitIntoBox, units_formatNumber as formatNumber, units_formatValue as formatValue, units_formatVwValue as formatVwValue, units_formatWithSeparator as formatWithSeparator, units_gcd as gcd, units_ipFromBinary as ipFromBinary, units_ipFromDecimal as ipFromDecimal, units_ipFromHex as ipFromHex, units_ipToBinary as ipToBinary, units_ipToDecimal as ipToDecimal, units_ipToDecimalCidr as ipToDecimalCidr, units_ipToHex as ipToHex, units_ipToOctal as ipToOctal, units_isValid as isValid, units_isValidCidr as isValidCidr, units_isValidIp as isValidIp, units_isValidIpv4 as isValidIpv4, units_octalToPermissions as octalToPermissions, units_parseFileSize as parseFileSize, units_parseInput as parseInput, units_parseNumberString as parseNumberString, units_parseSemver as parseSemver, units_permissionsToChmod as permissionsToChmod, units_permissionsToOctal as permissionsToOctal, units_permissionsToSymbolic as permissionsToSymbolic, units_ptToPx as ptToPx, units_pxToAll as pxToAll, units_pxToViewport as pxToViewport, units_remToPx as remToPx, units_satisfiesRange as satisfiesRange, units_scaleByHeight as scaleByHeight, units_scaleByWidth as scaleByWidth, units_sortVersions as sortVersions, units_splitSubnet as splitSubnet, units_symbolicToPermissions as symbolicToPermissions, units_validateBarcode as validateBarcode, units_validateCardNumber as validateCardNumber, units_validateIban as validateIban, units_validateIsbn as validateIsbn, units_viewportToPx as viewportToPx };
536
587
  }
537
588
 
538
- export { compareSemver as $, type AmortizationRow as A, BASE_LABELS as B, COMMON_CURRENCIES as C, type Dimensions as D, type SubnetInfo as E, type FilePermissions as F, type TaxResult as G, type TimeValueDirection as H, type IbanValidationResult as I, type TimeValueResult as J, type TipSplitResult as K, type LoanResult as L, autoFormat as M, type NotationStyle as N, bumpVersion as O, type Permission as P, calcAspectRatio as Q, calcSubnet as R, type SemverVersion as S, type TaxDirection as T, calculateCompoundInterest as U, type ViewportConvertResult as V, calculateLoan as W, calculateSimpleInterest as X, calculateTax as Y, calculateTimeValue as Z, calculateTipSplit as _, type AspectRatioResult as a, convert as a0, convertBytes as a1, convertIp as a2, coverBox as a3, decimalToIp as a4, decimalToIpCidr as a5, describePermissions as a6, fitIntoBox as a7, formatNumber as a8, formatValue as a9, remToPx as aA, satisfiesRange as aB, scaleByHeight as aC, scaleByWidth as aD, sortVersions as aE, splitSubnet as aF, symbolicToPermissions as aG, validateBarcode as aH, validateCardNumber as aI, validateIban as aJ, validateIsbn as aK, viewportToPx as aL, formatVwValue as aa, formatWithSeparator as ab, gcd as ac, ipFromBinary as ad, ipFromDecimal as ae, ipFromHex as af, ipToBinary as ag, ipToDecimal as ah, ipToDecimalCidr as ai, ipToHex as aj, ipToOctal as ak, isValid as al, isValidCidr as am, isValidIp as an, isValidIpv4 as ao, octalToPermissions as ap, parseFileSize as aq, parseInput as ar, parseNumberString as as, parseSemver as at, permissionsToChmod as au, permissionsToOctal as av, permissionsToSymbolic as aw, ptToPx as ax, pxToAll as ay, pxToViewport as az, BASE_PREFIXES as b, BYTE_UNITS as c, type BarcodeFormat as d, type BarcodeValidationResult as e, type BaseConvertResult as f, type ByteConvertResult as g, type ByteUnit as h, COMMON_LOCALES as i, COMMON_PERMISSIONS as j, COMMON_RATIOS as k, COMMON_SIZES as l, COMMON_TAX_RATES as m, COMMON_TIP_PERCENTAGES as n, COMMON_VIEWPORTS as o, type CardValidationResult as p, type CompoundInterestResult as q, type CompoundYearRow as r, type FormatOptions as s, type IpConversion as t, units as u, type IsbnFormat as v, type IsbnResult as w, type NumberBase as x, type PxConvertResult as y, type SimpleInterestResult as z };
589
+ export { calculatePercentageChange as $, type AmortizationRow as A, BASE_LABELS as B, COMMON_CURRENCIES as C, type Dimensions as D, type PercentageChangeResult as E, type FilePermissions as F, type Permission as G, type PxConvertResult as H, type IbanValidationResult as I, type SimpleInterestResult as J, type SubnetInfo as K, type LoanResult as L, type TaxResult as M, type NotationStyle as N, type TimeValueDirection as O, type PercentChangeDirection as P, type TimeValueResult as Q, type TipSplitResult as R, type SemverVersion as S, type TaxDirection as T, autoFormat as U, type ViewportConvertResult as V, bumpVersion as W, calcAspectRatio as X, calcSubnet as Y, calculateCompoundInterest as Z, calculateLoan as _, type AprApyDirection as a, calculateSimpleInterest as a0, calculateTax as a1, calculateTimeValue as a2, calculateTipSplit as a3, compareSemver as a4, convert as a5, convertAprApy as a6, convertBytes as a7, convertIp as a8, coverBox as a9, permissionsToChmod as aA, permissionsToOctal as aB, permissionsToSymbolic as aC, ptToPx as aD, pxToAll as aE, pxToViewport as aF, remToPx as aG, satisfiesRange as aH, scaleByHeight as aI, scaleByWidth as aJ, sortVersions as aK, splitSubnet as aL, symbolicToPermissions as aM, validateBarcode as aN, validateCardNumber as aO, validateIban as aP, validateIsbn as aQ, viewportToPx as aR, decimalToIp as aa, decimalToIpCidr as ab, describePermissions as ac, fitIntoBox as ad, formatNumber as ae, formatValue as af, formatVwValue as ag, formatWithSeparator as ah, gcd as ai, ipFromBinary as aj, ipFromDecimal as ak, ipFromHex as al, ipToBinary as am, ipToDecimal as an, ipToDecimalCidr as ao, ipToHex as ap, ipToOctal as aq, isValid as ar, isValidCidr as as, isValidIp as at, isValidIpv4 as au, octalToPermissions as av, parseFileSize as aw, parseInput as ax, parseNumberString as ay, parseSemver as az, type AprApyResult as b, type AspectRatioResult as c, BASE_PREFIXES as d, BYTE_UNITS as e, type BarcodeFormat as f, type BarcodeValidationResult as g, type BaseConvertResult as h, type ByteConvertResult as i, type ByteUnit as j, COMMON_LOCALES as k, COMMON_PERMISSIONS as l, COMMON_RATIOS as m, COMMON_SIZES as n, COMMON_TAX_RATES as o, COMMON_TIP_PERCENTAGES as p, COMMON_VIEWPORTS as q, type CardValidationResult as r, type CompoundInterestResult as s, type CompoundYearRow as t, units as u, type FormatOptions as v, type IpConversion as w, type IsbnFormat as x, type IsbnResult as y, type NumberBase as z };
@@ -21,6 +21,9 @@
21
21
  * - isbn-validator : validateIsbn
22
22
  * - tip-calculator : calculateTipSplit
23
23
  * - simple-interest-calculator : calculateSimpleInterest
24
+ * - present-value-calculator : calculateTimeValue
25
+ * - percentage-change-calculator : calculatePercentageChange
26
+ * - apr-apy-converter : convertAprApy
24
27
  */
25
28
  interface PxConvertResult {
26
29
  px: number;
@@ -429,8 +432,52 @@ interface TimeValueResult {
429
432
  declare function calculateTimeValue(amount: number, annualRatePercent: number, years: number, direction: TimeValueDirection, compoundsPerYear?: number): TimeValueResult | {
430
433
  error: string;
431
434
  };
435
+ type PercentChangeDirection = "increase" | "decrease" | "no change";
436
+ interface PercentageChangeResult {
437
+ oldValue: number;
438
+ newValue: number;
439
+ absoluteChange: number;
440
+ percentChange: number;
441
+ direction: PercentChangeDirection;
442
+ multiplier: number;
443
+ }
444
+ /**
445
+ * Percentage change from oldValue to newValue: ((new - old) / |old|) * 100.
446
+ * `absoluteChange` is the raw difference (new - old) and `multiplier` is
447
+ * new / old (how many times the original the new value is). The original
448
+ * value cannot be zero (division by zero) unless the new value is also zero.
449
+ * Pure arithmetic over user-supplied numbers.
450
+ */
451
+ declare function calculatePercentageChange(oldValue: number, newValue: number): PercentageChangeResult | {
452
+ error: string;
453
+ };
454
+ type AprApyDirection = "apr-to-apy" | "apy-to-apr";
455
+ interface AprApyResult {
456
+ direction: AprApyDirection;
457
+ compoundsPerYear: number;
458
+ apr: number;
459
+ apy: number;
460
+ aprDecimal: number;
461
+ apyDecimal: number;
462
+ difference: number;
463
+ }
464
+ /**
465
+ * Convert between a nominal annual rate (APR) and the effective annual yield
466
+ * (APY) for a given compounding frequency. With direction "apr-to-apy" the
467
+ * input rate is treated as the nominal APR and the effective APY is computed
468
+ * as (1 + apr/n)^n - 1; with "apy-to-apr" the input is the effective APY and
469
+ * the nominal APR is recovered as n * ((1 + apy)^(1/n) - 1). Both rates are
470
+ * percentages, `difference` is apy - apr in percentage points, and n is the
471
+ * number of compounding periods per year. Pure closed-form formula, no live
472
+ * rate feed.
473
+ */
474
+ declare function convertAprApy(rate: number, compoundsPerYear: number, direction: AprApyDirection): AprApyResult | {
475
+ error: string;
476
+ };
432
477
 
433
478
  type units_AmortizationRow = AmortizationRow;
479
+ type units_AprApyDirection = AprApyDirection;
480
+ type units_AprApyResult = AprApyResult;
434
481
  type units_AspectRatioResult = AspectRatioResult;
435
482
  declare const units_BASE_LABELS: typeof BASE_LABELS;
436
483
  declare const units_BASE_PREFIXES: typeof BASE_PREFIXES;
@@ -461,6 +508,8 @@ type units_IsbnResult = IsbnResult;
461
508
  type units_LoanResult = LoanResult;
462
509
  type units_NotationStyle = NotationStyle;
463
510
  type units_NumberBase = NumberBase;
511
+ type units_PercentChangeDirection = PercentChangeDirection;
512
+ type units_PercentageChangeResult = PercentageChangeResult;
464
513
  type units_Permission = Permission;
465
514
  type units_PxConvertResult = PxConvertResult;
466
515
  type units_SemverVersion = SemverVersion;
@@ -478,12 +527,14 @@ declare const units_calcAspectRatio: typeof calcAspectRatio;
478
527
  declare const units_calcSubnet: typeof calcSubnet;
479
528
  declare const units_calculateCompoundInterest: typeof calculateCompoundInterest;
480
529
  declare const units_calculateLoan: typeof calculateLoan;
530
+ declare const units_calculatePercentageChange: typeof calculatePercentageChange;
481
531
  declare const units_calculateSimpleInterest: typeof calculateSimpleInterest;
482
532
  declare const units_calculateTax: typeof calculateTax;
483
533
  declare const units_calculateTimeValue: typeof calculateTimeValue;
484
534
  declare const units_calculateTipSplit: typeof calculateTipSplit;
485
535
  declare const units_compareSemver: typeof compareSemver;
486
536
  declare const units_convert: typeof convert;
537
+ declare const units_convertAprApy: typeof convertAprApy;
487
538
  declare const units_convertBytes: typeof convertBytes;
488
539
  declare const units_convertIp: typeof convertIp;
489
540
  declare const units_coverBox: typeof coverBox;
@@ -532,7 +583,7 @@ declare const units_validateIban: typeof validateIban;
532
583
  declare const units_validateIsbn: typeof validateIsbn;
533
584
  declare const units_viewportToPx: typeof viewportToPx;
534
585
  declare namespace units {
535
- export { type units_AmortizationRow as AmortizationRow, type units_AspectRatioResult as AspectRatioResult, units_BASE_LABELS as BASE_LABELS, units_BASE_PREFIXES as BASE_PREFIXES, units_BYTE_UNITS as BYTE_UNITS, type units_BarcodeFormat as BarcodeFormat, type units_BarcodeValidationResult as BarcodeValidationResult, type units_BaseConvertResult as BaseConvertResult, type units_ByteConvertResult as ByteConvertResult, type units_ByteUnit as ByteUnit, units_COMMON_CURRENCIES as COMMON_CURRENCIES, units_COMMON_LOCALES as COMMON_LOCALES, units_COMMON_PERMISSIONS as COMMON_PERMISSIONS, units_COMMON_RATIOS as COMMON_RATIOS, units_COMMON_SIZES as COMMON_SIZES, units_COMMON_TAX_RATES as COMMON_TAX_RATES, units_COMMON_TIP_PERCENTAGES as COMMON_TIP_PERCENTAGES, units_COMMON_VIEWPORTS as COMMON_VIEWPORTS, type units_CardValidationResult as CardValidationResult, type units_CompoundInterestResult as CompoundInterestResult, type units_CompoundYearRow as CompoundYearRow, type units_Dimensions as Dimensions, type units_FilePermissions as FilePermissions, type units_FormatOptions as FormatOptions, type units_IbanValidationResult as IbanValidationResult, type units_IpConversion as IpConversion, type units_IsbnFormat as IsbnFormat, type units_IsbnResult as IsbnResult, type units_LoanResult as LoanResult, type units_NotationStyle as NotationStyle, type units_NumberBase as NumberBase, type units_Permission as Permission, type units_PxConvertResult as PxConvertResult, type units_SemverVersion as SemverVersion, type units_SimpleInterestResult as SimpleInterestResult, type units_SubnetInfo as SubnetInfo, type units_TaxDirection as TaxDirection, type units_TaxResult as TaxResult, type units_TimeValueDirection as TimeValueDirection, type units_TimeValueResult as TimeValueResult, type units_TipSplitResult as TipSplitResult, type units_ViewportConvertResult as ViewportConvertResult, units_autoFormat as autoFormat, units_bumpVersion as bumpVersion, units_calcAspectRatio as calcAspectRatio, units_calcSubnet as calcSubnet, units_calculateCompoundInterest as calculateCompoundInterest, units_calculateLoan as calculateLoan, units_calculateSimpleInterest as calculateSimpleInterest, units_calculateTax as calculateTax, units_calculateTimeValue as calculateTimeValue, units_calculateTipSplit as calculateTipSplit, units_compareSemver as compareSemver, units_convert as convert, units_convertBytes as convertBytes, units_convertIp as convertIp, units_coverBox as coverBox, units_decimalToIp as decimalToIp, units_decimalToIpCidr as decimalToIpCidr, units_describePermissions as describePermissions, units_fitIntoBox as fitIntoBox, units_formatNumber as formatNumber, units_formatValue as formatValue, units_formatVwValue as formatVwValue, units_formatWithSeparator as formatWithSeparator, units_gcd as gcd, units_ipFromBinary as ipFromBinary, units_ipFromDecimal as ipFromDecimal, units_ipFromHex as ipFromHex, units_ipToBinary as ipToBinary, units_ipToDecimal as ipToDecimal, units_ipToDecimalCidr as ipToDecimalCidr, units_ipToHex as ipToHex, units_ipToOctal as ipToOctal, units_isValid as isValid, units_isValidCidr as isValidCidr, units_isValidIp as isValidIp, units_isValidIpv4 as isValidIpv4, units_octalToPermissions as octalToPermissions, units_parseFileSize as parseFileSize, units_parseInput as parseInput, units_parseNumberString as parseNumberString, units_parseSemver as parseSemver, units_permissionsToChmod as permissionsToChmod, units_permissionsToOctal as permissionsToOctal, units_permissionsToSymbolic as permissionsToSymbolic, units_ptToPx as ptToPx, units_pxToAll as pxToAll, units_pxToViewport as pxToViewport, units_remToPx as remToPx, units_satisfiesRange as satisfiesRange, units_scaleByHeight as scaleByHeight, units_scaleByWidth as scaleByWidth, units_sortVersions as sortVersions, units_splitSubnet as splitSubnet, units_symbolicToPermissions as symbolicToPermissions, units_validateBarcode as validateBarcode, units_validateCardNumber as validateCardNumber, units_validateIban as validateIban, units_validateIsbn as validateIsbn, units_viewportToPx as viewportToPx };
586
+ export { type units_AmortizationRow as AmortizationRow, type units_AprApyDirection as AprApyDirection, type units_AprApyResult as AprApyResult, type units_AspectRatioResult as AspectRatioResult, units_BASE_LABELS as BASE_LABELS, units_BASE_PREFIXES as BASE_PREFIXES, units_BYTE_UNITS as BYTE_UNITS, type units_BarcodeFormat as BarcodeFormat, type units_BarcodeValidationResult as BarcodeValidationResult, type units_BaseConvertResult as BaseConvertResult, type units_ByteConvertResult as ByteConvertResult, type units_ByteUnit as ByteUnit, units_COMMON_CURRENCIES as COMMON_CURRENCIES, units_COMMON_LOCALES as COMMON_LOCALES, units_COMMON_PERMISSIONS as COMMON_PERMISSIONS, units_COMMON_RATIOS as COMMON_RATIOS, units_COMMON_SIZES as COMMON_SIZES, units_COMMON_TAX_RATES as COMMON_TAX_RATES, units_COMMON_TIP_PERCENTAGES as COMMON_TIP_PERCENTAGES, units_COMMON_VIEWPORTS as COMMON_VIEWPORTS, type units_CardValidationResult as CardValidationResult, type units_CompoundInterestResult as CompoundInterestResult, type units_CompoundYearRow as CompoundYearRow, type units_Dimensions as Dimensions, type units_FilePermissions as FilePermissions, type units_FormatOptions as FormatOptions, type units_IbanValidationResult as IbanValidationResult, type units_IpConversion as IpConversion, type units_IsbnFormat as IsbnFormat, type units_IsbnResult as IsbnResult, type units_LoanResult as LoanResult, type units_NotationStyle as NotationStyle, type units_NumberBase as NumberBase, type units_PercentChangeDirection as PercentChangeDirection, type units_PercentageChangeResult as PercentageChangeResult, type units_Permission as Permission, type units_PxConvertResult as PxConvertResult, type units_SemverVersion as SemverVersion, type units_SimpleInterestResult as SimpleInterestResult, type units_SubnetInfo as SubnetInfo, type units_TaxDirection as TaxDirection, type units_TaxResult as TaxResult, type units_TimeValueDirection as TimeValueDirection, type units_TimeValueResult as TimeValueResult, type units_TipSplitResult as TipSplitResult, type units_ViewportConvertResult as ViewportConvertResult, units_autoFormat as autoFormat, units_bumpVersion as bumpVersion, units_calcAspectRatio as calcAspectRatio, units_calcSubnet as calcSubnet, units_calculateCompoundInterest as calculateCompoundInterest, units_calculateLoan as calculateLoan, units_calculatePercentageChange as calculatePercentageChange, units_calculateSimpleInterest as calculateSimpleInterest, units_calculateTax as calculateTax, units_calculateTimeValue as calculateTimeValue, units_calculateTipSplit as calculateTipSplit, units_compareSemver as compareSemver, units_convert as convert, units_convertAprApy as convertAprApy, units_convertBytes as convertBytes, units_convertIp as convertIp, units_coverBox as coverBox, units_decimalToIp as decimalToIp, units_decimalToIpCidr as decimalToIpCidr, units_describePermissions as describePermissions, units_fitIntoBox as fitIntoBox, units_formatNumber as formatNumber, units_formatValue as formatValue, units_formatVwValue as formatVwValue, units_formatWithSeparator as formatWithSeparator, units_gcd as gcd, units_ipFromBinary as ipFromBinary, units_ipFromDecimal as ipFromDecimal, units_ipFromHex as ipFromHex, units_ipToBinary as ipToBinary, units_ipToDecimal as ipToDecimal, units_ipToDecimalCidr as ipToDecimalCidr, units_ipToHex as ipToHex, units_ipToOctal as ipToOctal, units_isValid as isValid, units_isValidCidr as isValidCidr, units_isValidIp as isValidIp, units_isValidIpv4 as isValidIpv4, units_octalToPermissions as octalToPermissions, units_parseFileSize as parseFileSize, units_parseInput as parseInput, units_parseNumberString as parseNumberString, units_parseSemver as parseSemver, units_permissionsToChmod as permissionsToChmod, units_permissionsToOctal as permissionsToOctal, units_permissionsToSymbolic as permissionsToSymbolic, units_ptToPx as ptToPx, units_pxToAll as pxToAll, units_pxToViewport as pxToViewport, units_remToPx as remToPx, units_satisfiesRange as satisfiesRange, units_scaleByHeight as scaleByHeight, units_scaleByWidth as scaleByWidth, units_sortVersions as sortVersions, units_splitSubnet as splitSubnet, units_symbolicToPermissions as symbolicToPermissions, units_validateBarcode as validateBarcode, units_validateCardNumber as validateCardNumber, units_validateIban as validateIban, units_validateIsbn as validateIsbn, units_viewportToPx as viewportToPx };
536
587
  }
537
588
 
538
- export { compareSemver as $, type AmortizationRow as A, BASE_LABELS as B, COMMON_CURRENCIES as C, type Dimensions as D, type SubnetInfo as E, type FilePermissions as F, type TaxResult as G, type TimeValueDirection as H, type IbanValidationResult as I, type TimeValueResult as J, type TipSplitResult as K, type LoanResult as L, autoFormat as M, type NotationStyle as N, bumpVersion as O, type Permission as P, calcAspectRatio as Q, calcSubnet as R, type SemverVersion as S, type TaxDirection as T, calculateCompoundInterest as U, type ViewportConvertResult as V, calculateLoan as W, calculateSimpleInterest as X, calculateTax as Y, calculateTimeValue as Z, calculateTipSplit as _, type AspectRatioResult as a, convert as a0, convertBytes as a1, convertIp as a2, coverBox as a3, decimalToIp as a4, decimalToIpCidr as a5, describePermissions as a6, fitIntoBox as a7, formatNumber as a8, formatValue as a9, remToPx as aA, satisfiesRange as aB, scaleByHeight as aC, scaleByWidth as aD, sortVersions as aE, splitSubnet as aF, symbolicToPermissions as aG, validateBarcode as aH, validateCardNumber as aI, validateIban as aJ, validateIsbn as aK, viewportToPx as aL, formatVwValue as aa, formatWithSeparator as ab, gcd as ac, ipFromBinary as ad, ipFromDecimal as ae, ipFromHex as af, ipToBinary as ag, ipToDecimal as ah, ipToDecimalCidr as ai, ipToHex as aj, ipToOctal as ak, isValid as al, isValidCidr as am, isValidIp as an, isValidIpv4 as ao, octalToPermissions as ap, parseFileSize as aq, parseInput as ar, parseNumberString as as, parseSemver as at, permissionsToChmod as au, permissionsToOctal as av, permissionsToSymbolic as aw, ptToPx as ax, pxToAll as ay, pxToViewport as az, BASE_PREFIXES as b, BYTE_UNITS as c, type BarcodeFormat as d, type BarcodeValidationResult as e, type BaseConvertResult as f, type ByteConvertResult as g, type ByteUnit as h, COMMON_LOCALES as i, COMMON_PERMISSIONS as j, COMMON_RATIOS as k, COMMON_SIZES as l, COMMON_TAX_RATES as m, COMMON_TIP_PERCENTAGES as n, COMMON_VIEWPORTS as o, type CardValidationResult as p, type CompoundInterestResult as q, type CompoundYearRow as r, type FormatOptions as s, type IpConversion as t, units as u, type IsbnFormat as v, type IsbnResult as w, type NumberBase as x, type PxConvertResult as y, type SimpleInterestResult as z };
589
+ export { calculatePercentageChange as $, type AmortizationRow as A, BASE_LABELS as B, COMMON_CURRENCIES as C, type Dimensions as D, type PercentageChangeResult as E, type FilePermissions as F, type Permission as G, type PxConvertResult as H, type IbanValidationResult as I, type SimpleInterestResult as J, type SubnetInfo as K, type LoanResult as L, type TaxResult as M, type NotationStyle as N, type TimeValueDirection as O, type PercentChangeDirection as P, type TimeValueResult as Q, type TipSplitResult as R, type SemverVersion as S, type TaxDirection as T, autoFormat as U, type ViewportConvertResult as V, bumpVersion as W, calcAspectRatio as X, calcSubnet as Y, calculateCompoundInterest as Z, calculateLoan as _, type AprApyDirection as a, calculateSimpleInterest as a0, calculateTax as a1, calculateTimeValue as a2, calculateTipSplit as a3, compareSemver as a4, convert as a5, convertAprApy as a6, convertBytes as a7, convertIp as a8, coverBox as a9, permissionsToChmod as aA, permissionsToOctal as aB, permissionsToSymbolic as aC, ptToPx as aD, pxToAll as aE, pxToViewport as aF, remToPx as aG, satisfiesRange as aH, scaleByHeight as aI, scaleByWidth as aJ, sortVersions as aK, splitSubnet as aL, symbolicToPermissions as aM, validateBarcode as aN, validateCardNumber as aO, validateIban as aP, validateIsbn as aQ, viewportToPx as aR, decimalToIp as aa, decimalToIpCidr as ab, describePermissions as ac, fitIntoBox as ad, formatNumber as ae, formatValue as af, formatVwValue as ag, formatWithSeparator as ah, gcd as ai, ipFromBinary as aj, ipFromDecimal as ak, ipFromHex as al, ipToBinary as am, ipToDecimal as an, ipToDecimalCidr as ao, ipToHex as ap, ipToOctal as aq, isValid as ar, isValidCidr as as, isValidIp as at, isValidIpv4 as au, octalToPermissions as av, parseFileSize as aw, parseInput as ax, parseNumberString as ay, parseSemver as az, type AprApyResult as b, type AspectRatioResult as c, BASE_PREFIXES as d, BYTE_UNITS as e, type BarcodeFormat as f, type BarcodeValidationResult as g, type BaseConvertResult as h, type ByteConvertResult as i, type ByteUnit as j, COMMON_LOCALES as k, COMMON_PERMISSIONS as l, COMMON_RATIOS as m, COMMON_SIZES as n, COMMON_TAX_RATES as o, COMMON_TIP_PERCENTAGES as p, COMMON_VIEWPORTS as q, type CardValidationResult as r, type CompoundInterestResult as s, type CompoundYearRow as t, units as u, type FormatOptions as v, type IpConversion as w, type IsbnFormat as x, type IsbnResult as y, type NumberBase as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utilix-tech/sdk",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "description": "154+ developer utility tools for Node.js: JSON, encoding, hashing, color, CSS, network and more. Runs locally, no API key required.",
5
5
  "author": "Utilix <hello@utilix.tech>",
6
6
  "license": "MIT",