@utilix-tech/sdk 0.26.0 → 0.27.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 +18 -7
- package/dist/{chunk-HP6C4VBX.js → chunk-I63BCOAG.js} +35 -1
- package/dist/{chunk-XMKJYVKB.js → chunk-Q3M23WNJ.js} +97 -1
- package/dist/index.cjs +130 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/{media-9HEpTPGA.d.cts → media-CN17a3MM.d.cts} +34 -2
- package/dist/{media-9HEpTPGA.d.ts → media-CN17a3MM.d.ts} +34 -2
- package/dist/tools/media.cjs +96 -0
- package/dist/tools/media.d.cts +1 -1
- package/dist/tools/media.d.ts +1 -1
- package/dist/tools/media.js +1 -1
- package/dist/tools/units.cjs +34 -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-D2wEimKG.d.cts → units-COt5uI20.d.cts} +27 -2
- package/dist/{units-D2wEimKG.d.ts → units-COt5uI20.d.ts} +27 -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.27.0
|
|
6
|
+
- Add `calculateRuleOf72` (rule-of-72-calculator): estimate years to double an investment from a rate, or the rate needed to double in a given number of years, alongside the exact logarithmic result.
|
|
7
|
+
- Add `readFlacInfo` (flac-metadata-reader): sample rate, channels, bit depth, total samples, and duration from a FLAC file's STREAMINFO block, plus Vorbis comment tags when present.
|
|
8
|
+
|
|
5
9
|
## 0.26.0
|
|
6
10
|
- Add `computeJwkThumbprint` (jwk-thumbprint): RFC 7638 canonical thumbprint of a single JWK, hashed with SHA-256/384/512.
|
|
7
11
|
- Add `calculateVideoBitrate` (video-bitrate-calculator): resulting file size from a video/audio bitrate and duration, or the required bitrate to hit a target file size.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @utilix-tech/sdk
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**578 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)
|
|
@@ -272,7 +272,7 @@ formatIso8601Duration(90061); // { iso: "P1DT1H1M1S", ... }
|
|
|
272
272
|
### `/units`: Conversions
|
|
273
273
|
|
|
274
274
|
```ts
|
|
275
|
-
import { convertBytes, pxToAll, convert, formatValue, validateCardNumber, validateIban, calculateLoan, validateBarcode, calculateTax, calculateCompoundInterest, validateIsbn, calculateTipSplit, calculateSimpleInterest, calculateTimeValue, calculatePercentageChange, convertAprApy, calculateMarginMarkup, calculateDiscount, applySuccessiveDiscounts, calculateBreakEven, calculateVideoBitrate } from "@utilix-tech/sdk/units";
|
|
275
|
+
import { convertBytes, pxToAll, convert, formatValue, validateCardNumber, validateIban, calculateLoan, validateBarcode, calculateTax, calculateCompoundInterest, validateIsbn, calculateTipSplit, calculateSimpleInterest, calculateTimeValue, calculatePercentageChange, convertAprApy, calculateMarginMarkup, calculateDiscount, applySuccessiveDiscounts, calculateBreakEven, calculateVideoBitrate, calculateRuleOf72 } from "@utilix-tech/sdk/units";
|
|
276
276
|
|
|
277
277
|
// File sizes
|
|
278
278
|
convertBytes(1073741824, "GB"); // 1
|
|
@@ -358,6 +358,10 @@ calculateBreakEven({ fixedCosts: 10000, variableCostPerUnit: 20, pricePerUnit: 5
|
|
|
358
358
|
// Video file size from a bitrate + duration, or the bitrate to hit a target size
|
|
359
359
|
calculateVideoBitrate({ mode: "size-from-bitrate", durationSeconds: 600, videoBitrateKbps: 5000, audioBitrateKbps: 192 });
|
|
360
360
|
// { totalBitrateKbps: 5192, fileSizeBytes: 389400000, fileSizeMB: 389.4, fileSizeMiB: 371.36, ... }
|
|
361
|
+
|
|
362
|
+
// Rule of 72: years to double from a rate, or the rate needed to double in N years
|
|
363
|
+
calculateRuleOf72(8, "rate-to-years");
|
|
364
|
+
// { ruleOf72Estimate: 9, exactValue: 9.0065, errorPercent: -0.0718, ... }
|
|
361
365
|
```
|
|
362
366
|
|
|
363
367
|
---
|
|
@@ -557,10 +561,10 @@ analyzeString("café"); // { length: 4, codePoints: [...], ... }
|
|
|
557
561
|
|
|
558
562
|
---
|
|
559
563
|
|
|
560
|
-
### `/media`: Image Header Parsing, EXIF, PDF, WAV, ID3 &
|
|
564
|
+
### `/media`: Image Header Parsing, EXIF, PDF, WAV, ID3, ICO & FLAC Metadata
|
|
561
565
|
|
|
562
566
|
```ts
|
|
563
|
-
import { readImageInfo, readExifData, readPdfMetadata, readWavInfo, readId3Tags, readIcoInfo } from "@utilix-tech/sdk/media";
|
|
567
|
+
import { readImageInfo, readExifData, readPdfMetadata, readWavInfo, readId3Tags, readIcoInfo, readFlacInfo } from "@utilix-tech/sdk/media";
|
|
564
568
|
|
|
565
569
|
// Reads format, dimensions, bit depth, and alpha channel straight from
|
|
566
570
|
// file bytes: no decoding, no canvas, no image library.
|
|
@@ -598,9 +602,16 @@ readId3Tags(new Uint8Array(mp3Bytes));
|
|
|
598
602
|
const icoBytes = await fs.promises.readFile("favicon.ico");
|
|
599
603
|
readIcoInfo(new Uint8Array(icoBytes));
|
|
600
604
|
// { imageCount: 3, images: [{ width: 16, height: 16, bitCount: 32, bytesInRes: 1128, ... }, ...] }
|
|
605
|
+
|
|
606
|
+
// Reads sample rate, channels, bit depth, total samples, and duration from a
|
|
607
|
+
// FLAC file's STREAMINFO block, plus Vorbis comment tags (artist, title,
|
|
608
|
+
// album, ...) from its VORBIS_COMMENT block if present.
|
|
609
|
+
const flacBytes = await fs.promises.readFile("track.flac");
|
|
610
|
+
readFlacInfo(new Uint8Array(flacBytes));
|
|
611
|
+
// { sampleRate: 44100, channels: 2, bitsPerSample: 16, durationSeconds: 214.7, artist: "Artist Name", ... }
|
|
601
612
|
```
|
|
602
613
|
|
|
603
|
-
`readImageInfo` supports PNG, JPEG, GIF, WebP, and BMP. `readExifData` supports JPEG only. `readWavInfo` supports the canonical RIFF/WAVE container only. `readId3Tags` decodes ID3v2.3/2.4 and ID3v1/1.1 only (ID3v2.2 is detected but not decoded). `readIcoInfo` reads .ico icon files only and rejects .cur cursor files.
|
|
614
|
+
`readImageInfo` supports PNG, JPEG, GIF, WebP, and BMP. `readExifData` supports JPEG only. `readWavInfo` supports the canonical RIFF/WAVE container only. `readId3Tags` decodes ID3v2.3/2.4 and ID3v1/1.1 only (ID3v2.2 is detected but not decoded). `readIcoInfo` reads .ico icon files only and rejects .cur cursor files. `readFlacInfo` reads the native FLAC container only, not FLAC-in-Ogg.
|
|
604
615
|
|
|
605
616
|
---
|
|
606
617
|
|
|
@@ -615,7 +626,7 @@ readIcoInfo(new Uint8Array(icoBytes));
|
|
|
615
626
|
| `@utilix-tech/sdk/data` | CSV, YAML, TOML, XML, INI, NDJSON parse and convert, SRT/WebVTT subtitles |
|
|
616
627
|
| `@utilix-tech/sdk/generators` | UUID v4/v7, ULID, passwords, strength check, fake data |
|
|
617
628
|
| `@utilix-tech/sdk/time` | Date diff, timezone convert, cron parse, relative time |
|
|
618
|
-
| `@utilix-tech/sdk/units` | Bytes, CSS px/rem, number bases, currency format, credit card/IBAN/barcode/ISBN validation, loan calculator, compound/simple interest calculators, VAT/sales tax calculator, tip/bill split calculator, break-even point calculator |
|
|
629
|
+
| `@utilix-tech/sdk/units` | Bytes, CSS px/rem, number bases, currency format, credit card/IBAN/barcode/ISBN validation, loan calculator, compound/simple interest calculators, VAT/sales tax calculator, tip/bill split calculator, break-even point calculator, Rule of 72 calculator |
|
|
619
630
|
| `@utilix-tech/sdk/network` | HTTP status codes, IP validation, country flags, geolocation URLs, HAR file parsing, User-Agent parsing |
|
|
620
631
|
| `@utilix-tech/sdk/api` | cURL build/parse, JWT decode/sign, JWKS parse, CORS headers, CSP header |
|
|
621
632
|
| `@utilix-tech/sdk/code` | SQL format/minify, HTML format/minify, regex tester, GraphQL format, MIME type lookup, GitHub URL parsing |
|
|
@@ -623,7 +634,7 @@ readIcoInfo(new Uint8Array(icoBytes));
|
|
|
623
634
|
| `@utilix-tech/sdk/css` | CSS gradient, box-shadow, border-radius, keyframe animation generators |
|
|
624
635
|
| `@utilix-tech/sdk/misc` | SVG optimize/sanitize, file size format, Unicode inspector |
|
|
625
636
|
| `@utilix-tech/sdk/ai_agent` | Token estimate/trim, chunk text, extract URLs/JSON/keywords, sanitize HTML, flatten/merge JSON, dedupe lines, validate schema, PII/secret/injection detect, vector similarity |
|
|
626
|
-
| `@utilix-tech/sdk/media` | Image format & dimension reading from raw bytes (PNG, JPEG, GIF, WebP, BMP); PDF metadata reading; WAV audio info; ID3 tags; ICO favicon inspection |
|
|
637
|
+
| `@utilix-tech/sdk/media` | Image format & dimension reading from raw bytes (PNG, JPEG, GIF, WebP, BMP); PDF metadata reading; WAV audio info; ID3 tags; ICO favicon inspection; FLAC metadata reading |
|
|
627
638
|
|
|
628
639
|
---
|
|
629
640
|
|
|
@@ -25,6 +25,7 @@ __export(units_exports, {
|
|
|
25
25
|
calculateLoan: () => calculateLoan,
|
|
26
26
|
calculateMarginMarkup: () => calculateMarginMarkup,
|
|
27
27
|
calculatePercentageChange: () => calculatePercentageChange,
|
|
28
|
+
calculateRuleOf72: () => calculateRuleOf72,
|
|
28
29
|
calculateSimpleInterest: () => calculateSimpleInterest,
|
|
29
30
|
calculateTax: () => calculateTax,
|
|
30
31
|
calculateTimeValue: () => calculateTimeValue,
|
|
@@ -1642,5 +1643,38 @@ function calculateVideoBitrate(input) {
|
|
|
1642
1643
|
}
|
|
1643
1644
|
return { error: 'mode must be "size-from-bitrate" or "bitrate-from-size"' };
|
|
1644
1645
|
}
|
|
1646
|
+
function calculateRuleOf72(value, direction) {
|
|
1647
|
+
if (!Number.isFinite(value) || value <= 0) return { error: "Value must be a positive number" };
|
|
1648
|
+
if (direction !== "rate-to-years" && direction !== "years-to-rate") {
|
|
1649
|
+
return { error: 'Direction must be "rate-to-years" or "years-to-rate"' };
|
|
1650
|
+
}
|
|
1651
|
+
const round4 = (n) => Math.round(n * 1e4) / 1e4;
|
|
1652
|
+
if (direction === "rate-to-years") {
|
|
1653
|
+
const ratePercent = value;
|
|
1654
|
+
const ruleOf72Estimate2 = 72 / ratePercent;
|
|
1655
|
+
const exactValue2 = Math.log(2) / Math.log(1 + ratePercent / 100);
|
|
1656
|
+
const errorPercent2 = (ruleOf72Estimate2 - exactValue2) / exactValue2 * 100;
|
|
1657
|
+
return {
|
|
1658
|
+
direction,
|
|
1659
|
+
ratePercent: round4(ratePercent),
|
|
1660
|
+
years: round4(exactValue2),
|
|
1661
|
+
ruleOf72Estimate: round4(ruleOf72Estimate2),
|
|
1662
|
+
exactValue: round4(exactValue2),
|
|
1663
|
+
errorPercent: round4(errorPercent2)
|
|
1664
|
+
};
|
|
1665
|
+
}
|
|
1666
|
+
const years = value;
|
|
1667
|
+
const ruleOf72Estimate = 72 / years;
|
|
1668
|
+
const exactValue = (Math.pow(2, 1 / years) - 1) * 100;
|
|
1669
|
+
const errorPercent = (ruleOf72Estimate - exactValue) / exactValue * 100;
|
|
1670
|
+
return {
|
|
1671
|
+
direction,
|
|
1672
|
+
ratePercent: round4(exactValue),
|
|
1673
|
+
years: round4(years),
|
|
1674
|
+
ruleOf72Estimate: round4(ruleOf72Estimate),
|
|
1675
|
+
exactValue: round4(exactValue),
|
|
1676
|
+
errorPercent: round4(errorPercent)
|
|
1677
|
+
};
|
|
1678
|
+
}
|
|
1645
1679
|
|
|
1646
|
-
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, applySuccessiveDiscounts, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, calculateBreakEven, calculateCompoundInterest, calculateDiscount, calculateLoan, calculateMarginMarkup, calculatePercentageChange, calculateSimpleInterest, calculateTax, calculateTimeValue, calculateTipSplit, calculateVideoBitrate, compareSemver, convert, convertAprApy, convertBytes, convertIp, coverBox, decimalToIp, decimalToIpCidr, describePermissions, fitIntoBox, formatNumber, formatValue, formatVwValue, formatWithSeparator, gcd, ipFromBinary, ipFromDecimal, ipFromHex, ipToBinary, ipToDecimal, ipToDecimalCidr, ipToHex, ipToOctal, isValid, isValidCidr, isValidIp, isValidIpv4, marginToMarkup, markupToMargin, 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 };
|
|
1680
|
+
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, applySuccessiveDiscounts, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, calculateBreakEven, calculateCompoundInterest, calculateDiscount, calculateLoan, calculateMarginMarkup, calculatePercentageChange, calculateRuleOf72, calculateSimpleInterest, calculateTax, calculateTimeValue, calculateTipSplit, calculateVideoBitrate, compareSemver, convert, convertAprApy, convertBytes, convertIp, coverBox, decimalToIp, decimalToIpCidr, describePermissions, fitIntoBox, formatNumber, formatValue, formatVwValue, formatWithSeparator, gcd, ipFromBinary, ipFromDecimal, ipFromHex, ipToBinary, ipToDecimal, ipToDecimalCidr, ipToHex, ipToOctal, isValid, isValidCidr, isValidIp, isValidIpv4, marginToMarkup, markupToMargin, 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 };
|
|
@@ -4,6 +4,7 @@ import { __export } from './chunk-MLKGABMK.js';
|
|
|
4
4
|
var media_exports = {};
|
|
5
5
|
__export(media_exports, {
|
|
6
6
|
readExifData: () => readExifData,
|
|
7
|
+
readFlacInfo: () => readFlacInfo,
|
|
7
8
|
readIcoInfo: () => readIcoInfo,
|
|
8
9
|
readId3Tags: () => readId3Tags,
|
|
9
10
|
readImageInfo: () => readImageInfo,
|
|
@@ -764,5 +765,100 @@ function readIcoInfo(bytes) {
|
|
|
764
765
|
}
|
|
765
766
|
return { imageCount: count, images };
|
|
766
767
|
}
|
|
768
|
+
var FLAC_TAG_FIELDS = {
|
|
769
|
+
TITLE: "title",
|
|
770
|
+
ARTIST: "artist",
|
|
771
|
+
ALBUM: "album",
|
|
772
|
+
DATE: "date",
|
|
773
|
+
GENRE: "genre",
|
|
774
|
+
TRACKNUMBER: "trackNumber"
|
|
775
|
+
};
|
|
776
|
+
function readU24BE(bytes, offset) {
|
|
777
|
+
return bytes[offset] << 16 | bytes[offset + 1] << 8 | bytes[offset + 2];
|
|
778
|
+
}
|
|
779
|
+
function readVorbisComment(bytes, start, end) {
|
|
780
|
+
let offset = start;
|
|
781
|
+
if (offset + 4 > end) return null;
|
|
782
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
783
|
+
const vendorLength = view.getUint32(offset, true);
|
|
784
|
+
offset += 4;
|
|
785
|
+
if (offset + vendorLength > end) return null;
|
|
786
|
+
const vendor = Buffer.from(bytes.subarray(offset, offset + vendorLength)).toString("utf8");
|
|
787
|
+
offset += vendorLength;
|
|
788
|
+
if (offset + 4 > end) return null;
|
|
789
|
+
const commentCount = view.getUint32(offset, true);
|
|
790
|
+
offset += 4;
|
|
791
|
+
const tags = {};
|
|
792
|
+
for (let i = 0; i < commentCount; i++) {
|
|
793
|
+
if (offset + 4 > end) break;
|
|
794
|
+
const commentLength = view.getUint32(offset, true);
|
|
795
|
+
offset += 4;
|
|
796
|
+
if (offset + commentLength > end) break;
|
|
797
|
+
const comment = Buffer.from(bytes.subarray(offset, offset + commentLength)).toString("utf8");
|
|
798
|
+
offset += commentLength;
|
|
799
|
+
const eq = comment.indexOf("=");
|
|
800
|
+
if (eq > 0) {
|
|
801
|
+
const key = comment.slice(0, eq).toUpperCase();
|
|
802
|
+
const value = comment.slice(eq + 1);
|
|
803
|
+
tags[key] = value;
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
return { vendor, tags };
|
|
807
|
+
}
|
|
808
|
+
function readFlacInfo(bytes) {
|
|
809
|
+
if (bytes.length < 4) return { error: "File is too small to be a valid FLAC file" };
|
|
810
|
+
if (readAscii4(bytes, 0) !== "fLaC") return { error: 'Not a FLAC file (missing "fLaC" marker)' };
|
|
811
|
+
let offset = 4;
|
|
812
|
+
let streamInfo = null;
|
|
813
|
+
let vorbisComment = null;
|
|
814
|
+
while (offset + 4 <= bytes.length) {
|
|
815
|
+
const header = bytes[offset];
|
|
816
|
+
const isLast = (header & 128) !== 0;
|
|
817
|
+
const blockType = header & 127;
|
|
818
|
+
const length = readU24BE(bytes, offset + 1);
|
|
819
|
+
const dataStart = offset + 4;
|
|
820
|
+
const dataEnd = dataStart + length;
|
|
821
|
+
if (dataEnd > bytes.length) return { error: "Truncated metadata block" };
|
|
822
|
+
if (blockType === 0) {
|
|
823
|
+
if (length < 34) return { error: "Truncated STREAMINFO block" };
|
|
824
|
+
const minBlockSize = bytes[dataStart] << 8 | bytes[dataStart + 1];
|
|
825
|
+
const maxBlockSize = bytes[dataStart + 2] << 8 | bytes[dataStart + 3];
|
|
826
|
+
const minFrameSize = readU24BE(bytes, dataStart + 4);
|
|
827
|
+
const maxFrameSize = readU24BE(bytes, dataStart + 7);
|
|
828
|
+
let packed = 0n;
|
|
829
|
+
for (let i = 0; i < 8; i++) packed = packed << 8n | BigInt(bytes[dataStart + 10 + i]);
|
|
830
|
+
const sampleRate = Number(packed >> 44n & 0xfffffn);
|
|
831
|
+
const channels = Number(packed >> 41n & 0x7n) + 1;
|
|
832
|
+
const bitsPerSample = Number(packed >> 36n & 0x1fn) + 1;
|
|
833
|
+
const totalSamples = Number(packed & 0xfffffffffn);
|
|
834
|
+
if (sampleRate <= 0) return { error: "Invalid sample rate in STREAMINFO block" };
|
|
835
|
+
streamInfo = {
|
|
836
|
+
sampleRate,
|
|
837
|
+
channels,
|
|
838
|
+
bitsPerSample,
|
|
839
|
+
totalSamples,
|
|
840
|
+
durationSeconds: Math.round(totalSamples / sampleRate * 1e3) / 1e3,
|
|
841
|
+
minBlockSize,
|
|
842
|
+
maxBlockSize,
|
|
843
|
+
minFrameSize,
|
|
844
|
+
maxFrameSize
|
|
845
|
+
};
|
|
846
|
+
} else if (blockType === 4) {
|
|
847
|
+
vorbisComment = readVorbisComment(bytes, dataStart, dataEnd);
|
|
848
|
+
}
|
|
849
|
+
offset = dataEnd;
|
|
850
|
+
if (isLast) break;
|
|
851
|
+
}
|
|
852
|
+
if (!streamInfo) return { error: "No STREAMINFO block found in this FLAC file" };
|
|
853
|
+
const result = { ...streamInfo };
|
|
854
|
+
if (vorbisComment) {
|
|
855
|
+
result.vendor = vorbisComment.vendor;
|
|
856
|
+
result.tags = vorbisComment.tags;
|
|
857
|
+
for (const [key, field] of Object.entries(FLAC_TAG_FIELDS)) {
|
|
858
|
+
if (vorbisComment.tags[key] !== void 0) result[field] = vorbisComment.tags[key];
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
return result;
|
|
862
|
+
}
|
|
767
863
|
|
|
768
|
-
export { media_exports, readExifData, readIcoInfo, readId3Tags, readImageInfo, readPdfMetadata, readWavInfo };
|
|
864
|
+
export { media_exports, readExifData, readFlacInfo, readIcoInfo, readId3Tags, readImageInfo, readPdfMetadata, readWavInfo };
|
package/dist/index.cjs
CHANGED
|
@@ -7154,6 +7154,7 @@ __export(units_exports, {
|
|
|
7154
7154
|
calculateLoan: () => calculateLoan,
|
|
7155
7155
|
calculateMarginMarkup: () => calculateMarginMarkup,
|
|
7156
7156
|
calculatePercentageChange: () => calculatePercentageChange,
|
|
7157
|
+
calculateRuleOf72: () => calculateRuleOf72,
|
|
7157
7158
|
calculateSimpleInterest: () => calculateSimpleInterest,
|
|
7158
7159
|
calculateTax: () => calculateTax,
|
|
7159
7160
|
calculateTimeValue: () => calculateTimeValue,
|
|
@@ -8771,6 +8772,39 @@ function calculateVideoBitrate(input) {
|
|
|
8771
8772
|
}
|
|
8772
8773
|
return { error: 'mode must be "size-from-bitrate" or "bitrate-from-size"' };
|
|
8773
8774
|
}
|
|
8775
|
+
function calculateRuleOf72(value, direction) {
|
|
8776
|
+
if (!Number.isFinite(value) || value <= 0) return { error: "Value must be a positive number" };
|
|
8777
|
+
if (direction !== "rate-to-years" && direction !== "years-to-rate") {
|
|
8778
|
+
return { error: 'Direction must be "rate-to-years" or "years-to-rate"' };
|
|
8779
|
+
}
|
|
8780
|
+
const round4 = (n) => Math.round(n * 1e4) / 1e4;
|
|
8781
|
+
if (direction === "rate-to-years") {
|
|
8782
|
+
const ratePercent = value;
|
|
8783
|
+
const ruleOf72Estimate2 = 72 / ratePercent;
|
|
8784
|
+
const exactValue2 = Math.log(2) / Math.log(1 + ratePercent / 100);
|
|
8785
|
+
const errorPercent2 = (ruleOf72Estimate2 - exactValue2) / exactValue2 * 100;
|
|
8786
|
+
return {
|
|
8787
|
+
direction,
|
|
8788
|
+
ratePercent: round4(ratePercent),
|
|
8789
|
+
years: round4(exactValue2),
|
|
8790
|
+
ruleOf72Estimate: round4(ruleOf72Estimate2),
|
|
8791
|
+
exactValue: round4(exactValue2),
|
|
8792
|
+
errorPercent: round4(errorPercent2)
|
|
8793
|
+
};
|
|
8794
|
+
}
|
|
8795
|
+
const years = value;
|
|
8796
|
+
const ruleOf72Estimate = 72 / years;
|
|
8797
|
+
const exactValue = (Math.pow(2, 1 / years) - 1) * 100;
|
|
8798
|
+
const errorPercent = (ruleOf72Estimate - exactValue) / exactValue * 100;
|
|
8799
|
+
return {
|
|
8800
|
+
direction,
|
|
8801
|
+
ratePercent: round4(exactValue),
|
|
8802
|
+
years: round4(years),
|
|
8803
|
+
ruleOf72Estimate: round4(ruleOf72Estimate),
|
|
8804
|
+
exactValue: round4(exactValue),
|
|
8805
|
+
errorPercent: round4(errorPercent)
|
|
8806
|
+
};
|
|
8807
|
+
}
|
|
8774
8808
|
|
|
8775
8809
|
// src/tools/network.ts
|
|
8776
8810
|
var network_exports = {};
|
|
@@ -19198,6 +19232,7 @@ function vectorSimilarity(a, b) {
|
|
|
19198
19232
|
var media_exports = {};
|
|
19199
19233
|
__export(media_exports, {
|
|
19200
19234
|
readExifData: () => readExifData,
|
|
19235
|
+
readFlacInfo: () => readFlacInfo,
|
|
19201
19236
|
readIcoInfo: () => readIcoInfo,
|
|
19202
19237
|
readId3Tags: () => readId3Tags,
|
|
19203
19238
|
readImageInfo: () => readImageInfo,
|
|
@@ -19958,6 +19993,101 @@ function readIcoInfo(bytes) {
|
|
|
19958
19993
|
}
|
|
19959
19994
|
return { imageCount: count, images };
|
|
19960
19995
|
}
|
|
19996
|
+
var FLAC_TAG_FIELDS = {
|
|
19997
|
+
TITLE: "title",
|
|
19998
|
+
ARTIST: "artist",
|
|
19999
|
+
ALBUM: "album",
|
|
20000
|
+
DATE: "date",
|
|
20001
|
+
GENRE: "genre",
|
|
20002
|
+
TRACKNUMBER: "trackNumber"
|
|
20003
|
+
};
|
|
20004
|
+
function readU24BE(bytes, offset) {
|
|
20005
|
+
return bytes[offset] << 16 | bytes[offset + 1] << 8 | bytes[offset + 2];
|
|
20006
|
+
}
|
|
20007
|
+
function readVorbisComment(bytes, start, end) {
|
|
20008
|
+
let offset = start;
|
|
20009
|
+
if (offset + 4 > end) return null;
|
|
20010
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
20011
|
+
const vendorLength = view.getUint32(offset, true);
|
|
20012
|
+
offset += 4;
|
|
20013
|
+
if (offset + vendorLength > end) return null;
|
|
20014
|
+
const vendor = Buffer.from(bytes.subarray(offset, offset + vendorLength)).toString("utf8");
|
|
20015
|
+
offset += vendorLength;
|
|
20016
|
+
if (offset + 4 > end) return null;
|
|
20017
|
+
const commentCount = view.getUint32(offset, true);
|
|
20018
|
+
offset += 4;
|
|
20019
|
+
const tags = {};
|
|
20020
|
+
for (let i = 0; i < commentCount; i++) {
|
|
20021
|
+
if (offset + 4 > end) break;
|
|
20022
|
+
const commentLength = view.getUint32(offset, true);
|
|
20023
|
+
offset += 4;
|
|
20024
|
+
if (offset + commentLength > end) break;
|
|
20025
|
+
const comment = Buffer.from(bytes.subarray(offset, offset + commentLength)).toString("utf8");
|
|
20026
|
+
offset += commentLength;
|
|
20027
|
+
const eq = comment.indexOf("=");
|
|
20028
|
+
if (eq > 0) {
|
|
20029
|
+
const key = comment.slice(0, eq).toUpperCase();
|
|
20030
|
+
const value = comment.slice(eq + 1);
|
|
20031
|
+
tags[key] = value;
|
|
20032
|
+
}
|
|
20033
|
+
}
|
|
20034
|
+
return { vendor, tags };
|
|
20035
|
+
}
|
|
20036
|
+
function readFlacInfo(bytes) {
|
|
20037
|
+
if (bytes.length < 4) return { error: "File is too small to be a valid FLAC file" };
|
|
20038
|
+
if (readAscii4(bytes, 0) !== "fLaC") return { error: 'Not a FLAC file (missing "fLaC" marker)' };
|
|
20039
|
+
let offset = 4;
|
|
20040
|
+
let streamInfo = null;
|
|
20041
|
+
let vorbisComment = null;
|
|
20042
|
+
while (offset + 4 <= bytes.length) {
|
|
20043
|
+
const header = bytes[offset];
|
|
20044
|
+
const isLast = (header & 128) !== 0;
|
|
20045
|
+
const blockType = header & 127;
|
|
20046
|
+
const length = readU24BE(bytes, offset + 1);
|
|
20047
|
+
const dataStart = offset + 4;
|
|
20048
|
+
const dataEnd = dataStart + length;
|
|
20049
|
+
if (dataEnd > bytes.length) return { error: "Truncated metadata block" };
|
|
20050
|
+
if (blockType === 0) {
|
|
20051
|
+
if (length < 34) return { error: "Truncated STREAMINFO block" };
|
|
20052
|
+
const minBlockSize = bytes[dataStart] << 8 | bytes[dataStart + 1];
|
|
20053
|
+
const maxBlockSize = bytes[dataStart + 2] << 8 | bytes[dataStart + 3];
|
|
20054
|
+
const minFrameSize = readU24BE(bytes, dataStart + 4);
|
|
20055
|
+
const maxFrameSize = readU24BE(bytes, dataStart + 7);
|
|
20056
|
+
let packed = 0n;
|
|
20057
|
+
for (let i = 0; i < 8; i++) packed = packed << 8n | BigInt(bytes[dataStart + 10 + i]);
|
|
20058
|
+
const sampleRate = Number(packed >> 44n & 0xfffffn);
|
|
20059
|
+
const channels = Number(packed >> 41n & 0x7n) + 1;
|
|
20060
|
+
const bitsPerSample = Number(packed >> 36n & 0x1fn) + 1;
|
|
20061
|
+
const totalSamples = Number(packed & 0xfffffffffn);
|
|
20062
|
+
if (sampleRate <= 0) return { error: "Invalid sample rate in STREAMINFO block" };
|
|
20063
|
+
streamInfo = {
|
|
20064
|
+
sampleRate,
|
|
20065
|
+
channels,
|
|
20066
|
+
bitsPerSample,
|
|
20067
|
+
totalSamples,
|
|
20068
|
+
durationSeconds: Math.round(totalSamples / sampleRate * 1e3) / 1e3,
|
|
20069
|
+
minBlockSize,
|
|
20070
|
+
maxBlockSize,
|
|
20071
|
+
minFrameSize,
|
|
20072
|
+
maxFrameSize
|
|
20073
|
+
};
|
|
20074
|
+
} else if (blockType === 4) {
|
|
20075
|
+
vorbisComment = readVorbisComment(bytes, dataStart, dataEnd);
|
|
20076
|
+
}
|
|
20077
|
+
offset = dataEnd;
|
|
20078
|
+
if (isLast) break;
|
|
20079
|
+
}
|
|
20080
|
+
if (!streamInfo) return { error: "No STREAMINFO block found in this FLAC file" };
|
|
20081
|
+
const result = { ...streamInfo };
|
|
20082
|
+
if (vorbisComment) {
|
|
20083
|
+
result.vendor = vorbisComment.vendor;
|
|
20084
|
+
result.tags = vorbisComment.tags;
|
|
20085
|
+
for (const [key, field] of Object.entries(FLAC_TAG_FIELDS)) {
|
|
20086
|
+
if (vorbisComment.tags[key] !== void 0) result[field] = vorbisComment.tags[key];
|
|
20087
|
+
}
|
|
20088
|
+
}
|
|
20089
|
+
return result;
|
|
20090
|
+
}
|
|
19961
20091
|
|
|
19962
20092
|
// src/index.ts
|
|
19963
20093
|
var version = "0.1.0";
|
package/dist/index.d.cts
CHANGED
|
@@ -5,7 +5,7 @@ export { t as text } from './text-D1fySkCB.cjs';
|
|
|
5
5
|
export { d as data } from './data-XRb0D7Zn.cjs';
|
|
6
6
|
export { g as generators } from './generators-BGtRGpJZ.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-COt5uI20.cjs';
|
|
9
9
|
export { n as network } from './network-BJOjJnmY.cjs';
|
|
10
10
|
export { a as api } from './api-DmTNE4c1.cjs';
|
|
11
11
|
export { c as code } from './code-DaRvff2v.cjs';
|
|
@@ -13,7 +13,7 @@ export { c as color } from './color-tPwZCr9H.cjs';
|
|
|
13
13
|
export { c as css } from './css-Cf7AMGM-.cjs';
|
|
14
14
|
export { m as misc } from './misc-CA3N198T.cjs';
|
|
15
15
|
export { a as ai_agent } from './ai_agent-B-c59NXD.cjs';
|
|
16
|
-
export { m as media } from './media-
|
|
16
|
+
export { m as media } from './media-CN17a3MM.cjs';
|
|
17
17
|
|
|
18
18
|
declare const version = "0.1.0";
|
|
19
19
|
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { t as text } from './text-D1fySkCB.js';
|
|
|
5
5
|
export { d as data } from './data-XRb0D7Zn.js';
|
|
6
6
|
export { g as generators } from './generators-BGtRGpJZ.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-COt5uI20.js';
|
|
9
9
|
export { n as network } from './network-BJOjJnmY.js';
|
|
10
10
|
export { a as api } from './api-DmTNE4c1.js';
|
|
11
11
|
export { c as code } from './code-DaRvff2v.js';
|
|
@@ -13,7 +13,7 @@ export { c as color } from './color-tPwZCr9H.js';
|
|
|
13
13
|
export { c as css } from './css-Cf7AMGM-.js';
|
|
14
14
|
export { m as misc } from './misc-CA3N198T.js';
|
|
15
15
|
export { a as ai_agent } from './ai_agent-B-c59NXD.js';
|
|
16
|
-
export { m as media } from './media-
|
|
16
|
+
export { m as media } from './media-CN17a3MM.js';
|
|
17
17
|
|
|
18
18
|
declare const version = "0.1.0";
|
|
19
19
|
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { media_exports as media } from './chunk-
|
|
2
|
-
export { units_exports as units } from './chunk-
|
|
1
|
+
export { media_exports as media } from './chunk-Q3M23WNJ.js';
|
|
2
|
+
export { units_exports as units } from './chunk-I63BCOAG.js';
|
|
3
3
|
export { network_exports as network } from './chunk-Y5OOP6WN.js';
|
|
4
4
|
export { api_exports as api } from './chunk-52ZDKSIX.js';
|
|
5
5
|
export { code_exports as code } from './chunk-LXKIPPDG.js';
|
|
@@ -131,9 +131,40 @@ interface IcoInfoError {
|
|
|
131
131
|
* the same container format but a different type flag.
|
|
132
132
|
*/
|
|
133
133
|
declare function readIcoInfo(bytes: Uint8Array): IcoInfo | IcoInfoError;
|
|
134
|
+
interface FlacInfo {
|
|
135
|
+
sampleRate: number;
|
|
136
|
+
channels: number;
|
|
137
|
+
bitsPerSample: number;
|
|
138
|
+
totalSamples: number;
|
|
139
|
+
durationSeconds: number;
|
|
140
|
+
minBlockSize: number;
|
|
141
|
+
maxBlockSize: number;
|
|
142
|
+
minFrameSize: number;
|
|
143
|
+
maxFrameSize: number;
|
|
144
|
+
vendor?: string;
|
|
145
|
+
title?: string;
|
|
146
|
+
artist?: string;
|
|
147
|
+
album?: string;
|
|
148
|
+
date?: string;
|
|
149
|
+
genre?: string;
|
|
150
|
+
trackNumber?: string;
|
|
151
|
+
tags?: Record<string, string>;
|
|
152
|
+
}
|
|
153
|
+
interface FlacInfoError {
|
|
154
|
+
error: string;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Read a FLAC file's STREAMINFO metadata block (sample rate, channels, bit
|
|
158
|
+
* depth, total samples, duration) and, if present, its VORBIS_COMMENT block
|
|
159
|
+
* (vendor string and tags like ARTIST/TITLE/ALBUM), directly from the file's
|
|
160
|
+
* metadata-block headers. No audio frame decoding is performed.
|
|
161
|
+
*/
|
|
162
|
+
declare function readFlacInfo(bytes: Uint8Array): FlacInfo | FlacInfoError;
|
|
134
163
|
|
|
135
164
|
type media_ExifData = ExifData;
|
|
136
165
|
type media_ExifError = ExifError;
|
|
166
|
+
type media_FlacInfo = FlacInfo;
|
|
167
|
+
type media_FlacInfoError = FlacInfoError;
|
|
137
168
|
type media_IcoImageEntry = IcoImageEntry;
|
|
138
169
|
type media_IcoInfo = IcoInfo;
|
|
139
170
|
type media_IcoInfoError = IcoInfoError;
|
|
@@ -147,13 +178,14 @@ type media_PdfMetadataError = PdfMetadataError;
|
|
|
147
178
|
type media_WavInfo = WavInfo;
|
|
148
179
|
type media_WavInfoError = WavInfoError;
|
|
149
180
|
declare const media_readExifData: typeof readExifData;
|
|
181
|
+
declare const media_readFlacInfo: typeof readFlacInfo;
|
|
150
182
|
declare const media_readIcoInfo: typeof readIcoInfo;
|
|
151
183
|
declare const media_readId3Tags: typeof readId3Tags;
|
|
152
184
|
declare const media_readImageInfo: typeof readImageInfo;
|
|
153
185
|
declare const media_readPdfMetadata: typeof readPdfMetadata;
|
|
154
186
|
declare const media_readWavInfo: typeof readWavInfo;
|
|
155
187
|
declare namespace media {
|
|
156
|
-
export { type media_ExifData as ExifData, type media_ExifError as ExifError, type media_IcoImageEntry as IcoImageEntry, type media_IcoInfo as IcoInfo, type media_IcoInfoError as IcoInfoError, type media_Id3Tags as Id3Tags, type media_Id3TagsError as Id3TagsError, type media_ImageFormat as ImageFormat, type media_ImageInfo as ImageInfo, type media_ImageInfoError as ImageInfoError, type media_PdfMetadata as PdfMetadata, type media_PdfMetadataError as PdfMetadataError, type media_WavInfo as WavInfo, type media_WavInfoError as WavInfoError, media_readExifData as readExifData, media_readIcoInfo as readIcoInfo, media_readId3Tags as readId3Tags, media_readImageInfo as readImageInfo, media_readPdfMetadata as readPdfMetadata, media_readWavInfo as readWavInfo };
|
|
188
|
+
export { type media_ExifData as ExifData, type media_ExifError as ExifError, type media_FlacInfo as FlacInfo, type media_FlacInfoError as FlacInfoError, type media_IcoImageEntry as IcoImageEntry, type media_IcoInfo as IcoInfo, type media_IcoInfoError as IcoInfoError, type media_Id3Tags as Id3Tags, type media_Id3TagsError as Id3TagsError, type media_ImageFormat as ImageFormat, type media_ImageInfo as ImageInfo, type media_ImageInfoError as ImageInfoError, type media_PdfMetadata as PdfMetadata, type media_PdfMetadataError as PdfMetadataError, type media_WavInfo as WavInfo, type media_WavInfoError as WavInfoError, media_readExifData as readExifData, media_readFlacInfo as readFlacInfo, media_readIcoInfo as readIcoInfo, media_readId3Tags as readId3Tags, media_readImageInfo as readImageInfo, media_readPdfMetadata as readPdfMetadata, media_readWavInfo as readWavInfo };
|
|
157
189
|
}
|
|
158
190
|
|
|
159
|
-
export { type ExifData as E, type IcoImageEntry as I, type PdfMetadata as P, type WavInfo as W, type ExifError as a, type
|
|
191
|
+
export { type ExifData as E, type FlacInfo as F, type IcoImageEntry as I, type PdfMetadata as P, type WavInfo as W, type ExifError as a, type FlacInfoError as b, type IcoInfo as c, type IcoInfoError as d, type Id3Tags as e, type Id3TagsError as f, type ImageFormat as g, type ImageInfo as h, type ImageInfoError as i, type PdfMetadataError as j, type WavInfoError as k, readFlacInfo as l, media as m, readIcoInfo as n, readId3Tags as o, readImageInfo as p, readPdfMetadata as q, readExifData as r, readWavInfo as s };
|
|
@@ -131,9 +131,40 @@ interface IcoInfoError {
|
|
|
131
131
|
* the same container format but a different type flag.
|
|
132
132
|
*/
|
|
133
133
|
declare function readIcoInfo(bytes: Uint8Array): IcoInfo | IcoInfoError;
|
|
134
|
+
interface FlacInfo {
|
|
135
|
+
sampleRate: number;
|
|
136
|
+
channels: number;
|
|
137
|
+
bitsPerSample: number;
|
|
138
|
+
totalSamples: number;
|
|
139
|
+
durationSeconds: number;
|
|
140
|
+
minBlockSize: number;
|
|
141
|
+
maxBlockSize: number;
|
|
142
|
+
minFrameSize: number;
|
|
143
|
+
maxFrameSize: number;
|
|
144
|
+
vendor?: string;
|
|
145
|
+
title?: string;
|
|
146
|
+
artist?: string;
|
|
147
|
+
album?: string;
|
|
148
|
+
date?: string;
|
|
149
|
+
genre?: string;
|
|
150
|
+
trackNumber?: string;
|
|
151
|
+
tags?: Record<string, string>;
|
|
152
|
+
}
|
|
153
|
+
interface FlacInfoError {
|
|
154
|
+
error: string;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Read a FLAC file's STREAMINFO metadata block (sample rate, channels, bit
|
|
158
|
+
* depth, total samples, duration) and, if present, its VORBIS_COMMENT block
|
|
159
|
+
* (vendor string and tags like ARTIST/TITLE/ALBUM), directly from the file's
|
|
160
|
+
* metadata-block headers. No audio frame decoding is performed.
|
|
161
|
+
*/
|
|
162
|
+
declare function readFlacInfo(bytes: Uint8Array): FlacInfo | FlacInfoError;
|
|
134
163
|
|
|
135
164
|
type media_ExifData = ExifData;
|
|
136
165
|
type media_ExifError = ExifError;
|
|
166
|
+
type media_FlacInfo = FlacInfo;
|
|
167
|
+
type media_FlacInfoError = FlacInfoError;
|
|
137
168
|
type media_IcoImageEntry = IcoImageEntry;
|
|
138
169
|
type media_IcoInfo = IcoInfo;
|
|
139
170
|
type media_IcoInfoError = IcoInfoError;
|
|
@@ -147,13 +178,14 @@ type media_PdfMetadataError = PdfMetadataError;
|
|
|
147
178
|
type media_WavInfo = WavInfo;
|
|
148
179
|
type media_WavInfoError = WavInfoError;
|
|
149
180
|
declare const media_readExifData: typeof readExifData;
|
|
181
|
+
declare const media_readFlacInfo: typeof readFlacInfo;
|
|
150
182
|
declare const media_readIcoInfo: typeof readIcoInfo;
|
|
151
183
|
declare const media_readId3Tags: typeof readId3Tags;
|
|
152
184
|
declare const media_readImageInfo: typeof readImageInfo;
|
|
153
185
|
declare const media_readPdfMetadata: typeof readPdfMetadata;
|
|
154
186
|
declare const media_readWavInfo: typeof readWavInfo;
|
|
155
187
|
declare namespace media {
|
|
156
|
-
export { type media_ExifData as ExifData, type media_ExifError as ExifError, type media_IcoImageEntry as IcoImageEntry, type media_IcoInfo as IcoInfo, type media_IcoInfoError as IcoInfoError, type media_Id3Tags as Id3Tags, type media_Id3TagsError as Id3TagsError, type media_ImageFormat as ImageFormat, type media_ImageInfo as ImageInfo, type media_ImageInfoError as ImageInfoError, type media_PdfMetadata as PdfMetadata, type media_PdfMetadataError as PdfMetadataError, type media_WavInfo as WavInfo, type media_WavInfoError as WavInfoError, media_readExifData as readExifData, media_readIcoInfo as readIcoInfo, media_readId3Tags as readId3Tags, media_readImageInfo as readImageInfo, media_readPdfMetadata as readPdfMetadata, media_readWavInfo as readWavInfo };
|
|
188
|
+
export { type media_ExifData as ExifData, type media_ExifError as ExifError, type media_FlacInfo as FlacInfo, type media_FlacInfoError as FlacInfoError, type media_IcoImageEntry as IcoImageEntry, type media_IcoInfo as IcoInfo, type media_IcoInfoError as IcoInfoError, type media_Id3Tags as Id3Tags, type media_Id3TagsError as Id3TagsError, type media_ImageFormat as ImageFormat, type media_ImageInfo as ImageInfo, type media_ImageInfoError as ImageInfoError, type media_PdfMetadata as PdfMetadata, type media_PdfMetadataError as PdfMetadataError, type media_WavInfo as WavInfo, type media_WavInfoError as WavInfoError, media_readExifData as readExifData, media_readFlacInfo as readFlacInfo, media_readIcoInfo as readIcoInfo, media_readId3Tags as readId3Tags, media_readImageInfo as readImageInfo, media_readPdfMetadata as readPdfMetadata, media_readWavInfo as readWavInfo };
|
|
157
189
|
}
|
|
158
190
|
|
|
159
|
-
export { type ExifData as E, type IcoImageEntry as I, type PdfMetadata as P, type WavInfo as W, type ExifError as a, type
|
|
191
|
+
export { type ExifData as E, type FlacInfo as F, type IcoImageEntry as I, type PdfMetadata as P, type WavInfo as W, type ExifError as a, type FlacInfoError as b, type IcoInfo as c, type IcoInfoError as d, type Id3Tags as e, type Id3TagsError as f, type ImageFormat as g, type ImageInfo as h, type ImageInfoError as i, type PdfMetadataError as j, type WavInfoError as k, readFlacInfo as l, media as m, readIcoInfo as n, readId3Tags as o, readImageInfo as p, readPdfMetadata as q, readExifData as r, readWavInfo as s };
|
package/dist/tools/media.cjs
CHANGED
|
@@ -755,8 +755,104 @@ function readIcoInfo(bytes) {
|
|
|
755
755
|
}
|
|
756
756
|
return { imageCount: count, images };
|
|
757
757
|
}
|
|
758
|
+
var FLAC_TAG_FIELDS = {
|
|
759
|
+
TITLE: "title",
|
|
760
|
+
ARTIST: "artist",
|
|
761
|
+
ALBUM: "album",
|
|
762
|
+
DATE: "date",
|
|
763
|
+
GENRE: "genre",
|
|
764
|
+
TRACKNUMBER: "trackNumber"
|
|
765
|
+
};
|
|
766
|
+
function readU24BE(bytes, offset) {
|
|
767
|
+
return bytes[offset] << 16 | bytes[offset + 1] << 8 | bytes[offset + 2];
|
|
768
|
+
}
|
|
769
|
+
function readVorbisComment(bytes, start, end) {
|
|
770
|
+
let offset = start;
|
|
771
|
+
if (offset + 4 > end) return null;
|
|
772
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
773
|
+
const vendorLength = view.getUint32(offset, true);
|
|
774
|
+
offset += 4;
|
|
775
|
+
if (offset + vendorLength > end) return null;
|
|
776
|
+
const vendor = Buffer.from(bytes.subarray(offset, offset + vendorLength)).toString("utf8");
|
|
777
|
+
offset += vendorLength;
|
|
778
|
+
if (offset + 4 > end) return null;
|
|
779
|
+
const commentCount = view.getUint32(offset, true);
|
|
780
|
+
offset += 4;
|
|
781
|
+
const tags = {};
|
|
782
|
+
for (let i = 0; i < commentCount; i++) {
|
|
783
|
+
if (offset + 4 > end) break;
|
|
784
|
+
const commentLength = view.getUint32(offset, true);
|
|
785
|
+
offset += 4;
|
|
786
|
+
if (offset + commentLength > end) break;
|
|
787
|
+
const comment = Buffer.from(bytes.subarray(offset, offset + commentLength)).toString("utf8");
|
|
788
|
+
offset += commentLength;
|
|
789
|
+
const eq = comment.indexOf("=");
|
|
790
|
+
if (eq > 0) {
|
|
791
|
+
const key = comment.slice(0, eq).toUpperCase();
|
|
792
|
+
const value = comment.slice(eq + 1);
|
|
793
|
+
tags[key] = value;
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
return { vendor, tags };
|
|
797
|
+
}
|
|
798
|
+
function readFlacInfo(bytes) {
|
|
799
|
+
if (bytes.length < 4) return { error: "File is too small to be a valid FLAC file" };
|
|
800
|
+
if (readAscii4(bytes, 0) !== "fLaC") return { error: 'Not a FLAC file (missing "fLaC" marker)' };
|
|
801
|
+
let offset = 4;
|
|
802
|
+
let streamInfo = null;
|
|
803
|
+
let vorbisComment = null;
|
|
804
|
+
while (offset + 4 <= bytes.length) {
|
|
805
|
+
const header = bytes[offset];
|
|
806
|
+
const isLast = (header & 128) !== 0;
|
|
807
|
+
const blockType = header & 127;
|
|
808
|
+
const length = readU24BE(bytes, offset + 1);
|
|
809
|
+
const dataStart = offset + 4;
|
|
810
|
+
const dataEnd = dataStart + length;
|
|
811
|
+
if (dataEnd > bytes.length) return { error: "Truncated metadata block" };
|
|
812
|
+
if (blockType === 0) {
|
|
813
|
+
if (length < 34) return { error: "Truncated STREAMINFO block" };
|
|
814
|
+
const minBlockSize = bytes[dataStart] << 8 | bytes[dataStart + 1];
|
|
815
|
+
const maxBlockSize = bytes[dataStart + 2] << 8 | bytes[dataStart + 3];
|
|
816
|
+
const minFrameSize = readU24BE(bytes, dataStart + 4);
|
|
817
|
+
const maxFrameSize = readU24BE(bytes, dataStart + 7);
|
|
818
|
+
let packed = 0n;
|
|
819
|
+
for (let i = 0; i < 8; i++) packed = packed << 8n | BigInt(bytes[dataStart + 10 + i]);
|
|
820
|
+
const sampleRate = Number(packed >> 44n & 0xfffffn);
|
|
821
|
+
const channels = Number(packed >> 41n & 0x7n) + 1;
|
|
822
|
+
const bitsPerSample = Number(packed >> 36n & 0x1fn) + 1;
|
|
823
|
+
const totalSamples = Number(packed & 0xfffffffffn);
|
|
824
|
+
if (sampleRate <= 0) return { error: "Invalid sample rate in STREAMINFO block" };
|
|
825
|
+
streamInfo = {
|
|
826
|
+
sampleRate,
|
|
827
|
+
channels,
|
|
828
|
+
bitsPerSample,
|
|
829
|
+
totalSamples,
|
|
830
|
+
durationSeconds: Math.round(totalSamples / sampleRate * 1e3) / 1e3,
|
|
831
|
+
minBlockSize,
|
|
832
|
+
maxBlockSize,
|
|
833
|
+
minFrameSize,
|
|
834
|
+
maxFrameSize
|
|
835
|
+
};
|
|
836
|
+
} else if (blockType === 4) {
|
|
837
|
+
vorbisComment = readVorbisComment(bytes, dataStart, dataEnd);
|
|
838
|
+
}
|
|
839
|
+
offset = dataEnd;
|
|
840
|
+
if (isLast) break;
|
|
841
|
+
}
|
|
842
|
+
if (!streamInfo) return { error: "No STREAMINFO block found in this FLAC file" };
|
|
843
|
+
const result = { ...streamInfo };
|
|
844
|
+
if (vorbisComment) {
|
|
845
|
+
result.vendor = vorbisComment.vendor;
|
|
846
|
+
result.tags = vorbisComment.tags;
|
|
847
|
+
for (const [key, field] of Object.entries(FLAC_TAG_FIELDS)) {
|
|
848
|
+
if (vorbisComment.tags[key] !== void 0) result[field] = vorbisComment.tags[key];
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
return result;
|
|
852
|
+
}
|
|
758
853
|
|
|
759
854
|
exports.readExifData = readExifData;
|
|
855
|
+
exports.readFlacInfo = readFlacInfo;
|
|
760
856
|
exports.readIcoInfo = readIcoInfo;
|
|
761
857
|
exports.readId3Tags = readId3Tags;
|
|
762
858
|
exports.readImageInfo = readImageInfo;
|
package/dist/tools/media.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { E as ExifData, a as ExifError, I as IcoImageEntry,
|
|
1
|
+
export { E as ExifData, a as ExifError, F as FlacInfo, b as FlacInfoError, I as IcoImageEntry, c as IcoInfo, d as IcoInfoError, e as Id3Tags, f as Id3TagsError, g as ImageFormat, h as ImageInfo, i as ImageInfoError, P as PdfMetadata, j as PdfMetadataError, W as WavInfo, k as WavInfoError, r as readExifData, l as readFlacInfo, n as readIcoInfo, o as readId3Tags, p as readImageInfo, q as readPdfMetadata, s as readWavInfo } from '../media-CN17a3MM.cjs';
|
package/dist/tools/media.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { E as ExifData, a as ExifError, I as IcoImageEntry,
|
|
1
|
+
export { E as ExifData, a as ExifError, F as FlacInfo, b as FlacInfoError, I as IcoImageEntry, c as IcoInfo, d as IcoInfoError, e as Id3Tags, f as Id3TagsError, g as ImageFormat, h as ImageInfo, i as ImageInfoError, P as PdfMetadata, j as PdfMetadataError, W as WavInfo, k as WavInfoError, r as readExifData, l as readFlacInfo, n as readIcoInfo, o as readId3Tags, p as readImageInfo, q as readPdfMetadata, s as readWavInfo } from '../media-CN17a3MM.js';
|
package/dist/tools/media.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { readExifData, readIcoInfo, readId3Tags, readImageInfo, readPdfMetadata, readWavInfo } from '../chunk-
|
|
1
|
+
export { readExifData, readFlacInfo, readIcoInfo, readId3Tags, readImageInfo, readPdfMetadata, readWavInfo } from '../chunk-Q3M23WNJ.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
package/dist/tools/units.cjs
CHANGED
|
@@ -1560,6 +1560,39 @@ function calculateVideoBitrate(input) {
|
|
|
1560
1560
|
}
|
|
1561
1561
|
return { error: 'mode must be "size-from-bitrate" or "bitrate-from-size"' };
|
|
1562
1562
|
}
|
|
1563
|
+
function calculateRuleOf72(value, direction) {
|
|
1564
|
+
if (!Number.isFinite(value) || value <= 0) return { error: "Value must be a positive number" };
|
|
1565
|
+
if (direction !== "rate-to-years" && direction !== "years-to-rate") {
|
|
1566
|
+
return { error: 'Direction must be "rate-to-years" or "years-to-rate"' };
|
|
1567
|
+
}
|
|
1568
|
+
const round4 = (n) => Math.round(n * 1e4) / 1e4;
|
|
1569
|
+
if (direction === "rate-to-years") {
|
|
1570
|
+
const ratePercent = value;
|
|
1571
|
+
const ruleOf72Estimate2 = 72 / ratePercent;
|
|
1572
|
+
const exactValue2 = Math.log(2) / Math.log(1 + ratePercent / 100);
|
|
1573
|
+
const errorPercent2 = (ruleOf72Estimate2 - exactValue2) / exactValue2 * 100;
|
|
1574
|
+
return {
|
|
1575
|
+
direction,
|
|
1576
|
+
ratePercent: round4(ratePercent),
|
|
1577
|
+
years: round4(exactValue2),
|
|
1578
|
+
ruleOf72Estimate: round4(ruleOf72Estimate2),
|
|
1579
|
+
exactValue: round4(exactValue2),
|
|
1580
|
+
errorPercent: round4(errorPercent2)
|
|
1581
|
+
};
|
|
1582
|
+
}
|
|
1583
|
+
const years = value;
|
|
1584
|
+
const ruleOf72Estimate = 72 / years;
|
|
1585
|
+
const exactValue = (Math.pow(2, 1 / years) - 1) * 100;
|
|
1586
|
+
const errorPercent = (ruleOf72Estimate - exactValue) / exactValue * 100;
|
|
1587
|
+
return {
|
|
1588
|
+
direction,
|
|
1589
|
+
ratePercent: round4(exactValue),
|
|
1590
|
+
years: round4(years),
|
|
1591
|
+
ruleOf72Estimate: round4(ruleOf72Estimate),
|
|
1592
|
+
exactValue: round4(exactValue),
|
|
1593
|
+
errorPercent: round4(errorPercent)
|
|
1594
|
+
};
|
|
1595
|
+
}
|
|
1563
1596
|
|
|
1564
1597
|
exports.BASE_LABELS = BASE_LABELS;
|
|
1565
1598
|
exports.BASE_PREFIXES = BASE_PREFIXES;
|
|
@@ -1583,6 +1616,7 @@ exports.calculateDiscount = calculateDiscount;
|
|
|
1583
1616
|
exports.calculateLoan = calculateLoan;
|
|
1584
1617
|
exports.calculateMarginMarkup = calculateMarginMarkup;
|
|
1585
1618
|
exports.calculatePercentageChange = calculatePercentageChange;
|
|
1619
|
+
exports.calculateRuleOf72 = calculateRuleOf72;
|
|
1586
1620
|
exports.calculateSimpleInterest = calculateSimpleInterest;
|
|
1587
1621
|
exports.calculateTax = calculateTax;
|
|
1588
1622
|
exports.calculateTimeValue = calculateTimeValue;
|
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 BreakEvenInput, j as BreakEvenResult, k as ByteConvertResult, l as ByteUnit, C as COMMON_CURRENCIES, m as COMMON_LOCALES, n as COMMON_PERMISSIONS, o as COMMON_RATIOS, p as COMMON_SIZES, q as COMMON_TAX_RATES, r as COMMON_TIP_PERCENTAGES, s as COMMON_VIEWPORTS, t as CardValidationResult, v as CompoundInterestResult, w as CompoundYearRow, D as Dimensions, x as DiscountField, y as DiscountInput, z as DiscountResult, F as FilePermissions, E as FormatOptions, I as IbanValidationResult, G as IpConversion, H as IsbnFormat, J as IsbnResult, L as LoanResult, M as MarginMarkupField, K as MarginMarkupInput, N as MarginMarkupResult, O as NotationStyle, P as NumberBase, Q as PercentChangeDirection, R as PercentageChangeResult, S as Permission, T as PxConvertResult, U 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 BreakEvenInput, j as BreakEvenResult, k as ByteConvertResult, l as ByteUnit, C as COMMON_CURRENCIES, m as COMMON_LOCALES, n as COMMON_PERMISSIONS, o as COMMON_RATIOS, p as COMMON_SIZES, q as COMMON_TAX_RATES, r as COMMON_TIP_PERCENTAGES, s as COMMON_VIEWPORTS, t as CardValidationResult, v as CompoundInterestResult, w as CompoundYearRow, D as Dimensions, x as DiscountField, y as DiscountInput, z as DiscountResult, F as FilePermissions, E as FormatOptions, I as IbanValidationResult, G as IpConversion, H as IsbnFormat, J as IsbnResult, L as LoanResult, M as MarginMarkupField, K as MarginMarkupInput, N as MarginMarkupResult, O as NotationStyle, P as NumberBase, Q as PercentChangeDirection, R as PercentageChangeResult, S as Permission, T as PxConvertResult, U as RuleOf72Direction, V as RuleOf72Result, W as SemverVersion, X as SimpleInterestResult, Y as SubnetInfo, Z as SuccessiveDiscountResult, _ as SuccessiveDiscountStep, $ as TaxDirection, a0 as TaxResult, a1 as TimeValueDirection, a2 as TimeValueResult, a3 as TipSplitResult, a4 as VideoBitrateInput, a5 as VideoBitrateMode, a6 as VideoBitrateResult, a7 as ViewportConvertResult, a8 as applySuccessiveDiscounts, a9 as autoFormat, aa as bumpVersion, ab as calcAspectRatio, ac as calcSubnet, ad as calculateBreakEven, ae as calculateCompoundInterest, af as calculateDiscount, ag as calculateLoan, ah as calculateMarginMarkup, ai as calculatePercentageChange, aj as calculateRuleOf72, ak as calculateSimpleInterest, al as calculateTax, am as calculateTimeValue, an as calculateTipSplit, ao as calculateVideoBitrate, ap as compareSemver, aq as convert, ar as convertAprApy, as as convertBytes, at as convertIp, au as coverBox, av as decimalToIp, aw as decimalToIpCidr, ax as describePermissions, ay as fitIntoBox, az as formatNumber, aA as formatValue, aB as formatVwValue, aC as formatWithSeparator, aD as gcd, aE as ipFromBinary, aF as ipFromDecimal, aG as ipFromHex, aH as ipToBinary, aI as ipToDecimal, aJ as ipToDecimalCidr, aK as ipToHex, aL as ipToOctal, aM as isValid, aN as isValidCidr, aO as isValidIp, aP as isValidIpv4, aQ as marginToMarkup, aR as markupToMargin, aS as octalToPermissions, aT as parseFileSize, aU as parseInput, aV as parseNumberString, aW as parseSemver, aX as permissionsToChmod, aY as permissionsToOctal, aZ as permissionsToSymbolic, a_ as ptToPx, a$ as pxToAll, b0 as pxToViewport, b1 as remToPx, b2 as satisfiesRange, b3 as scaleByHeight, b4 as scaleByWidth, b5 as sortVersions, b6 as splitSubnet, b7 as symbolicToPermissions, b8 as validateBarcode, b9 as validateCardNumber, ba as validateIban, bb as validateIsbn, bc as viewportToPx } from '../units-COt5uI20.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 BreakEvenInput, j as BreakEvenResult, k as ByteConvertResult, l as ByteUnit, C as COMMON_CURRENCIES, m as COMMON_LOCALES, n as COMMON_PERMISSIONS, o as COMMON_RATIOS, p as COMMON_SIZES, q as COMMON_TAX_RATES, r as COMMON_TIP_PERCENTAGES, s as COMMON_VIEWPORTS, t as CardValidationResult, v as CompoundInterestResult, w as CompoundYearRow, D as Dimensions, x as DiscountField, y as DiscountInput, z as DiscountResult, F as FilePermissions, E as FormatOptions, I as IbanValidationResult, G as IpConversion, H as IsbnFormat, J as IsbnResult, L as LoanResult, M as MarginMarkupField, K as MarginMarkupInput, N as MarginMarkupResult, O as NotationStyle, P as NumberBase, Q as PercentChangeDirection, R as PercentageChangeResult, S as Permission, T as PxConvertResult, U 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 BreakEvenInput, j as BreakEvenResult, k as ByteConvertResult, l as ByteUnit, C as COMMON_CURRENCIES, m as COMMON_LOCALES, n as COMMON_PERMISSIONS, o as COMMON_RATIOS, p as COMMON_SIZES, q as COMMON_TAX_RATES, r as COMMON_TIP_PERCENTAGES, s as COMMON_VIEWPORTS, t as CardValidationResult, v as CompoundInterestResult, w as CompoundYearRow, D as Dimensions, x as DiscountField, y as DiscountInput, z as DiscountResult, F as FilePermissions, E as FormatOptions, I as IbanValidationResult, G as IpConversion, H as IsbnFormat, J as IsbnResult, L as LoanResult, M as MarginMarkupField, K as MarginMarkupInput, N as MarginMarkupResult, O as NotationStyle, P as NumberBase, Q as PercentChangeDirection, R as PercentageChangeResult, S as Permission, T as PxConvertResult, U as RuleOf72Direction, V as RuleOf72Result, W as SemverVersion, X as SimpleInterestResult, Y as SubnetInfo, Z as SuccessiveDiscountResult, _ as SuccessiveDiscountStep, $ as TaxDirection, a0 as TaxResult, a1 as TimeValueDirection, a2 as TimeValueResult, a3 as TipSplitResult, a4 as VideoBitrateInput, a5 as VideoBitrateMode, a6 as VideoBitrateResult, a7 as ViewportConvertResult, a8 as applySuccessiveDiscounts, a9 as autoFormat, aa as bumpVersion, ab as calcAspectRatio, ac as calcSubnet, ad as calculateBreakEven, ae as calculateCompoundInterest, af as calculateDiscount, ag as calculateLoan, ah as calculateMarginMarkup, ai as calculatePercentageChange, aj as calculateRuleOf72, ak as calculateSimpleInterest, al as calculateTax, am as calculateTimeValue, an as calculateTipSplit, ao as calculateVideoBitrate, ap as compareSemver, aq as convert, ar as convertAprApy, as as convertBytes, at as convertIp, au as coverBox, av as decimalToIp, aw as decimalToIpCidr, ax as describePermissions, ay as fitIntoBox, az as formatNumber, aA as formatValue, aB as formatVwValue, aC as formatWithSeparator, aD as gcd, aE as ipFromBinary, aF as ipFromDecimal, aG as ipFromHex, aH as ipToBinary, aI as ipToDecimal, aJ as ipToDecimalCidr, aK as ipToHex, aL as ipToOctal, aM as isValid, aN as isValidCidr, aO as isValidIp, aP as isValidIpv4, aQ as marginToMarkup, aR as markupToMargin, aS as octalToPermissions, aT as parseFileSize, aU as parseInput, aV as parseNumberString, aW as parseSemver, aX as permissionsToChmod, aY as permissionsToOctal, aZ as permissionsToSymbolic, a_ as ptToPx, a$ as pxToAll, b0 as pxToViewport, b1 as remToPx, b2 as satisfiesRange, b3 as scaleByHeight, b4 as scaleByWidth, b5 as sortVersions, b6 as splitSubnet, b7 as symbolicToPermissions, b8 as validateBarcode, b9 as validateCardNumber, ba as validateIban, bb as validateIsbn, bc as viewportToPx } from '../units-COt5uI20.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, applySuccessiveDiscounts, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, calculateBreakEven, calculateCompoundInterest, calculateDiscount, calculateLoan, calculateMarginMarkup, calculatePercentageChange, calculateSimpleInterest, calculateTax, calculateTimeValue, calculateTipSplit, calculateVideoBitrate, compareSemver, convert, convertAprApy, convertBytes, convertIp, coverBox, decimalToIp, decimalToIpCidr, describePermissions, fitIntoBox, formatNumber, formatValue, formatVwValue, formatWithSeparator, gcd, ipFromBinary, ipFromDecimal, ipFromHex, ipToBinary, ipToDecimal, ipToDecimalCidr, ipToHex, ipToOctal, isValid, isValidCidr, isValidIp, isValidIpv4, marginToMarkup, markupToMargin, 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-
|
|
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, applySuccessiveDiscounts, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, calculateBreakEven, calculateCompoundInterest, calculateDiscount, calculateLoan, calculateMarginMarkup, calculatePercentageChange, calculateRuleOf72, calculateSimpleInterest, calculateTax, calculateTimeValue, calculateTipSplit, calculateVideoBitrate, compareSemver, convert, convertAprApy, convertBytes, convertIp, coverBox, decimalToIp, decimalToIpCidr, describePermissions, fitIntoBox, formatNumber, formatValue, formatVwValue, formatWithSeparator, gcd, ipFromBinary, ipFromDecimal, ipFromHex, ipToBinary, ipToDecimal, ipToDecimalCidr, ipToHex, ipToOctal, isValid, isValidCidr, isValidIp, isValidIpv4, marginToMarkup, markupToMargin, 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-I63BCOAG.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
|
@@ -627,6 +627,28 @@ interface VideoBitrateResult {
|
|
|
627
627
|
declare function calculateVideoBitrate(input: VideoBitrateInput): VideoBitrateResult | {
|
|
628
628
|
error: string;
|
|
629
629
|
};
|
|
630
|
+
type RuleOf72Direction = 'rate-to-years' | 'years-to-rate';
|
|
631
|
+
interface RuleOf72Result {
|
|
632
|
+
direction: RuleOf72Direction;
|
|
633
|
+
ratePercent: number;
|
|
634
|
+
years: number;
|
|
635
|
+
ruleOf72Estimate: number;
|
|
636
|
+
exactValue: number;
|
|
637
|
+
errorPercent: number;
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* Estimate how many years it takes an investment to double at a given annual
|
|
641
|
+
* rate (direction "rate-to-years"), or the rate needed to double in a given
|
|
642
|
+
* number of years (direction "years-to-rate"), using the Rule of 72 shortcut
|
|
643
|
+
* (72 / rate, or 72 / years). Also computes the exact result from the
|
|
644
|
+
* logarithmic doubling-time formula ln(2) / ln(1 + rate/100), so the two can
|
|
645
|
+
* be compared: the Rule of 72 is most accurate for rates roughly between 6%
|
|
646
|
+
* and 10% and drifts further from the exact value outside that range. Pure
|
|
647
|
+
* arithmetic, no live rate feed.
|
|
648
|
+
*/
|
|
649
|
+
declare function calculateRuleOf72(value: number, direction: RuleOf72Direction): RuleOf72Result | {
|
|
650
|
+
error: string;
|
|
651
|
+
};
|
|
630
652
|
|
|
631
653
|
type units_AmortizationRow = AmortizationRow;
|
|
632
654
|
type units_AprApyDirection = AprApyDirection;
|
|
@@ -673,6 +695,8 @@ type units_PercentChangeDirection = PercentChangeDirection;
|
|
|
673
695
|
type units_PercentageChangeResult = PercentageChangeResult;
|
|
674
696
|
type units_Permission = Permission;
|
|
675
697
|
type units_PxConvertResult = PxConvertResult;
|
|
698
|
+
type units_RuleOf72Direction = RuleOf72Direction;
|
|
699
|
+
type units_RuleOf72Result = RuleOf72Result;
|
|
676
700
|
type units_SemverVersion = SemverVersion;
|
|
677
701
|
type units_SimpleInterestResult = SimpleInterestResult;
|
|
678
702
|
type units_SubnetInfo = SubnetInfo;
|
|
@@ -698,6 +722,7 @@ declare const units_calculateDiscount: typeof calculateDiscount;
|
|
|
698
722
|
declare const units_calculateLoan: typeof calculateLoan;
|
|
699
723
|
declare const units_calculateMarginMarkup: typeof calculateMarginMarkup;
|
|
700
724
|
declare const units_calculatePercentageChange: typeof calculatePercentageChange;
|
|
725
|
+
declare const units_calculateRuleOf72: typeof calculateRuleOf72;
|
|
701
726
|
declare const units_calculateSimpleInterest: typeof calculateSimpleInterest;
|
|
702
727
|
declare const units_calculateTax: typeof calculateTax;
|
|
703
728
|
declare const units_calculateTimeValue: typeof calculateTimeValue;
|
|
@@ -756,7 +781,7 @@ declare const units_validateIban: typeof validateIban;
|
|
|
756
781
|
declare const units_validateIsbn: typeof validateIsbn;
|
|
757
782
|
declare const units_viewportToPx: typeof viewportToPx;
|
|
758
783
|
declare namespace units {
|
|
759
|
-
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_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_CompoundInterestResult as CompoundInterestResult, type units_CompoundYearRow as CompoundYearRow, type units_Dimensions as Dimensions, type units_DiscountField as DiscountField, type units_DiscountInput as DiscountInput, type units_DiscountResult as DiscountResult, 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_MarginMarkupField as MarginMarkupField, type units_MarginMarkupInput as MarginMarkupInput, type units_MarginMarkupResult as MarginMarkupResult, type units_NotationStyle as NotationStyle, type units_NumberBase as NumberBase, type units_PercentChangeDirection as PercentChangeDirection, type units_PercentageChangeResult as PercentageChangeResult, type units_Permission as Permission, type units_PxConvertResult as PxConvertResult, type units_SemverVersion as SemverVersion, type units_SimpleInterestResult as SimpleInterestResult, type units_SubnetInfo as SubnetInfo, type units_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, 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_calculateBreakEven as calculateBreakEven, units_calculateCompoundInterest as calculateCompoundInterest, units_calculateDiscount as calculateDiscount, units_calculateLoan as calculateLoan, units_calculateMarginMarkup as calculateMarginMarkup, units_calculatePercentageChange as calculatePercentageChange, 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_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_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 };
|
|
784
|
+
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_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_CompoundInterestResult as CompoundInterestResult, type units_CompoundYearRow as CompoundYearRow, type units_Dimensions as Dimensions, type units_DiscountField as DiscountField, type units_DiscountInput as DiscountInput, type units_DiscountResult as DiscountResult, 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_MarginMarkupField as MarginMarkupField, type units_MarginMarkupInput as MarginMarkupInput, type units_MarginMarkupResult as MarginMarkupResult, type units_NotationStyle as NotationStyle, type units_NumberBase as NumberBase, type units_PercentChangeDirection as PercentChangeDirection, type units_PercentageChangeResult as PercentageChangeResult, type units_Permission as Permission, type units_PxConvertResult as PxConvertResult, type units_RuleOf72Direction as RuleOf72Direction, type units_RuleOf72Result as RuleOf72Result, 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, 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_calculateBreakEven as calculateBreakEven, units_calculateCompoundInterest as calculateCompoundInterest, units_calculateDiscount as calculateDiscount, units_calculateLoan as calculateLoan, units_calculateMarginMarkup as calculateMarginMarkup, units_calculatePercentageChange as calculatePercentageChange, units_calculateRuleOf72 as calculateRuleOf72, 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_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_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 };
|
|
760
785
|
}
|
|
761
786
|
|
|
762
|
-
export { type
|
|
787
|
+
export { type TaxDirection as $, type AmortizationRow as A, BASE_LABELS as B, COMMON_CURRENCIES as C, type Dimensions as D, type FormatOptions as E, type FilePermissions as F, type IpConversion as G, type IsbnFormat as H, type IbanValidationResult as I, type IsbnResult as J, type MarginMarkupInput as K, type LoanResult as L, type MarginMarkupField as M, type MarginMarkupResult as N, type NotationStyle as O, type NumberBase as P, type PercentChangeDirection as Q, type PercentageChangeResult as R, type Permission as S, type PxConvertResult as T, type RuleOf72Direction as U, type RuleOf72Result as V, type SemverVersion as W, type SimpleInterestResult as X, type SubnetInfo as Y, type SuccessiveDiscountResult as Z, type SuccessiveDiscountStep as _, type AprApyDirection as a, pxToAll as a$, type TaxResult as a0, type TimeValueDirection as a1, type TimeValueResult as a2, type TipSplitResult as a3, type VideoBitrateInput as a4, type VideoBitrateMode as a5, type VideoBitrateResult as a6, type ViewportConvertResult as a7, applySuccessiveDiscounts as a8, autoFormat as a9, formatValue as aA, formatVwValue as aB, formatWithSeparator as aC, gcd as aD, ipFromBinary as aE, ipFromDecimal as aF, ipFromHex as aG, ipToBinary as aH, ipToDecimal as aI, ipToDecimalCidr as aJ, ipToHex as aK, ipToOctal as aL, isValid as aM, isValidCidr as aN, isValidIp as aO, isValidIpv4 as aP, marginToMarkup as aQ, markupToMargin as aR, octalToPermissions as aS, parseFileSize as aT, parseInput as aU, parseNumberString as aV, parseSemver as aW, permissionsToChmod as aX, permissionsToOctal as aY, permissionsToSymbolic as aZ, ptToPx as a_, bumpVersion as aa, calcAspectRatio as ab, calcSubnet as ac, calculateBreakEven as ad, calculateCompoundInterest as ae, calculateDiscount as af, calculateLoan as ag, calculateMarginMarkup as ah, calculatePercentageChange as ai, calculateRuleOf72 as aj, calculateSimpleInterest as ak, calculateTax as al, calculateTimeValue as am, calculateTipSplit as an, calculateVideoBitrate as ao, compareSemver as ap, convert as aq, convertAprApy as ar, convertBytes as as, convertIp as at, coverBox as au, decimalToIp as av, decimalToIpCidr as aw, describePermissions as ax, fitIntoBox as ay, formatNumber as az, type AprApyResult as b, pxToViewport as b0, remToPx as b1, satisfiesRange as b2, scaleByHeight as b3, scaleByWidth as b4, sortVersions as b5, splitSubnet as b6, symbolicToPermissions as b7, validateBarcode as b8, validateCardNumber as b9, validateIban as ba, validateIsbn as bb, viewportToPx as bc, type AspectRatioResult as c, BASE_PREFIXES as d, BYTE_UNITS as e, type BarcodeFormat as f, type BarcodeValidationResult as g, type BaseConvertResult as h, type BreakEvenInput as i, type BreakEvenResult as j, type ByteConvertResult as k, type ByteUnit as l, COMMON_LOCALES as m, COMMON_PERMISSIONS as n, COMMON_RATIOS as o, COMMON_SIZES as p, COMMON_TAX_RATES as q, COMMON_TIP_PERCENTAGES as r, COMMON_VIEWPORTS as s, type CardValidationResult as t, units as u, type CompoundInterestResult as v, type CompoundYearRow as w, type DiscountField as x, type DiscountInput as y, type DiscountResult as z };
|
|
@@ -627,6 +627,28 @@ interface VideoBitrateResult {
|
|
|
627
627
|
declare function calculateVideoBitrate(input: VideoBitrateInput): VideoBitrateResult | {
|
|
628
628
|
error: string;
|
|
629
629
|
};
|
|
630
|
+
type RuleOf72Direction = 'rate-to-years' | 'years-to-rate';
|
|
631
|
+
interface RuleOf72Result {
|
|
632
|
+
direction: RuleOf72Direction;
|
|
633
|
+
ratePercent: number;
|
|
634
|
+
years: number;
|
|
635
|
+
ruleOf72Estimate: number;
|
|
636
|
+
exactValue: number;
|
|
637
|
+
errorPercent: number;
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* Estimate how many years it takes an investment to double at a given annual
|
|
641
|
+
* rate (direction "rate-to-years"), or the rate needed to double in a given
|
|
642
|
+
* number of years (direction "years-to-rate"), using the Rule of 72 shortcut
|
|
643
|
+
* (72 / rate, or 72 / years). Also computes the exact result from the
|
|
644
|
+
* logarithmic doubling-time formula ln(2) / ln(1 + rate/100), so the two can
|
|
645
|
+
* be compared: the Rule of 72 is most accurate for rates roughly between 6%
|
|
646
|
+
* and 10% and drifts further from the exact value outside that range. Pure
|
|
647
|
+
* arithmetic, no live rate feed.
|
|
648
|
+
*/
|
|
649
|
+
declare function calculateRuleOf72(value: number, direction: RuleOf72Direction): RuleOf72Result | {
|
|
650
|
+
error: string;
|
|
651
|
+
};
|
|
630
652
|
|
|
631
653
|
type units_AmortizationRow = AmortizationRow;
|
|
632
654
|
type units_AprApyDirection = AprApyDirection;
|
|
@@ -673,6 +695,8 @@ type units_PercentChangeDirection = PercentChangeDirection;
|
|
|
673
695
|
type units_PercentageChangeResult = PercentageChangeResult;
|
|
674
696
|
type units_Permission = Permission;
|
|
675
697
|
type units_PxConvertResult = PxConvertResult;
|
|
698
|
+
type units_RuleOf72Direction = RuleOf72Direction;
|
|
699
|
+
type units_RuleOf72Result = RuleOf72Result;
|
|
676
700
|
type units_SemverVersion = SemverVersion;
|
|
677
701
|
type units_SimpleInterestResult = SimpleInterestResult;
|
|
678
702
|
type units_SubnetInfo = SubnetInfo;
|
|
@@ -698,6 +722,7 @@ declare const units_calculateDiscount: typeof calculateDiscount;
|
|
|
698
722
|
declare const units_calculateLoan: typeof calculateLoan;
|
|
699
723
|
declare const units_calculateMarginMarkup: typeof calculateMarginMarkup;
|
|
700
724
|
declare const units_calculatePercentageChange: typeof calculatePercentageChange;
|
|
725
|
+
declare const units_calculateRuleOf72: typeof calculateRuleOf72;
|
|
701
726
|
declare const units_calculateSimpleInterest: typeof calculateSimpleInterest;
|
|
702
727
|
declare const units_calculateTax: typeof calculateTax;
|
|
703
728
|
declare const units_calculateTimeValue: typeof calculateTimeValue;
|
|
@@ -756,7 +781,7 @@ declare const units_validateIban: typeof validateIban;
|
|
|
756
781
|
declare const units_validateIsbn: typeof validateIsbn;
|
|
757
782
|
declare const units_viewportToPx: typeof viewportToPx;
|
|
758
783
|
declare namespace units {
|
|
759
|
-
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_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_CompoundInterestResult as CompoundInterestResult, type units_CompoundYearRow as CompoundYearRow, type units_Dimensions as Dimensions, type units_DiscountField as DiscountField, type units_DiscountInput as DiscountInput, type units_DiscountResult as DiscountResult, 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_MarginMarkupField as MarginMarkupField, type units_MarginMarkupInput as MarginMarkupInput, type units_MarginMarkupResult as MarginMarkupResult, type units_NotationStyle as NotationStyle, type units_NumberBase as NumberBase, type units_PercentChangeDirection as PercentChangeDirection, type units_PercentageChangeResult as PercentageChangeResult, type units_Permission as Permission, type units_PxConvertResult as PxConvertResult, type units_SemverVersion as SemverVersion, type units_SimpleInterestResult as SimpleInterestResult, type units_SubnetInfo as SubnetInfo, type units_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, 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_calculateBreakEven as calculateBreakEven, units_calculateCompoundInterest as calculateCompoundInterest, units_calculateDiscount as calculateDiscount, units_calculateLoan as calculateLoan, units_calculateMarginMarkup as calculateMarginMarkup, units_calculatePercentageChange as calculatePercentageChange, 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_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_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 };
|
|
784
|
+
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_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_CompoundInterestResult as CompoundInterestResult, type units_CompoundYearRow as CompoundYearRow, type units_Dimensions as Dimensions, type units_DiscountField as DiscountField, type units_DiscountInput as DiscountInput, type units_DiscountResult as DiscountResult, 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_MarginMarkupField as MarginMarkupField, type units_MarginMarkupInput as MarginMarkupInput, type units_MarginMarkupResult as MarginMarkupResult, type units_NotationStyle as NotationStyle, type units_NumberBase as NumberBase, type units_PercentChangeDirection as PercentChangeDirection, type units_PercentageChangeResult as PercentageChangeResult, type units_Permission as Permission, type units_PxConvertResult as PxConvertResult, type units_RuleOf72Direction as RuleOf72Direction, type units_RuleOf72Result as RuleOf72Result, 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, 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_calculateBreakEven as calculateBreakEven, units_calculateCompoundInterest as calculateCompoundInterest, units_calculateDiscount as calculateDiscount, units_calculateLoan as calculateLoan, units_calculateMarginMarkup as calculateMarginMarkup, units_calculatePercentageChange as calculatePercentageChange, units_calculateRuleOf72 as calculateRuleOf72, 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_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_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 };
|
|
760
785
|
}
|
|
761
786
|
|
|
762
|
-
export { type
|
|
787
|
+
export { type TaxDirection as $, type AmortizationRow as A, BASE_LABELS as B, COMMON_CURRENCIES as C, type Dimensions as D, type FormatOptions as E, type FilePermissions as F, type IpConversion as G, type IsbnFormat as H, type IbanValidationResult as I, type IsbnResult as J, type MarginMarkupInput as K, type LoanResult as L, type MarginMarkupField as M, type MarginMarkupResult as N, type NotationStyle as O, type NumberBase as P, type PercentChangeDirection as Q, type PercentageChangeResult as R, type Permission as S, type PxConvertResult as T, type RuleOf72Direction as U, type RuleOf72Result as V, type SemverVersion as W, type SimpleInterestResult as X, type SubnetInfo as Y, type SuccessiveDiscountResult as Z, type SuccessiveDiscountStep as _, type AprApyDirection as a, pxToAll as a$, type TaxResult as a0, type TimeValueDirection as a1, type TimeValueResult as a2, type TipSplitResult as a3, type VideoBitrateInput as a4, type VideoBitrateMode as a5, type VideoBitrateResult as a6, type ViewportConvertResult as a7, applySuccessiveDiscounts as a8, autoFormat as a9, formatValue as aA, formatVwValue as aB, formatWithSeparator as aC, gcd as aD, ipFromBinary as aE, ipFromDecimal as aF, ipFromHex as aG, ipToBinary as aH, ipToDecimal as aI, ipToDecimalCidr as aJ, ipToHex as aK, ipToOctal as aL, isValid as aM, isValidCidr as aN, isValidIp as aO, isValidIpv4 as aP, marginToMarkup as aQ, markupToMargin as aR, octalToPermissions as aS, parseFileSize as aT, parseInput as aU, parseNumberString as aV, parseSemver as aW, permissionsToChmod as aX, permissionsToOctal as aY, permissionsToSymbolic as aZ, ptToPx as a_, bumpVersion as aa, calcAspectRatio as ab, calcSubnet as ac, calculateBreakEven as ad, calculateCompoundInterest as ae, calculateDiscount as af, calculateLoan as ag, calculateMarginMarkup as ah, calculatePercentageChange as ai, calculateRuleOf72 as aj, calculateSimpleInterest as ak, calculateTax as al, calculateTimeValue as am, calculateTipSplit as an, calculateVideoBitrate as ao, compareSemver as ap, convert as aq, convertAprApy as ar, convertBytes as as, convertIp as at, coverBox as au, decimalToIp as av, decimalToIpCidr as aw, describePermissions as ax, fitIntoBox as ay, formatNumber as az, type AprApyResult as b, pxToViewport as b0, remToPx as b1, satisfiesRange as b2, scaleByHeight as b3, scaleByWidth as b4, sortVersions as b5, splitSubnet as b6, symbolicToPermissions as b7, validateBarcode as b8, validateCardNumber as b9, validateIban as ba, validateIsbn as bb, viewportToPx as bc, type AspectRatioResult as c, BASE_PREFIXES as d, BYTE_UNITS as e, type BarcodeFormat as f, type BarcodeValidationResult as g, type BaseConvertResult as h, type BreakEvenInput as i, type BreakEvenResult as j, type ByteConvertResult as k, type ByteUnit as l, COMMON_LOCALES as m, COMMON_PERMISSIONS as n, COMMON_RATIOS as o, COMMON_SIZES as p, COMMON_TAX_RATES as q, COMMON_TIP_PERCENTAGES as r, COMMON_VIEWPORTS as s, type CardValidationResult as t, units as u, type CompoundInterestResult as v, type CompoundYearRow as w, type DiscountField as x, type DiscountInput as y, type DiscountResult as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utilix-tech/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.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",
|