@utilix-tech/sdk 0.69.0 → 0.70.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.
- package/CHANGELOG.md +4 -0
- package/README.md +3 -3
- package/dist/{api-DmTNE4c1.d.cts → api-C8rImfka.d.cts} +55 -2
- package/dist/{api-DmTNE4c1.d.ts → api-C8rImfka.d.ts} +55 -2
- package/dist/{chunk-52ZDKSIX.js → chunk-4S63T7Y4.js} +72 -1
- package/dist/{chunk-4HNHEOJL.js → chunk-653HDWXW.js} +41 -1
- package/dist/index.cjs +111 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/tools/api.cjs +71 -0
- package/dist/tools/api.d.cts +1 -1
- package/dist/tools/api.d.ts +1 -1
- package/dist/tools/api.js +1 -1
- package/dist/tools/units.cjs +40 -0
- package/dist/tools/units.d.cts +1 -1
- package/dist/tools/units.d.ts +1 -1
- package/dist/tools/units.js +1 -1
- package/dist/{units-DPefgzmH.d.cts → units-BT8P27G0.d.cts} +29 -2
- package/dist/{units-DPefgzmH.d.ts → units-BT8P27G0.d.ts} +29 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Full release notes for all Utilix surfaces (browser tools, REST API, SDKs, MCP server) live at [utilix.tech/changelog](https://utilix.tech/changelog). This file tracks just this package.
|
|
4
4
|
|
|
5
|
+
## 0.70.0
|
|
6
|
+
- Add `generateHotp`, `generateTotp` (totp-hotp-generator): generate an HOTP code (RFC 4226) for a counter value, or the current TOTP code (RFC 6238) plus seconds until rotation, from a base32-encoded shared secret, supporting SHA-1/SHA-256/SHA-512 and 6-8 digit codes.
|
|
7
|
+
- Add `calculateTaxEquivalentYield` (tax-equivalent-yield-calculator): convert between a tax-free municipal bond yield and its taxable equivalent given a marginal federal (plus optional state) tax rate, in both directions.
|
|
8
|
+
|
|
5
9
|
## 0.69.0
|
|
6
10
|
- Add `parseCommitTrailers` (git-commit-trailer-parser): parse a commit message's trailer block (Co-authored-by, Signed-off-by, Fixes, Reviewed-by, etc.) per git's RFC 822-style trailer convention, returning each trailer's key and value plus the body with the trailer block removed.
|
|
7
11
|
- Add `extractMarkdownFootnotes` (markdown-footnote-extractor): extract every Markdown-Extra-style footnote reference and definition from a document, flagging references with no matching definition and definitions that are never referenced.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @utilix-tech/sdk
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**691 developer utility functions for Node.js: runs locally, no API key required.**
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@utilix-tech/sdk)
|
|
6
6
|
[](https://www.npmjs.com/package/@utilix-tech/sdk)
|
|
@@ -962,9 +962,9 @@ inspectGifFrames(new Uint8Array(gifBytes));
|
|
|
962
962
|
| `@utilix-tech/sdk/data` | CSV, YAML, TOML, XML, INI, NDJSON parse and convert, NDJSON record deduplicator, SRT/WebVTT subtitles, Markdown front matter parser, YAML anchor/alias resolver, CSV column type inferencer, Markdown table column aligner |
|
|
963
963
|
| `@utilix-tech/sdk/generators` | UUID v4/v7, ULID, passwords, strength check, entropy estimator, fake data, CSP nonce generator |
|
|
964
964
|
| `@utilix-tech/sdk/time` | Date diff, timezone convert, cron parse, relative time |
|
|
965
|
-
| `@utilix-tech/sdk/units` | Bytes, CSS px/rem, number bases, currency format, credit card/IBAN/barcode/ISBN validation, loan calculator, EMI calculator, compound/simple interest calculators, VAT/sales tax calculator, tip/bill split calculator, break-even point calculator, Rule of 72 calculator, savings goal calculator, ROI calculator, cash denomination/till calculator, payback period calculator, CD maturity calculator, debt-to-income ratio calculator, freelancer hourly rate calculator, debt snowball/avalanche payoff planner |
|
|
965
|
+
| `@utilix-tech/sdk/units` | Bytes, CSS px/rem, number bases, currency format, credit card/IBAN/barcode/ISBN validation, loan calculator, EMI calculator, compound/simple interest calculators, VAT/sales tax calculator, tip/bill split calculator, break-even point calculator, Rule of 72 calculator, savings goal calculator, ROI calculator, cash denomination/till calculator, payback period calculator, CD maturity calculator, debt-to-income ratio calculator, freelancer hourly rate calculator, debt snowball/avalanche payoff planner, tax-equivalent yield calculator |
|
|
966
966
|
| `@utilix-tech/sdk/network` | HTTP status codes, IP validation, country flags, geolocation URLs, HAR file parsing, User-Agent parsing, IPv6 address compress/expand, Permissions-Policy header builder, Client Hints header builder/parser, Content-Disposition header builder/parser, X-Content-Type-Options header builder/risk assessor, sitemap.xml validator, sitemap index splitter, Prefer header builder/parser (RFC 7240), Retry-After header builder/parser (RFC 9110), Priority header builder/parser (RFC 9218), WebSocket close code reference/lookup, Strict-Transport-Security (HSTS) header builder/parser, X-Robots-Tag header builder/parser, WebSocket frame opcode reference/lookup, robots meta tag builder/parser |
|
|
967
|
-
| `@utilix-tech/sdk/api` | cURL build/parse, JWT decode/sign, JWKS parse, CORS headers, CSP header |
|
|
967
|
+
| `@utilix-tech/sdk/api` | cURL build/parse, JWT decode/sign, JWKS parse, CORS headers, CSP header, TOTP/HOTP code generator |
|
|
968
968
|
| `@utilix-tech/sdk/code` | SQL format/minify, HTML format/minify, regex tester, GraphQL format, MIME type lookup, GitHub URL parsing, regex ReDoS detector, Conventional Commits linter, package.json exports field validator, package.json dependency range auditor, regex capture group/backreference visualizer, SVG sprite symbol extractor |
|
|
969
969
|
| `@utilix-tech/sdk/color` | Hex/RGB/HSL/HSV/CMYK convert, palette generation, contrast check |
|
|
970
970
|
| `@utilix-tech/sdk/css` | CSS gradient, box-shadow, border-radius, keyframe animation generators |
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* - url-parser : parseUrl, buildUrl, addParam, removeParam, getParam,
|
|
14
14
|
* encodeUrlComponent, decodeUrlComponent, isValidUrl, normalizeUrl
|
|
15
15
|
* - og-meta : parseMetaTags, validateOgTags, generateMetaHtml
|
|
16
|
+
* - totp-hotp-generator : generateHotp, generateTotp
|
|
16
17
|
*
|
|
17
18
|
* Node 18+ only. All crypto uses node:crypto; no browser-only APIs.
|
|
18
19
|
*/
|
|
@@ -287,6 +288,51 @@ declare function validateOgTags(tags: OgTags): {
|
|
|
287
288
|
missing: string[];
|
|
288
289
|
};
|
|
289
290
|
declare function generateMetaHtml(tags: Partial<OgTags & TwitterTags>): string;
|
|
291
|
+
type OtpAlgorithm = 'SHA1' | 'SHA256' | 'SHA512';
|
|
292
|
+
interface OtpOptions {
|
|
293
|
+
digits?: number;
|
|
294
|
+
algorithm?: OtpAlgorithm;
|
|
295
|
+
}
|
|
296
|
+
interface HotpResult {
|
|
297
|
+
code: string;
|
|
298
|
+
counter: number;
|
|
299
|
+
digits: number;
|
|
300
|
+
algorithm: OtpAlgorithm;
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Generates an HOTP code (RFC 4226) for a given counter value from a
|
|
304
|
+
* base32-encoded shared secret. Supports 6-8 digit codes and
|
|
305
|
+
* SHA-1/SHA-256/SHA-512 (SHA-1 is the default per the RFC and what most
|
|
306
|
+
* authenticator apps expect). The secret is never stored, only used for
|
|
307
|
+
* this one HMAC computation.
|
|
308
|
+
*/
|
|
309
|
+
declare function generateHotp(secret: string, counter: number, options?: OtpOptions): HotpResult | {
|
|
310
|
+
error: string;
|
|
311
|
+
};
|
|
312
|
+
interface TotpOptions extends OtpOptions {
|
|
313
|
+
periodSeconds?: number;
|
|
314
|
+
/** Unix timestamp in seconds. Defaults to the current time; pass an
|
|
315
|
+
* explicit value for deterministic/testable output. */
|
|
316
|
+
timestamp?: number;
|
|
317
|
+
}
|
|
318
|
+
interface TotpResult {
|
|
319
|
+
code: string;
|
|
320
|
+
counter: number;
|
|
321
|
+
digits: number;
|
|
322
|
+
algorithm: OtpAlgorithm;
|
|
323
|
+
periodSeconds: number;
|
|
324
|
+
secondsRemaining: number;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Generates the current TOTP code (RFC 6238) from a base32-encoded shared
|
|
328
|
+
* secret, plus how many seconds remain before it rotates. TOTP is HOTP
|
|
329
|
+
* where the counter is the number of `periodSeconds` windows elapsed since
|
|
330
|
+
* the Unix epoch. Defaults (30s period, 6 digits, SHA-1) match what
|
|
331
|
+
* Google Authenticator and most other authenticator apps use.
|
|
332
|
+
*/
|
|
333
|
+
declare function generateTotp(secret: string, options?: TotpOptions): TotpResult | {
|
|
334
|
+
error: string;
|
|
335
|
+
};
|
|
290
336
|
|
|
291
337
|
declare const api_COMMON_HEADERS: typeof COMMON_HEADERS;
|
|
292
338
|
declare const api_COMMON_PRESETS: typeof COMMON_PRESETS;
|
|
@@ -304,6 +350,7 @@ type api_DirectiveConfig = DirectiveConfig;
|
|
|
304
350
|
type api_FormatResult = FormatResult;
|
|
305
351
|
declare const api_HTTP_METHODS: typeof HTTP_METHODS;
|
|
306
352
|
type api_Header = Header;
|
|
353
|
+
type api_HotpResult = HotpResult;
|
|
307
354
|
type api_HttpMethod = HttpMethod;
|
|
308
355
|
type api_JwkSummary = JwkSummary;
|
|
309
356
|
type api_JwkThumbprintErrorResult = JwkThumbprintErrorResult;
|
|
@@ -322,10 +369,14 @@ type api_JwtResult = JwtResult;
|
|
|
322
369
|
type api_JwtSignOptions = JwtSignOptions;
|
|
323
370
|
type api_MetaTags = MetaTags;
|
|
324
371
|
type api_OgTags = OgTags;
|
|
372
|
+
type api_OtpAlgorithm = OtpAlgorithm;
|
|
373
|
+
type api_OtpOptions = OtpOptions;
|
|
325
374
|
type api_ParsedUrl = ParsedUrl;
|
|
326
375
|
type api_ResponseFormat = ResponseFormat;
|
|
327
376
|
declare const api_SUPPORTED_LANGUAGES: typeof SUPPORTED_LANGUAGES;
|
|
328
377
|
type api_TargetLanguage = TargetLanguage;
|
|
378
|
+
type api_TotpOptions = TotpOptions;
|
|
379
|
+
type api_TotpResult = TotpResult;
|
|
329
380
|
type api_TwitterTags = TwitterTags;
|
|
330
381
|
declare const api_addParam: typeof addParam;
|
|
331
382
|
declare const api_base64urlDecode: typeof base64urlDecode;
|
|
@@ -345,7 +396,9 @@ declare const api_formatResponse: typeof formatResponse;
|
|
|
345
396
|
declare const api_generateCors: typeof generateCors;
|
|
346
397
|
declare const api_generateCspHeader: typeof generateCspHeader;
|
|
347
398
|
declare const api_generateFullHeader: typeof generateFullHeader;
|
|
399
|
+
declare const api_generateHotp: typeof generateHotp;
|
|
348
400
|
declare const api_generateMetaHtml: typeof generateMetaHtml;
|
|
401
|
+
declare const api_generateTotp: typeof generateTotp;
|
|
349
402
|
declare const api_getParam: typeof getParam;
|
|
350
403
|
declare const api_getStats: typeof getStats;
|
|
351
404
|
declare const api_isValidUrl: typeof isValidUrl;
|
|
@@ -362,7 +415,7 @@ declare const api_validateCorsConfig: typeof validateCorsConfig;
|
|
|
362
415
|
declare const api_validateCspConfig: typeof validateCspConfig;
|
|
363
416
|
declare const api_validateOgTags: typeof validateOgTags;
|
|
364
417
|
declare namespace api {
|
|
365
|
-
export { api_COMMON_HEADERS as COMMON_HEADERS, api_COMMON_PRESETS as COMMON_PRESETS, api_CORS_COMMON_HEADERS as CORS_COMMON_HEADERS, type api_CorsConfig as CorsConfig, type api_CorsOutput as CorsOutput, type api_CspConfig as CspConfig, type api_CspDirective as CspDirective, type api_CspSource as CspSource, type api_CurlCommand as CurlCommand, type api_CurlConfig as CurlConfig, api_DEFAULT_CORS_CONFIG as DEFAULT_CORS_CONFIG, api_DIRECTIVE_DESCRIPTIONS as DIRECTIVE_DESCRIPTIONS, type api_DirectiveConfig as DirectiveConfig, type api_FormatResult as FormatResult, api_HTTP_METHODS as HTTP_METHODS, type api_Header as Header, type api_HttpMethod as HttpMethod, type api_JwkSummary as JwkSummary, type api_JwkThumbprintErrorResult as JwkThumbprintErrorResult, type api_JwkThumbprintHash as JwkThumbprintHash, type api_JwkThumbprintOutcome as JwkThumbprintOutcome, type api_JwkThumbprintResult as JwkThumbprintResult, type api_JwksError as JwksError, type api_JwksParseResult as JwksParseResult, type api_JwksResult as JwksResult, type api_JwtAlgorithm as JwtAlgorithm, type api_JwtDecodeError as JwtDecodeError, type api_JwtDecodeResult as JwtDecodeResult, type api_JwtExpiry as JwtExpiry, type api_JwtPart as JwtPart, type api_JwtResult as JwtResult, type api_JwtSignOptions as JwtSignOptions, type api_MetaTags as MetaTags, type api_OgTags as OgTags, type api_ParsedUrl as ParsedUrl, type api_ResponseFormat as ResponseFormat, api_SUPPORTED_LANGUAGES as SUPPORTED_LANGUAGES, type api_TargetLanguage as TargetLanguage, type api_TwitterTags as TwitterTags, api_addParam as addParam, api_base64urlDecode as base64urlDecode, api_base64urlEncode as base64urlEncode, api_buildCurl as buildCurl, api_buildCurlMultiline as buildCurlMultiline, api_buildUrl as buildUrl, api_computeJwkThumbprint as computeJwkThumbprint, api_convertToCode as convertToCode, api_decodeJwt as decodeJwt, api_decodeUrlComponent as decodeUrlComponent, api_detectFormat as detectFormat, api_encodeUrlComponent as encodeUrlComponent, api_extractJsonPaths as extractJsonPaths, api_formatJwtJson as formatJwtJson, api_formatResponse as formatResponse, api_generateCors as generateCors, api_generateCspHeader as generateCspHeader, api_generateFullHeader as generateFullHeader, api_generateMetaHtml as generateMetaHtml, api_getParam as getParam, api_getStats as getStats, api_isValidUrl as isValidUrl, api_normalizeUrl as normalizeUrl, api_parseCspHeader as parseCspHeader, api_parseCurl as parseCurl, api_parseCurlCommand as parseCurlCommand, api_parseJwks as parseJwks, api_parseMetaTags as parseMetaTags, api_parseUrl as parseUrl, api_removeParam as removeParam, api_signJwt as signJwt, api_validateCorsConfig as validateCorsConfig, api_validateCspConfig as validateCspConfig, api_validateOgTags as validateOgTags };
|
|
418
|
+
export { api_COMMON_HEADERS as COMMON_HEADERS, api_COMMON_PRESETS as COMMON_PRESETS, api_CORS_COMMON_HEADERS as CORS_COMMON_HEADERS, type api_CorsConfig as CorsConfig, type api_CorsOutput as CorsOutput, type api_CspConfig as CspConfig, type api_CspDirective as CspDirective, type api_CspSource as CspSource, type api_CurlCommand as CurlCommand, type api_CurlConfig as CurlConfig, api_DEFAULT_CORS_CONFIG as DEFAULT_CORS_CONFIG, api_DIRECTIVE_DESCRIPTIONS as DIRECTIVE_DESCRIPTIONS, type api_DirectiveConfig as DirectiveConfig, type api_FormatResult as FormatResult, api_HTTP_METHODS as HTTP_METHODS, type api_Header as Header, type api_HotpResult as HotpResult, type api_HttpMethod as HttpMethod, type api_JwkSummary as JwkSummary, type api_JwkThumbprintErrorResult as JwkThumbprintErrorResult, type api_JwkThumbprintHash as JwkThumbprintHash, type api_JwkThumbprintOutcome as JwkThumbprintOutcome, type api_JwkThumbprintResult as JwkThumbprintResult, type api_JwksError as JwksError, type api_JwksParseResult as JwksParseResult, type api_JwksResult as JwksResult, type api_JwtAlgorithm as JwtAlgorithm, type api_JwtDecodeError as JwtDecodeError, type api_JwtDecodeResult as JwtDecodeResult, type api_JwtExpiry as JwtExpiry, type api_JwtPart as JwtPart, type api_JwtResult as JwtResult, type api_JwtSignOptions as JwtSignOptions, type api_MetaTags as MetaTags, type api_OgTags as OgTags, type api_OtpAlgorithm as OtpAlgorithm, type api_OtpOptions as OtpOptions, type api_ParsedUrl as ParsedUrl, type api_ResponseFormat as ResponseFormat, api_SUPPORTED_LANGUAGES as SUPPORTED_LANGUAGES, type api_TargetLanguage as TargetLanguage, type api_TotpOptions as TotpOptions, type api_TotpResult as TotpResult, type api_TwitterTags as TwitterTags, api_addParam as addParam, api_base64urlDecode as base64urlDecode, api_base64urlEncode as base64urlEncode, api_buildCurl as buildCurl, api_buildCurlMultiline as buildCurlMultiline, api_buildUrl as buildUrl, api_computeJwkThumbprint as computeJwkThumbprint, api_convertToCode as convertToCode, api_decodeJwt as decodeJwt, api_decodeUrlComponent as decodeUrlComponent, api_detectFormat as detectFormat, api_encodeUrlComponent as encodeUrlComponent, api_extractJsonPaths as extractJsonPaths, api_formatJwtJson as formatJwtJson, api_formatResponse as formatResponse, api_generateCors as generateCors, api_generateCspHeader as generateCspHeader, api_generateFullHeader as generateFullHeader, api_generateHotp as generateHotp, api_generateMetaHtml as generateMetaHtml, api_generateTotp as generateTotp, api_getParam as getParam, api_getStats as getStats, api_isValidUrl as isValidUrl, api_normalizeUrl as normalizeUrl, api_parseCspHeader as parseCspHeader, api_parseCurl as parseCurl, api_parseCurlCommand as parseCurlCommand, api_parseJwks as parseJwks, api_parseMetaTags as parseMetaTags, api_parseUrl as parseUrl, api_removeParam as removeParam, api_signJwt as signJwt, api_validateCorsConfig as validateCorsConfig, api_validateCspConfig as validateCspConfig, api_validateOgTags as validateOgTags };
|
|
366
419
|
}
|
|
367
420
|
|
|
368
|
-
export {
|
|
421
|
+
export { decodeJwt as $, type JwtPart as A, type JwtResult as B, COMMON_HEADERS as C, DEFAULT_CORS_CONFIG as D, type JwtSignOptions as E, type FormatResult as F, type OtpAlgorithm as G, HTTP_METHODS as H, type OtpOptions as I, type JwkSummary as J, type TotpOptions as K, type TotpResult as L, type MetaTags as M, type TwitterTags as N, type OgTags as O, type ParsedUrl as P, addParam as Q, type ResponseFormat as R, SUPPORTED_LANGUAGES as S, type TargetLanguage as T, base64urlDecode as U, base64urlEncode as V, buildCurl as W, buildCurlMultiline as X, buildUrl as Y, computeJwkThumbprint as Z, convertToCode as _, api as a, decodeUrlComponent as a0, detectFormat as a1, encodeUrlComponent as a2, extractJsonPaths as a3, formatJwtJson as a4, formatResponse as a5, generateCors as a6, generateCspHeader as a7, generateFullHeader as a8, generateHotp as a9, generateMetaHtml as aa, generateTotp as ab, getParam as ac, getStats as ad, isValidUrl as ae, normalizeUrl as af, parseCspHeader as ag, parseCurl as ah, parseCurlCommand as ai, parseJwks as aj, parseMetaTags as ak, parseUrl as al, removeParam as am, signJwt as an, validateCorsConfig as ao, validateCspConfig as ap, validateOgTags as aq, COMMON_PRESETS as b, CORS_COMMON_HEADERS as c, type CorsConfig as d, type CorsOutput as e, type CspConfig as f, type CspDirective as g, type CspSource as h, type CurlCommand as i, type CurlConfig as j, DIRECTIVE_DESCRIPTIONS as k, type DirectiveConfig as l, type Header as m, type HotpResult as n, type HttpMethod as o, type JwkThumbprintErrorResult as p, type JwkThumbprintHash as q, type JwkThumbprintOutcome as r, type JwkThumbprintResult as s, type JwksError as t, type JwksParseResult as u, type JwksResult as v, type JwtAlgorithm as w, type JwtDecodeError as x, type JwtDecodeResult as y, type JwtExpiry as z };
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* - url-parser : parseUrl, buildUrl, addParam, removeParam, getParam,
|
|
14
14
|
* encodeUrlComponent, decodeUrlComponent, isValidUrl, normalizeUrl
|
|
15
15
|
* - og-meta : parseMetaTags, validateOgTags, generateMetaHtml
|
|
16
|
+
* - totp-hotp-generator : generateHotp, generateTotp
|
|
16
17
|
*
|
|
17
18
|
* Node 18+ only. All crypto uses node:crypto; no browser-only APIs.
|
|
18
19
|
*/
|
|
@@ -287,6 +288,51 @@ declare function validateOgTags(tags: OgTags): {
|
|
|
287
288
|
missing: string[];
|
|
288
289
|
};
|
|
289
290
|
declare function generateMetaHtml(tags: Partial<OgTags & TwitterTags>): string;
|
|
291
|
+
type OtpAlgorithm = 'SHA1' | 'SHA256' | 'SHA512';
|
|
292
|
+
interface OtpOptions {
|
|
293
|
+
digits?: number;
|
|
294
|
+
algorithm?: OtpAlgorithm;
|
|
295
|
+
}
|
|
296
|
+
interface HotpResult {
|
|
297
|
+
code: string;
|
|
298
|
+
counter: number;
|
|
299
|
+
digits: number;
|
|
300
|
+
algorithm: OtpAlgorithm;
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Generates an HOTP code (RFC 4226) for a given counter value from a
|
|
304
|
+
* base32-encoded shared secret. Supports 6-8 digit codes and
|
|
305
|
+
* SHA-1/SHA-256/SHA-512 (SHA-1 is the default per the RFC and what most
|
|
306
|
+
* authenticator apps expect). The secret is never stored, only used for
|
|
307
|
+
* this one HMAC computation.
|
|
308
|
+
*/
|
|
309
|
+
declare function generateHotp(secret: string, counter: number, options?: OtpOptions): HotpResult | {
|
|
310
|
+
error: string;
|
|
311
|
+
};
|
|
312
|
+
interface TotpOptions extends OtpOptions {
|
|
313
|
+
periodSeconds?: number;
|
|
314
|
+
/** Unix timestamp in seconds. Defaults to the current time; pass an
|
|
315
|
+
* explicit value for deterministic/testable output. */
|
|
316
|
+
timestamp?: number;
|
|
317
|
+
}
|
|
318
|
+
interface TotpResult {
|
|
319
|
+
code: string;
|
|
320
|
+
counter: number;
|
|
321
|
+
digits: number;
|
|
322
|
+
algorithm: OtpAlgorithm;
|
|
323
|
+
periodSeconds: number;
|
|
324
|
+
secondsRemaining: number;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Generates the current TOTP code (RFC 6238) from a base32-encoded shared
|
|
328
|
+
* secret, plus how many seconds remain before it rotates. TOTP is HOTP
|
|
329
|
+
* where the counter is the number of `periodSeconds` windows elapsed since
|
|
330
|
+
* the Unix epoch. Defaults (30s period, 6 digits, SHA-1) match what
|
|
331
|
+
* Google Authenticator and most other authenticator apps use.
|
|
332
|
+
*/
|
|
333
|
+
declare function generateTotp(secret: string, options?: TotpOptions): TotpResult | {
|
|
334
|
+
error: string;
|
|
335
|
+
};
|
|
290
336
|
|
|
291
337
|
declare const api_COMMON_HEADERS: typeof COMMON_HEADERS;
|
|
292
338
|
declare const api_COMMON_PRESETS: typeof COMMON_PRESETS;
|
|
@@ -304,6 +350,7 @@ type api_DirectiveConfig = DirectiveConfig;
|
|
|
304
350
|
type api_FormatResult = FormatResult;
|
|
305
351
|
declare const api_HTTP_METHODS: typeof HTTP_METHODS;
|
|
306
352
|
type api_Header = Header;
|
|
353
|
+
type api_HotpResult = HotpResult;
|
|
307
354
|
type api_HttpMethod = HttpMethod;
|
|
308
355
|
type api_JwkSummary = JwkSummary;
|
|
309
356
|
type api_JwkThumbprintErrorResult = JwkThumbprintErrorResult;
|
|
@@ -322,10 +369,14 @@ type api_JwtResult = JwtResult;
|
|
|
322
369
|
type api_JwtSignOptions = JwtSignOptions;
|
|
323
370
|
type api_MetaTags = MetaTags;
|
|
324
371
|
type api_OgTags = OgTags;
|
|
372
|
+
type api_OtpAlgorithm = OtpAlgorithm;
|
|
373
|
+
type api_OtpOptions = OtpOptions;
|
|
325
374
|
type api_ParsedUrl = ParsedUrl;
|
|
326
375
|
type api_ResponseFormat = ResponseFormat;
|
|
327
376
|
declare const api_SUPPORTED_LANGUAGES: typeof SUPPORTED_LANGUAGES;
|
|
328
377
|
type api_TargetLanguage = TargetLanguage;
|
|
378
|
+
type api_TotpOptions = TotpOptions;
|
|
379
|
+
type api_TotpResult = TotpResult;
|
|
329
380
|
type api_TwitterTags = TwitterTags;
|
|
330
381
|
declare const api_addParam: typeof addParam;
|
|
331
382
|
declare const api_base64urlDecode: typeof base64urlDecode;
|
|
@@ -345,7 +396,9 @@ declare const api_formatResponse: typeof formatResponse;
|
|
|
345
396
|
declare const api_generateCors: typeof generateCors;
|
|
346
397
|
declare const api_generateCspHeader: typeof generateCspHeader;
|
|
347
398
|
declare const api_generateFullHeader: typeof generateFullHeader;
|
|
399
|
+
declare const api_generateHotp: typeof generateHotp;
|
|
348
400
|
declare const api_generateMetaHtml: typeof generateMetaHtml;
|
|
401
|
+
declare const api_generateTotp: typeof generateTotp;
|
|
349
402
|
declare const api_getParam: typeof getParam;
|
|
350
403
|
declare const api_getStats: typeof getStats;
|
|
351
404
|
declare const api_isValidUrl: typeof isValidUrl;
|
|
@@ -362,7 +415,7 @@ declare const api_validateCorsConfig: typeof validateCorsConfig;
|
|
|
362
415
|
declare const api_validateCspConfig: typeof validateCspConfig;
|
|
363
416
|
declare const api_validateOgTags: typeof validateOgTags;
|
|
364
417
|
declare namespace api {
|
|
365
|
-
export { api_COMMON_HEADERS as COMMON_HEADERS, api_COMMON_PRESETS as COMMON_PRESETS, api_CORS_COMMON_HEADERS as CORS_COMMON_HEADERS, type api_CorsConfig as CorsConfig, type api_CorsOutput as CorsOutput, type api_CspConfig as CspConfig, type api_CspDirective as CspDirective, type api_CspSource as CspSource, type api_CurlCommand as CurlCommand, type api_CurlConfig as CurlConfig, api_DEFAULT_CORS_CONFIG as DEFAULT_CORS_CONFIG, api_DIRECTIVE_DESCRIPTIONS as DIRECTIVE_DESCRIPTIONS, type api_DirectiveConfig as DirectiveConfig, type api_FormatResult as FormatResult, api_HTTP_METHODS as HTTP_METHODS, type api_Header as Header, type api_HttpMethod as HttpMethod, type api_JwkSummary as JwkSummary, type api_JwkThumbprintErrorResult as JwkThumbprintErrorResult, type api_JwkThumbprintHash as JwkThumbprintHash, type api_JwkThumbprintOutcome as JwkThumbprintOutcome, type api_JwkThumbprintResult as JwkThumbprintResult, type api_JwksError as JwksError, type api_JwksParseResult as JwksParseResult, type api_JwksResult as JwksResult, type api_JwtAlgorithm as JwtAlgorithm, type api_JwtDecodeError as JwtDecodeError, type api_JwtDecodeResult as JwtDecodeResult, type api_JwtExpiry as JwtExpiry, type api_JwtPart as JwtPart, type api_JwtResult as JwtResult, type api_JwtSignOptions as JwtSignOptions, type api_MetaTags as MetaTags, type api_OgTags as OgTags, type api_ParsedUrl as ParsedUrl, type api_ResponseFormat as ResponseFormat, api_SUPPORTED_LANGUAGES as SUPPORTED_LANGUAGES, type api_TargetLanguage as TargetLanguage, type api_TwitterTags as TwitterTags, api_addParam as addParam, api_base64urlDecode as base64urlDecode, api_base64urlEncode as base64urlEncode, api_buildCurl as buildCurl, api_buildCurlMultiline as buildCurlMultiline, api_buildUrl as buildUrl, api_computeJwkThumbprint as computeJwkThumbprint, api_convertToCode as convertToCode, api_decodeJwt as decodeJwt, api_decodeUrlComponent as decodeUrlComponent, api_detectFormat as detectFormat, api_encodeUrlComponent as encodeUrlComponent, api_extractJsonPaths as extractJsonPaths, api_formatJwtJson as formatJwtJson, api_formatResponse as formatResponse, api_generateCors as generateCors, api_generateCspHeader as generateCspHeader, api_generateFullHeader as generateFullHeader, api_generateMetaHtml as generateMetaHtml, api_getParam as getParam, api_getStats as getStats, api_isValidUrl as isValidUrl, api_normalizeUrl as normalizeUrl, api_parseCspHeader as parseCspHeader, api_parseCurl as parseCurl, api_parseCurlCommand as parseCurlCommand, api_parseJwks as parseJwks, api_parseMetaTags as parseMetaTags, api_parseUrl as parseUrl, api_removeParam as removeParam, api_signJwt as signJwt, api_validateCorsConfig as validateCorsConfig, api_validateCspConfig as validateCspConfig, api_validateOgTags as validateOgTags };
|
|
418
|
+
export { api_COMMON_HEADERS as COMMON_HEADERS, api_COMMON_PRESETS as COMMON_PRESETS, api_CORS_COMMON_HEADERS as CORS_COMMON_HEADERS, type api_CorsConfig as CorsConfig, type api_CorsOutput as CorsOutput, type api_CspConfig as CspConfig, type api_CspDirective as CspDirective, type api_CspSource as CspSource, type api_CurlCommand as CurlCommand, type api_CurlConfig as CurlConfig, api_DEFAULT_CORS_CONFIG as DEFAULT_CORS_CONFIG, api_DIRECTIVE_DESCRIPTIONS as DIRECTIVE_DESCRIPTIONS, type api_DirectiveConfig as DirectiveConfig, type api_FormatResult as FormatResult, api_HTTP_METHODS as HTTP_METHODS, type api_Header as Header, type api_HotpResult as HotpResult, type api_HttpMethod as HttpMethod, type api_JwkSummary as JwkSummary, type api_JwkThumbprintErrorResult as JwkThumbprintErrorResult, type api_JwkThumbprintHash as JwkThumbprintHash, type api_JwkThumbprintOutcome as JwkThumbprintOutcome, type api_JwkThumbprintResult as JwkThumbprintResult, type api_JwksError as JwksError, type api_JwksParseResult as JwksParseResult, type api_JwksResult as JwksResult, type api_JwtAlgorithm as JwtAlgorithm, type api_JwtDecodeError as JwtDecodeError, type api_JwtDecodeResult as JwtDecodeResult, type api_JwtExpiry as JwtExpiry, type api_JwtPart as JwtPart, type api_JwtResult as JwtResult, type api_JwtSignOptions as JwtSignOptions, type api_MetaTags as MetaTags, type api_OgTags as OgTags, type api_OtpAlgorithm as OtpAlgorithm, type api_OtpOptions as OtpOptions, type api_ParsedUrl as ParsedUrl, type api_ResponseFormat as ResponseFormat, api_SUPPORTED_LANGUAGES as SUPPORTED_LANGUAGES, type api_TargetLanguage as TargetLanguage, type api_TotpOptions as TotpOptions, type api_TotpResult as TotpResult, type api_TwitterTags as TwitterTags, api_addParam as addParam, api_base64urlDecode as base64urlDecode, api_base64urlEncode as base64urlEncode, api_buildCurl as buildCurl, api_buildCurlMultiline as buildCurlMultiline, api_buildUrl as buildUrl, api_computeJwkThumbprint as computeJwkThumbprint, api_convertToCode as convertToCode, api_decodeJwt as decodeJwt, api_decodeUrlComponent as decodeUrlComponent, api_detectFormat as detectFormat, api_encodeUrlComponent as encodeUrlComponent, api_extractJsonPaths as extractJsonPaths, api_formatJwtJson as formatJwtJson, api_formatResponse as formatResponse, api_generateCors as generateCors, api_generateCspHeader as generateCspHeader, api_generateFullHeader as generateFullHeader, api_generateHotp as generateHotp, api_generateMetaHtml as generateMetaHtml, api_generateTotp as generateTotp, api_getParam as getParam, api_getStats as getStats, api_isValidUrl as isValidUrl, api_normalizeUrl as normalizeUrl, api_parseCspHeader as parseCspHeader, api_parseCurl as parseCurl, api_parseCurlCommand as parseCurlCommand, api_parseJwks as parseJwks, api_parseMetaTags as parseMetaTags, api_parseUrl as parseUrl, api_removeParam as removeParam, api_signJwt as signJwt, api_validateCorsConfig as validateCorsConfig, api_validateCspConfig as validateCspConfig, api_validateOgTags as validateOgTags };
|
|
366
419
|
}
|
|
367
420
|
|
|
368
|
-
export {
|
|
421
|
+
export { decodeJwt as $, type JwtPart as A, type JwtResult as B, COMMON_HEADERS as C, DEFAULT_CORS_CONFIG as D, type JwtSignOptions as E, type FormatResult as F, type OtpAlgorithm as G, HTTP_METHODS as H, type OtpOptions as I, type JwkSummary as J, type TotpOptions as K, type TotpResult as L, type MetaTags as M, type TwitterTags as N, type OgTags as O, type ParsedUrl as P, addParam as Q, type ResponseFormat as R, SUPPORTED_LANGUAGES as S, type TargetLanguage as T, base64urlDecode as U, base64urlEncode as V, buildCurl as W, buildCurlMultiline as X, buildUrl as Y, computeJwkThumbprint as Z, convertToCode as _, api as a, decodeUrlComponent as a0, detectFormat as a1, encodeUrlComponent as a2, extractJsonPaths as a3, formatJwtJson as a4, formatResponse as a5, generateCors as a6, generateCspHeader as a7, generateFullHeader as a8, generateHotp as a9, generateMetaHtml as aa, generateTotp as ab, getParam as ac, getStats as ad, isValidUrl as ae, normalizeUrl as af, parseCspHeader as ag, parseCurl as ah, parseCurlCommand as ai, parseJwks as aj, parseMetaTags as ak, parseUrl as al, removeParam as am, signJwt as an, validateCorsConfig as ao, validateCspConfig as ap, validateOgTags as aq, COMMON_PRESETS as b, CORS_COMMON_HEADERS as c, type CorsConfig as d, type CorsOutput as e, type CspConfig as f, type CspDirective as g, type CspSource as h, type CurlCommand as i, type CurlConfig as j, DIRECTIVE_DESCRIPTIONS as k, type DirectiveConfig as l, type Header as m, type HotpResult as n, type HttpMethod as o, type JwkThumbprintErrorResult as p, type JwkThumbprintHash as q, type JwkThumbprintOutcome as r, type JwkThumbprintResult as s, type JwksError as t, type JwksParseResult as u, type JwksResult as v, type JwtAlgorithm as w, type JwtDecodeError as x, type JwtDecodeResult as y, type JwtExpiry as z };
|
|
@@ -29,7 +29,9 @@ __export(api_exports, {
|
|
|
29
29
|
generateCors: () => generateCors,
|
|
30
30
|
generateCspHeader: () => generateCspHeader,
|
|
31
31
|
generateFullHeader: () => generateFullHeader,
|
|
32
|
+
generateHotp: () => generateHotp,
|
|
32
33
|
generateMetaHtml: () => generateMetaHtml,
|
|
34
|
+
generateTotp: () => generateTotp,
|
|
33
35
|
getParam: () => getParam,
|
|
34
36
|
getStats: () => getStats,
|
|
35
37
|
isValidUrl: () => isValidUrl,
|
|
@@ -1308,5 +1310,74 @@ function generateMetaHtml(tags) {
|
|
|
1308
1310
|
}
|
|
1309
1311
|
return lines.join("\n");
|
|
1310
1312
|
}
|
|
1313
|
+
var OTP_ALG_TO_NODE_HASH = {
|
|
1314
|
+
SHA1: "sha1",
|
|
1315
|
+
SHA256: "sha256",
|
|
1316
|
+
SHA512: "sha512"
|
|
1317
|
+
};
|
|
1318
|
+
function decodeBase32Secret(secret) {
|
|
1319
|
+
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
|
|
1320
|
+
const cleaned = secret.toUpperCase().replace(/[\s=]/g, "");
|
|
1321
|
+
if (!cleaned) {
|
|
1322
|
+
return { error: "Secret must not be empty" };
|
|
1323
|
+
}
|
|
1324
|
+
const bytes = [];
|
|
1325
|
+
let buffer = 0;
|
|
1326
|
+
let bitsLeft = 0;
|
|
1327
|
+
for (const char of cleaned) {
|
|
1328
|
+
const val = alphabet.indexOf(char);
|
|
1329
|
+
if (val === -1) {
|
|
1330
|
+
return { error: `Invalid base32 character '${char}' in secret` };
|
|
1331
|
+
}
|
|
1332
|
+
buffer = buffer << 5 | val;
|
|
1333
|
+
bitsLeft += 5;
|
|
1334
|
+
if (bitsLeft >= 8) {
|
|
1335
|
+
bitsLeft -= 8;
|
|
1336
|
+
bytes.push(buffer >> bitsLeft & 255);
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
return Buffer.from(bytes);
|
|
1340
|
+
}
|
|
1341
|
+
function hotpFromCounter(keyBytes, counter, digits, algorithm) {
|
|
1342
|
+
const counterBuffer = Buffer.alloc(8);
|
|
1343
|
+
counterBuffer.writeUInt32BE(Math.floor(counter / 4294967296), 0);
|
|
1344
|
+
counterBuffer.writeUInt32BE(counter % 4294967296, 4);
|
|
1345
|
+
const hmac = createHmac(OTP_ALG_TO_NODE_HASH[algorithm], keyBytes).update(counterBuffer).digest();
|
|
1346
|
+
const offset = hmac[hmac.length - 1] & 15;
|
|
1347
|
+
const binCode = (hmac[offset] & 127) << 24 | (hmac[offset + 1] & 255) << 16 | (hmac[offset + 2] & 255) << 8 | hmac[offset + 3] & 255;
|
|
1348
|
+
const code = (binCode % 10 ** digits).toString().padStart(digits, "0");
|
|
1349
|
+
return code;
|
|
1350
|
+
}
|
|
1351
|
+
function generateHotp(secret, counter, options = {}) {
|
|
1352
|
+
const digits = options.digits ?? 6;
|
|
1353
|
+
const algorithm = options.algorithm ?? "SHA1";
|
|
1354
|
+
if (!Number.isInteger(counter) || counter < 0) {
|
|
1355
|
+
return { error: "Counter must be a non-negative whole number" };
|
|
1356
|
+
}
|
|
1357
|
+
if (!Number.isInteger(digits) || digits < 6 || digits > 8) {
|
|
1358
|
+
return { error: "Digits must be an integer between 6 and 8" };
|
|
1359
|
+
}
|
|
1360
|
+
if (!(algorithm in OTP_ALG_TO_NODE_HASH)) {
|
|
1361
|
+
return { error: "Algorithm must be one of SHA1, SHA256, SHA512" };
|
|
1362
|
+
}
|
|
1363
|
+
const keyBytes = decodeBase32Secret(secret);
|
|
1364
|
+
if ("error" in keyBytes) return keyBytes;
|
|
1365
|
+
return { code: hotpFromCounter(keyBytes, counter, digits, algorithm), counter, digits, algorithm };
|
|
1366
|
+
}
|
|
1367
|
+
function generateTotp(secret, options = {}) {
|
|
1368
|
+
const periodSeconds = options.periodSeconds ?? 30;
|
|
1369
|
+
const timestamp = options.timestamp ?? Math.floor(Date.now() / 1e3);
|
|
1370
|
+
if (!Number.isFinite(periodSeconds) || periodSeconds <= 0) {
|
|
1371
|
+
return { error: "Period must be a positive number of seconds" };
|
|
1372
|
+
}
|
|
1373
|
+
if (!Number.isFinite(timestamp) || timestamp < 0) {
|
|
1374
|
+
return { error: "Timestamp must be a non-negative number of seconds" };
|
|
1375
|
+
}
|
|
1376
|
+
const counter = Math.floor(timestamp / periodSeconds);
|
|
1377
|
+
const hotp = generateHotp(secret, counter, options);
|
|
1378
|
+
if ("error" in hotp) return hotp;
|
|
1379
|
+
const secondsRemaining = periodSeconds - timestamp % periodSeconds;
|
|
1380
|
+
return { ...hotp, periodSeconds, secondsRemaining };
|
|
1381
|
+
}
|
|
1311
1382
|
|
|
1312
|
-
export { COMMON_HEADERS, COMMON_PRESETS, CORS_COMMON_HEADERS, DEFAULT_CORS_CONFIG, DIRECTIVE_DESCRIPTIONS, HTTP_METHODS, SUPPORTED_LANGUAGES, addParam, api_exports, base64urlDecode, base64urlEncode, buildCurl, buildCurlMultiline, buildUrl, computeJwkThumbprint, convertToCode, decodeJwt, decodeUrlComponent, detectFormat, encodeUrlComponent, extractJsonPaths, formatJwtJson, formatResponse, generateCors, generateCspHeader, generateFullHeader, generateMetaHtml, getParam, getStats, isValidUrl, normalizeUrl, parseCspHeader, parseCurl, parseCurlCommand, parseJwks, parseMetaTags, parseUrl, removeParam, signJwt, validateCorsConfig, validateCspConfig, validateOgTags };
|
|
1383
|
+
export { COMMON_HEADERS, COMMON_PRESETS, CORS_COMMON_HEADERS, DEFAULT_CORS_CONFIG, DIRECTIVE_DESCRIPTIONS, HTTP_METHODS, SUPPORTED_LANGUAGES, addParam, api_exports, base64urlDecode, base64urlEncode, buildCurl, buildCurlMultiline, buildUrl, computeJwkThumbprint, convertToCode, decodeJwt, decodeUrlComponent, detectFormat, encodeUrlComponent, extractJsonPaths, formatJwtJson, formatResponse, generateCors, generateCspHeader, generateFullHeader, generateHotp, generateMetaHtml, generateTotp, getParam, getStats, isValidUrl, normalizeUrl, parseCspHeader, parseCurl, parseCurlCommand, parseJwks, parseMetaTags, parseUrl, removeParam, signJwt, validateCorsConfig, validateCspConfig, validateOgTags };
|
|
@@ -47,6 +47,7 @@ __export(units_exports, {
|
|
|
47
47
|
calculateSavingsGoal: () => calculateSavingsGoal,
|
|
48
48
|
calculateSimpleInterest: () => calculateSimpleInterest,
|
|
49
49
|
calculateTax: () => calculateTax,
|
|
50
|
+
calculateTaxEquivalentYield: () => calculateTaxEquivalentYield,
|
|
50
51
|
calculateTimeValue: () => calculateTimeValue,
|
|
51
52
|
calculateTipSplit: () => calculateTipSplit,
|
|
52
53
|
calculateVideoBitrate: () => calculateVideoBitrate,
|
|
@@ -2503,5 +2504,44 @@ function calculateLoanRefinance(currentBalance, currentRatePercent, currentRemai
|
|
|
2503
2504
|
totalInterestSavings: round2(current.totalInterest - refinanced.totalInterest)
|
|
2504
2505
|
};
|
|
2505
2506
|
}
|
|
2507
|
+
function calculateTaxEquivalentYield(inputYieldPercent, federalTaxRatePercent, stateTaxRatePercent = 0, direction) {
|
|
2508
|
+
if (!Number.isFinite(inputYieldPercent) || inputYieldPercent < 0) {
|
|
2509
|
+
return { error: "Yield must be zero or a positive number" };
|
|
2510
|
+
}
|
|
2511
|
+
if (!Number.isFinite(federalTaxRatePercent) || federalTaxRatePercent < 0 || federalTaxRatePercent >= 100) {
|
|
2512
|
+
return { error: "Federal tax rate must be a percentage between 0 and 100 (exclusive of 100)" };
|
|
2513
|
+
}
|
|
2514
|
+
if (!Number.isFinite(stateTaxRatePercent) || stateTaxRatePercent < 0 || stateTaxRatePercent >= 100) {
|
|
2515
|
+
return { error: "State tax rate must be a percentage between 0 and 100 (exclusive of 100)" };
|
|
2516
|
+
}
|
|
2517
|
+
if (direction !== "tax-free-to-taxable" && direction !== "taxable-to-tax-free") {
|
|
2518
|
+
return { error: 'Direction must be "tax-free-to-taxable" or "taxable-to-tax-free"' };
|
|
2519
|
+
}
|
|
2520
|
+
const combinedTaxRatePercent = federalTaxRatePercent + stateTaxRatePercent;
|
|
2521
|
+
if (combinedTaxRatePercent >= 100) {
|
|
2522
|
+
return { error: "Combined federal and state tax rate must be less than 100%" };
|
|
2523
|
+
}
|
|
2524
|
+
const round6 = (n) => Math.round(n * 1e6) / 1e6;
|
|
2525
|
+
const combinedRateDecimal = combinedTaxRatePercent / 100;
|
|
2526
|
+
let taxFreeYield;
|
|
2527
|
+
let taxableYield;
|
|
2528
|
+
if (direction === "tax-free-to-taxable") {
|
|
2529
|
+
taxFreeYield = inputYieldPercent;
|
|
2530
|
+
taxableYield = taxFreeYield / (1 - combinedRateDecimal);
|
|
2531
|
+
} else {
|
|
2532
|
+
taxableYield = inputYieldPercent;
|
|
2533
|
+
taxFreeYield = taxableYield * (1 - combinedRateDecimal);
|
|
2534
|
+
}
|
|
2535
|
+
return {
|
|
2536
|
+
direction,
|
|
2537
|
+
inputYield: round6(inputYieldPercent),
|
|
2538
|
+
federalTaxRatePercent: round6(federalTaxRatePercent),
|
|
2539
|
+
stateTaxRatePercent: round6(stateTaxRatePercent),
|
|
2540
|
+
combinedTaxRatePercent: round6(combinedTaxRatePercent),
|
|
2541
|
+
taxFreeYield: round6(taxFreeYield),
|
|
2542
|
+
taxableYield: round6(taxableYield),
|
|
2543
|
+
yieldDifference: round6(taxableYield - taxFreeYield)
|
|
2544
|
+
};
|
|
2545
|
+
}
|
|
2506
2546
|
|
|
2507
|
-
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, GPA_GRADE_POINTS, USD_DENOMINATIONS, applySuccessiveDiscounts, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, calculateBlendedLoanRate, calculateBreakEven, calculateCashBreakdown, calculateCashRounding, calculateCdMaturity, calculateChange, calculateCompoundInterest, calculateCreditUtilization, calculateDebtToIncomeRatio, calculateDepreciationSchedule, calculateDiscount, calculateEmi, calculateExtraPaymentPayoff, calculateFreelancerRate, calculateGpa, calculateLoan, calculateLoanRefinance, calculateMarginMarkup, calculateMovingAverages, calculatePaybackPeriod, calculatePercentageChange, calculateRoi, calculateRuleOf72, calculateSavingsGoal, calculateSimpleInterest, calculateTax, calculateTimeValue, calculateTipSplit, calculateVideoBitrate, compareSemver, compareUnitPrices, 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, marginToMarkup, markupToMargin, octalToPermissions, parseFileSize, parseInput, parseNumberString, parseSemver, permissionsToChmod, permissionsToOctal, permissionsToSymbolic, planDebtPayoff, ptToPx, pxToAll, pxToViewport, remToPx, satisfiesRange, scaleByHeight, scaleByWidth, sortVersions, splitSubnet, symbolicToPermissions, units_exports, validateBarcode, validateCardNumber, validateIban, validateIsbn, viewportToPx };
|
|
2547
|
+
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, GPA_GRADE_POINTS, USD_DENOMINATIONS, applySuccessiveDiscounts, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, calculateBlendedLoanRate, calculateBreakEven, calculateCashBreakdown, calculateCashRounding, calculateCdMaturity, calculateChange, calculateCompoundInterest, calculateCreditUtilization, calculateDebtToIncomeRatio, calculateDepreciationSchedule, calculateDiscount, calculateEmi, calculateExtraPaymentPayoff, calculateFreelancerRate, calculateGpa, calculateLoan, calculateLoanRefinance, calculateMarginMarkup, calculateMovingAverages, calculatePaybackPeriod, calculatePercentageChange, calculateRoi, calculateRuleOf72, calculateSavingsGoal, calculateSimpleInterest, calculateTax, calculateTaxEquivalentYield, calculateTimeValue, calculateTipSplit, calculateVideoBitrate, compareSemver, compareUnitPrices, 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, marginToMarkup, markupToMargin, octalToPermissions, parseFileSize, parseInput, parseNumberString, parseSemver, permissionsToChmod, permissionsToOctal, permissionsToSymbolic, planDebtPayoff, ptToPx, pxToAll, pxToViewport, remToPx, satisfiesRange, scaleByHeight, scaleByWidth, sortVersions, splitSubnet, symbolicToPermissions, units_exports, validateBarcode, validateCardNumber, validateIban, validateIsbn, viewportToPx };
|
package/dist/index.cjs
CHANGED
|
@@ -8581,6 +8581,7 @@ __export(units_exports, {
|
|
|
8581
8581
|
calculateSavingsGoal: () => calculateSavingsGoal,
|
|
8582
8582
|
calculateSimpleInterest: () => calculateSimpleInterest,
|
|
8583
8583
|
calculateTax: () => calculateTax,
|
|
8584
|
+
calculateTaxEquivalentYield: () => calculateTaxEquivalentYield,
|
|
8584
8585
|
calculateTimeValue: () => calculateTimeValue,
|
|
8585
8586
|
calculateTipSplit: () => calculateTipSplit,
|
|
8586
8587
|
calculateVideoBitrate: () => calculateVideoBitrate,
|
|
@@ -11037,6 +11038,45 @@ function calculateLoanRefinance(currentBalance, currentRatePercent, currentRemai
|
|
|
11037
11038
|
totalInterestSavings: round2(current.totalInterest - refinanced.totalInterest)
|
|
11038
11039
|
};
|
|
11039
11040
|
}
|
|
11041
|
+
function calculateTaxEquivalentYield(inputYieldPercent, federalTaxRatePercent, stateTaxRatePercent = 0, direction) {
|
|
11042
|
+
if (!Number.isFinite(inputYieldPercent) || inputYieldPercent < 0) {
|
|
11043
|
+
return { error: "Yield must be zero or a positive number" };
|
|
11044
|
+
}
|
|
11045
|
+
if (!Number.isFinite(federalTaxRatePercent) || federalTaxRatePercent < 0 || federalTaxRatePercent >= 100) {
|
|
11046
|
+
return { error: "Federal tax rate must be a percentage between 0 and 100 (exclusive of 100)" };
|
|
11047
|
+
}
|
|
11048
|
+
if (!Number.isFinite(stateTaxRatePercent) || stateTaxRatePercent < 0 || stateTaxRatePercent >= 100) {
|
|
11049
|
+
return { error: "State tax rate must be a percentage between 0 and 100 (exclusive of 100)" };
|
|
11050
|
+
}
|
|
11051
|
+
if (direction !== "tax-free-to-taxable" && direction !== "taxable-to-tax-free") {
|
|
11052
|
+
return { error: 'Direction must be "tax-free-to-taxable" or "taxable-to-tax-free"' };
|
|
11053
|
+
}
|
|
11054
|
+
const combinedTaxRatePercent = federalTaxRatePercent + stateTaxRatePercent;
|
|
11055
|
+
if (combinedTaxRatePercent >= 100) {
|
|
11056
|
+
return { error: "Combined federal and state tax rate must be less than 100%" };
|
|
11057
|
+
}
|
|
11058
|
+
const round6 = (n) => Math.round(n * 1e6) / 1e6;
|
|
11059
|
+
const combinedRateDecimal = combinedTaxRatePercent / 100;
|
|
11060
|
+
let taxFreeYield;
|
|
11061
|
+
let taxableYield;
|
|
11062
|
+
if (direction === "tax-free-to-taxable") {
|
|
11063
|
+
taxFreeYield = inputYieldPercent;
|
|
11064
|
+
taxableYield = taxFreeYield / (1 - combinedRateDecimal);
|
|
11065
|
+
} else {
|
|
11066
|
+
taxableYield = inputYieldPercent;
|
|
11067
|
+
taxFreeYield = taxableYield * (1 - combinedRateDecimal);
|
|
11068
|
+
}
|
|
11069
|
+
return {
|
|
11070
|
+
direction,
|
|
11071
|
+
inputYield: round6(inputYieldPercent),
|
|
11072
|
+
federalTaxRatePercent: round6(federalTaxRatePercent),
|
|
11073
|
+
stateTaxRatePercent: round6(stateTaxRatePercent),
|
|
11074
|
+
combinedTaxRatePercent: round6(combinedTaxRatePercent),
|
|
11075
|
+
taxFreeYield: round6(taxFreeYield),
|
|
11076
|
+
taxableYield: round6(taxableYield),
|
|
11077
|
+
yieldDifference: round6(taxableYield - taxFreeYield)
|
|
11078
|
+
};
|
|
11079
|
+
}
|
|
11040
11080
|
|
|
11041
11081
|
// src/tools/network.ts
|
|
11042
11082
|
var network_exports = {};
|
|
@@ -14547,7 +14587,9 @@ __export(api_exports, {
|
|
|
14547
14587
|
generateCors: () => generateCors,
|
|
14548
14588
|
generateCspHeader: () => generateCspHeader,
|
|
14549
14589
|
generateFullHeader: () => generateFullHeader,
|
|
14590
|
+
generateHotp: () => generateHotp,
|
|
14550
14591
|
generateMetaHtml: () => generateMetaHtml,
|
|
14592
|
+
generateTotp: () => generateTotp,
|
|
14551
14593
|
getParam: () => getParam,
|
|
14552
14594
|
getStats: () => getStats,
|
|
14553
14595
|
isValidUrl: () => isValidUrl,
|
|
@@ -15826,6 +15868,75 @@ function generateMetaHtml(tags) {
|
|
|
15826
15868
|
}
|
|
15827
15869
|
return lines.join("\n");
|
|
15828
15870
|
}
|
|
15871
|
+
var OTP_ALG_TO_NODE_HASH = {
|
|
15872
|
+
SHA1: "sha1",
|
|
15873
|
+
SHA256: "sha256",
|
|
15874
|
+
SHA512: "sha512"
|
|
15875
|
+
};
|
|
15876
|
+
function decodeBase32Secret(secret) {
|
|
15877
|
+
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
|
|
15878
|
+
const cleaned = secret.toUpperCase().replace(/[\s=]/g, "");
|
|
15879
|
+
if (!cleaned) {
|
|
15880
|
+
return { error: "Secret must not be empty" };
|
|
15881
|
+
}
|
|
15882
|
+
const bytes = [];
|
|
15883
|
+
let buffer = 0;
|
|
15884
|
+
let bitsLeft = 0;
|
|
15885
|
+
for (const char of cleaned) {
|
|
15886
|
+
const val = alphabet.indexOf(char);
|
|
15887
|
+
if (val === -1) {
|
|
15888
|
+
return { error: `Invalid base32 character '${char}' in secret` };
|
|
15889
|
+
}
|
|
15890
|
+
buffer = buffer << 5 | val;
|
|
15891
|
+
bitsLeft += 5;
|
|
15892
|
+
if (bitsLeft >= 8) {
|
|
15893
|
+
bitsLeft -= 8;
|
|
15894
|
+
bytes.push(buffer >> bitsLeft & 255);
|
|
15895
|
+
}
|
|
15896
|
+
}
|
|
15897
|
+
return Buffer.from(bytes);
|
|
15898
|
+
}
|
|
15899
|
+
function hotpFromCounter(keyBytes, counter, digits, algorithm) {
|
|
15900
|
+
const counterBuffer = Buffer.alloc(8);
|
|
15901
|
+
counterBuffer.writeUInt32BE(Math.floor(counter / 4294967296), 0);
|
|
15902
|
+
counterBuffer.writeUInt32BE(counter % 4294967296, 4);
|
|
15903
|
+
const hmac = crypto.createHmac(OTP_ALG_TO_NODE_HASH[algorithm], keyBytes).update(counterBuffer).digest();
|
|
15904
|
+
const offset = hmac[hmac.length - 1] & 15;
|
|
15905
|
+
const binCode = (hmac[offset] & 127) << 24 | (hmac[offset + 1] & 255) << 16 | (hmac[offset + 2] & 255) << 8 | hmac[offset + 3] & 255;
|
|
15906
|
+
const code = (binCode % 10 ** digits).toString().padStart(digits, "0");
|
|
15907
|
+
return code;
|
|
15908
|
+
}
|
|
15909
|
+
function generateHotp(secret, counter, options = {}) {
|
|
15910
|
+
const digits = options.digits ?? 6;
|
|
15911
|
+
const algorithm = options.algorithm ?? "SHA1";
|
|
15912
|
+
if (!Number.isInteger(counter) || counter < 0) {
|
|
15913
|
+
return { error: "Counter must be a non-negative whole number" };
|
|
15914
|
+
}
|
|
15915
|
+
if (!Number.isInteger(digits) || digits < 6 || digits > 8) {
|
|
15916
|
+
return { error: "Digits must be an integer between 6 and 8" };
|
|
15917
|
+
}
|
|
15918
|
+
if (!(algorithm in OTP_ALG_TO_NODE_HASH)) {
|
|
15919
|
+
return { error: "Algorithm must be one of SHA1, SHA256, SHA512" };
|
|
15920
|
+
}
|
|
15921
|
+
const keyBytes = decodeBase32Secret(secret);
|
|
15922
|
+
if ("error" in keyBytes) return keyBytes;
|
|
15923
|
+
return { code: hotpFromCounter(keyBytes, counter, digits, algorithm), counter, digits, algorithm };
|
|
15924
|
+
}
|
|
15925
|
+
function generateTotp(secret, options = {}) {
|
|
15926
|
+
const periodSeconds = options.periodSeconds ?? 30;
|
|
15927
|
+
const timestamp = options.timestamp ?? Math.floor(Date.now() / 1e3);
|
|
15928
|
+
if (!Number.isFinite(periodSeconds) || periodSeconds <= 0) {
|
|
15929
|
+
return { error: "Period must be a positive number of seconds" };
|
|
15930
|
+
}
|
|
15931
|
+
if (!Number.isFinite(timestamp) || timestamp < 0) {
|
|
15932
|
+
return { error: "Timestamp must be a non-negative number of seconds" };
|
|
15933
|
+
}
|
|
15934
|
+
const counter = Math.floor(timestamp / periodSeconds);
|
|
15935
|
+
const hotp = generateHotp(secret, counter, options);
|
|
15936
|
+
if ("error" in hotp) return hotp;
|
|
15937
|
+
const secondsRemaining = periodSeconds - timestamp % periodSeconds;
|
|
15938
|
+
return { ...hotp, periodSeconds, secondsRemaining };
|
|
15939
|
+
}
|
|
15829
15940
|
|
|
15830
15941
|
// src/tools/code.ts
|
|
15831
15942
|
var code_exports = {};
|
package/dist/index.d.cts
CHANGED
|
@@ -5,9 +5,9 @@ export { t as text } from './text-DWUcY8H1.cjs';
|
|
|
5
5
|
export { d as data } from './data-26TALa9U.cjs';
|
|
6
6
|
export { g as generators } from './generators-DAXXrMvG.cjs';
|
|
7
7
|
export { t as time } from './time-KqJjdqII.cjs';
|
|
8
|
-
export { u as units } from './units-
|
|
8
|
+
export { u as units } from './units-BT8P27G0.cjs';
|
|
9
9
|
export { n as network } from './network-BmqYmfqY.cjs';
|
|
10
|
-
export { a as api } from './api-
|
|
10
|
+
export { a as api } from './api-C8rImfka.cjs';
|
|
11
11
|
export { c as code } from './code-CoeD4Fmq.cjs';
|
|
12
12
|
export { c as color } from './color-tPwZCr9H.cjs';
|
|
13
13
|
export { c as css } from './css-Cf7AMGM-.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -5,9 +5,9 @@ export { t as text } from './text-DWUcY8H1.js';
|
|
|
5
5
|
export { d as data } from './data-26TALa9U.js';
|
|
6
6
|
export { g as generators } from './generators-DAXXrMvG.js';
|
|
7
7
|
export { t as time } from './time-KqJjdqII.js';
|
|
8
|
-
export { u as units } from './units-
|
|
8
|
+
export { u as units } from './units-BT8P27G0.js';
|
|
9
9
|
export { n as network } from './network-BmqYmfqY.js';
|
|
10
|
-
export { a as api } from './api-
|
|
10
|
+
export { a as api } from './api-C8rImfka.js';
|
|
11
11
|
export { c as code } from './code-CoeD4Fmq.js';
|
|
12
12
|
export { c as color } from './color-tPwZCr9H.js';
|
|
13
13
|
export { c as css } from './css-Cf7AMGM-.js';
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { media_exports as media } from './chunk-226EH3ZI.js';
|
|
2
|
-
export { units_exports as units } from './chunk-
|
|
2
|
+
export { units_exports as units } from './chunk-653HDWXW.js';
|
|
3
3
|
export { network_exports as network } from './chunk-ACGCCOCK.js';
|
|
4
|
-
export { api_exports as api } from './chunk-
|
|
4
|
+
export { api_exports as api } from './chunk-4S63T7Y4.js';
|
|
5
5
|
export { code_exports as code } from './chunk-DAD2ZOTJ.js';
|
|
6
6
|
export { color_exports as color } from './chunk-BPVAB4P2.js';
|
|
7
7
|
export { css_exports as css } from './chunk-6YPV2AB5.js';
|
package/dist/tools/api.cjs
CHANGED
|
@@ -1265,6 +1265,75 @@ function generateMetaHtml(tags) {
|
|
|
1265
1265
|
}
|
|
1266
1266
|
return lines.join("\n");
|
|
1267
1267
|
}
|
|
1268
|
+
var OTP_ALG_TO_NODE_HASH = {
|
|
1269
|
+
SHA1: "sha1",
|
|
1270
|
+
SHA256: "sha256",
|
|
1271
|
+
SHA512: "sha512"
|
|
1272
|
+
};
|
|
1273
|
+
function decodeBase32Secret(secret) {
|
|
1274
|
+
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
|
|
1275
|
+
const cleaned = secret.toUpperCase().replace(/[\s=]/g, "");
|
|
1276
|
+
if (!cleaned) {
|
|
1277
|
+
return { error: "Secret must not be empty" };
|
|
1278
|
+
}
|
|
1279
|
+
const bytes = [];
|
|
1280
|
+
let buffer = 0;
|
|
1281
|
+
let bitsLeft = 0;
|
|
1282
|
+
for (const char of cleaned) {
|
|
1283
|
+
const val = alphabet.indexOf(char);
|
|
1284
|
+
if (val === -1) {
|
|
1285
|
+
return { error: `Invalid base32 character '${char}' in secret` };
|
|
1286
|
+
}
|
|
1287
|
+
buffer = buffer << 5 | val;
|
|
1288
|
+
bitsLeft += 5;
|
|
1289
|
+
if (bitsLeft >= 8) {
|
|
1290
|
+
bitsLeft -= 8;
|
|
1291
|
+
bytes.push(buffer >> bitsLeft & 255);
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
return Buffer.from(bytes);
|
|
1295
|
+
}
|
|
1296
|
+
function hotpFromCounter(keyBytes, counter, digits, algorithm) {
|
|
1297
|
+
const counterBuffer = Buffer.alloc(8);
|
|
1298
|
+
counterBuffer.writeUInt32BE(Math.floor(counter / 4294967296), 0);
|
|
1299
|
+
counterBuffer.writeUInt32BE(counter % 4294967296, 4);
|
|
1300
|
+
const hmac = crypto.createHmac(OTP_ALG_TO_NODE_HASH[algorithm], keyBytes).update(counterBuffer).digest();
|
|
1301
|
+
const offset = hmac[hmac.length - 1] & 15;
|
|
1302
|
+
const binCode = (hmac[offset] & 127) << 24 | (hmac[offset + 1] & 255) << 16 | (hmac[offset + 2] & 255) << 8 | hmac[offset + 3] & 255;
|
|
1303
|
+
const code = (binCode % 10 ** digits).toString().padStart(digits, "0");
|
|
1304
|
+
return code;
|
|
1305
|
+
}
|
|
1306
|
+
function generateHotp(secret, counter, options = {}) {
|
|
1307
|
+
const digits = options.digits ?? 6;
|
|
1308
|
+
const algorithm = options.algorithm ?? "SHA1";
|
|
1309
|
+
if (!Number.isInteger(counter) || counter < 0) {
|
|
1310
|
+
return { error: "Counter must be a non-negative whole number" };
|
|
1311
|
+
}
|
|
1312
|
+
if (!Number.isInteger(digits) || digits < 6 || digits > 8) {
|
|
1313
|
+
return { error: "Digits must be an integer between 6 and 8" };
|
|
1314
|
+
}
|
|
1315
|
+
if (!(algorithm in OTP_ALG_TO_NODE_HASH)) {
|
|
1316
|
+
return { error: "Algorithm must be one of SHA1, SHA256, SHA512" };
|
|
1317
|
+
}
|
|
1318
|
+
const keyBytes = decodeBase32Secret(secret);
|
|
1319
|
+
if ("error" in keyBytes) return keyBytes;
|
|
1320
|
+
return { code: hotpFromCounter(keyBytes, counter, digits, algorithm), counter, digits, algorithm };
|
|
1321
|
+
}
|
|
1322
|
+
function generateTotp(secret, options = {}) {
|
|
1323
|
+
const periodSeconds = options.periodSeconds ?? 30;
|
|
1324
|
+
const timestamp = options.timestamp ?? Math.floor(Date.now() / 1e3);
|
|
1325
|
+
if (!Number.isFinite(periodSeconds) || periodSeconds <= 0) {
|
|
1326
|
+
return { error: "Period must be a positive number of seconds" };
|
|
1327
|
+
}
|
|
1328
|
+
if (!Number.isFinite(timestamp) || timestamp < 0) {
|
|
1329
|
+
return { error: "Timestamp must be a non-negative number of seconds" };
|
|
1330
|
+
}
|
|
1331
|
+
const counter = Math.floor(timestamp / periodSeconds);
|
|
1332
|
+
const hotp = generateHotp(secret, counter, options);
|
|
1333
|
+
if ("error" in hotp) return hotp;
|
|
1334
|
+
const secondsRemaining = periodSeconds - timestamp % periodSeconds;
|
|
1335
|
+
return { ...hotp, periodSeconds, secondsRemaining };
|
|
1336
|
+
}
|
|
1268
1337
|
|
|
1269
1338
|
exports.COMMON_HEADERS = COMMON_HEADERS;
|
|
1270
1339
|
exports.COMMON_PRESETS = COMMON_PRESETS;
|
|
@@ -1291,7 +1360,9 @@ exports.formatResponse = formatResponse;
|
|
|
1291
1360
|
exports.generateCors = generateCors;
|
|
1292
1361
|
exports.generateCspHeader = generateCspHeader;
|
|
1293
1362
|
exports.generateFullHeader = generateFullHeader;
|
|
1363
|
+
exports.generateHotp = generateHotp;
|
|
1294
1364
|
exports.generateMetaHtml = generateMetaHtml;
|
|
1365
|
+
exports.generateTotp = generateTotp;
|
|
1295
1366
|
exports.getParam = getParam;
|
|
1296
1367
|
exports.getStats = getStats;
|
|
1297
1368
|
exports.isValidUrl = isValidUrl;
|
package/dist/tools/api.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { C as COMMON_HEADERS, b as COMMON_PRESETS, c as CORS_COMMON_HEADERS, d as CorsConfig, e as CorsOutput, f as CspConfig, g as CspDirective, h as CspSource, i as CurlCommand, j as CurlConfig, D as DEFAULT_CORS_CONFIG, k as DIRECTIVE_DESCRIPTIONS, l as DirectiveConfig, F as FormatResult, H as HTTP_METHODS, m as Header, n as HttpMethod, J as JwkSummary,
|
|
1
|
+
export { C as COMMON_HEADERS, b as COMMON_PRESETS, c as CORS_COMMON_HEADERS, d as CorsConfig, e as CorsOutput, f as CspConfig, g as CspDirective, h as CspSource, i as CurlCommand, j as CurlConfig, D as DEFAULT_CORS_CONFIG, k as DIRECTIVE_DESCRIPTIONS, l as DirectiveConfig, F as FormatResult, H as HTTP_METHODS, m as Header, n as HotpResult, o as HttpMethod, J as JwkSummary, p as JwkThumbprintErrorResult, q as JwkThumbprintHash, r as JwkThumbprintOutcome, s as JwkThumbprintResult, t as JwksError, u as JwksParseResult, v as JwksResult, w as JwtAlgorithm, x as JwtDecodeError, y as JwtDecodeResult, z as JwtExpiry, A as JwtPart, B as JwtResult, E as JwtSignOptions, M as MetaTags, O as OgTags, G as OtpAlgorithm, I as OtpOptions, P as ParsedUrl, R as ResponseFormat, S as SUPPORTED_LANGUAGES, T as TargetLanguage, K as TotpOptions, L as TotpResult, N as TwitterTags, Q as addParam, U as base64urlDecode, V as base64urlEncode, W as buildCurl, X as buildCurlMultiline, Y as buildUrl, Z as computeJwkThumbprint, _ as convertToCode, $ as decodeJwt, a0 as decodeUrlComponent, a1 as detectFormat, a2 as encodeUrlComponent, a3 as extractJsonPaths, a4 as formatJwtJson, a5 as formatResponse, a6 as generateCors, a7 as generateCspHeader, a8 as generateFullHeader, a9 as generateHotp, aa as generateMetaHtml, ab as generateTotp, ac as getParam, ad as getStats, ae as isValidUrl, af as normalizeUrl, ag as parseCspHeader, ah as parseCurl, ai as parseCurlCommand, aj as parseJwks, ak as parseMetaTags, al as parseUrl, am as removeParam, an as signJwt, ao as validateCorsConfig, ap as validateCspConfig, aq as validateOgTags } from '../api-C8rImfka.cjs';
|
package/dist/tools/api.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { C as COMMON_HEADERS, b as COMMON_PRESETS, c as CORS_COMMON_HEADERS, d as CorsConfig, e as CorsOutput, f as CspConfig, g as CspDirective, h as CspSource, i as CurlCommand, j as CurlConfig, D as DEFAULT_CORS_CONFIG, k as DIRECTIVE_DESCRIPTIONS, l as DirectiveConfig, F as FormatResult, H as HTTP_METHODS, m as Header, n as HttpMethod, J as JwkSummary,
|
|
1
|
+
export { C as COMMON_HEADERS, b as COMMON_PRESETS, c as CORS_COMMON_HEADERS, d as CorsConfig, e as CorsOutput, f as CspConfig, g as CspDirective, h as CspSource, i as CurlCommand, j as CurlConfig, D as DEFAULT_CORS_CONFIG, k as DIRECTIVE_DESCRIPTIONS, l as DirectiveConfig, F as FormatResult, H as HTTP_METHODS, m as Header, n as HotpResult, o as HttpMethod, J as JwkSummary, p as JwkThumbprintErrorResult, q as JwkThumbprintHash, r as JwkThumbprintOutcome, s as JwkThumbprintResult, t as JwksError, u as JwksParseResult, v as JwksResult, w as JwtAlgorithm, x as JwtDecodeError, y as JwtDecodeResult, z as JwtExpiry, A as JwtPart, B as JwtResult, E as JwtSignOptions, M as MetaTags, O as OgTags, G as OtpAlgorithm, I as OtpOptions, P as ParsedUrl, R as ResponseFormat, S as SUPPORTED_LANGUAGES, T as TargetLanguage, K as TotpOptions, L as TotpResult, N as TwitterTags, Q as addParam, U as base64urlDecode, V as base64urlEncode, W as buildCurl, X as buildCurlMultiline, Y as buildUrl, Z as computeJwkThumbprint, _ as convertToCode, $ as decodeJwt, a0 as decodeUrlComponent, a1 as detectFormat, a2 as encodeUrlComponent, a3 as extractJsonPaths, a4 as formatJwtJson, a5 as formatResponse, a6 as generateCors, a7 as generateCspHeader, a8 as generateFullHeader, a9 as generateHotp, aa as generateMetaHtml, ab as generateTotp, ac as getParam, ad as getStats, ae as isValidUrl, af as normalizeUrl, ag as parseCspHeader, ah as parseCurl, ai as parseCurlCommand, aj as parseJwks, ak as parseMetaTags, al as parseUrl, am as removeParam, an as signJwt, ao as validateCorsConfig, ap as validateCspConfig, aq as validateOgTags } from '../api-C8rImfka.js';
|
package/dist/tools/api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { COMMON_HEADERS, COMMON_PRESETS, CORS_COMMON_HEADERS, DEFAULT_CORS_CONFIG, DIRECTIVE_DESCRIPTIONS, HTTP_METHODS, SUPPORTED_LANGUAGES, addParam, base64urlDecode, base64urlEncode, buildCurl, buildCurlMultiline, buildUrl, computeJwkThumbprint, convertToCode, decodeJwt, decodeUrlComponent, detectFormat, encodeUrlComponent, extractJsonPaths, formatJwtJson, formatResponse, generateCors, generateCspHeader, generateFullHeader, generateMetaHtml, getParam, getStats, isValidUrl, normalizeUrl, parseCspHeader, parseCurl, parseCurlCommand, parseJwks, parseMetaTags, parseUrl, removeParam, signJwt, validateCorsConfig, validateCspConfig, validateOgTags } from '../chunk-
|
|
1
|
+
export { COMMON_HEADERS, COMMON_PRESETS, CORS_COMMON_HEADERS, DEFAULT_CORS_CONFIG, DIRECTIVE_DESCRIPTIONS, HTTP_METHODS, SUPPORTED_LANGUAGES, addParam, base64urlDecode, base64urlEncode, buildCurl, buildCurlMultiline, buildUrl, computeJwkThumbprint, convertToCode, decodeJwt, decodeUrlComponent, detectFormat, encodeUrlComponent, extractJsonPaths, formatJwtJson, formatResponse, generateCors, generateCspHeader, generateFullHeader, generateHotp, generateMetaHtml, generateTotp, getParam, getStats, isValidUrl, normalizeUrl, parseCspHeader, parseCurl, parseCurlCommand, parseJwks, parseMetaTags, parseUrl, removeParam, signJwt, validateCorsConfig, validateCspConfig, validateOgTags } from '../chunk-4S63T7Y4.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
package/dist/tools/units.cjs
CHANGED
|
@@ -2399,6 +2399,45 @@ function calculateLoanRefinance(currentBalance, currentRatePercent, currentRemai
|
|
|
2399
2399
|
totalInterestSavings: round2(current.totalInterest - refinanced.totalInterest)
|
|
2400
2400
|
};
|
|
2401
2401
|
}
|
|
2402
|
+
function calculateTaxEquivalentYield(inputYieldPercent, federalTaxRatePercent, stateTaxRatePercent = 0, direction) {
|
|
2403
|
+
if (!Number.isFinite(inputYieldPercent) || inputYieldPercent < 0) {
|
|
2404
|
+
return { error: "Yield must be zero or a positive number" };
|
|
2405
|
+
}
|
|
2406
|
+
if (!Number.isFinite(federalTaxRatePercent) || federalTaxRatePercent < 0 || federalTaxRatePercent >= 100) {
|
|
2407
|
+
return { error: "Federal tax rate must be a percentage between 0 and 100 (exclusive of 100)" };
|
|
2408
|
+
}
|
|
2409
|
+
if (!Number.isFinite(stateTaxRatePercent) || stateTaxRatePercent < 0 || stateTaxRatePercent >= 100) {
|
|
2410
|
+
return { error: "State tax rate must be a percentage between 0 and 100 (exclusive of 100)" };
|
|
2411
|
+
}
|
|
2412
|
+
if (direction !== "tax-free-to-taxable" && direction !== "taxable-to-tax-free") {
|
|
2413
|
+
return { error: 'Direction must be "tax-free-to-taxable" or "taxable-to-tax-free"' };
|
|
2414
|
+
}
|
|
2415
|
+
const combinedTaxRatePercent = federalTaxRatePercent + stateTaxRatePercent;
|
|
2416
|
+
if (combinedTaxRatePercent >= 100) {
|
|
2417
|
+
return { error: "Combined federal and state tax rate must be less than 100%" };
|
|
2418
|
+
}
|
|
2419
|
+
const round6 = (n) => Math.round(n * 1e6) / 1e6;
|
|
2420
|
+
const combinedRateDecimal = combinedTaxRatePercent / 100;
|
|
2421
|
+
let taxFreeYield;
|
|
2422
|
+
let taxableYield;
|
|
2423
|
+
if (direction === "tax-free-to-taxable") {
|
|
2424
|
+
taxFreeYield = inputYieldPercent;
|
|
2425
|
+
taxableYield = taxFreeYield / (1 - combinedRateDecimal);
|
|
2426
|
+
} else {
|
|
2427
|
+
taxableYield = inputYieldPercent;
|
|
2428
|
+
taxFreeYield = taxableYield * (1 - combinedRateDecimal);
|
|
2429
|
+
}
|
|
2430
|
+
return {
|
|
2431
|
+
direction,
|
|
2432
|
+
inputYield: round6(inputYieldPercent),
|
|
2433
|
+
federalTaxRatePercent: round6(federalTaxRatePercent),
|
|
2434
|
+
stateTaxRatePercent: round6(stateTaxRatePercent),
|
|
2435
|
+
combinedTaxRatePercent: round6(combinedTaxRatePercent),
|
|
2436
|
+
taxFreeYield: round6(taxFreeYield),
|
|
2437
|
+
taxableYield: round6(taxableYield),
|
|
2438
|
+
yieldDifference: round6(taxableYield - taxFreeYield)
|
|
2439
|
+
};
|
|
2440
|
+
}
|
|
2402
2441
|
|
|
2403
2442
|
exports.BASE_LABELS = BASE_LABELS;
|
|
2404
2443
|
exports.BASE_PREFIXES = BASE_PREFIXES;
|
|
@@ -2444,6 +2483,7 @@ exports.calculateRuleOf72 = calculateRuleOf72;
|
|
|
2444
2483
|
exports.calculateSavingsGoal = calculateSavingsGoal;
|
|
2445
2484
|
exports.calculateSimpleInterest = calculateSimpleInterest;
|
|
2446
2485
|
exports.calculateTax = calculateTax;
|
|
2486
|
+
exports.calculateTaxEquivalentYield = calculateTaxEquivalentYield;
|
|
2447
2487
|
exports.calculateTimeValue = calculateTimeValue;
|
|
2448
2488
|
exports.calculateTipSplit = calculateTipSplit;
|
|
2449
2489
|
exports.calculateVideoBitrate = calculateVideoBitrate;
|
package/dist/tools/units.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as AmortizationRow, a as AprApyDirection, b as AprApyResult, c as AspectRatioResult, B as BASE_LABELS, d as BASE_PREFIXES, e as BYTE_UNITS, f as BarcodeFormat, g as BarcodeValidationResult, h as BaseConvertResult, i as BlendedLoanRateResult, j as BreakEvenInput, k as BreakEvenResult, l as ByteConvertResult, m as ByteUnit, C as COMMON_CURRENCIES, n as COMMON_LOCALES, o as COMMON_PERMISSIONS, p as COMMON_RATIOS, q as COMMON_SIZES, r as COMMON_TAX_RATES, s as COMMON_TIP_PERCENTAGES, t as COMMON_VIEWPORTS, v as CardValidationResult, w as CashBreakdownResult, x as CashChangeResult, y as CashDenominationItem, z as CashRoundingMode, D as CashRoundingResult, E as CdMaturityResult, F as CompareUnitPricesResult, G as CompoundInterestResult, H as CompoundYearRow, I as CreditAccountInput, J as CreditAccountResult, K as CreditUtilizationResult, L as DebtItemInput, M as DebtItemResult, N as DebtPayoffComparison, O as DebtPayoffInput, P as DebtPayoffPlanResult, Q as DebtPayoffScheduleEntry, R as DebtPayoffStrategy, S as DebtPayoffStrategyResult, T as DebtToIncomeRatioResult, U as DepreciationMethod, V as DepreciationResult, W as DepreciationYear, X as Dimensions, Y as DiscountField, Z as DiscountInput, _ as DiscountResult, $ as DtiTier, a0 as EmiResult, a1 as EmiTenureUnit, a2 as EmiYearlyBreakdownRow, a3 as ExtraPaymentPayoffResult, a4 as FilePermissions, a5 as FormatOptions, a6 as FreelancerRateInput, a7 as FreelancerRateResult, a8 as GPA_GRADE_POINTS, a9 as GpaCourse, aa as GpaCourseResult, ab as GpaResult, ac as IbanValidationResult, ad as IpConversion, ae as IsbnFormat, af as IsbnResult, ag as LoanBalanceInput, ah as LoanBalanceResult, ai as LoanRefinanceResult, aj as LoanResult, ak as MarginMarkupField, al as MarginMarkupInput, am as MarginMarkupResult, an as MovingAveragePoint, ao as MovingAverageResult, ap as NotationStyle, aq as NumberBase, ar as PaybackPeriodInput, as as PaybackPeriodResult, at as PercentChangeDirection, au as PercentageChangeResult, av as Permission, aw as PxConvertResult, ax as RoiInput, ay as RoiResult, az as RuleOf72Direction, aA as RuleOf72Result, aB as SavingsGoalInput, aC as SavingsGoalMode, aD as SavingsGoalResult, aE as SemverVersion, aF as SimpleInterestResult, aG as SubnetInfo, aH as SuccessiveDiscountResult, aI as SuccessiveDiscountStep, aJ as TaxDirection, aK as
|
|
1
|
+
export { A as AmortizationRow, a as AprApyDirection, b as AprApyResult, c as AspectRatioResult, B as BASE_LABELS, d as BASE_PREFIXES, e as BYTE_UNITS, f as BarcodeFormat, g as BarcodeValidationResult, h as BaseConvertResult, i as BlendedLoanRateResult, j as BreakEvenInput, k as BreakEvenResult, l as ByteConvertResult, m as ByteUnit, C as COMMON_CURRENCIES, n as COMMON_LOCALES, o as COMMON_PERMISSIONS, p as COMMON_RATIOS, q as COMMON_SIZES, r as COMMON_TAX_RATES, s as COMMON_TIP_PERCENTAGES, t as COMMON_VIEWPORTS, v as CardValidationResult, w as CashBreakdownResult, x as CashChangeResult, y as CashDenominationItem, z as CashRoundingMode, D as CashRoundingResult, E as CdMaturityResult, F as CompareUnitPricesResult, G as CompoundInterestResult, H as CompoundYearRow, I as CreditAccountInput, J as CreditAccountResult, K as CreditUtilizationResult, L as DebtItemInput, M as DebtItemResult, N as DebtPayoffComparison, O as DebtPayoffInput, P as DebtPayoffPlanResult, Q as DebtPayoffScheduleEntry, R as DebtPayoffStrategy, S as DebtPayoffStrategyResult, T as DebtToIncomeRatioResult, U as DepreciationMethod, V as DepreciationResult, W as DepreciationYear, X as Dimensions, Y as DiscountField, Z as DiscountInput, _ as DiscountResult, $ as DtiTier, a0 as EmiResult, a1 as EmiTenureUnit, a2 as EmiYearlyBreakdownRow, a3 as ExtraPaymentPayoffResult, a4 as FilePermissions, a5 as FormatOptions, a6 as FreelancerRateInput, a7 as FreelancerRateResult, a8 as GPA_GRADE_POINTS, a9 as GpaCourse, aa as GpaCourseResult, ab as GpaResult, ac as IbanValidationResult, ad as IpConversion, ae as IsbnFormat, af as IsbnResult, ag as LoanBalanceInput, ah as LoanBalanceResult, ai as LoanRefinanceResult, aj as LoanResult, ak as MarginMarkupField, al as MarginMarkupInput, am as MarginMarkupResult, an as MovingAveragePoint, ao as MovingAverageResult, ap as NotationStyle, aq as NumberBase, ar as PaybackPeriodInput, as as PaybackPeriodResult, at as PercentChangeDirection, au as PercentageChangeResult, av as Permission, aw as PxConvertResult, ax as RoiInput, ay as RoiResult, az as RuleOf72Direction, aA as RuleOf72Result, aB as SavingsGoalInput, aC as SavingsGoalMode, aD as SavingsGoalResult, aE as SemverVersion, aF as SimpleInterestResult, aG as SubnetInfo, aH as SuccessiveDiscountResult, aI as SuccessiveDiscountStep, aJ as TaxDirection, aK as TaxEquivalentYieldDirection, aL as TaxEquivalentYieldResult, aM as TaxResult, aN as TimeValueDirection, aO as TimeValueResult, aP as TipSplitResult, aQ as USD_DENOMINATIONS, aR as UnitPriceItem, aS as UnitPriceResult, aT as UtilizationTier, aU as VideoBitrateInput, aV as VideoBitrateMode, aW as VideoBitrateResult, aX as ViewportConvertResult, aY as applySuccessiveDiscounts, aZ as autoFormat, a_ as bumpVersion, a$ as calcAspectRatio, b0 as calcSubnet, b1 as calculateBlendedLoanRate, b2 as calculateBreakEven, b3 as calculateCashBreakdown, b4 as calculateCashRounding, b5 as calculateCdMaturity, b6 as calculateChange, b7 as calculateCompoundInterest, b8 as calculateCreditUtilization, b9 as calculateDebtToIncomeRatio, ba as calculateDepreciationSchedule, bb as calculateDiscount, bc as calculateEmi, bd as calculateExtraPaymentPayoff, be as calculateFreelancerRate, bf as calculateGpa, bg as calculateLoan, bh as calculateLoanRefinance, bi as calculateMarginMarkup, bj as calculateMovingAverages, bk as calculatePaybackPeriod, bl as calculatePercentageChange, bm as calculateRoi, bn as calculateRuleOf72, bo as calculateSavingsGoal, bp as calculateSimpleInterest, bq as calculateTax, br as calculateTaxEquivalentYield, bs as calculateTimeValue, bt as calculateTipSplit, bu as calculateVideoBitrate, bv as compareSemver, bw as compareUnitPrices, bx as convert, by as convertAprApy, bz as convertBytes, bA as convertIp, bB as coverBox, bC as decimalToIp, bD as decimalToIpCidr, bE as describePermissions, bF as fitIntoBox, bG as formatNumber, bH as formatValue, bI as formatVwValue, bJ as formatWithSeparator, bK as gcd, bL as ipFromBinary, bM as ipFromDecimal, bN as ipFromHex, bO as ipToBinary, bP as ipToDecimal, bQ as ipToDecimalCidr, bR as ipToHex, bS as ipToOctal, bT as isValid, bU as isValidCidr, bV as isValidIp, bW as isValidIpv4, bX as marginToMarkup, bY as markupToMargin, bZ as octalToPermissions, b_ as parseFileSize, b$ as parseInput, c0 as parseNumberString, c1 as parseSemver, c2 as permissionsToChmod, c3 as permissionsToOctal, c4 as permissionsToSymbolic, c5 as planDebtPayoff, c6 as ptToPx, c7 as pxToAll, c8 as pxToViewport, c9 as remToPx, ca as satisfiesRange, cb as scaleByHeight, cc as scaleByWidth, cd as sortVersions, ce as splitSubnet, cf as symbolicToPermissions, cg as validateBarcode, ch as validateCardNumber, ci as validateIban, cj as validateIsbn, ck as viewportToPx } from '../units-BT8P27G0.cjs';
|
package/dist/tools/units.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as AmortizationRow, a as AprApyDirection, b as AprApyResult, c as AspectRatioResult, B as BASE_LABELS, d as BASE_PREFIXES, e as BYTE_UNITS, f as BarcodeFormat, g as BarcodeValidationResult, h as BaseConvertResult, i as BlendedLoanRateResult, j as BreakEvenInput, k as BreakEvenResult, l as ByteConvertResult, m as ByteUnit, C as COMMON_CURRENCIES, n as COMMON_LOCALES, o as COMMON_PERMISSIONS, p as COMMON_RATIOS, q as COMMON_SIZES, r as COMMON_TAX_RATES, s as COMMON_TIP_PERCENTAGES, t as COMMON_VIEWPORTS, v as CardValidationResult, w as CashBreakdownResult, x as CashChangeResult, y as CashDenominationItem, z as CashRoundingMode, D as CashRoundingResult, E as CdMaturityResult, F as CompareUnitPricesResult, G as CompoundInterestResult, H as CompoundYearRow, I as CreditAccountInput, J as CreditAccountResult, K as CreditUtilizationResult, L as DebtItemInput, M as DebtItemResult, N as DebtPayoffComparison, O as DebtPayoffInput, P as DebtPayoffPlanResult, Q as DebtPayoffScheduleEntry, R as DebtPayoffStrategy, S as DebtPayoffStrategyResult, T as DebtToIncomeRatioResult, U as DepreciationMethod, V as DepreciationResult, W as DepreciationYear, X as Dimensions, Y as DiscountField, Z as DiscountInput, _ as DiscountResult, $ as DtiTier, a0 as EmiResult, a1 as EmiTenureUnit, a2 as EmiYearlyBreakdownRow, a3 as ExtraPaymentPayoffResult, a4 as FilePermissions, a5 as FormatOptions, a6 as FreelancerRateInput, a7 as FreelancerRateResult, a8 as GPA_GRADE_POINTS, a9 as GpaCourse, aa as GpaCourseResult, ab as GpaResult, ac as IbanValidationResult, ad as IpConversion, ae as IsbnFormat, af as IsbnResult, ag as LoanBalanceInput, ah as LoanBalanceResult, ai as LoanRefinanceResult, aj as LoanResult, ak as MarginMarkupField, al as MarginMarkupInput, am as MarginMarkupResult, an as MovingAveragePoint, ao as MovingAverageResult, ap as NotationStyle, aq as NumberBase, ar as PaybackPeriodInput, as as PaybackPeriodResult, at as PercentChangeDirection, au as PercentageChangeResult, av as Permission, aw as PxConvertResult, ax as RoiInput, ay as RoiResult, az as RuleOf72Direction, aA as RuleOf72Result, aB as SavingsGoalInput, aC as SavingsGoalMode, aD as SavingsGoalResult, aE as SemverVersion, aF as SimpleInterestResult, aG as SubnetInfo, aH as SuccessiveDiscountResult, aI as SuccessiveDiscountStep, aJ as TaxDirection, aK as
|
|
1
|
+
export { A as AmortizationRow, a as AprApyDirection, b as AprApyResult, c as AspectRatioResult, B as BASE_LABELS, d as BASE_PREFIXES, e as BYTE_UNITS, f as BarcodeFormat, g as BarcodeValidationResult, h as BaseConvertResult, i as BlendedLoanRateResult, j as BreakEvenInput, k as BreakEvenResult, l as ByteConvertResult, m as ByteUnit, C as COMMON_CURRENCIES, n as COMMON_LOCALES, o as COMMON_PERMISSIONS, p as COMMON_RATIOS, q as COMMON_SIZES, r as COMMON_TAX_RATES, s as COMMON_TIP_PERCENTAGES, t as COMMON_VIEWPORTS, v as CardValidationResult, w as CashBreakdownResult, x as CashChangeResult, y as CashDenominationItem, z as CashRoundingMode, D as CashRoundingResult, E as CdMaturityResult, F as CompareUnitPricesResult, G as CompoundInterestResult, H as CompoundYearRow, I as CreditAccountInput, J as CreditAccountResult, K as CreditUtilizationResult, L as DebtItemInput, M as DebtItemResult, N as DebtPayoffComparison, O as DebtPayoffInput, P as DebtPayoffPlanResult, Q as DebtPayoffScheduleEntry, R as DebtPayoffStrategy, S as DebtPayoffStrategyResult, T as DebtToIncomeRatioResult, U as DepreciationMethod, V as DepreciationResult, W as DepreciationYear, X as Dimensions, Y as DiscountField, Z as DiscountInput, _ as DiscountResult, $ as DtiTier, a0 as EmiResult, a1 as EmiTenureUnit, a2 as EmiYearlyBreakdownRow, a3 as ExtraPaymentPayoffResult, a4 as FilePermissions, a5 as FormatOptions, a6 as FreelancerRateInput, a7 as FreelancerRateResult, a8 as GPA_GRADE_POINTS, a9 as GpaCourse, aa as GpaCourseResult, ab as GpaResult, ac as IbanValidationResult, ad as IpConversion, ae as IsbnFormat, af as IsbnResult, ag as LoanBalanceInput, ah as LoanBalanceResult, ai as LoanRefinanceResult, aj as LoanResult, ak as MarginMarkupField, al as MarginMarkupInput, am as MarginMarkupResult, an as MovingAveragePoint, ao as MovingAverageResult, ap as NotationStyle, aq as NumberBase, ar as PaybackPeriodInput, as as PaybackPeriodResult, at as PercentChangeDirection, au as PercentageChangeResult, av as Permission, aw as PxConvertResult, ax as RoiInput, ay as RoiResult, az as RuleOf72Direction, aA as RuleOf72Result, aB as SavingsGoalInput, aC as SavingsGoalMode, aD as SavingsGoalResult, aE as SemverVersion, aF as SimpleInterestResult, aG as SubnetInfo, aH as SuccessiveDiscountResult, aI as SuccessiveDiscountStep, aJ as TaxDirection, aK as TaxEquivalentYieldDirection, aL as TaxEquivalentYieldResult, aM as TaxResult, aN as TimeValueDirection, aO as TimeValueResult, aP as TipSplitResult, aQ as USD_DENOMINATIONS, aR as UnitPriceItem, aS as UnitPriceResult, aT as UtilizationTier, aU as VideoBitrateInput, aV as VideoBitrateMode, aW as VideoBitrateResult, aX as ViewportConvertResult, aY as applySuccessiveDiscounts, aZ as autoFormat, a_ as bumpVersion, a$ as calcAspectRatio, b0 as calcSubnet, b1 as calculateBlendedLoanRate, b2 as calculateBreakEven, b3 as calculateCashBreakdown, b4 as calculateCashRounding, b5 as calculateCdMaturity, b6 as calculateChange, b7 as calculateCompoundInterest, b8 as calculateCreditUtilization, b9 as calculateDebtToIncomeRatio, ba as calculateDepreciationSchedule, bb as calculateDiscount, bc as calculateEmi, bd as calculateExtraPaymentPayoff, be as calculateFreelancerRate, bf as calculateGpa, bg as calculateLoan, bh as calculateLoanRefinance, bi as calculateMarginMarkup, bj as calculateMovingAverages, bk as calculatePaybackPeriod, bl as calculatePercentageChange, bm as calculateRoi, bn as calculateRuleOf72, bo as calculateSavingsGoal, bp as calculateSimpleInterest, bq as calculateTax, br as calculateTaxEquivalentYield, bs as calculateTimeValue, bt as calculateTipSplit, bu as calculateVideoBitrate, bv as compareSemver, bw as compareUnitPrices, bx as convert, by as convertAprApy, bz as convertBytes, bA as convertIp, bB as coverBox, bC as decimalToIp, bD as decimalToIpCidr, bE as describePermissions, bF as fitIntoBox, bG as formatNumber, bH as formatValue, bI as formatVwValue, bJ as formatWithSeparator, bK as gcd, bL as ipFromBinary, bM as ipFromDecimal, bN as ipFromHex, bO as ipToBinary, bP as ipToDecimal, bQ as ipToDecimalCidr, bR as ipToHex, bS as ipToOctal, bT as isValid, bU as isValidCidr, bV as isValidIp, bW as isValidIpv4, bX as marginToMarkup, bY as markupToMargin, bZ as octalToPermissions, b_ as parseFileSize, b$ as parseInput, c0 as parseNumberString, c1 as parseSemver, c2 as permissionsToChmod, c3 as permissionsToOctal, c4 as permissionsToSymbolic, c5 as planDebtPayoff, c6 as ptToPx, c7 as pxToAll, c8 as pxToViewport, c9 as remToPx, ca as satisfiesRange, cb as scaleByHeight, cc as scaleByWidth, cd as sortVersions, ce as splitSubnet, cf as symbolicToPermissions, cg as validateBarcode, ch as validateCardNumber, ci as validateIban, cj as validateIsbn, ck as viewportToPx } from '../units-BT8P27G0.js';
|
package/dist/tools/units.js
CHANGED
|
@@ -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, GPA_GRADE_POINTS, USD_DENOMINATIONS, applySuccessiveDiscounts, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, calculateBlendedLoanRate, calculateBreakEven, calculateCashBreakdown, calculateCashRounding, calculateCdMaturity, calculateChange, calculateCompoundInterest, calculateCreditUtilization, calculateDebtToIncomeRatio, calculateDepreciationSchedule, calculateDiscount, calculateEmi, calculateExtraPaymentPayoff, calculateFreelancerRate, calculateGpa, calculateLoan, calculateLoanRefinance, calculateMarginMarkup, calculateMovingAverages, calculatePaybackPeriod, calculatePercentageChange, calculateRoi, calculateRuleOf72, calculateSavingsGoal, calculateSimpleInterest, calculateTax, calculateTimeValue, calculateTipSplit, calculateVideoBitrate, compareSemver, compareUnitPrices, 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, marginToMarkup, markupToMargin, octalToPermissions, parseFileSize, parseInput, parseNumberString, parseSemver, permissionsToChmod, permissionsToOctal, permissionsToSymbolic, planDebtPayoff, ptToPx, pxToAll, pxToViewport, remToPx, satisfiesRange, scaleByHeight, scaleByWidth, sortVersions, splitSubnet, symbolicToPermissions, validateBarcode, validateCardNumber, validateIban, validateIsbn, viewportToPx } from '../chunk-
|
|
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, GPA_GRADE_POINTS, USD_DENOMINATIONS, applySuccessiveDiscounts, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, calculateBlendedLoanRate, calculateBreakEven, calculateCashBreakdown, calculateCashRounding, calculateCdMaturity, calculateChange, calculateCompoundInterest, calculateCreditUtilization, calculateDebtToIncomeRatio, calculateDepreciationSchedule, calculateDiscount, calculateEmi, calculateExtraPaymentPayoff, calculateFreelancerRate, calculateGpa, calculateLoan, calculateLoanRefinance, calculateMarginMarkup, calculateMovingAverages, calculatePaybackPeriod, calculatePercentageChange, calculateRoi, calculateRuleOf72, calculateSavingsGoal, calculateSimpleInterest, calculateTax, calculateTaxEquivalentYield, calculateTimeValue, calculateTipSplit, calculateVideoBitrate, compareSemver, compareUnitPrices, 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, marginToMarkup, markupToMargin, octalToPermissions, parseFileSize, parseInput, parseNumberString, parseSemver, permissionsToChmod, permissionsToOctal, permissionsToSymbolic, planDebtPayoff, ptToPx, pxToAll, pxToViewport, remToPx, satisfiesRange, scaleByHeight, scaleByWidth, sortVersions, splitSubnet, symbolicToPermissions, validateBarcode, validateCardNumber, validateIban, validateIsbn, viewportToPx } from '../chunk-653HDWXW.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
* - extra-payment-mortgage-calculator : calculateExtraPaymentPayoff
|
|
41
41
|
* - freelancer-rate-calculator : calculateFreelancerRate
|
|
42
42
|
* - debt-payoff-planner : planDebtPayoff
|
|
43
|
+
* - tax-equivalent-yield-calculator : calculateTaxEquivalentYield
|
|
43
44
|
*/
|
|
44
45
|
interface PxConvertResult {
|
|
45
46
|
px: number;
|
|
@@ -1171,6 +1172,29 @@ interface LoanRefinanceResult {
|
|
|
1171
1172
|
declare function calculateLoanRefinance(currentBalance: number, currentRatePercent: number, currentRemainingMonths: number, newRatePercent: number, newTermMonths: number, closingCosts: number): LoanRefinanceResult | {
|
|
1172
1173
|
error: string;
|
|
1173
1174
|
};
|
|
1175
|
+
type TaxEquivalentYieldDirection = "tax-free-to-taxable" | "taxable-to-tax-free";
|
|
1176
|
+
interface TaxEquivalentYieldResult {
|
|
1177
|
+
direction: TaxEquivalentYieldDirection;
|
|
1178
|
+
inputYield: number;
|
|
1179
|
+
federalTaxRatePercent: number;
|
|
1180
|
+
stateTaxRatePercent: number;
|
|
1181
|
+
combinedTaxRatePercent: number;
|
|
1182
|
+
taxFreeYield: number;
|
|
1183
|
+
taxableYield: number;
|
|
1184
|
+
yieldDifference: number;
|
|
1185
|
+
}
|
|
1186
|
+
/**
|
|
1187
|
+
* Converts between a tax-free municipal bond yield and the equivalent
|
|
1188
|
+
* taxable-bond yield given a marginal federal tax rate (plus an optional
|
|
1189
|
+
* state rate, summed into a single combined rate). With direction
|
|
1190
|
+
* "tax-free-to-taxable", taxableYield = taxFreeYield / (1 - combinedRate);
|
|
1191
|
+
* with "taxable-to-tax-free", taxFreeYield = taxableYield * (1 -
|
|
1192
|
+
* combinedRate). Pure formula over user-supplied rates, no live bond
|
|
1193
|
+
* pricing or jurisdiction-specific tax tables.
|
|
1194
|
+
*/
|
|
1195
|
+
declare function calculateTaxEquivalentYield(inputYieldPercent: number, federalTaxRatePercent: number, stateTaxRatePercent: number | undefined, direction: TaxEquivalentYieldDirection): TaxEquivalentYieldResult | {
|
|
1196
|
+
error: string;
|
|
1197
|
+
};
|
|
1174
1198
|
|
|
1175
1199
|
type units_AmortizationRow = AmortizationRow;
|
|
1176
1200
|
type units_AprApyDirection = AprApyDirection;
|
|
@@ -1271,6 +1295,8 @@ type units_SubnetInfo = SubnetInfo;
|
|
|
1271
1295
|
type units_SuccessiveDiscountResult = SuccessiveDiscountResult;
|
|
1272
1296
|
type units_SuccessiveDiscountStep = SuccessiveDiscountStep;
|
|
1273
1297
|
type units_TaxDirection = TaxDirection;
|
|
1298
|
+
type units_TaxEquivalentYieldDirection = TaxEquivalentYieldDirection;
|
|
1299
|
+
type units_TaxEquivalentYieldResult = TaxEquivalentYieldResult;
|
|
1274
1300
|
type units_TaxResult = TaxResult;
|
|
1275
1301
|
type units_TimeValueDirection = TimeValueDirection;
|
|
1276
1302
|
type units_TimeValueResult = TimeValueResult;
|
|
@@ -1314,6 +1340,7 @@ declare const units_calculateRuleOf72: typeof calculateRuleOf72;
|
|
|
1314
1340
|
declare const units_calculateSavingsGoal: typeof calculateSavingsGoal;
|
|
1315
1341
|
declare const units_calculateSimpleInterest: typeof calculateSimpleInterest;
|
|
1316
1342
|
declare const units_calculateTax: typeof calculateTax;
|
|
1343
|
+
declare const units_calculateTaxEquivalentYield: typeof calculateTaxEquivalentYield;
|
|
1317
1344
|
declare const units_calculateTimeValue: typeof calculateTimeValue;
|
|
1318
1345
|
declare const units_calculateTipSplit: typeof calculateTipSplit;
|
|
1319
1346
|
declare const units_calculateVideoBitrate: typeof calculateVideoBitrate;
|
|
@@ -1372,7 +1399,7 @@ declare const units_validateIban: typeof validateIban;
|
|
|
1372
1399
|
declare const units_validateIsbn: typeof validateIsbn;
|
|
1373
1400
|
declare const units_viewportToPx: typeof viewportToPx;
|
|
1374
1401
|
declare namespace units {
|
|
1375
|
-
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_BlendedLoanRateResult as BlendedLoanRateResult, type units_BreakEvenInput as BreakEvenInput, type units_BreakEvenResult as BreakEvenResult, 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_CashBreakdownResult as CashBreakdownResult, type units_CashChangeResult as CashChangeResult, type units_CashDenominationItem as CashDenominationItem, type units_CashRoundingMode as CashRoundingMode, type units_CashRoundingResult as CashRoundingResult, type units_CdMaturityResult as CdMaturityResult, type units_CompareUnitPricesResult as CompareUnitPricesResult, type units_CompoundInterestResult as CompoundInterestResult, type units_CompoundYearRow as CompoundYearRow, type units_CreditAccountInput as CreditAccountInput, type units_CreditAccountResult as CreditAccountResult, type units_CreditUtilizationResult as CreditUtilizationResult, type units_DebtItemInput as DebtItemInput, type units_DebtItemResult as DebtItemResult, type units_DebtPayoffComparison as DebtPayoffComparison, type units_DebtPayoffInput as DebtPayoffInput, type units_DebtPayoffPlanResult as DebtPayoffPlanResult, type units_DebtPayoffScheduleEntry as DebtPayoffScheduleEntry, type units_DebtPayoffStrategy as DebtPayoffStrategy, type units_DebtPayoffStrategyResult as DebtPayoffStrategyResult, type units_DebtToIncomeRatioResult as DebtToIncomeRatioResult, type units_DepreciationMethod as DepreciationMethod, type units_DepreciationResult as DepreciationResult, type units_DepreciationYear as DepreciationYear, type units_Dimensions as Dimensions, type units_DiscountField as DiscountField, type units_DiscountInput as DiscountInput, type units_DiscountResult as DiscountResult, type units_DtiTier as DtiTier, type units_EmiResult as EmiResult, type units_EmiTenureUnit as EmiTenureUnit, type units_EmiYearlyBreakdownRow as EmiYearlyBreakdownRow, type units_ExtraPaymentPayoffResult as ExtraPaymentPayoffResult, type units_FilePermissions as FilePermissions, type units_FormatOptions as FormatOptions, type units_FreelancerRateInput as FreelancerRateInput, type units_FreelancerRateResult as FreelancerRateResult, units_GPA_GRADE_POINTS as GPA_GRADE_POINTS, type units_GpaCourse as GpaCourse, type units_GpaCourseResult as GpaCourseResult, type units_GpaResult as GpaResult, type units_IbanValidationResult as IbanValidationResult, type units_IpConversion as IpConversion, type units_IsbnFormat as IsbnFormat, type units_IsbnResult as IsbnResult, type units_LoanBalanceInput as LoanBalanceInput, type units_LoanBalanceResult as LoanBalanceResult, type units_LoanRefinanceResult as LoanRefinanceResult, type units_LoanResult as LoanResult, type units_MarginMarkupField as MarginMarkupField, type units_MarginMarkupInput as MarginMarkupInput, type units_MarginMarkupResult as MarginMarkupResult, type units_MovingAveragePoint as MovingAveragePoint, type units_MovingAverageResult as MovingAverageResult, type units_NotationStyle as NotationStyle, type units_NumberBase as NumberBase, type units_PaybackPeriodInput as PaybackPeriodInput, type units_PaybackPeriodResult as PaybackPeriodResult, type units_PercentChangeDirection as PercentChangeDirection, type units_PercentageChangeResult as PercentageChangeResult, type units_Permission as Permission, type units_PxConvertResult as PxConvertResult, type units_RoiInput as RoiInput, type units_RoiResult as RoiResult, type units_RuleOf72Direction as RuleOf72Direction, type units_RuleOf72Result as RuleOf72Result, type units_SavingsGoalInput as SavingsGoalInput, type units_SavingsGoalMode as SavingsGoalMode, type units_SavingsGoalResult as SavingsGoalResult, type units_SemverVersion as SemverVersion, type units_SimpleInterestResult as SimpleInterestResult, type units_SubnetInfo as SubnetInfo, type units_SuccessiveDiscountResult as SuccessiveDiscountResult, type units_SuccessiveDiscountStep as SuccessiveDiscountStep, 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, units_USD_DENOMINATIONS as USD_DENOMINATIONS, type units_UnitPriceItem as UnitPriceItem, type units_UnitPriceResult as UnitPriceResult, type units_UtilizationTier as UtilizationTier, type units_VideoBitrateInput as VideoBitrateInput, type units_VideoBitrateMode as VideoBitrateMode, type units_VideoBitrateResult as VideoBitrateResult, type units_ViewportConvertResult as ViewportConvertResult, units_applySuccessiveDiscounts as applySuccessiveDiscounts, units_autoFormat as autoFormat, units_bumpVersion as bumpVersion, units_calcAspectRatio as calcAspectRatio, units_calcSubnet as calcSubnet, units_calculateBlendedLoanRate as calculateBlendedLoanRate, units_calculateBreakEven as calculateBreakEven, units_calculateCashBreakdown as calculateCashBreakdown, units_calculateCashRounding as calculateCashRounding, units_calculateCdMaturity as calculateCdMaturity, units_calculateChange as calculateChange, units_calculateCompoundInterest as calculateCompoundInterest, units_calculateCreditUtilization as calculateCreditUtilization, units_calculateDebtToIncomeRatio as calculateDebtToIncomeRatio, units_calculateDepreciationSchedule as calculateDepreciationSchedule, units_calculateDiscount as calculateDiscount, units_calculateEmi as calculateEmi, units_calculateExtraPaymentPayoff as calculateExtraPaymentPayoff, units_calculateFreelancerRate as calculateFreelancerRate, units_calculateGpa as calculateGpa, units_calculateLoan as calculateLoan, units_calculateLoanRefinance as calculateLoanRefinance, units_calculateMarginMarkup as calculateMarginMarkup, units_calculateMovingAverages as calculateMovingAverages, units_calculatePaybackPeriod as calculatePaybackPeriod, units_calculatePercentageChange as calculatePercentageChange, units_calculateRoi as calculateRoi, units_calculateRuleOf72 as calculateRuleOf72, units_calculateSavingsGoal as calculateSavingsGoal, units_calculateSimpleInterest as calculateSimpleInterest, units_calculateTax as calculateTax, units_calculateTimeValue as calculateTimeValue, units_calculateTipSplit as calculateTipSplit, units_calculateVideoBitrate as calculateVideoBitrate, units_compareSemver as compareSemver, units_compareUnitPrices as compareUnitPrices, 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_marginToMarkup as marginToMarkup, units_markupToMargin as markupToMargin, 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_planDebtPayoff as planDebtPayoff, 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 };
|
|
1402
|
+
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_BlendedLoanRateResult as BlendedLoanRateResult, type units_BreakEvenInput as BreakEvenInput, type units_BreakEvenResult as BreakEvenResult, 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_CashBreakdownResult as CashBreakdownResult, type units_CashChangeResult as CashChangeResult, type units_CashDenominationItem as CashDenominationItem, type units_CashRoundingMode as CashRoundingMode, type units_CashRoundingResult as CashRoundingResult, type units_CdMaturityResult as CdMaturityResult, type units_CompareUnitPricesResult as CompareUnitPricesResult, type units_CompoundInterestResult as CompoundInterestResult, type units_CompoundYearRow as CompoundYearRow, type units_CreditAccountInput as CreditAccountInput, type units_CreditAccountResult as CreditAccountResult, type units_CreditUtilizationResult as CreditUtilizationResult, type units_DebtItemInput as DebtItemInput, type units_DebtItemResult as DebtItemResult, type units_DebtPayoffComparison as DebtPayoffComparison, type units_DebtPayoffInput as DebtPayoffInput, type units_DebtPayoffPlanResult as DebtPayoffPlanResult, type units_DebtPayoffScheduleEntry as DebtPayoffScheduleEntry, type units_DebtPayoffStrategy as DebtPayoffStrategy, type units_DebtPayoffStrategyResult as DebtPayoffStrategyResult, type units_DebtToIncomeRatioResult as DebtToIncomeRatioResult, type units_DepreciationMethod as DepreciationMethod, type units_DepreciationResult as DepreciationResult, type units_DepreciationYear as DepreciationYear, type units_Dimensions as Dimensions, type units_DiscountField as DiscountField, type units_DiscountInput as DiscountInput, type units_DiscountResult as DiscountResult, type units_DtiTier as DtiTier, type units_EmiResult as EmiResult, type units_EmiTenureUnit as EmiTenureUnit, type units_EmiYearlyBreakdownRow as EmiYearlyBreakdownRow, type units_ExtraPaymentPayoffResult as ExtraPaymentPayoffResult, type units_FilePermissions as FilePermissions, type units_FormatOptions as FormatOptions, type units_FreelancerRateInput as FreelancerRateInput, type units_FreelancerRateResult as FreelancerRateResult, units_GPA_GRADE_POINTS as GPA_GRADE_POINTS, type units_GpaCourse as GpaCourse, type units_GpaCourseResult as GpaCourseResult, type units_GpaResult as GpaResult, type units_IbanValidationResult as IbanValidationResult, type units_IpConversion as IpConversion, type units_IsbnFormat as IsbnFormat, type units_IsbnResult as IsbnResult, type units_LoanBalanceInput as LoanBalanceInput, type units_LoanBalanceResult as LoanBalanceResult, type units_LoanRefinanceResult as LoanRefinanceResult, type units_LoanResult as LoanResult, type units_MarginMarkupField as MarginMarkupField, type units_MarginMarkupInput as MarginMarkupInput, type units_MarginMarkupResult as MarginMarkupResult, type units_MovingAveragePoint as MovingAveragePoint, type units_MovingAverageResult as MovingAverageResult, type units_NotationStyle as NotationStyle, type units_NumberBase as NumberBase, type units_PaybackPeriodInput as PaybackPeriodInput, type units_PaybackPeriodResult as PaybackPeriodResult, type units_PercentChangeDirection as PercentChangeDirection, type units_PercentageChangeResult as PercentageChangeResult, type units_Permission as Permission, type units_PxConvertResult as PxConvertResult, type units_RoiInput as RoiInput, type units_RoiResult as RoiResult, type units_RuleOf72Direction as RuleOf72Direction, type units_RuleOf72Result as RuleOf72Result, type units_SavingsGoalInput as SavingsGoalInput, type units_SavingsGoalMode as SavingsGoalMode, type units_SavingsGoalResult as SavingsGoalResult, type units_SemverVersion as SemverVersion, type units_SimpleInterestResult as SimpleInterestResult, type units_SubnetInfo as SubnetInfo, type units_SuccessiveDiscountResult as SuccessiveDiscountResult, type units_SuccessiveDiscountStep as SuccessiveDiscountStep, type units_TaxDirection as TaxDirection, type units_TaxEquivalentYieldDirection as TaxEquivalentYieldDirection, type units_TaxEquivalentYieldResult as TaxEquivalentYieldResult, type units_TaxResult as TaxResult, type units_TimeValueDirection as TimeValueDirection, type units_TimeValueResult as TimeValueResult, type units_TipSplitResult as TipSplitResult, units_USD_DENOMINATIONS as USD_DENOMINATIONS, type units_UnitPriceItem as UnitPriceItem, type units_UnitPriceResult as UnitPriceResult, type units_UtilizationTier as UtilizationTier, type units_VideoBitrateInput as VideoBitrateInput, type units_VideoBitrateMode as VideoBitrateMode, type units_VideoBitrateResult as VideoBitrateResult, type units_ViewportConvertResult as ViewportConvertResult, units_applySuccessiveDiscounts as applySuccessiveDiscounts, units_autoFormat as autoFormat, units_bumpVersion as bumpVersion, units_calcAspectRatio as calcAspectRatio, units_calcSubnet as calcSubnet, units_calculateBlendedLoanRate as calculateBlendedLoanRate, units_calculateBreakEven as calculateBreakEven, units_calculateCashBreakdown as calculateCashBreakdown, units_calculateCashRounding as calculateCashRounding, units_calculateCdMaturity as calculateCdMaturity, units_calculateChange as calculateChange, units_calculateCompoundInterest as calculateCompoundInterest, units_calculateCreditUtilization as calculateCreditUtilization, units_calculateDebtToIncomeRatio as calculateDebtToIncomeRatio, units_calculateDepreciationSchedule as calculateDepreciationSchedule, units_calculateDiscount as calculateDiscount, units_calculateEmi as calculateEmi, units_calculateExtraPaymentPayoff as calculateExtraPaymentPayoff, units_calculateFreelancerRate as calculateFreelancerRate, units_calculateGpa as calculateGpa, units_calculateLoan as calculateLoan, units_calculateLoanRefinance as calculateLoanRefinance, units_calculateMarginMarkup as calculateMarginMarkup, units_calculateMovingAverages as calculateMovingAverages, units_calculatePaybackPeriod as calculatePaybackPeriod, units_calculatePercentageChange as calculatePercentageChange, units_calculateRoi as calculateRoi, units_calculateRuleOf72 as calculateRuleOf72, units_calculateSavingsGoal as calculateSavingsGoal, units_calculateSimpleInterest as calculateSimpleInterest, units_calculateTax as calculateTax, units_calculateTaxEquivalentYield as calculateTaxEquivalentYield, units_calculateTimeValue as calculateTimeValue, units_calculateTipSplit as calculateTipSplit, units_calculateVideoBitrate as calculateVideoBitrate, units_compareSemver as compareSemver, units_compareUnitPrices as compareUnitPrices, 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_marginToMarkup as marginToMarkup, units_markupToMargin as markupToMargin, 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_planDebtPayoff as planDebtPayoff, 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 };
|
|
1376
1403
|
}
|
|
1377
1404
|
|
|
1378
|
-
export { type DtiTier as $, type AmortizationRow as A, BASE_LABELS as B, COMMON_CURRENCIES as C, type CashRoundingResult as D, type CdMaturityResult as E, type CompareUnitPricesResult as F, type CompoundInterestResult as G, type CompoundYearRow as H, type CreditAccountInput as I, type CreditAccountResult as J, type CreditUtilizationResult as K, type DebtItemInput as L, type DebtItemResult as M, type DebtPayoffComparison as N, type DebtPayoffInput as O, type DebtPayoffPlanResult as P, type DebtPayoffScheduleEntry as Q, type DebtPayoffStrategy as R, type DebtPayoffStrategyResult as S, type DebtToIncomeRatioResult as T, type DepreciationMethod as U, type DepreciationResult as V, type DepreciationYear as W, type Dimensions as X, type DiscountField as Y, type DiscountInput as Z, type DiscountResult as _, type AprApyDirection as a,
|
|
1405
|
+
export { type DtiTier as $, type AmortizationRow as A, BASE_LABELS as B, COMMON_CURRENCIES as C, type CashRoundingResult as D, type CdMaturityResult as E, type CompareUnitPricesResult as F, type CompoundInterestResult as G, type CompoundYearRow as H, type CreditAccountInput as I, type CreditAccountResult as J, type CreditUtilizationResult as K, type DebtItemInput as L, type DebtItemResult as M, type DebtPayoffComparison as N, type DebtPayoffInput as O, type DebtPayoffPlanResult as P, type DebtPayoffScheduleEntry as Q, type DebtPayoffStrategy as R, type DebtPayoffStrategyResult as S, type DebtToIncomeRatioResult as T, type DepreciationMethod as U, type DepreciationResult as V, type DepreciationYear as W, type Dimensions as X, type DiscountField as Y, type DiscountInput as Z, type DiscountResult as _, type AprApyDirection as a, calcAspectRatio as a$, type EmiResult as a0, type EmiTenureUnit as a1, type EmiYearlyBreakdownRow as a2, type ExtraPaymentPayoffResult as a3, type FilePermissions as a4, type FormatOptions as a5, type FreelancerRateInput as a6, type FreelancerRateResult as a7, GPA_GRADE_POINTS as a8, type GpaCourse as a9, type RuleOf72Result as aA, type SavingsGoalInput as aB, type SavingsGoalMode as aC, type SavingsGoalResult as aD, type SemverVersion as aE, type SimpleInterestResult as aF, type SubnetInfo as aG, type SuccessiveDiscountResult as aH, type SuccessiveDiscountStep as aI, type TaxDirection as aJ, type TaxEquivalentYieldDirection as aK, type TaxEquivalentYieldResult as aL, type TaxResult as aM, type TimeValueDirection as aN, type TimeValueResult as aO, type TipSplitResult as aP, USD_DENOMINATIONS as aQ, type UnitPriceItem as aR, type UnitPriceResult as aS, type UtilizationTier as aT, type VideoBitrateInput as aU, type VideoBitrateMode as aV, type VideoBitrateResult as aW, type ViewportConvertResult as aX, applySuccessiveDiscounts as aY, autoFormat as aZ, bumpVersion as a_, type GpaCourseResult as aa, type GpaResult as ab, type IbanValidationResult as ac, type IpConversion as ad, type IsbnFormat as ae, type IsbnResult as af, type LoanBalanceInput as ag, type LoanBalanceResult as ah, type LoanRefinanceResult as ai, type LoanResult as aj, type MarginMarkupField as ak, type MarginMarkupInput as al, type MarginMarkupResult as am, type MovingAveragePoint as an, type MovingAverageResult as ao, type NotationStyle as ap, type NumberBase as aq, type PaybackPeriodInput as ar, type PaybackPeriodResult as as, type PercentChangeDirection as at, type PercentageChangeResult as au, type Permission as av, type PxConvertResult as aw, type RoiInput as ax, type RoiResult as ay, type RuleOf72Direction as az, type AprApyResult as b, parseInput as b$, calcSubnet as b0, calculateBlendedLoanRate as b1, calculateBreakEven as b2, calculateCashBreakdown as b3, calculateCashRounding as b4, calculateCdMaturity as b5, calculateChange as b6, calculateCompoundInterest as b7, calculateCreditUtilization as b8, calculateDebtToIncomeRatio as b9, convertIp as bA, coverBox as bB, decimalToIp as bC, decimalToIpCidr as bD, describePermissions as bE, fitIntoBox as bF, formatNumber as bG, formatValue as bH, formatVwValue as bI, formatWithSeparator as bJ, gcd as bK, ipFromBinary as bL, ipFromDecimal as bM, ipFromHex as bN, ipToBinary as bO, ipToDecimal as bP, ipToDecimalCidr as bQ, ipToHex as bR, ipToOctal as bS, isValid as bT, isValidCidr as bU, isValidIp as bV, isValidIpv4 as bW, marginToMarkup as bX, markupToMargin as bY, octalToPermissions as bZ, parseFileSize as b_, calculateDepreciationSchedule as ba, calculateDiscount as bb, calculateEmi as bc, calculateExtraPaymentPayoff as bd, calculateFreelancerRate as be, calculateGpa as bf, calculateLoan as bg, calculateLoanRefinance as bh, calculateMarginMarkup as bi, calculateMovingAverages as bj, calculatePaybackPeriod as bk, calculatePercentageChange as bl, calculateRoi as bm, calculateRuleOf72 as bn, calculateSavingsGoal as bo, calculateSimpleInterest as bp, calculateTax as bq, calculateTaxEquivalentYield as br, calculateTimeValue as bs, calculateTipSplit as bt, calculateVideoBitrate as bu, compareSemver as bv, compareUnitPrices as bw, convert as bx, convertAprApy as by, convertBytes as bz, type AspectRatioResult as c, parseNumberString as c0, parseSemver as c1, permissionsToChmod as c2, permissionsToOctal as c3, permissionsToSymbolic as c4, planDebtPayoff as c5, ptToPx as c6, pxToAll as c7, pxToViewport as c8, remToPx as c9, satisfiesRange as ca, scaleByHeight as cb, scaleByWidth as cc, sortVersions as cd, splitSubnet as ce, symbolicToPermissions as cf, validateBarcode as cg, validateCardNumber as ch, validateIban as ci, validateIsbn as cj, viewportToPx as ck, BASE_PREFIXES as d, BYTE_UNITS as e, type BarcodeFormat as f, type BarcodeValidationResult as g, type BaseConvertResult as h, type BlendedLoanRateResult as i, type BreakEvenInput as j, type BreakEvenResult as k, type ByteConvertResult as l, type ByteUnit as m, COMMON_LOCALES as n, COMMON_PERMISSIONS as o, COMMON_RATIOS as p, COMMON_SIZES as q, COMMON_TAX_RATES as r, COMMON_TIP_PERCENTAGES as s, COMMON_VIEWPORTS as t, units as u, type CardValidationResult as v, type CashBreakdownResult as w, type CashChangeResult as x, type CashDenominationItem as y, type CashRoundingMode as z };
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
* - extra-payment-mortgage-calculator : calculateExtraPaymentPayoff
|
|
41
41
|
* - freelancer-rate-calculator : calculateFreelancerRate
|
|
42
42
|
* - debt-payoff-planner : planDebtPayoff
|
|
43
|
+
* - tax-equivalent-yield-calculator : calculateTaxEquivalentYield
|
|
43
44
|
*/
|
|
44
45
|
interface PxConvertResult {
|
|
45
46
|
px: number;
|
|
@@ -1171,6 +1172,29 @@ interface LoanRefinanceResult {
|
|
|
1171
1172
|
declare function calculateLoanRefinance(currentBalance: number, currentRatePercent: number, currentRemainingMonths: number, newRatePercent: number, newTermMonths: number, closingCosts: number): LoanRefinanceResult | {
|
|
1172
1173
|
error: string;
|
|
1173
1174
|
};
|
|
1175
|
+
type TaxEquivalentYieldDirection = "tax-free-to-taxable" | "taxable-to-tax-free";
|
|
1176
|
+
interface TaxEquivalentYieldResult {
|
|
1177
|
+
direction: TaxEquivalentYieldDirection;
|
|
1178
|
+
inputYield: number;
|
|
1179
|
+
federalTaxRatePercent: number;
|
|
1180
|
+
stateTaxRatePercent: number;
|
|
1181
|
+
combinedTaxRatePercent: number;
|
|
1182
|
+
taxFreeYield: number;
|
|
1183
|
+
taxableYield: number;
|
|
1184
|
+
yieldDifference: number;
|
|
1185
|
+
}
|
|
1186
|
+
/**
|
|
1187
|
+
* Converts between a tax-free municipal bond yield and the equivalent
|
|
1188
|
+
* taxable-bond yield given a marginal federal tax rate (plus an optional
|
|
1189
|
+
* state rate, summed into a single combined rate). With direction
|
|
1190
|
+
* "tax-free-to-taxable", taxableYield = taxFreeYield / (1 - combinedRate);
|
|
1191
|
+
* with "taxable-to-tax-free", taxFreeYield = taxableYield * (1 -
|
|
1192
|
+
* combinedRate). Pure formula over user-supplied rates, no live bond
|
|
1193
|
+
* pricing or jurisdiction-specific tax tables.
|
|
1194
|
+
*/
|
|
1195
|
+
declare function calculateTaxEquivalentYield(inputYieldPercent: number, federalTaxRatePercent: number, stateTaxRatePercent: number | undefined, direction: TaxEquivalentYieldDirection): TaxEquivalentYieldResult | {
|
|
1196
|
+
error: string;
|
|
1197
|
+
};
|
|
1174
1198
|
|
|
1175
1199
|
type units_AmortizationRow = AmortizationRow;
|
|
1176
1200
|
type units_AprApyDirection = AprApyDirection;
|
|
@@ -1271,6 +1295,8 @@ type units_SubnetInfo = SubnetInfo;
|
|
|
1271
1295
|
type units_SuccessiveDiscountResult = SuccessiveDiscountResult;
|
|
1272
1296
|
type units_SuccessiveDiscountStep = SuccessiveDiscountStep;
|
|
1273
1297
|
type units_TaxDirection = TaxDirection;
|
|
1298
|
+
type units_TaxEquivalentYieldDirection = TaxEquivalentYieldDirection;
|
|
1299
|
+
type units_TaxEquivalentYieldResult = TaxEquivalentYieldResult;
|
|
1274
1300
|
type units_TaxResult = TaxResult;
|
|
1275
1301
|
type units_TimeValueDirection = TimeValueDirection;
|
|
1276
1302
|
type units_TimeValueResult = TimeValueResult;
|
|
@@ -1314,6 +1340,7 @@ declare const units_calculateRuleOf72: typeof calculateRuleOf72;
|
|
|
1314
1340
|
declare const units_calculateSavingsGoal: typeof calculateSavingsGoal;
|
|
1315
1341
|
declare const units_calculateSimpleInterest: typeof calculateSimpleInterest;
|
|
1316
1342
|
declare const units_calculateTax: typeof calculateTax;
|
|
1343
|
+
declare const units_calculateTaxEquivalentYield: typeof calculateTaxEquivalentYield;
|
|
1317
1344
|
declare const units_calculateTimeValue: typeof calculateTimeValue;
|
|
1318
1345
|
declare const units_calculateTipSplit: typeof calculateTipSplit;
|
|
1319
1346
|
declare const units_calculateVideoBitrate: typeof calculateVideoBitrate;
|
|
@@ -1372,7 +1399,7 @@ declare const units_validateIban: typeof validateIban;
|
|
|
1372
1399
|
declare const units_validateIsbn: typeof validateIsbn;
|
|
1373
1400
|
declare const units_viewportToPx: typeof viewportToPx;
|
|
1374
1401
|
declare namespace units {
|
|
1375
|
-
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_BlendedLoanRateResult as BlendedLoanRateResult, type units_BreakEvenInput as BreakEvenInput, type units_BreakEvenResult as BreakEvenResult, 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_CashBreakdownResult as CashBreakdownResult, type units_CashChangeResult as CashChangeResult, type units_CashDenominationItem as CashDenominationItem, type units_CashRoundingMode as CashRoundingMode, type units_CashRoundingResult as CashRoundingResult, type units_CdMaturityResult as CdMaturityResult, type units_CompareUnitPricesResult as CompareUnitPricesResult, type units_CompoundInterestResult as CompoundInterestResult, type units_CompoundYearRow as CompoundYearRow, type units_CreditAccountInput as CreditAccountInput, type units_CreditAccountResult as CreditAccountResult, type units_CreditUtilizationResult as CreditUtilizationResult, type units_DebtItemInput as DebtItemInput, type units_DebtItemResult as DebtItemResult, type units_DebtPayoffComparison as DebtPayoffComparison, type units_DebtPayoffInput as DebtPayoffInput, type units_DebtPayoffPlanResult as DebtPayoffPlanResult, type units_DebtPayoffScheduleEntry as DebtPayoffScheduleEntry, type units_DebtPayoffStrategy as DebtPayoffStrategy, type units_DebtPayoffStrategyResult as DebtPayoffStrategyResult, type units_DebtToIncomeRatioResult as DebtToIncomeRatioResult, type units_DepreciationMethod as DepreciationMethod, type units_DepreciationResult as DepreciationResult, type units_DepreciationYear as DepreciationYear, type units_Dimensions as Dimensions, type units_DiscountField as DiscountField, type units_DiscountInput as DiscountInput, type units_DiscountResult as DiscountResult, type units_DtiTier as DtiTier, type units_EmiResult as EmiResult, type units_EmiTenureUnit as EmiTenureUnit, type units_EmiYearlyBreakdownRow as EmiYearlyBreakdownRow, type units_ExtraPaymentPayoffResult as ExtraPaymentPayoffResult, type units_FilePermissions as FilePermissions, type units_FormatOptions as FormatOptions, type units_FreelancerRateInput as FreelancerRateInput, type units_FreelancerRateResult as FreelancerRateResult, units_GPA_GRADE_POINTS as GPA_GRADE_POINTS, type units_GpaCourse as GpaCourse, type units_GpaCourseResult as GpaCourseResult, type units_GpaResult as GpaResult, type units_IbanValidationResult as IbanValidationResult, type units_IpConversion as IpConversion, type units_IsbnFormat as IsbnFormat, type units_IsbnResult as IsbnResult, type units_LoanBalanceInput as LoanBalanceInput, type units_LoanBalanceResult as LoanBalanceResult, type units_LoanRefinanceResult as LoanRefinanceResult, type units_LoanResult as LoanResult, type units_MarginMarkupField as MarginMarkupField, type units_MarginMarkupInput as MarginMarkupInput, type units_MarginMarkupResult as MarginMarkupResult, type units_MovingAveragePoint as MovingAveragePoint, type units_MovingAverageResult as MovingAverageResult, type units_NotationStyle as NotationStyle, type units_NumberBase as NumberBase, type units_PaybackPeriodInput as PaybackPeriodInput, type units_PaybackPeriodResult as PaybackPeriodResult, type units_PercentChangeDirection as PercentChangeDirection, type units_PercentageChangeResult as PercentageChangeResult, type units_Permission as Permission, type units_PxConvertResult as PxConvertResult, type units_RoiInput as RoiInput, type units_RoiResult as RoiResult, type units_RuleOf72Direction as RuleOf72Direction, type units_RuleOf72Result as RuleOf72Result, type units_SavingsGoalInput as SavingsGoalInput, type units_SavingsGoalMode as SavingsGoalMode, type units_SavingsGoalResult as SavingsGoalResult, type units_SemverVersion as SemverVersion, type units_SimpleInterestResult as SimpleInterestResult, type units_SubnetInfo as SubnetInfo, type units_SuccessiveDiscountResult as SuccessiveDiscountResult, type units_SuccessiveDiscountStep as SuccessiveDiscountStep, 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, units_USD_DENOMINATIONS as USD_DENOMINATIONS, type units_UnitPriceItem as UnitPriceItem, type units_UnitPriceResult as UnitPriceResult, type units_UtilizationTier as UtilizationTier, type units_VideoBitrateInput as VideoBitrateInput, type units_VideoBitrateMode as VideoBitrateMode, type units_VideoBitrateResult as VideoBitrateResult, type units_ViewportConvertResult as ViewportConvertResult, units_applySuccessiveDiscounts as applySuccessiveDiscounts, units_autoFormat as autoFormat, units_bumpVersion as bumpVersion, units_calcAspectRatio as calcAspectRatio, units_calcSubnet as calcSubnet, units_calculateBlendedLoanRate as calculateBlendedLoanRate, units_calculateBreakEven as calculateBreakEven, units_calculateCashBreakdown as calculateCashBreakdown, units_calculateCashRounding as calculateCashRounding, units_calculateCdMaturity as calculateCdMaturity, units_calculateChange as calculateChange, units_calculateCompoundInterest as calculateCompoundInterest, units_calculateCreditUtilization as calculateCreditUtilization, units_calculateDebtToIncomeRatio as calculateDebtToIncomeRatio, units_calculateDepreciationSchedule as calculateDepreciationSchedule, units_calculateDiscount as calculateDiscount, units_calculateEmi as calculateEmi, units_calculateExtraPaymentPayoff as calculateExtraPaymentPayoff, units_calculateFreelancerRate as calculateFreelancerRate, units_calculateGpa as calculateGpa, units_calculateLoan as calculateLoan, units_calculateLoanRefinance as calculateLoanRefinance, units_calculateMarginMarkup as calculateMarginMarkup, units_calculateMovingAverages as calculateMovingAverages, units_calculatePaybackPeriod as calculatePaybackPeriod, units_calculatePercentageChange as calculatePercentageChange, units_calculateRoi as calculateRoi, units_calculateRuleOf72 as calculateRuleOf72, units_calculateSavingsGoal as calculateSavingsGoal, units_calculateSimpleInterest as calculateSimpleInterest, units_calculateTax as calculateTax, units_calculateTimeValue as calculateTimeValue, units_calculateTipSplit as calculateTipSplit, units_calculateVideoBitrate as calculateVideoBitrate, units_compareSemver as compareSemver, units_compareUnitPrices as compareUnitPrices, 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_marginToMarkup as marginToMarkup, units_markupToMargin as markupToMargin, 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_planDebtPayoff as planDebtPayoff, 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 };
|
|
1402
|
+
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_BlendedLoanRateResult as BlendedLoanRateResult, type units_BreakEvenInput as BreakEvenInput, type units_BreakEvenResult as BreakEvenResult, 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_CashBreakdownResult as CashBreakdownResult, type units_CashChangeResult as CashChangeResult, type units_CashDenominationItem as CashDenominationItem, type units_CashRoundingMode as CashRoundingMode, type units_CashRoundingResult as CashRoundingResult, type units_CdMaturityResult as CdMaturityResult, type units_CompareUnitPricesResult as CompareUnitPricesResult, type units_CompoundInterestResult as CompoundInterestResult, type units_CompoundYearRow as CompoundYearRow, type units_CreditAccountInput as CreditAccountInput, type units_CreditAccountResult as CreditAccountResult, type units_CreditUtilizationResult as CreditUtilizationResult, type units_DebtItemInput as DebtItemInput, type units_DebtItemResult as DebtItemResult, type units_DebtPayoffComparison as DebtPayoffComparison, type units_DebtPayoffInput as DebtPayoffInput, type units_DebtPayoffPlanResult as DebtPayoffPlanResult, type units_DebtPayoffScheduleEntry as DebtPayoffScheduleEntry, type units_DebtPayoffStrategy as DebtPayoffStrategy, type units_DebtPayoffStrategyResult as DebtPayoffStrategyResult, type units_DebtToIncomeRatioResult as DebtToIncomeRatioResult, type units_DepreciationMethod as DepreciationMethod, type units_DepreciationResult as DepreciationResult, type units_DepreciationYear as DepreciationYear, type units_Dimensions as Dimensions, type units_DiscountField as DiscountField, type units_DiscountInput as DiscountInput, type units_DiscountResult as DiscountResult, type units_DtiTier as DtiTier, type units_EmiResult as EmiResult, type units_EmiTenureUnit as EmiTenureUnit, type units_EmiYearlyBreakdownRow as EmiYearlyBreakdownRow, type units_ExtraPaymentPayoffResult as ExtraPaymentPayoffResult, type units_FilePermissions as FilePermissions, type units_FormatOptions as FormatOptions, type units_FreelancerRateInput as FreelancerRateInput, type units_FreelancerRateResult as FreelancerRateResult, units_GPA_GRADE_POINTS as GPA_GRADE_POINTS, type units_GpaCourse as GpaCourse, type units_GpaCourseResult as GpaCourseResult, type units_GpaResult as GpaResult, type units_IbanValidationResult as IbanValidationResult, type units_IpConversion as IpConversion, type units_IsbnFormat as IsbnFormat, type units_IsbnResult as IsbnResult, type units_LoanBalanceInput as LoanBalanceInput, type units_LoanBalanceResult as LoanBalanceResult, type units_LoanRefinanceResult as LoanRefinanceResult, type units_LoanResult as LoanResult, type units_MarginMarkupField as MarginMarkupField, type units_MarginMarkupInput as MarginMarkupInput, type units_MarginMarkupResult as MarginMarkupResult, type units_MovingAveragePoint as MovingAveragePoint, type units_MovingAverageResult as MovingAverageResult, type units_NotationStyle as NotationStyle, type units_NumberBase as NumberBase, type units_PaybackPeriodInput as PaybackPeriodInput, type units_PaybackPeriodResult as PaybackPeriodResult, type units_PercentChangeDirection as PercentChangeDirection, type units_PercentageChangeResult as PercentageChangeResult, type units_Permission as Permission, type units_PxConvertResult as PxConvertResult, type units_RoiInput as RoiInput, type units_RoiResult as RoiResult, type units_RuleOf72Direction as RuleOf72Direction, type units_RuleOf72Result as RuleOf72Result, type units_SavingsGoalInput as SavingsGoalInput, type units_SavingsGoalMode as SavingsGoalMode, type units_SavingsGoalResult as SavingsGoalResult, type units_SemverVersion as SemverVersion, type units_SimpleInterestResult as SimpleInterestResult, type units_SubnetInfo as SubnetInfo, type units_SuccessiveDiscountResult as SuccessiveDiscountResult, type units_SuccessiveDiscountStep as SuccessiveDiscountStep, type units_TaxDirection as TaxDirection, type units_TaxEquivalentYieldDirection as TaxEquivalentYieldDirection, type units_TaxEquivalentYieldResult as TaxEquivalentYieldResult, type units_TaxResult as TaxResult, type units_TimeValueDirection as TimeValueDirection, type units_TimeValueResult as TimeValueResult, type units_TipSplitResult as TipSplitResult, units_USD_DENOMINATIONS as USD_DENOMINATIONS, type units_UnitPriceItem as UnitPriceItem, type units_UnitPriceResult as UnitPriceResult, type units_UtilizationTier as UtilizationTier, type units_VideoBitrateInput as VideoBitrateInput, type units_VideoBitrateMode as VideoBitrateMode, type units_VideoBitrateResult as VideoBitrateResult, type units_ViewportConvertResult as ViewportConvertResult, units_applySuccessiveDiscounts as applySuccessiveDiscounts, units_autoFormat as autoFormat, units_bumpVersion as bumpVersion, units_calcAspectRatio as calcAspectRatio, units_calcSubnet as calcSubnet, units_calculateBlendedLoanRate as calculateBlendedLoanRate, units_calculateBreakEven as calculateBreakEven, units_calculateCashBreakdown as calculateCashBreakdown, units_calculateCashRounding as calculateCashRounding, units_calculateCdMaturity as calculateCdMaturity, units_calculateChange as calculateChange, units_calculateCompoundInterest as calculateCompoundInterest, units_calculateCreditUtilization as calculateCreditUtilization, units_calculateDebtToIncomeRatio as calculateDebtToIncomeRatio, units_calculateDepreciationSchedule as calculateDepreciationSchedule, units_calculateDiscount as calculateDiscount, units_calculateEmi as calculateEmi, units_calculateExtraPaymentPayoff as calculateExtraPaymentPayoff, units_calculateFreelancerRate as calculateFreelancerRate, units_calculateGpa as calculateGpa, units_calculateLoan as calculateLoan, units_calculateLoanRefinance as calculateLoanRefinance, units_calculateMarginMarkup as calculateMarginMarkup, units_calculateMovingAverages as calculateMovingAverages, units_calculatePaybackPeriod as calculatePaybackPeriod, units_calculatePercentageChange as calculatePercentageChange, units_calculateRoi as calculateRoi, units_calculateRuleOf72 as calculateRuleOf72, units_calculateSavingsGoal as calculateSavingsGoal, units_calculateSimpleInterest as calculateSimpleInterest, units_calculateTax as calculateTax, units_calculateTaxEquivalentYield as calculateTaxEquivalentYield, units_calculateTimeValue as calculateTimeValue, units_calculateTipSplit as calculateTipSplit, units_calculateVideoBitrate as calculateVideoBitrate, units_compareSemver as compareSemver, units_compareUnitPrices as compareUnitPrices, 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_marginToMarkup as marginToMarkup, units_markupToMargin as markupToMargin, 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_planDebtPayoff as planDebtPayoff, 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 };
|
|
1376
1403
|
}
|
|
1377
1404
|
|
|
1378
|
-
export { type DtiTier as $, type AmortizationRow as A, BASE_LABELS as B, COMMON_CURRENCIES as C, type CashRoundingResult as D, type CdMaturityResult as E, type CompareUnitPricesResult as F, type CompoundInterestResult as G, type CompoundYearRow as H, type CreditAccountInput as I, type CreditAccountResult as J, type CreditUtilizationResult as K, type DebtItemInput as L, type DebtItemResult as M, type DebtPayoffComparison as N, type DebtPayoffInput as O, type DebtPayoffPlanResult as P, type DebtPayoffScheduleEntry as Q, type DebtPayoffStrategy as R, type DebtPayoffStrategyResult as S, type DebtToIncomeRatioResult as T, type DepreciationMethod as U, type DepreciationResult as V, type DepreciationYear as W, type Dimensions as X, type DiscountField as Y, type DiscountInput as Z, type DiscountResult as _, type AprApyDirection as a,
|
|
1405
|
+
export { type DtiTier as $, type AmortizationRow as A, BASE_LABELS as B, COMMON_CURRENCIES as C, type CashRoundingResult as D, type CdMaturityResult as E, type CompareUnitPricesResult as F, type CompoundInterestResult as G, type CompoundYearRow as H, type CreditAccountInput as I, type CreditAccountResult as J, type CreditUtilizationResult as K, type DebtItemInput as L, type DebtItemResult as M, type DebtPayoffComparison as N, type DebtPayoffInput as O, type DebtPayoffPlanResult as P, type DebtPayoffScheduleEntry as Q, type DebtPayoffStrategy as R, type DebtPayoffStrategyResult as S, type DebtToIncomeRatioResult as T, type DepreciationMethod as U, type DepreciationResult as V, type DepreciationYear as W, type Dimensions as X, type DiscountField as Y, type DiscountInput as Z, type DiscountResult as _, type AprApyDirection as a, calcAspectRatio as a$, type EmiResult as a0, type EmiTenureUnit as a1, type EmiYearlyBreakdownRow as a2, type ExtraPaymentPayoffResult as a3, type FilePermissions as a4, type FormatOptions as a5, type FreelancerRateInput as a6, type FreelancerRateResult as a7, GPA_GRADE_POINTS as a8, type GpaCourse as a9, type RuleOf72Result as aA, type SavingsGoalInput as aB, type SavingsGoalMode as aC, type SavingsGoalResult as aD, type SemverVersion as aE, type SimpleInterestResult as aF, type SubnetInfo as aG, type SuccessiveDiscountResult as aH, type SuccessiveDiscountStep as aI, type TaxDirection as aJ, type TaxEquivalentYieldDirection as aK, type TaxEquivalentYieldResult as aL, type TaxResult as aM, type TimeValueDirection as aN, type TimeValueResult as aO, type TipSplitResult as aP, USD_DENOMINATIONS as aQ, type UnitPriceItem as aR, type UnitPriceResult as aS, type UtilizationTier as aT, type VideoBitrateInput as aU, type VideoBitrateMode as aV, type VideoBitrateResult as aW, type ViewportConvertResult as aX, applySuccessiveDiscounts as aY, autoFormat as aZ, bumpVersion as a_, type GpaCourseResult as aa, type GpaResult as ab, type IbanValidationResult as ac, type IpConversion as ad, type IsbnFormat as ae, type IsbnResult as af, type LoanBalanceInput as ag, type LoanBalanceResult as ah, type LoanRefinanceResult as ai, type LoanResult as aj, type MarginMarkupField as ak, type MarginMarkupInput as al, type MarginMarkupResult as am, type MovingAveragePoint as an, type MovingAverageResult as ao, type NotationStyle as ap, type NumberBase as aq, type PaybackPeriodInput as ar, type PaybackPeriodResult as as, type PercentChangeDirection as at, type PercentageChangeResult as au, type Permission as av, type PxConvertResult as aw, type RoiInput as ax, type RoiResult as ay, type RuleOf72Direction as az, type AprApyResult as b, parseInput as b$, calcSubnet as b0, calculateBlendedLoanRate as b1, calculateBreakEven as b2, calculateCashBreakdown as b3, calculateCashRounding as b4, calculateCdMaturity as b5, calculateChange as b6, calculateCompoundInterest as b7, calculateCreditUtilization as b8, calculateDebtToIncomeRatio as b9, convertIp as bA, coverBox as bB, decimalToIp as bC, decimalToIpCidr as bD, describePermissions as bE, fitIntoBox as bF, formatNumber as bG, formatValue as bH, formatVwValue as bI, formatWithSeparator as bJ, gcd as bK, ipFromBinary as bL, ipFromDecimal as bM, ipFromHex as bN, ipToBinary as bO, ipToDecimal as bP, ipToDecimalCidr as bQ, ipToHex as bR, ipToOctal as bS, isValid as bT, isValidCidr as bU, isValidIp as bV, isValidIpv4 as bW, marginToMarkup as bX, markupToMargin as bY, octalToPermissions as bZ, parseFileSize as b_, calculateDepreciationSchedule as ba, calculateDiscount as bb, calculateEmi as bc, calculateExtraPaymentPayoff as bd, calculateFreelancerRate as be, calculateGpa as bf, calculateLoan as bg, calculateLoanRefinance as bh, calculateMarginMarkup as bi, calculateMovingAverages as bj, calculatePaybackPeriod as bk, calculatePercentageChange as bl, calculateRoi as bm, calculateRuleOf72 as bn, calculateSavingsGoal as bo, calculateSimpleInterest as bp, calculateTax as bq, calculateTaxEquivalentYield as br, calculateTimeValue as bs, calculateTipSplit as bt, calculateVideoBitrate as bu, compareSemver as bv, compareUnitPrices as bw, convert as bx, convertAprApy as by, convertBytes as bz, type AspectRatioResult as c, parseNumberString as c0, parseSemver as c1, permissionsToChmod as c2, permissionsToOctal as c3, permissionsToSymbolic as c4, planDebtPayoff as c5, ptToPx as c6, pxToAll as c7, pxToViewport as c8, remToPx as c9, satisfiesRange as ca, scaleByHeight as cb, scaleByWidth as cc, sortVersions as cd, splitSubnet as ce, symbolicToPermissions as cf, validateBarcode as cg, validateCardNumber as ch, validateIban as ci, validateIsbn as cj, viewportToPx as ck, BASE_PREFIXES as d, BYTE_UNITS as e, type BarcodeFormat as f, type BarcodeValidationResult as g, type BaseConvertResult as h, type BlendedLoanRateResult as i, type BreakEvenInput as j, type BreakEvenResult as k, type ByteConvertResult as l, type ByteUnit as m, COMMON_LOCALES as n, COMMON_PERMISSIONS as o, COMMON_RATIOS as p, COMMON_SIZES as q, COMMON_TAX_RATES as r, COMMON_TIP_PERCENTAGES as s, COMMON_VIEWPORTS as t, units as u, type CardValidationResult as v, type CashBreakdownResult as w, type CashChangeResult as x, type CashDenominationItem as y, type CashRoundingMode as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utilix-tech/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.70.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",
|