@utilix-tech/sdk 0.13.0 → 0.14.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 +3 -0
- package/README.md +11 -3
- package/dist/{chunk-BI3SOWM7.js → chunk-2TQTKZCN.js} +92 -1
- package/dist/index.cjs +91 -0
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/tools/units.cjs +91 -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-CKS5W_ih.d.cts → units-C4N1Dq7_.d.cts} +56 -2
- package/dist/{units-CKS5W_ih.d.ts → units-C4N1Dq7_.d.ts} +56 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
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.14.0
|
|
6
|
+
- Added Compound Interest Calculator (`calculateCompoundInterest`) and ISBN Validator / Converter (`validateIsbn`).
|
|
7
|
+
|
|
5
8
|
## 0.13.0
|
|
6
9
|
- Added VAT / Sales Tax Calculator (`calculateTax`).
|
|
7
10
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @utilix-tech/sdk
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**539 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)
|
|
@@ -242,7 +242,7 @@ getNextRuns("*/5 * * * *", 5); // next 5 run timestamps
|
|
|
242
242
|
### `/units`: Conversions
|
|
243
243
|
|
|
244
244
|
```ts
|
|
245
|
-
import { convertBytes, pxToAll, convert, formatValue, validateCardNumber, validateIban, calculateLoan, validateBarcode, calculateTax } from "@utilix-tech/sdk/units";
|
|
245
|
+
import { convertBytes, pxToAll, convert, formatValue, validateCardNumber, validateIban, calculateLoan, validateBarcode, calculateTax, calculateCompoundInterest, validateIsbn } from "@utilix-tech/sdk/units";
|
|
246
246
|
|
|
247
247
|
// File sizes
|
|
248
248
|
convertBytes(1073741824, "GB"); // 1
|
|
@@ -280,6 +280,14 @@ validateBarcode("4006381333931");
|
|
|
280
280
|
// VAT / sales tax: add or remove tax in either direction
|
|
281
281
|
calculateTax(100, 20, "add");
|
|
282
282
|
// { netAmount: 100, taxAmount: 20, grossAmount: 120, ratePercent: 20, direction: "add" }
|
|
283
|
+
|
|
284
|
+
// Compound interest: future value with an optional recurring contribution
|
|
285
|
+
calculateCompoundInterest(1000, 5, 10, 1);
|
|
286
|
+
// { futureValue: 1628.89, totalInterest: 628.89, years: 10, compoundsPerYear: 1, schedule: [...] }
|
|
287
|
+
|
|
288
|
+
// ISBN-10 / ISBN-13 checksum validation + format conversion
|
|
289
|
+
validateIsbn("0-306-40615-2");
|
|
290
|
+
// { valid: true, format: "ISBN-10", converted: "9780306406157", ... }
|
|
283
291
|
```
|
|
284
292
|
|
|
285
293
|
---
|
|
@@ -510,7 +518,7 @@ readIcoInfo(new Uint8Array(icoBytes));
|
|
|
510
518
|
| `@utilix-tech/sdk/data` | CSV, YAML, TOML, XML, INI, NDJSON parse and convert |
|
|
511
519
|
| `@utilix-tech/sdk/generators` | UUID v4/v7, ULID, passwords, strength check, fake data |
|
|
512
520
|
| `@utilix-tech/sdk/time` | Date diff, timezone convert, cron parse, relative time |
|
|
513
|
-
| `@utilix-tech/sdk/units` | Bytes, CSS px/rem, number bases, currency format, credit card/IBAN/barcode validation, loan calculator, VAT/sales tax calculator |
|
|
521
|
+
| `@utilix-tech/sdk/units` | Bytes, CSS px/rem, number bases, currency format, credit card/IBAN/barcode/ISBN validation, loan calculator, compound interest calculator, VAT/sales tax calculator |
|
|
514
522
|
| `@utilix-tech/sdk/network` | HTTP status codes, IP validation, country flags, geolocation URLs, HAR file parsing |
|
|
515
523
|
| `@utilix-tech/sdk/api` | cURL build/parse, JWT decode/sign, JWKS parse, CORS headers, CSP header |
|
|
516
524
|
| `@utilix-tech/sdk/code` | SQL format/minify, HTML format/minify, regex tester, GraphQL format |
|
|
@@ -17,6 +17,7 @@ __export(units_exports, {
|
|
|
17
17
|
bumpVersion: () => bumpVersion,
|
|
18
18
|
calcAspectRatio: () => calcAspectRatio,
|
|
19
19
|
calcSubnet: () => calcSubnet,
|
|
20
|
+
calculateCompoundInterest: () => calculateCompoundInterest,
|
|
20
21
|
calculateLoan: () => calculateLoan,
|
|
21
22
|
calculateTax: () => calculateTax,
|
|
22
23
|
compareSemver: () => compareSemver,
|
|
@@ -66,6 +67,7 @@ __export(units_exports, {
|
|
|
66
67
|
validateBarcode: () => validateBarcode,
|
|
67
68
|
validateCardNumber: () => validateCardNumber,
|
|
68
69
|
validateIban: () => validateIban,
|
|
70
|
+
validateIsbn: () => validateIsbn,
|
|
69
71
|
viewportToPx: () => viewportToPx
|
|
70
72
|
});
|
|
71
73
|
function pxToAll(px, baseFontSize = 16, viewportWidth = 1440, viewportHeight = 900) {
|
|
@@ -1167,5 +1169,94 @@ function calculateTax(amount, ratePercent, direction) {
|
|
|
1167
1169
|
const taxAmount = round22(grossAmount - netAmount);
|
|
1168
1170
|
return { netAmount, taxAmount, grossAmount, ratePercent, direction };
|
|
1169
1171
|
}
|
|
1172
|
+
function calculateCompoundInterest(principal, annualRatePercent, years, compoundsPerYear, contributionPerPeriod = 0) {
|
|
1173
|
+
if (!Number.isFinite(principal) || principal < 0) return { error: "Principal must be zero or a positive number" };
|
|
1174
|
+
if (!Number.isFinite(annualRatePercent) || annualRatePercent < 0) {
|
|
1175
|
+
return { error: "Annual interest rate must be zero or a positive number" };
|
|
1176
|
+
}
|
|
1177
|
+
if (!Number.isInteger(years) || years <= 0) return { error: "Years must be a positive whole number" };
|
|
1178
|
+
if (!Number.isInteger(compoundsPerYear) || compoundsPerYear <= 0) {
|
|
1179
|
+
return { error: "Compounding frequency must be a positive whole number of periods per year" };
|
|
1180
|
+
}
|
|
1181
|
+
if (!Number.isFinite(contributionPerPeriod) || contributionPerPeriod < 0) {
|
|
1182
|
+
return { error: "Contribution per period must be zero or a positive number" };
|
|
1183
|
+
}
|
|
1184
|
+
if (principal === 0 && contributionPerPeriod === 0) return { error: "Enter a principal or a recurring contribution" };
|
|
1185
|
+
const round22 = (n) => Math.round(n * 100) / 100;
|
|
1186
|
+
const ratePerPeriod = annualRatePercent / 100 / compoundsPerYear;
|
|
1187
|
+
function futureValueAtPeriod(periods) {
|
|
1188
|
+
const growth = ratePerPeriod === 0 ? 1 : Math.pow(1 + ratePerPeriod, periods);
|
|
1189
|
+
const fvPrincipal = principal * growth;
|
|
1190
|
+
const fvContributions = contributionPerPeriod === 0 ? 0 : ratePerPeriod === 0 ? contributionPerPeriod * periods : contributionPerPeriod * ((growth - 1) / ratePerPeriod);
|
|
1191
|
+
return fvPrincipal + fvContributions;
|
|
1192
|
+
}
|
|
1193
|
+
const schedule = [];
|
|
1194
|
+
for (let year = 1; year <= years; year++) {
|
|
1195
|
+
const periods = year * compoundsPerYear;
|
|
1196
|
+
const balance = round22(futureValueAtPeriod(periods));
|
|
1197
|
+
const contributions = round22(contributionPerPeriod * periods);
|
|
1198
|
+
schedule.push({ year, balance, contributions, interest: round22(balance - principal - contributions) });
|
|
1199
|
+
}
|
|
1200
|
+
const totalPeriods = years * compoundsPerYear;
|
|
1201
|
+
const futureValue = round22(futureValueAtPeriod(totalPeriods));
|
|
1202
|
+
const totalContributions = round22(contributionPerPeriod * totalPeriods);
|
|
1203
|
+
const totalInterest = round22(futureValue - principal - totalContributions);
|
|
1204
|
+
return {
|
|
1205
|
+
futureValue,
|
|
1206
|
+
totalPrincipal: round22(principal),
|
|
1207
|
+
totalContributions,
|
|
1208
|
+
totalInterest,
|
|
1209
|
+
years,
|
|
1210
|
+
compoundsPerYear,
|
|
1211
|
+
schedule
|
|
1212
|
+
};
|
|
1213
|
+
}
|
|
1214
|
+
function computeIsbn10CheckDigit(dataDigits) {
|
|
1215
|
+
let sum = 0;
|
|
1216
|
+
for (let i = 0; i < 9; i++) sum += dataDigits[i] * (10 - i);
|
|
1217
|
+
const check = (11 - sum % 11) % 11;
|
|
1218
|
+
return check === 10 ? "X" : String(check);
|
|
1219
|
+
}
|
|
1220
|
+
function computeIsbn13CheckDigit(dataDigits) {
|
|
1221
|
+
let sum = 0;
|
|
1222
|
+
const n = dataDigits.length;
|
|
1223
|
+
for (let i = 0; i < n; i++) {
|
|
1224
|
+
const distanceFromEnd = n - 1 - i;
|
|
1225
|
+
const weight = distanceFromEnd % 2 === 0 ? 3 : 1;
|
|
1226
|
+
sum += dataDigits[i] * weight;
|
|
1227
|
+
}
|
|
1228
|
+
return String((10 - sum % 10) % 10);
|
|
1229
|
+
}
|
|
1230
|
+
function validateIsbn(input) {
|
|
1231
|
+
if (!input || !input.trim()) return { error: "Input is empty" };
|
|
1232
|
+
const cleaned = input.replace(/[\s-]/g, "").toUpperCase();
|
|
1233
|
+
if (cleaned.length === 10) {
|
|
1234
|
+
if (!/^\d{9}[\dX]$/.test(cleaned)) {
|
|
1235
|
+
return { error: 'ISBN-10 must be 9 digits followed by a digit or "X" check digit' };
|
|
1236
|
+
}
|
|
1237
|
+
const dataDigits = cleaned.slice(0, 9).split("").map(Number);
|
|
1238
|
+
const checkDigit = cleaned[9];
|
|
1239
|
+
const expectedCheckDigit = computeIsbn10CheckDigit(dataDigits);
|
|
1240
|
+
const valid = checkDigit === expectedCheckDigit;
|
|
1241
|
+
const isbn13Digits = [9, 7, 8, ...dataDigits];
|
|
1242
|
+
const isbn13Check = computeIsbn13CheckDigit(isbn13Digits);
|
|
1243
|
+
const converted = valid ? isbn13Digits.join("") + isbn13Check : null;
|
|
1244
|
+
return { valid, format: "ISBN-10", digits: cleaned, checkDigit, expectedCheckDigit, converted };
|
|
1245
|
+
}
|
|
1246
|
+
if (cleaned.length === 13) {
|
|
1247
|
+
if (!/^\d{13}$/.test(cleaned)) return { error: "ISBN-13 must contain only digits" };
|
|
1248
|
+
const dataDigits = cleaned.slice(0, 12).split("").map(Number);
|
|
1249
|
+
const checkDigit = cleaned[12];
|
|
1250
|
+
const expectedCheckDigit = computeIsbn13CheckDigit(dataDigits);
|
|
1251
|
+
const valid = checkDigit === expectedCheckDigit;
|
|
1252
|
+
let converted = null;
|
|
1253
|
+
if (valid && cleaned.startsWith("978")) {
|
|
1254
|
+
const isbn10Digits = dataDigits.slice(3);
|
|
1255
|
+
converted = isbn10Digits.join("") + computeIsbn10CheckDigit(isbn10Digits);
|
|
1256
|
+
}
|
|
1257
|
+
return { valid, format: "ISBN-13", digits: cleaned, checkDigit, expectedCheckDigit, converted };
|
|
1258
|
+
}
|
|
1259
|
+
return { error: `Unsupported length (${cleaned.length} characters); expected 10 (ISBN-10) or 13 (ISBN-13)` };
|
|
1260
|
+
}
|
|
1170
1261
|
|
|
1171
|
-
export { BASE_LABELS, BASE_PREFIXES, BYTE_UNITS, COMMON_CURRENCIES, COMMON_LOCALES, COMMON_PERMISSIONS, COMMON_RATIOS, COMMON_SIZES, COMMON_TAX_RATES, COMMON_VIEWPORTS, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, calculateLoan, calculateTax, compareSemver, convert, convertBytes, convertIp, coverBox, decimalToIp, decimalToIpCidr, describePermissions, fitIntoBox, formatNumber, formatValue, formatVwValue, formatWithSeparator, gcd, ipFromBinary, ipFromDecimal, ipFromHex, ipToBinary, ipToDecimal, ipToDecimalCidr, ipToHex, ipToOctal, isValid, isValidCidr, isValidIp, isValidIpv4, octalToPermissions, parseFileSize, parseInput, parseNumberString, parseSemver, permissionsToChmod, permissionsToOctal, permissionsToSymbolic, ptToPx, pxToAll, pxToViewport, remToPx, satisfiesRange, scaleByHeight, scaleByWidth, sortVersions, splitSubnet, symbolicToPermissions, units_exports, validateBarcode, validateCardNumber, validateIban, viewportToPx };
|
|
1262
|
+
export { BASE_LABELS, BASE_PREFIXES, BYTE_UNITS, COMMON_CURRENCIES, COMMON_LOCALES, COMMON_PERMISSIONS, COMMON_RATIOS, COMMON_SIZES, COMMON_TAX_RATES, COMMON_VIEWPORTS, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, calculateCompoundInterest, calculateLoan, calculateTax, compareSemver, convert, convertBytes, convertIp, coverBox, decimalToIp, decimalToIpCidr, describePermissions, fitIntoBox, formatNumber, formatValue, formatVwValue, formatWithSeparator, gcd, ipFromBinary, ipFromDecimal, ipFromHex, ipToBinary, ipToDecimal, ipToDecimalCidr, ipToHex, ipToOctal, isValid, isValidCidr, isValidIp, isValidIpv4, octalToPermissions, parseFileSize, parseInput, parseNumberString, parseSemver, permissionsToChmod, permissionsToOctal, permissionsToSymbolic, ptToPx, pxToAll, pxToViewport, remToPx, satisfiesRange, scaleByHeight, scaleByWidth, sortVersions, splitSubnet, symbolicToPermissions, units_exports, validateBarcode, validateCardNumber, validateIban, validateIsbn, viewportToPx };
|
package/dist/index.cjs
CHANGED
|
@@ -6622,6 +6622,7 @@ __export(units_exports, {
|
|
|
6622
6622
|
bumpVersion: () => bumpVersion,
|
|
6623
6623
|
calcAspectRatio: () => calcAspectRatio,
|
|
6624
6624
|
calcSubnet: () => calcSubnet,
|
|
6625
|
+
calculateCompoundInterest: () => calculateCompoundInterest,
|
|
6625
6626
|
calculateLoan: () => calculateLoan,
|
|
6626
6627
|
calculateTax: () => calculateTax,
|
|
6627
6628
|
compareSemver: () => compareSemver,
|
|
@@ -6671,6 +6672,7 @@ __export(units_exports, {
|
|
|
6671
6672
|
validateBarcode: () => validateBarcode,
|
|
6672
6673
|
validateCardNumber: () => validateCardNumber,
|
|
6673
6674
|
validateIban: () => validateIban,
|
|
6675
|
+
validateIsbn: () => validateIsbn,
|
|
6674
6676
|
viewportToPx: () => viewportToPx
|
|
6675
6677
|
});
|
|
6676
6678
|
function pxToAll(px, baseFontSize = 16, viewportWidth = 1440, viewportHeight = 900) {
|
|
@@ -7772,6 +7774,95 @@ function calculateTax(amount, ratePercent, direction) {
|
|
|
7772
7774
|
const taxAmount = round23(grossAmount - netAmount);
|
|
7773
7775
|
return { netAmount, taxAmount, grossAmount, ratePercent, direction };
|
|
7774
7776
|
}
|
|
7777
|
+
function calculateCompoundInterest(principal, annualRatePercent, years, compoundsPerYear, contributionPerPeriod = 0) {
|
|
7778
|
+
if (!Number.isFinite(principal) || principal < 0) return { error: "Principal must be zero or a positive number" };
|
|
7779
|
+
if (!Number.isFinite(annualRatePercent) || annualRatePercent < 0) {
|
|
7780
|
+
return { error: "Annual interest rate must be zero or a positive number" };
|
|
7781
|
+
}
|
|
7782
|
+
if (!Number.isInteger(years) || years <= 0) return { error: "Years must be a positive whole number" };
|
|
7783
|
+
if (!Number.isInteger(compoundsPerYear) || compoundsPerYear <= 0) {
|
|
7784
|
+
return { error: "Compounding frequency must be a positive whole number of periods per year" };
|
|
7785
|
+
}
|
|
7786
|
+
if (!Number.isFinite(contributionPerPeriod) || contributionPerPeriod < 0) {
|
|
7787
|
+
return { error: "Contribution per period must be zero or a positive number" };
|
|
7788
|
+
}
|
|
7789
|
+
if (principal === 0 && contributionPerPeriod === 0) return { error: "Enter a principal or a recurring contribution" };
|
|
7790
|
+
const round23 = (n) => Math.round(n * 100) / 100;
|
|
7791
|
+
const ratePerPeriod = annualRatePercent / 100 / compoundsPerYear;
|
|
7792
|
+
function futureValueAtPeriod(periods) {
|
|
7793
|
+
const growth = ratePerPeriod === 0 ? 1 : Math.pow(1 + ratePerPeriod, periods);
|
|
7794
|
+
const fvPrincipal = principal * growth;
|
|
7795
|
+
const fvContributions = contributionPerPeriod === 0 ? 0 : ratePerPeriod === 0 ? contributionPerPeriod * periods : contributionPerPeriod * ((growth - 1) / ratePerPeriod);
|
|
7796
|
+
return fvPrincipal + fvContributions;
|
|
7797
|
+
}
|
|
7798
|
+
const schedule = [];
|
|
7799
|
+
for (let year = 1; year <= years; year++) {
|
|
7800
|
+
const periods = year * compoundsPerYear;
|
|
7801
|
+
const balance = round23(futureValueAtPeriod(periods));
|
|
7802
|
+
const contributions = round23(contributionPerPeriod * periods);
|
|
7803
|
+
schedule.push({ year, balance, contributions, interest: round23(balance - principal - contributions) });
|
|
7804
|
+
}
|
|
7805
|
+
const totalPeriods = years * compoundsPerYear;
|
|
7806
|
+
const futureValue = round23(futureValueAtPeriod(totalPeriods));
|
|
7807
|
+
const totalContributions = round23(contributionPerPeriod * totalPeriods);
|
|
7808
|
+
const totalInterest = round23(futureValue - principal - totalContributions);
|
|
7809
|
+
return {
|
|
7810
|
+
futureValue,
|
|
7811
|
+
totalPrincipal: round23(principal),
|
|
7812
|
+
totalContributions,
|
|
7813
|
+
totalInterest,
|
|
7814
|
+
years,
|
|
7815
|
+
compoundsPerYear,
|
|
7816
|
+
schedule
|
|
7817
|
+
};
|
|
7818
|
+
}
|
|
7819
|
+
function computeIsbn10CheckDigit(dataDigits) {
|
|
7820
|
+
let sum = 0;
|
|
7821
|
+
for (let i = 0; i < 9; i++) sum += dataDigits[i] * (10 - i);
|
|
7822
|
+
const check = (11 - sum % 11) % 11;
|
|
7823
|
+
return check === 10 ? "X" : String(check);
|
|
7824
|
+
}
|
|
7825
|
+
function computeIsbn13CheckDigit(dataDigits) {
|
|
7826
|
+
let sum = 0;
|
|
7827
|
+
const n = dataDigits.length;
|
|
7828
|
+
for (let i = 0; i < n; i++) {
|
|
7829
|
+
const distanceFromEnd = n - 1 - i;
|
|
7830
|
+
const weight = distanceFromEnd % 2 === 0 ? 3 : 1;
|
|
7831
|
+
sum += dataDigits[i] * weight;
|
|
7832
|
+
}
|
|
7833
|
+
return String((10 - sum % 10) % 10);
|
|
7834
|
+
}
|
|
7835
|
+
function validateIsbn(input) {
|
|
7836
|
+
if (!input || !input.trim()) return { error: "Input is empty" };
|
|
7837
|
+
const cleaned = input.replace(/[\s-]/g, "").toUpperCase();
|
|
7838
|
+
if (cleaned.length === 10) {
|
|
7839
|
+
if (!/^\d{9}[\dX]$/.test(cleaned)) {
|
|
7840
|
+
return { error: 'ISBN-10 must be 9 digits followed by a digit or "X" check digit' };
|
|
7841
|
+
}
|
|
7842
|
+
const dataDigits = cleaned.slice(0, 9).split("").map(Number);
|
|
7843
|
+
const checkDigit = cleaned[9];
|
|
7844
|
+
const expectedCheckDigit = computeIsbn10CheckDigit(dataDigits);
|
|
7845
|
+
const valid = checkDigit === expectedCheckDigit;
|
|
7846
|
+
const isbn13Digits = [9, 7, 8, ...dataDigits];
|
|
7847
|
+
const isbn13Check = computeIsbn13CheckDigit(isbn13Digits);
|
|
7848
|
+
const converted = valid ? isbn13Digits.join("") + isbn13Check : null;
|
|
7849
|
+
return { valid, format: "ISBN-10", digits: cleaned, checkDigit, expectedCheckDigit, converted };
|
|
7850
|
+
}
|
|
7851
|
+
if (cleaned.length === 13) {
|
|
7852
|
+
if (!/^\d{13}$/.test(cleaned)) return { error: "ISBN-13 must contain only digits" };
|
|
7853
|
+
const dataDigits = cleaned.slice(0, 12).split("").map(Number);
|
|
7854
|
+
const checkDigit = cleaned[12];
|
|
7855
|
+
const expectedCheckDigit = computeIsbn13CheckDigit(dataDigits);
|
|
7856
|
+
const valid = checkDigit === expectedCheckDigit;
|
|
7857
|
+
let converted = null;
|
|
7858
|
+
if (valid && cleaned.startsWith("978")) {
|
|
7859
|
+
const isbn10Digits = dataDigits.slice(3);
|
|
7860
|
+
converted = isbn10Digits.join("") + computeIsbn10CheckDigit(isbn10Digits);
|
|
7861
|
+
}
|
|
7862
|
+
return { valid, format: "ISBN-13", digits: cleaned, checkDigit, expectedCheckDigit, converted };
|
|
7863
|
+
}
|
|
7864
|
+
return { error: `Unsupported length (${cleaned.length} characters); expected 10 (ISBN-10) or 13 (ISBN-13)` };
|
|
7865
|
+
}
|
|
7775
7866
|
|
|
7776
7867
|
// src/tools/network.ts
|
|
7777
7868
|
var network_exports = {};
|
package/dist/index.d.cts
CHANGED
|
@@ -5,7 +5,7 @@ export { t as text } from './text-Bbx-tZ43.cjs';
|
|
|
5
5
|
export { d as data } from './data-D8XTI7Du.cjs';
|
|
6
6
|
export { g as generators } from './generators-BGtRGpJZ.cjs';
|
|
7
7
|
export { t as time } from './time-DbT8fjaF.cjs';
|
|
8
|
-
export { u as units } from './units-
|
|
8
|
+
export { u as units } from './units-C4N1Dq7_.cjs';
|
|
9
9
|
export { n as network } from './network-DaNoZ5ER.cjs';
|
|
10
10
|
export { a as api } from './api-Xl7OzIgq.cjs';
|
|
11
11
|
export { c as code } from './code-BUqyaofO.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { t as text } from './text-Bbx-tZ43.js';
|
|
|
5
5
|
export { d as data } from './data-D8XTI7Du.js';
|
|
6
6
|
export { g as generators } from './generators-BGtRGpJZ.js';
|
|
7
7
|
export { t as time } from './time-DbT8fjaF.js';
|
|
8
|
-
export { u as units } from './units-
|
|
8
|
+
export { u as units } from './units-C4N1Dq7_.js';
|
|
9
9
|
export { n as network } from './network-DaNoZ5ER.js';
|
|
10
10
|
export { a as api } from './api-Xl7OzIgq.js';
|
|
11
11
|
export { c as code } from './code-BUqyaofO.js';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { media_exports as media } from './chunk-XMKJYVKB.js';
|
|
2
|
-
export { units_exports as units } from './chunk-
|
|
2
|
+
export { units_exports as units } from './chunk-2TQTKZCN.js';
|
|
3
3
|
export { network_exports as network } from './chunk-OB56VNKJ.js';
|
|
4
4
|
export { api_exports as api } from './chunk-Q3B3YWOA.js';
|
|
5
5
|
export { code_exports as code } from './chunk-V5S6OJ4A.js';
|
package/dist/tools/units.cjs
CHANGED
|
@@ -1100,6 +1100,95 @@ function calculateTax(amount, ratePercent, direction) {
|
|
|
1100
1100
|
const taxAmount = round22(grossAmount - netAmount);
|
|
1101
1101
|
return { netAmount, taxAmount, grossAmount, ratePercent, direction };
|
|
1102
1102
|
}
|
|
1103
|
+
function calculateCompoundInterest(principal, annualRatePercent, years, compoundsPerYear, contributionPerPeriod = 0) {
|
|
1104
|
+
if (!Number.isFinite(principal) || principal < 0) return { error: "Principal must be zero or a positive number" };
|
|
1105
|
+
if (!Number.isFinite(annualRatePercent) || annualRatePercent < 0) {
|
|
1106
|
+
return { error: "Annual interest rate must be zero or a positive number" };
|
|
1107
|
+
}
|
|
1108
|
+
if (!Number.isInteger(years) || years <= 0) return { error: "Years must be a positive whole number" };
|
|
1109
|
+
if (!Number.isInteger(compoundsPerYear) || compoundsPerYear <= 0) {
|
|
1110
|
+
return { error: "Compounding frequency must be a positive whole number of periods per year" };
|
|
1111
|
+
}
|
|
1112
|
+
if (!Number.isFinite(contributionPerPeriod) || contributionPerPeriod < 0) {
|
|
1113
|
+
return { error: "Contribution per period must be zero or a positive number" };
|
|
1114
|
+
}
|
|
1115
|
+
if (principal === 0 && contributionPerPeriod === 0) return { error: "Enter a principal or a recurring contribution" };
|
|
1116
|
+
const round22 = (n) => Math.round(n * 100) / 100;
|
|
1117
|
+
const ratePerPeriod = annualRatePercent / 100 / compoundsPerYear;
|
|
1118
|
+
function futureValueAtPeriod(periods) {
|
|
1119
|
+
const growth = ratePerPeriod === 0 ? 1 : Math.pow(1 + ratePerPeriod, periods);
|
|
1120
|
+
const fvPrincipal = principal * growth;
|
|
1121
|
+
const fvContributions = contributionPerPeriod === 0 ? 0 : ratePerPeriod === 0 ? contributionPerPeriod * periods : contributionPerPeriod * ((growth - 1) / ratePerPeriod);
|
|
1122
|
+
return fvPrincipal + fvContributions;
|
|
1123
|
+
}
|
|
1124
|
+
const schedule = [];
|
|
1125
|
+
for (let year = 1; year <= years; year++) {
|
|
1126
|
+
const periods = year * compoundsPerYear;
|
|
1127
|
+
const balance = round22(futureValueAtPeriod(periods));
|
|
1128
|
+
const contributions = round22(contributionPerPeriod * periods);
|
|
1129
|
+
schedule.push({ year, balance, contributions, interest: round22(balance - principal - contributions) });
|
|
1130
|
+
}
|
|
1131
|
+
const totalPeriods = years * compoundsPerYear;
|
|
1132
|
+
const futureValue = round22(futureValueAtPeriod(totalPeriods));
|
|
1133
|
+
const totalContributions = round22(contributionPerPeriod * totalPeriods);
|
|
1134
|
+
const totalInterest = round22(futureValue - principal - totalContributions);
|
|
1135
|
+
return {
|
|
1136
|
+
futureValue,
|
|
1137
|
+
totalPrincipal: round22(principal),
|
|
1138
|
+
totalContributions,
|
|
1139
|
+
totalInterest,
|
|
1140
|
+
years,
|
|
1141
|
+
compoundsPerYear,
|
|
1142
|
+
schedule
|
|
1143
|
+
};
|
|
1144
|
+
}
|
|
1145
|
+
function computeIsbn10CheckDigit(dataDigits) {
|
|
1146
|
+
let sum = 0;
|
|
1147
|
+
for (let i = 0; i < 9; i++) sum += dataDigits[i] * (10 - i);
|
|
1148
|
+
const check = (11 - sum % 11) % 11;
|
|
1149
|
+
return check === 10 ? "X" : String(check);
|
|
1150
|
+
}
|
|
1151
|
+
function computeIsbn13CheckDigit(dataDigits) {
|
|
1152
|
+
let sum = 0;
|
|
1153
|
+
const n = dataDigits.length;
|
|
1154
|
+
for (let i = 0; i < n; i++) {
|
|
1155
|
+
const distanceFromEnd = n - 1 - i;
|
|
1156
|
+
const weight = distanceFromEnd % 2 === 0 ? 3 : 1;
|
|
1157
|
+
sum += dataDigits[i] * weight;
|
|
1158
|
+
}
|
|
1159
|
+
return String((10 - sum % 10) % 10);
|
|
1160
|
+
}
|
|
1161
|
+
function validateIsbn(input) {
|
|
1162
|
+
if (!input || !input.trim()) return { error: "Input is empty" };
|
|
1163
|
+
const cleaned = input.replace(/[\s-]/g, "").toUpperCase();
|
|
1164
|
+
if (cleaned.length === 10) {
|
|
1165
|
+
if (!/^\d{9}[\dX]$/.test(cleaned)) {
|
|
1166
|
+
return { error: 'ISBN-10 must be 9 digits followed by a digit or "X" check digit' };
|
|
1167
|
+
}
|
|
1168
|
+
const dataDigits = cleaned.slice(0, 9).split("").map(Number);
|
|
1169
|
+
const checkDigit = cleaned[9];
|
|
1170
|
+
const expectedCheckDigit = computeIsbn10CheckDigit(dataDigits);
|
|
1171
|
+
const valid = checkDigit === expectedCheckDigit;
|
|
1172
|
+
const isbn13Digits = [9, 7, 8, ...dataDigits];
|
|
1173
|
+
const isbn13Check = computeIsbn13CheckDigit(isbn13Digits);
|
|
1174
|
+
const converted = valid ? isbn13Digits.join("") + isbn13Check : null;
|
|
1175
|
+
return { valid, format: "ISBN-10", digits: cleaned, checkDigit, expectedCheckDigit, converted };
|
|
1176
|
+
}
|
|
1177
|
+
if (cleaned.length === 13) {
|
|
1178
|
+
if (!/^\d{13}$/.test(cleaned)) return { error: "ISBN-13 must contain only digits" };
|
|
1179
|
+
const dataDigits = cleaned.slice(0, 12).split("").map(Number);
|
|
1180
|
+
const checkDigit = cleaned[12];
|
|
1181
|
+
const expectedCheckDigit = computeIsbn13CheckDigit(dataDigits);
|
|
1182
|
+
const valid = checkDigit === expectedCheckDigit;
|
|
1183
|
+
let converted = null;
|
|
1184
|
+
if (valid && cleaned.startsWith("978")) {
|
|
1185
|
+
const isbn10Digits = dataDigits.slice(3);
|
|
1186
|
+
converted = isbn10Digits.join("") + computeIsbn10CheckDigit(isbn10Digits);
|
|
1187
|
+
}
|
|
1188
|
+
return { valid, format: "ISBN-13", digits: cleaned, checkDigit, expectedCheckDigit, converted };
|
|
1189
|
+
}
|
|
1190
|
+
return { error: `Unsupported length (${cleaned.length} characters); expected 10 (ISBN-10) or 13 (ISBN-13)` };
|
|
1191
|
+
}
|
|
1103
1192
|
|
|
1104
1193
|
exports.BASE_LABELS = BASE_LABELS;
|
|
1105
1194
|
exports.BASE_PREFIXES = BASE_PREFIXES;
|
|
@@ -1115,6 +1204,7 @@ exports.autoFormat = autoFormat;
|
|
|
1115
1204
|
exports.bumpVersion = bumpVersion;
|
|
1116
1205
|
exports.calcAspectRatio = calcAspectRatio;
|
|
1117
1206
|
exports.calcSubnet = calcSubnet;
|
|
1207
|
+
exports.calculateCompoundInterest = calculateCompoundInterest;
|
|
1118
1208
|
exports.calculateLoan = calculateLoan;
|
|
1119
1209
|
exports.calculateTax = calculateTax;
|
|
1120
1210
|
exports.compareSemver = compareSemver;
|
|
@@ -1164,4 +1254,5 @@ exports.symbolicToPermissions = symbolicToPermissions;
|
|
|
1164
1254
|
exports.validateBarcode = validateBarcode;
|
|
1165
1255
|
exports.validateCardNumber = validateCardNumber;
|
|
1166
1256
|
exports.validateIban = validateIban;
|
|
1257
|
+
exports.validateIsbn = validateIsbn;
|
|
1167
1258
|
exports.viewportToPx = viewportToPx;
|
package/dist/tools/units.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as AmortizationRow, a as AspectRatioResult, B as BASE_LABELS, b as BASE_PREFIXES, c as BYTE_UNITS, d as BarcodeFormat, e as BarcodeValidationResult, f as BaseConvertResult, g as ByteConvertResult, h as ByteUnit, C as COMMON_CURRENCIES, i as COMMON_LOCALES, j as COMMON_PERMISSIONS, k as COMMON_RATIOS, l as COMMON_SIZES, m as COMMON_TAX_RATES, n as COMMON_VIEWPORTS, o as CardValidationResult, D as Dimensions, F as FilePermissions,
|
|
1
|
+
export { A as AmortizationRow, a as AspectRatioResult, B as BASE_LABELS, b as BASE_PREFIXES, c as BYTE_UNITS, d as BarcodeFormat, e as BarcodeValidationResult, f as BaseConvertResult, g as ByteConvertResult, h as ByteUnit, C as COMMON_CURRENCIES, i as COMMON_LOCALES, j as COMMON_PERMISSIONS, k as COMMON_RATIOS, l as COMMON_SIZES, m as COMMON_TAX_RATES, n as COMMON_VIEWPORTS, o as CardValidationResult, p as CompoundInterestResult, q as CompoundYearRow, D as Dimensions, F as FilePermissions, r as FormatOptions, I as IbanValidationResult, s as IpConversion, t as IsbnFormat, v as IsbnResult, L as LoanResult, N as NotationStyle, w as NumberBase, P as Permission, x as PxConvertResult, S as SemverVersion, y as SubnetInfo, T as TaxDirection, z as TaxResult, V as ViewportConvertResult, E as autoFormat, G as bumpVersion, H as calcAspectRatio, J as calcSubnet, K as calculateCompoundInterest, M as calculateLoan, O as calculateTax, Q as compareSemver, R as convert, U as convertBytes, W as convertIp, X as coverBox, Y as decimalToIp, Z as decimalToIpCidr, _ as describePermissions, $ as fitIntoBox, a0 as formatNumber, a1 as formatValue, a2 as formatVwValue, a3 as formatWithSeparator, a4 as gcd, a5 as ipFromBinary, a6 as ipFromDecimal, a7 as ipFromHex, a8 as ipToBinary, a9 as ipToDecimal, aa as ipToDecimalCidr, ab as ipToHex, ac as ipToOctal, ad as isValid, ae as isValidCidr, af as isValidIp, ag as isValidIpv4, ah as octalToPermissions, ai as parseFileSize, aj as parseInput, ak as parseNumberString, al as parseSemver, am as permissionsToChmod, an as permissionsToOctal, ao as permissionsToSymbolic, ap as ptToPx, aq as pxToAll, ar as pxToViewport, as as remToPx, at as satisfiesRange, au as scaleByHeight, av as scaleByWidth, aw as sortVersions, ax as splitSubnet, ay as symbolicToPermissions, az as validateBarcode, aA as validateCardNumber, aB as validateIban, aC as validateIsbn, aD as viewportToPx } from '../units-C4N1Dq7_.cjs';
|
package/dist/tools/units.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as AmortizationRow, a as AspectRatioResult, B as BASE_LABELS, b as BASE_PREFIXES, c as BYTE_UNITS, d as BarcodeFormat, e as BarcodeValidationResult, f as BaseConvertResult, g as ByteConvertResult, h as ByteUnit, C as COMMON_CURRENCIES, i as COMMON_LOCALES, j as COMMON_PERMISSIONS, k as COMMON_RATIOS, l as COMMON_SIZES, m as COMMON_TAX_RATES, n as COMMON_VIEWPORTS, o as CardValidationResult, D as Dimensions, F as FilePermissions,
|
|
1
|
+
export { A as AmortizationRow, a as AspectRatioResult, B as BASE_LABELS, b as BASE_PREFIXES, c as BYTE_UNITS, d as BarcodeFormat, e as BarcodeValidationResult, f as BaseConvertResult, g as ByteConvertResult, h as ByteUnit, C as COMMON_CURRENCIES, i as COMMON_LOCALES, j as COMMON_PERMISSIONS, k as COMMON_RATIOS, l as COMMON_SIZES, m as COMMON_TAX_RATES, n as COMMON_VIEWPORTS, o as CardValidationResult, p as CompoundInterestResult, q as CompoundYearRow, D as Dimensions, F as FilePermissions, r as FormatOptions, I as IbanValidationResult, s as IpConversion, t as IsbnFormat, v as IsbnResult, L as LoanResult, N as NotationStyle, w as NumberBase, P as Permission, x as PxConvertResult, S as SemverVersion, y as SubnetInfo, T as TaxDirection, z as TaxResult, V as ViewportConvertResult, E as autoFormat, G as bumpVersion, H as calcAspectRatio, J as calcSubnet, K as calculateCompoundInterest, M as calculateLoan, O as calculateTax, Q as compareSemver, R as convert, U as convertBytes, W as convertIp, X as coverBox, Y as decimalToIp, Z as decimalToIpCidr, _ as describePermissions, $ as fitIntoBox, a0 as formatNumber, a1 as formatValue, a2 as formatVwValue, a3 as formatWithSeparator, a4 as gcd, a5 as ipFromBinary, a6 as ipFromDecimal, a7 as ipFromHex, a8 as ipToBinary, a9 as ipToDecimal, aa as ipToDecimalCidr, ab as ipToHex, ac as ipToOctal, ad as isValid, ae as isValidCidr, af as isValidIp, ag as isValidIpv4, ah as octalToPermissions, ai as parseFileSize, aj as parseInput, ak as parseNumberString, al as parseSemver, am as permissionsToChmod, an as permissionsToOctal, ao as permissionsToSymbolic, ap as ptToPx, aq as pxToAll, ar as pxToViewport, as as remToPx, at as satisfiesRange, au as scaleByHeight, av as scaleByWidth, aw as sortVersions, ax as splitSubnet, ay as symbolicToPermissions, az as validateBarcode, aA as validateCardNumber, aB as validateIban, aC as validateIsbn, aD as viewportToPx } from '../units-C4N1Dq7_.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_VIEWPORTS, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, calculateLoan, calculateTax, compareSemver, convert, convertBytes, convertIp, coverBox, decimalToIp, decimalToIpCidr, describePermissions, fitIntoBox, formatNumber, formatValue, formatVwValue, formatWithSeparator, gcd, ipFromBinary, ipFromDecimal, ipFromHex, ipToBinary, ipToDecimal, ipToDecimalCidr, ipToHex, ipToOctal, isValid, isValidCidr, isValidIp, isValidIpv4, octalToPermissions, parseFileSize, parseInput, parseNumberString, parseSemver, permissionsToChmod, permissionsToOctal, permissionsToSymbolic, ptToPx, pxToAll, pxToViewport, remToPx, satisfiesRange, scaleByHeight, scaleByWidth, sortVersions, splitSubnet, symbolicToPermissions, validateBarcode, validateCardNumber, validateIban, 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_VIEWPORTS, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, calculateCompoundInterest, calculateLoan, calculateTax, compareSemver, convert, convertBytes, convertIp, coverBox, decimalToIp, decimalToIpCidr, describePermissions, fitIntoBox, formatNumber, formatValue, formatVwValue, formatWithSeparator, gcd, ipFromBinary, ipFromDecimal, ipFromHex, ipToBinary, ipToDecimal, ipToDecimalCidr, ipToHex, ipToOctal, isValid, isValidCidr, isValidIp, isValidIpv4, octalToPermissions, parseFileSize, parseInput, parseNumberString, parseSemver, permissionsToChmod, permissionsToOctal, permissionsToSymbolic, ptToPx, pxToAll, pxToViewport, remToPx, satisfiesRange, scaleByHeight, scaleByWidth, sortVersions, splitSubnet, symbolicToPermissions, validateBarcode, validateCardNumber, validateIban, validateIsbn, viewportToPx } from '../chunk-2TQTKZCN.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
* - credit-card-validator : validateCardNumber
|
|
16
16
|
* - iban-validator : validateIban
|
|
17
17
|
* - loan-calculator : calculateLoan
|
|
18
|
+
* - barcode-validator : validateBarcode
|
|
19
|
+
* - vat-calculator : calculateTax
|
|
20
|
+
* - compound-interest-calculator : calculateCompoundInterest
|
|
21
|
+
* - isbn-validator : validateIsbn
|
|
18
22
|
*/
|
|
19
23
|
interface PxConvertResult {
|
|
20
24
|
px: number;
|
|
@@ -318,6 +322,50 @@ declare const COMMON_TAX_RATES: Array<{
|
|
|
318
322
|
declare function calculateTax(amount: number, ratePercent: number, direction: TaxDirection): TaxResult | {
|
|
319
323
|
error: string;
|
|
320
324
|
};
|
|
325
|
+
interface CompoundYearRow {
|
|
326
|
+
year: number;
|
|
327
|
+
balance: number;
|
|
328
|
+
contributions: number;
|
|
329
|
+
interest: number;
|
|
330
|
+
}
|
|
331
|
+
interface CompoundInterestResult {
|
|
332
|
+
futureValue: number;
|
|
333
|
+
totalPrincipal: number;
|
|
334
|
+
totalContributions: number;
|
|
335
|
+
totalInterest: number;
|
|
336
|
+
years: number;
|
|
337
|
+
compoundsPerYear: number;
|
|
338
|
+
schedule: CompoundYearRow[];
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Compute the future value of a principal (plus an optional recurring
|
|
342
|
+
* contribution made at the end of each compounding period) under compound
|
|
343
|
+
* interest, given an annual interest rate (as a percent, e.g. 5), a term in
|
|
344
|
+
* years, and a compounding frequency (periods per year, e.g. 1 = annually,
|
|
345
|
+
* 12 = monthly, 365 = daily).
|
|
346
|
+
*/
|
|
347
|
+
declare function calculateCompoundInterest(principal: number, annualRatePercent: number, years: number, compoundsPerYear: number, contributionPerPeriod?: number): CompoundInterestResult | {
|
|
348
|
+
error: string;
|
|
349
|
+
};
|
|
350
|
+
type IsbnFormat = "ISBN-10" | "ISBN-13";
|
|
351
|
+
interface IsbnResult {
|
|
352
|
+
valid: boolean;
|
|
353
|
+
format: IsbnFormat;
|
|
354
|
+
digits: string;
|
|
355
|
+
checkDigit: string;
|
|
356
|
+
expectedCheckDigit: string;
|
|
357
|
+
converted: string | null;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Validate an ISBN-10 or ISBN-13 number via its checksum, inferred from the
|
|
361
|
+
* character count (10 or 13) once spaces and hyphens are stripped, and
|
|
362
|
+
* convert it to the other format where possible: ISBN-10 always converts to
|
|
363
|
+
* ISBN-13 by prefixing "978" and recomputing the check digit, but an
|
|
364
|
+
* ISBN-13 only converts back to ISBN-10 if it starts with the "978" prefix.
|
|
365
|
+
*/
|
|
366
|
+
declare function validateIsbn(input: string): IsbnResult | {
|
|
367
|
+
error: string;
|
|
368
|
+
};
|
|
321
369
|
|
|
322
370
|
type units_AmortizationRow = AmortizationRow;
|
|
323
371
|
type units_AspectRatioResult = AspectRatioResult;
|
|
@@ -337,11 +385,15 @@ declare const units_COMMON_SIZES: typeof COMMON_SIZES;
|
|
|
337
385
|
declare const units_COMMON_TAX_RATES: typeof COMMON_TAX_RATES;
|
|
338
386
|
declare const units_COMMON_VIEWPORTS: typeof COMMON_VIEWPORTS;
|
|
339
387
|
type units_CardValidationResult = CardValidationResult;
|
|
388
|
+
type units_CompoundInterestResult = CompoundInterestResult;
|
|
389
|
+
type units_CompoundYearRow = CompoundYearRow;
|
|
340
390
|
type units_Dimensions = Dimensions;
|
|
341
391
|
type units_FilePermissions = FilePermissions;
|
|
342
392
|
type units_FormatOptions = FormatOptions;
|
|
343
393
|
type units_IbanValidationResult = IbanValidationResult;
|
|
344
394
|
type units_IpConversion = IpConversion;
|
|
395
|
+
type units_IsbnFormat = IsbnFormat;
|
|
396
|
+
type units_IsbnResult = IsbnResult;
|
|
345
397
|
type units_LoanResult = LoanResult;
|
|
346
398
|
type units_NotationStyle = NotationStyle;
|
|
347
399
|
type units_NumberBase = NumberBase;
|
|
@@ -356,6 +408,7 @@ declare const units_autoFormat: typeof autoFormat;
|
|
|
356
408
|
declare const units_bumpVersion: typeof bumpVersion;
|
|
357
409
|
declare const units_calcAspectRatio: typeof calcAspectRatio;
|
|
358
410
|
declare const units_calcSubnet: typeof calcSubnet;
|
|
411
|
+
declare const units_calculateCompoundInterest: typeof calculateCompoundInterest;
|
|
359
412
|
declare const units_calculateLoan: typeof calculateLoan;
|
|
360
413
|
declare const units_calculateTax: typeof calculateTax;
|
|
361
414
|
declare const units_compareSemver: typeof compareSemver;
|
|
@@ -405,9 +458,10 @@ declare const units_symbolicToPermissions: typeof symbolicToPermissions;
|
|
|
405
458
|
declare const units_validateBarcode: typeof validateBarcode;
|
|
406
459
|
declare const units_validateCardNumber: typeof validateCardNumber;
|
|
407
460
|
declare const units_validateIban: typeof validateIban;
|
|
461
|
+
declare const units_validateIsbn: typeof validateIsbn;
|
|
408
462
|
declare const units_viewportToPx: typeof viewportToPx;
|
|
409
463
|
declare namespace units {
|
|
410
|
-
export { type units_AmortizationRow as AmortizationRow, type units_AspectRatioResult as AspectRatioResult, units_BASE_LABELS as BASE_LABELS, units_BASE_PREFIXES as BASE_PREFIXES, units_BYTE_UNITS as BYTE_UNITS, type units_BarcodeFormat as BarcodeFormat, type units_BarcodeValidationResult as BarcodeValidationResult, type units_BaseConvertResult as BaseConvertResult, type units_ByteConvertResult as ByteConvertResult, type units_ByteUnit as ByteUnit, units_COMMON_CURRENCIES as COMMON_CURRENCIES, units_COMMON_LOCALES as COMMON_LOCALES, units_COMMON_PERMISSIONS as COMMON_PERMISSIONS, units_COMMON_RATIOS as COMMON_RATIOS, units_COMMON_SIZES as COMMON_SIZES, units_COMMON_TAX_RATES as COMMON_TAX_RATES, units_COMMON_VIEWPORTS as COMMON_VIEWPORTS, type units_CardValidationResult as CardValidationResult, type units_Dimensions as Dimensions, type units_FilePermissions as FilePermissions, type units_FormatOptions as FormatOptions, type units_IbanValidationResult as IbanValidationResult, type units_IpConversion as IpConversion, type units_LoanResult as LoanResult, type units_NotationStyle as NotationStyle, type units_NumberBase as NumberBase, type units_Permission as Permission, type units_PxConvertResult as PxConvertResult, type units_SemverVersion as SemverVersion, type units_SubnetInfo as SubnetInfo, type units_TaxDirection as TaxDirection, type units_TaxResult as TaxResult, type units_ViewportConvertResult as ViewportConvertResult, units_autoFormat as autoFormat, units_bumpVersion as bumpVersion, units_calcAspectRatio as calcAspectRatio, units_calcSubnet as calcSubnet, units_calculateLoan as calculateLoan, units_calculateTax as calculateTax, units_compareSemver as compareSemver, units_convert as convert, units_convertBytes as convertBytes, units_convertIp as convertIp, units_coverBox as coverBox, units_decimalToIp as decimalToIp, units_decimalToIpCidr as decimalToIpCidr, units_describePermissions as describePermissions, units_fitIntoBox as fitIntoBox, units_formatNumber as formatNumber, units_formatValue as formatValue, units_formatVwValue as formatVwValue, units_formatWithSeparator as formatWithSeparator, units_gcd as gcd, units_ipFromBinary as ipFromBinary, units_ipFromDecimal as ipFromDecimal, units_ipFromHex as ipFromHex, units_ipToBinary as ipToBinary, units_ipToDecimal as ipToDecimal, units_ipToDecimalCidr as ipToDecimalCidr, units_ipToHex as ipToHex, units_ipToOctal as ipToOctal, units_isValid as isValid, units_isValidCidr as isValidCidr, units_isValidIp as isValidIp, units_isValidIpv4 as isValidIpv4, units_octalToPermissions as octalToPermissions, units_parseFileSize as parseFileSize, units_parseInput as parseInput, units_parseNumberString as parseNumberString, units_parseSemver as parseSemver, units_permissionsToChmod as permissionsToChmod, units_permissionsToOctal as permissionsToOctal, units_permissionsToSymbolic as permissionsToSymbolic, units_ptToPx as ptToPx, units_pxToAll as pxToAll, units_pxToViewport as pxToViewport, units_remToPx as remToPx, units_satisfiesRange as satisfiesRange, units_scaleByHeight as scaleByHeight, units_scaleByWidth as scaleByWidth, units_sortVersions as sortVersions, units_splitSubnet as splitSubnet, units_symbolicToPermissions as symbolicToPermissions, units_validateBarcode as validateBarcode, units_validateCardNumber as validateCardNumber, units_validateIban as validateIban, units_viewportToPx as viewportToPx };
|
|
464
|
+
export { type units_AmortizationRow as AmortizationRow, type units_AspectRatioResult as AspectRatioResult, units_BASE_LABELS as BASE_LABELS, units_BASE_PREFIXES as BASE_PREFIXES, units_BYTE_UNITS as BYTE_UNITS, type units_BarcodeFormat as BarcodeFormat, type units_BarcodeValidationResult as BarcodeValidationResult, type units_BaseConvertResult as BaseConvertResult, type units_ByteConvertResult as ByteConvertResult, type units_ByteUnit as ByteUnit, units_COMMON_CURRENCIES as COMMON_CURRENCIES, units_COMMON_LOCALES as COMMON_LOCALES, units_COMMON_PERMISSIONS as COMMON_PERMISSIONS, units_COMMON_RATIOS as COMMON_RATIOS, units_COMMON_SIZES as COMMON_SIZES, units_COMMON_TAX_RATES as COMMON_TAX_RATES, units_COMMON_VIEWPORTS as COMMON_VIEWPORTS, type units_CardValidationResult as CardValidationResult, type units_CompoundInterestResult as CompoundInterestResult, type units_CompoundYearRow as CompoundYearRow, type units_Dimensions as Dimensions, type units_FilePermissions as FilePermissions, type units_FormatOptions as FormatOptions, type units_IbanValidationResult as IbanValidationResult, type units_IpConversion as IpConversion, type units_IsbnFormat as IsbnFormat, type units_IsbnResult as IsbnResult, type units_LoanResult as LoanResult, type units_NotationStyle as NotationStyle, type units_NumberBase as NumberBase, type units_Permission as Permission, type units_PxConvertResult as PxConvertResult, type units_SemverVersion as SemverVersion, type units_SubnetInfo as SubnetInfo, type units_TaxDirection as TaxDirection, type units_TaxResult as TaxResult, type units_ViewportConvertResult as ViewportConvertResult, units_autoFormat as autoFormat, units_bumpVersion as bumpVersion, units_calcAspectRatio as calcAspectRatio, units_calcSubnet as calcSubnet, units_calculateCompoundInterest as calculateCompoundInterest, units_calculateLoan as calculateLoan, units_calculateTax as calculateTax, units_compareSemver as compareSemver, units_convert as convert, units_convertBytes as convertBytes, units_convertIp as convertIp, units_coverBox as coverBox, units_decimalToIp as decimalToIp, units_decimalToIpCidr as decimalToIpCidr, units_describePermissions as describePermissions, units_fitIntoBox as fitIntoBox, units_formatNumber as formatNumber, units_formatValue as formatValue, units_formatVwValue as formatVwValue, units_formatWithSeparator as formatWithSeparator, units_gcd as gcd, units_ipFromBinary as ipFromBinary, units_ipFromDecimal as ipFromDecimal, units_ipFromHex as ipFromHex, units_ipToBinary as ipToBinary, units_ipToDecimal as ipToDecimal, units_ipToDecimalCidr as ipToDecimalCidr, units_ipToHex as ipToHex, units_ipToOctal as ipToOctal, units_isValid as isValid, units_isValidCidr as isValidCidr, units_isValidIp as isValidIp, units_isValidIpv4 as isValidIpv4, units_octalToPermissions as octalToPermissions, units_parseFileSize as parseFileSize, units_parseInput as parseInput, units_parseNumberString as parseNumberString, units_parseSemver as parseSemver, units_permissionsToChmod as permissionsToChmod, units_permissionsToOctal as permissionsToOctal, units_permissionsToSymbolic as permissionsToSymbolic, units_ptToPx as ptToPx, units_pxToAll as pxToAll, units_pxToViewport as pxToViewport, units_remToPx as remToPx, units_satisfiesRange as satisfiesRange, units_scaleByHeight as scaleByHeight, units_scaleByWidth as scaleByWidth, units_sortVersions as sortVersions, units_splitSubnet as splitSubnet, units_symbolicToPermissions as symbolicToPermissions, units_validateBarcode as validateBarcode, units_validateCardNumber as validateCardNumber, units_validateIban as validateIban, units_validateIsbn as validateIsbn, units_viewportToPx as viewportToPx };
|
|
411
465
|
}
|
|
412
466
|
|
|
413
|
-
export {
|
|
467
|
+
export { fitIntoBox as $, type AmortizationRow as A, BASE_LABELS as B, COMMON_CURRENCIES as C, type Dimensions as D, autoFormat as E, type FilePermissions as F, bumpVersion as G, calcAspectRatio as H, type IbanValidationResult as I, calcSubnet as J, calculateCompoundInterest as K, type LoanResult as L, calculateLoan as M, type NotationStyle as N, calculateTax as O, type Permission as P, compareSemver as Q, convert as R, type SemverVersion as S, type TaxDirection as T, convertBytes as U, type ViewportConvertResult as V, convertIp as W, coverBox as X, decimalToIp as Y, decimalToIpCidr as Z, describePermissions as _, type AspectRatioResult as a, formatNumber as a0, formatValue as a1, formatVwValue as a2, formatWithSeparator as a3, gcd as a4, ipFromBinary as a5, ipFromDecimal as a6, ipFromHex as a7, ipToBinary as a8, ipToDecimal as a9, validateCardNumber as aA, validateIban as aB, validateIsbn as aC, viewportToPx as aD, ipToDecimalCidr as aa, ipToHex as ab, ipToOctal as ac, isValid as ad, isValidCidr as ae, isValidIp as af, isValidIpv4 as ag, octalToPermissions as ah, parseFileSize as ai, parseInput as aj, parseNumberString as ak, parseSemver as al, permissionsToChmod as am, permissionsToOctal as an, permissionsToSymbolic as ao, ptToPx as ap, pxToAll as aq, pxToViewport as ar, remToPx as as, satisfiesRange as at, scaleByHeight as au, scaleByWidth as av, sortVersions as aw, splitSubnet as ax, symbolicToPermissions as ay, validateBarcode as az, BASE_PREFIXES as b, BYTE_UNITS as c, type BarcodeFormat as d, type BarcodeValidationResult as e, type BaseConvertResult as f, type ByteConvertResult as g, type ByteUnit as h, COMMON_LOCALES as i, COMMON_PERMISSIONS as j, COMMON_RATIOS as k, COMMON_SIZES as l, COMMON_TAX_RATES as m, COMMON_VIEWPORTS as n, type CardValidationResult as o, type CompoundInterestResult as p, type CompoundYearRow as q, type FormatOptions as r, type IpConversion as s, type IsbnFormat as t, units as u, type IsbnResult as v, type NumberBase as w, type PxConvertResult as x, type SubnetInfo as y, type TaxResult as z };
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
* - credit-card-validator : validateCardNumber
|
|
16
16
|
* - iban-validator : validateIban
|
|
17
17
|
* - loan-calculator : calculateLoan
|
|
18
|
+
* - barcode-validator : validateBarcode
|
|
19
|
+
* - vat-calculator : calculateTax
|
|
20
|
+
* - compound-interest-calculator : calculateCompoundInterest
|
|
21
|
+
* - isbn-validator : validateIsbn
|
|
18
22
|
*/
|
|
19
23
|
interface PxConvertResult {
|
|
20
24
|
px: number;
|
|
@@ -318,6 +322,50 @@ declare const COMMON_TAX_RATES: Array<{
|
|
|
318
322
|
declare function calculateTax(amount: number, ratePercent: number, direction: TaxDirection): TaxResult | {
|
|
319
323
|
error: string;
|
|
320
324
|
};
|
|
325
|
+
interface CompoundYearRow {
|
|
326
|
+
year: number;
|
|
327
|
+
balance: number;
|
|
328
|
+
contributions: number;
|
|
329
|
+
interest: number;
|
|
330
|
+
}
|
|
331
|
+
interface CompoundInterestResult {
|
|
332
|
+
futureValue: number;
|
|
333
|
+
totalPrincipal: number;
|
|
334
|
+
totalContributions: number;
|
|
335
|
+
totalInterest: number;
|
|
336
|
+
years: number;
|
|
337
|
+
compoundsPerYear: number;
|
|
338
|
+
schedule: CompoundYearRow[];
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Compute the future value of a principal (plus an optional recurring
|
|
342
|
+
* contribution made at the end of each compounding period) under compound
|
|
343
|
+
* interest, given an annual interest rate (as a percent, e.g. 5), a term in
|
|
344
|
+
* years, and a compounding frequency (periods per year, e.g. 1 = annually,
|
|
345
|
+
* 12 = monthly, 365 = daily).
|
|
346
|
+
*/
|
|
347
|
+
declare function calculateCompoundInterest(principal: number, annualRatePercent: number, years: number, compoundsPerYear: number, contributionPerPeriod?: number): CompoundInterestResult | {
|
|
348
|
+
error: string;
|
|
349
|
+
};
|
|
350
|
+
type IsbnFormat = "ISBN-10" | "ISBN-13";
|
|
351
|
+
interface IsbnResult {
|
|
352
|
+
valid: boolean;
|
|
353
|
+
format: IsbnFormat;
|
|
354
|
+
digits: string;
|
|
355
|
+
checkDigit: string;
|
|
356
|
+
expectedCheckDigit: string;
|
|
357
|
+
converted: string | null;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Validate an ISBN-10 or ISBN-13 number via its checksum, inferred from the
|
|
361
|
+
* character count (10 or 13) once spaces and hyphens are stripped, and
|
|
362
|
+
* convert it to the other format where possible: ISBN-10 always converts to
|
|
363
|
+
* ISBN-13 by prefixing "978" and recomputing the check digit, but an
|
|
364
|
+
* ISBN-13 only converts back to ISBN-10 if it starts with the "978" prefix.
|
|
365
|
+
*/
|
|
366
|
+
declare function validateIsbn(input: string): IsbnResult | {
|
|
367
|
+
error: string;
|
|
368
|
+
};
|
|
321
369
|
|
|
322
370
|
type units_AmortizationRow = AmortizationRow;
|
|
323
371
|
type units_AspectRatioResult = AspectRatioResult;
|
|
@@ -337,11 +385,15 @@ declare const units_COMMON_SIZES: typeof COMMON_SIZES;
|
|
|
337
385
|
declare const units_COMMON_TAX_RATES: typeof COMMON_TAX_RATES;
|
|
338
386
|
declare const units_COMMON_VIEWPORTS: typeof COMMON_VIEWPORTS;
|
|
339
387
|
type units_CardValidationResult = CardValidationResult;
|
|
388
|
+
type units_CompoundInterestResult = CompoundInterestResult;
|
|
389
|
+
type units_CompoundYearRow = CompoundYearRow;
|
|
340
390
|
type units_Dimensions = Dimensions;
|
|
341
391
|
type units_FilePermissions = FilePermissions;
|
|
342
392
|
type units_FormatOptions = FormatOptions;
|
|
343
393
|
type units_IbanValidationResult = IbanValidationResult;
|
|
344
394
|
type units_IpConversion = IpConversion;
|
|
395
|
+
type units_IsbnFormat = IsbnFormat;
|
|
396
|
+
type units_IsbnResult = IsbnResult;
|
|
345
397
|
type units_LoanResult = LoanResult;
|
|
346
398
|
type units_NotationStyle = NotationStyle;
|
|
347
399
|
type units_NumberBase = NumberBase;
|
|
@@ -356,6 +408,7 @@ declare const units_autoFormat: typeof autoFormat;
|
|
|
356
408
|
declare const units_bumpVersion: typeof bumpVersion;
|
|
357
409
|
declare const units_calcAspectRatio: typeof calcAspectRatio;
|
|
358
410
|
declare const units_calcSubnet: typeof calcSubnet;
|
|
411
|
+
declare const units_calculateCompoundInterest: typeof calculateCompoundInterest;
|
|
359
412
|
declare const units_calculateLoan: typeof calculateLoan;
|
|
360
413
|
declare const units_calculateTax: typeof calculateTax;
|
|
361
414
|
declare const units_compareSemver: typeof compareSemver;
|
|
@@ -405,9 +458,10 @@ declare const units_symbolicToPermissions: typeof symbolicToPermissions;
|
|
|
405
458
|
declare const units_validateBarcode: typeof validateBarcode;
|
|
406
459
|
declare const units_validateCardNumber: typeof validateCardNumber;
|
|
407
460
|
declare const units_validateIban: typeof validateIban;
|
|
461
|
+
declare const units_validateIsbn: typeof validateIsbn;
|
|
408
462
|
declare const units_viewportToPx: typeof viewportToPx;
|
|
409
463
|
declare namespace units {
|
|
410
|
-
export { type units_AmortizationRow as AmortizationRow, type units_AspectRatioResult as AspectRatioResult, units_BASE_LABELS as BASE_LABELS, units_BASE_PREFIXES as BASE_PREFIXES, units_BYTE_UNITS as BYTE_UNITS, type units_BarcodeFormat as BarcodeFormat, type units_BarcodeValidationResult as BarcodeValidationResult, type units_BaseConvertResult as BaseConvertResult, type units_ByteConvertResult as ByteConvertResult, type units_ByteUnit as ByteUnit, units_COMMON_CURRENCIES as COMMON_CURRENCIES, units_COMMON_LOCALES as COMMON_LOCALES, units_COMMON_PERMISSIONS as COMMON_PERMISSIONS, units_COMMON_RATIOS as COMMON_RATIOS, units_COMMON_SIZES as COMMON_SIZES, units_COMMON_TAX_RATES as COMMON_TAX_RATES, units_COMMON_VIEWPORTS as COMMON_VIEWPORTS, type units_CardValidationResult as CardValidationResult, type units_Dimensions as Dimensions, type units_FilePermissions as FilePermissions, type units_FormatOptions as FormatOptions, type units_IbanValidationResult as IbanValidationResult, type units_IpConversion as IpConversion, type units_LoanResult as LoanResult, type units_NotationStyle as NotationStyle, type units_NumberBase as NumberBase, type units_Permission as Permission, type units_PxConvertResult as PxConvertResult, type units_SemverVersion as SemverVersion, type units_SubnetInfo as SubnetInfo, type units_TaxDirection as TaxDirection, type units_TaxResult as TaxResult, type units_ViewportConvertResult as ViewportConvertResult, units_autoFormat as autoFormat, units_bumpVersion as bumpVersion, units_calcAspectRatio as calcAspectRatio, units_calcSubnet as calcSubnet, units_calculateLoan as calculateLoan, units_calculateTax as calculateTax, units_compareSemver as compareSemver, units_convert as convert, units_convertBytes as convertBytes, units_convertIp as convertIp, units_coverBox as coverBox, units_decimalToIp as decimalToIp, units_decimalToIpCidr as decimalToIpCidr, units_describePermissions as describePermissions, units_fitIntoBox as fitIntoBox, units_formatNumber as formatNumber, units_formatValue as formatValue, units_formatVwValue as formatVwValue, units_formatWithSeparator as formatWithSeparator, units_gcd as gcd, units_ipFromBinary as ipFromBinary, units_ipFromDecimal as ipFromDecimal, units_ipFromHex as ipFromHex, units_ipToBinary as ipToBinary, units_ipToDecimal as ipToDecimal, units_ipToDecimalCidr as ipToDecimalCidr, units_ipToHex as ipToHex, units_ipToOctal as ipToOctal, units_isValid as isValid, units_isValidCidr as isValidCidr, units_isValidIp as isValidIp, units_isValidIpv4 as isValidIpv4, units_octalToPermissions as octalToPermissions, units_parseFileSize as parseFileSize, units_parseInput as parseInput, units_parseNumberString as parseNumberString, units_parseSemver as parseSemver, units_permissionsToChmod as permissionsToChmod, units_permissionsToOctal as permissionsToOctal, units_permissionsToSymbolic as permissionsToSymbolic, units_ptToPx as ptToPx, units_pxToAll as pxToAll, units_pxToViewport as pxToViewport, units_remToPx as remToPx, units_satisfiesRange as satisfiesRange, units_scaleByHeight as scaleByHeight, units_scaleByWidth as scaleByWidth, units_sortVersions as sortVersions, units_splitSubnet as splitSubnet, units_symbolicToPermissions as symbolicToPermissions, units_validateBarcode as validateBarcode, units_validateCardNumber as validateCardNumber, units_validateIban as validateIban, units_viewportToPx as viewportToPx };
|
|
464
|
+
export { type units_AmortizationRow as AmortizationRow, type units_AspectRatioResult as AspectRatioResult, units_BASE_LABELS as BASE_LABELS, units_BASE_PREFIXES as BASE_PREFIXES, units_BYTE_UNITS as BYTE_UNITS, type units_BarcodeFormat as BarcodeFormat, type units_BarcodeValidationResult as BarcodeValidationResult, type units_BaseConvertResult as BaseConvertResult, type units_ByteConvertResult as ByteConvertResult, type units_ByteUnit as ByteUnit, units_COMMON_CURRENCIES as COMMON_CURRENCIES, units_COMMON_LOCALES as COMMON_LOCALES, units_COMMON_PERMISSIONS as COMMON_PERMISSIONS, units_COMMON_RATIOS as COMMON_RATIOS, units_COMMON_SIZES as COMMON_SIZES, units_COMMON_TAX_RATES as COMMON_TAX_RATES, units_COMMON_VIEWPORTS as COMMON_VIEWPORTS, type units_CardValidationResult as CardValidationResult, type units_CompoundInterestResult as CompoundInterestResult, type units_CompoundYearRow as CompoundYearRow, type units_Dimensions as Dimensions, type units_FilePermissions as FilePermissions, type units_FormatOptions as FormatOptions, type units_IbanValidationResult as IbanValidationResult, type units_IpConversion as IpConversion, type units_IsbnFormat as IsbnFormat, type units_IsbnResult as IsbnResult, type units_LoanResult as LoanResult, type units_NotationStyle as NotationStyle, type units_NumberBase as NumberBase, type units_Permission as Permission, type units_PxConvertResult as PxConvertResult, type units_SemverVersion as SemverVersion, type units_SubnetInfo as SubnetInfo, type units_TaxDirection as TaxDirection, type units_TaxResult as TaxResult, type units_ViewportConvertResult as ViewportConvertResult, units_autoFormat as autoFormat, units_bumpVersion as bumpVersion, units_calcAspectRatio as calcAspectRatio, units_calcSubnet as calcSubnet, units_calculateCompoundInterest as calculateCompoundInterest, units_calculateLoan as calculateLoan, units_calculateTax as calculateTax, units_compareSemver as compareSemver, units_convert as convert, units_convertBytes as convertBytes, units_convertIp as convertIp, units_coverBox as coverBox, units_decimalToIp as decimalToIp, units_decimalToIpCidr as decimalToIpCidr, units_describePermissions as describePermissions, units_fitIntoBox as fitIntoBox, units_formatNumber as formatNumber, units_formatValue as formatValue, units_formatVwValue as formatVwValue, units_formatWithSeparator as formatWithSeparator, units_gcd as gcd, units_ipFromBinary as ipFromBinary, units_ipFromDecimal as ipFromDecimal, units_ipFromHex as ipFromHex, units_ipToBinary as ipToBinary, units_ipToDecimal as ipToDecimal, units_ipToDecimalCidr as ipToDecimalCidr, units_ipToHex as ipToHex, units_ipToOctal as ipToOctal, units_isValid as isValid, units_isValidCidr as isValidCidr, units_isValidIp as isValidIp, units_isValidIpv4 as isValidIpv4, units_octalToPermissions as octalToPermissions, units_parseFileSize as parseFileSize, units_parseInput as parseInput, units_parseNumberString as parseNumberString, units_parseSemver as parseSemver, units_permissionsToChmod as permissionsToChmod, units_permissionsToOctal as permissionsToOctal, units_permissionsToSymbolic as permissionsToSymbolic, units_ptToPx as ptToPx, units_pxToAll as pxToAll, units_pxToViewport as pxToViewport, units_remToPx as remToPx, units_satisfiesRange as satisfiesRange, units_scaleByHeight as scaleByHeight, units_scaleByWidth as scaleByWidth, units_sortVersions as sortVersions, units_splitSubnet as splitSubnet, units_symbolicToPermissions as symbolicToPermissions, units_validateBarcode as validateBarcode, units_validateCardNumber as validateCardNumber, units_validateIban as validateIban, units_validateIsbn as validateIsbn, units_viewportToPx as viewportToPx };
|
|
411
465
|
}
|
|
412
466
|
|
|
413
|
-
export {
|
|
467
|
+
export { fitIntoBox as $, type AmortizationRow as A, BASE_LABELS as B, COMMON_CURRENCIES as C, type Dimensions as D, autoFormat as E, type FilePermissions as F, bumpVersion as G, calcAspectRatio as H, type IbanValidationResult as I, calcSubnet as J, calculateCompoundInterest as K, type LoanResult as L, calculateLoan as M, type NotationStyle as N, calculateTax as O, type Permission as P, compareSemver as Q, convert as R, type SemverVersion as S, type TaxDirection as T, convertBytes as U, type ViewportConvertResult as V, convertIp as W, coverBox as X, decimalToIp as Y, decimalToIpCidr as Z, describePermissions as _, type AspectRatioResult as a, formatNumber as a0, formatValue as a1, formatVwValue as a2, formatWithSeparator as a3, gcd as a4, ipFromBinary as a5, ipFromDecimal as a6, ipFromHex as a7, ipToBinary as a8, ipToDecimal as a9, validateCardNumber as aA, validateIban as aB, validateIsbn as aC, viewportToPx as aD, ipToDecimalCidr as aa, ipToHex as ab, ipToOctal as ac, isValid as ad, isValidCidr as ae, isValidIp as af, isValidIpv4 as ag, octalToPermissions as ah, parseFileSize as ai, parseInput as aj, parseNumberString as ak, parseSemver as al, permissionsToChmod as am, permissionsToOctal as an, permissionsToSymbolic as ao, ptToPx as ap, pxToAll as aq, pxToViewport as ar, remToPx as as, satisfiesRange as at, scaleByHeight as au, scaleByWidth as av, sortVersions as aw, splitSubnet as ax, symbolicToPermissions as ay, validateBarcode as az, BASE_PREFIXES as b, BYTE_UNITS as c, type BarcodeFormat as d, type BarcodeValidationResult as e, type BaseConvertResult as f, type ByteConvertResult as g, type ByteUnit as h, COMMON_LOCALES as i, COMMON_PERMISSIONS as j, COMMON_RATIOS as k, COMMON_SIZES as l, COMMON_TAX_RATES as m, COMMON_VIEWPORTS as n, type CardValidationResult as o, type CompoundInterestResult as p, type CompoundYearRow as q, type FormatOptions as r, type IpConversion as s, type IsbnFormat as t, units as u, type IsbnResult as v, type NumberBase as w, type PxConvertResult as x, type SubnetInfo as y, type TaxResult as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utilix-tech/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.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",
|