@eternl/formats 0.9.14 → 0.9.16
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/LICENSE +177 -0
- package/README.md +3 -3
- package/dist/index.cjs +810 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +112 -0
- package/dist/index.d.mts +112 -0
- package/dist/index.mjs +759 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +23 -35
- package/dist/cjs/constants.js +0 -22
- package/dist/cjs/csv.js +0 -98
- package/dist/cjs/date.js +0 -70
- package/dist/cjs/display.js +0 -556
- package/dist/cjs/errors.js +0 -48
- package/dist/cjs/index.js +0 -31
- package/dist/cjs/internal/intl-cache.js +0 -92
- package/dist/cjs/internal/locale.js +0 -9
- package/dist/cjs/internal/numeric.js +0 -167
- package/dist/cjs/package.json +0 -3
- package/dist/cjs/types.js +0 -16
- package/dist/esm/constants.js +0 -20
- package/dist/esm/constants.js.map +0 -1
- package/dist/esm/csv.js +0 -92
- package/dist/esm/csv.js.map +0 -1
- package/dist/esm/date.js +0 -66
- package/dist/esm/date.js.map +0 -1
- package/dist/esm/display.js +0 -545
- package/dist/esm/display.js.map +0 -1
- package/dist/esm/errors.js +0 -42
- package/dist/esm/errors.js.map +0 -1
- package/dist/esm/index.js +0 -6
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/internal/intl-cache.js +0 -87
- package/dist/esm/internal/intl-cache.js.map +0 -1
- package/dist/esm/internal/locale.js +0 -6
- package/dist/esm/internal/locale.js.map +0 -1
- package/dist/esm/internal/numeric.js +0 -157
- package/dist/esm/internal/numeric.js.map +0 -1
- package/dist/esm/package.json +0 -3
- package/dist/esm/types.js +0 -14
- package/dist/esm/types.js.map +0 -1
- package/dist/types/constants.d.ts +0 -20
- package/dist/types/csv.d.ts +0 -5
- package/dist/types/date.d.ts +0 -3
- package/dist/types/display.d.ts +0 -7
- package/dist/types/errors.d.ts +0 -21
- package/dist/types/index.d.ts +0 -6
- package/dist/types/internal/intl-cache.d.ts +0 -17
- package/dist/types/internal/locale.d.ts +0 -1
- package/dist/types/internal/numeric.d.ts +0 -19
- package/dist/types/types.d.ts +0 -59
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDateFormat = exports.getNumberFormatPattern = exports.getNumberFormat = void 0;
|
|
4
|
-
const numberFormatCache = new Map();
|
|
5
|
-
const numberFormatMetaCache = new Map();
|
|
6
|
-
const dateFormatCache = new Map();
|
|
7
|
-
const serializeOptions = (options) => {
|
|
8
|
-
const entries = Object.entries(options)
|
|
9
|
-
.filter(([, value]) => value !== undefined)
|
|
10
|
-
.sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))
|
|
11
|
-
.map(([key, value]) => {
|
|
12
|
-
if (value
|
|
13
|
-
&& typeof value === 'object'
|
|
14
|
-
&& !Array.isArray(value)) {
|
|
15
|
-
return `${key}:{${serializeOptions(value)}}`;
|
|
16
|
-
}
|
|
17
|
-
if (Array.isArray(value)) {
|
|
18
|
-
return `${key}:[${value.join('|')}]`;
|
|
19
|
-
}
|
|
20
|
-
return `${key}:${String(value)}`;
|
|
21
|
-
});
|
|
22
|
-
return entries.join(',');
|
|
23
|
-
};
|
|
24
|
-
const buildNumberFormatKey = (locale, options) => `${locale}|${serializeOptions(options)}`;
|
|
25
|
-
const buildDateFormatKey = (locale, options) => `${locale}|${options ? serializeOptions(options) : ''}`;
|
|
26
|
-
const getNumberFormat = (locale, options) => {
|
|
27
|
-
const key = buildNumberFormatKey(locale, options);
|
|
28
|
-
const cached = numberFormatCache.get(key);
|
|
29
|
-
if (cached) {
|
|
30
|
-
return cached;
|
|
31
|
-
}
|
|
32
|
-
const nf = new Intl.NumberFormat(locale, options);
|
|
33
|
-
numberFormatCache.set(key, nf);
|
|
34
|
-
return nf;
|
|
35
|
-
};
|
|
36
|
-
exports.getNumberFormat = getNumberFormat;
|
|
37
|
-
const deriveGrouping = (parts) => {
|
|
38
|
-
const integerParts = parts.filter((part) => part.type === 'integer');
|
|
39
|
-
if (integerParts.length <= 1) {
|
|
40
|
-
return { primary: 0 };
|
|
41
|
-
}
|
|
42
|
-
const lengths = integerParts.map((part) => part.value.length);
|
|
43
|
-
const primary = lengths[lengths.length - 1];
|
|
44
|
-
const secondary = lengths.length > 1 ? lengths[lengths.length - 2] : undefined;
|
|
45
|
-
if (secondary === primary) {
|
|
46
|
-
return { primary };
|
|
47
|
-
}
|
|
48
|
-
return { primary, secondary };
|
|
49
|
-
};
|
|
50
|
-
const analyzePattern = (nf) => {
|
|
51
|
-
const sampleValue = 1234567.89123456;
|
|
52
|
-
const positiveParts = nf.formatToParts(sampleValue);
|
|
53
|
-
const negativeParts = nf.formatToParts(-sampleValue);
|
|
54
|
-
const plusProbe = nf.formatToParts(1);
|
|
55
|
-
const groupSeparator = positiveParts.find((part) => part.type === 'group')?.value ?? '';
|
|
56
|
-
const decimalSeparator = positiveParts.find((part) => part.type === 'decimal')?.value ?? '.';
|
|
57
|
-
const grouping = deriveGrouping(positiveParts);
|
|
58
|
-
const minusSign = negativeParts.find((part) => part.type === 'minusSign')?.value;
|
|
59
|
-
const plusSign = plusProbe.find((part) => part.type === 'plusSign')?.value;
|
|
60
|
-
return {
|
|
61
|
-
positive: positiveParts,
|
|
62
|
-
negative: negativeParts,
|
|
63
|
-
groupSeparator,
|
|
64
|
-
decimalSeparator,
|
|
65
|
-
grouping,
|
|
66
|
-
minusSign,
|
|
67
|
-
plusSign
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
const getNumberFormatPattern = (locale, options) => {
|
|
71
|
-
const key = buildNumberFormatKey(locale, options);
|
|
72
|
-
const cached = numberFormatMetaCache.get(key);
|
|
73
|
-
if (cached) {
|
|
74
|
-
return cached;
|
|
75
|
-
}
|
|
76
|
-
const nf = (0, exports.getNumberFormat)(locale, options);
|
|
77
|
-
const pattern = analyzePattern(nf);
|
|
78
|
-
numberFormatMetaCache.set(key, pattern);
|
|
79
|
-
return pattern;
|
|
80
|
-
};
|
|
81
|
-
exports.getNumberFormatPattern = getNumberFormatPattern;
|
|
82
|
-
const getDateFormat = (locale, options) => {
|
|
83
|
-
const key = buildDateFormatKey(locale, options);
|
|
84
|
-
const cached = dateFormatCache.get(key);
|
|
85
|
-
if (cached) {
|
|
86
|
-
return cached;
|
|
87
|
-
}
|
|
88
|
-
const df = new Intl.DateTimeFormat(locale, options);
|
|
89
|
-
dateFormatCache.set(key, df);
|
|
90
|
-
return df;
|
|
91
|
-
};
|
|
92
|
-
exports.getDateFormat = getDateFormat;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveLocale = void 0;
|
|
4
|
-
const constants_1 = require("../constants");
|
|
5
|
-
const resolveLocale = (value) => {
|
|
6
|
-
const candidate = value?.trim();
|
|
7
|
-
return candidate && candidate.length > 0 ? candidate : constants_1.DEFAULT_LOCALE;
|
|
8
|
-
};
|
|
9
|
-
exports.resolveLocale = resolveLocale;
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.applyGrouping = exports.bigToDecimalString = exports.computeNumericParts = exports.toFixedNoSci = exports.normalizeNumeric = void 0;
|
|
7
|
-
const big_js_1 = __importDefault(require("big.js"));
|
|
8
|
-
const constants_1 = require("../constants");
|
|
9
|
-
const errors_1 = require("../errors");
|
|
10
|
-
const BIG_ZERO = new big_js_1.default(0);
|
|
11
|
-
const ROUNDING_MODE_MAP = {
|
|
12
|
-
roundDown: big_js_1.default.roundDown,
|
|
13
|
-
roundHalfUp: big_js_1.default.roundHalfUp,
|
|
14
|
-
roundHalfEven: big_js_1.default.roundHalfEven,
|
|
15
|
-
roundUp: big_js_1.default.roundUp
|
|
16
|
-
};
|
|
17
|
-
const assertNonNegativeInteger = (value, label) => {
|
|
18
|
-
if (value === undefined) {
|
|
19
|
-
return undefined;
|
|
20
|
-
}
|
|
21
|
-
if (!Number.isInteger(value) || value < 0) {
|
|
22
|
-
throw (0, errors_1.toRangeError)(errors_1.FormatError.NonNegativeIntegerRequired, { label });
|
|
23
|
-
}
|
|
24
|
-
return value;
|
|
25
|
-
};
|
|
26
|
-
const assertPositiveInteger = (value, label) => {
|
|
27
|
-
if (value === undefined) {
|
|
28
|
-
return undefined;
|
|
29
|
-
}
|
|
30
|
-
if (!Number.isInteger(value) || value <= 0) {
|
|
31
|
-
throw (0, errors_1.toRangeError)(errors_1.FormatError.PositiveIntegerRequired, { label });
|
|
32
|
-
}
|
|
33
|
-
return value;
|
|
34
|
-
};
|
|
35
|
-
const isZeroString = (input) => {
|
|
36
|
-
return /^[-+]?0+(?:\.0+)?$/.test(input);
|
|
37
|
-
};
|
|
38
|
-
const normalizeNumeric = (value, clone = false) => {
|
|
39
|
-
if (value instanceof big_js_1.default) {
|
|
40
|
-
return clone ? new big_js_1.default(value) : value;
|
|
41
|
-
}
|
|
42
|
-
if (typeof value === 'number') {
|
|
43
|
-
if (!Number.isFinite(value)) {
|
|
44
|
-
throw (0, errors_1.toRangeError)(errors_1.FormatError.NumericValueNonFinite);
|
|
45
|
-
}
|
|
46
|
-
return value === 0 ? BIG_ZERO : new big_js_1.default(value);
|
|
47
|
-
}
|
|
48
|
-
if (typeof value === 'string') {
|
|
49
|
-
const trimmed = value.trim();
|
|
50
|
-
if (!trimmed) {
|
|
51
|
-
throw (0, errors_1.toRangeError)(errors_1.FormatError.NumericStringEmpty);
|
|
52
|
-
}
|
|
53
|
-
if (isZeroString(trimmed)) {
|
|
54
|
-
return BIG_ZERO;
|
|
55
|
-
}
|
|
56
|
-
return new big_js_1.default(trimmed);
|
|
57
|
-
}
|
|
58
|
-
throw (0, errors_1.toTypeError)(errors_1.FormatError.UnsupportedNumericInput);
|
|
59
|
-
};
|
|
60
|
-
exports.normalizeNumeric = normalizeNumeric;
|
|
61
|
-
const mapRoundingMode = (mode) => {
|
|
62
|
-
if (!mode) {
|
|
63
|
-
return big_js_1.default.roundHalfUp;
|
|
64
|
-
}
|
|
65
|
-
return ROUNDING_MODE_MAP[mode];
|
|
66
|
-
};
|
|
67
|
-
const toFixedNoSci = (value, fractionDigits, roundingMode) => {
|
|
68
|
-
const rm = mapRoundingMode(roundingMode);
|
|
69
|
-
let working = value;
|
|
70
|
-
if (fractionDigits !== undefined) {
|
|
71
|
-
working = working.round(fractionDigits, rm);
|
|
72
|
-
}
|
|
73
|
-
return (0, exports.bigToDecimalString)(working);
|
|
74
|
-
};
|
|
75
|
-
exports.toFixedNoSci = toFixedNoSci;
|
|
76
|
-
const computeNumericParts = (value, options = {}) => {
|
|
77
|
-
const minDecimals = assertNonNegativeInteger(options.minDecimals, 'minDecimals') ?? 0;
|
|
78
|
-
const maxDecimals = assertNonNegativeInteger(options.maxDecimals, 'maxDecimals');
|
|
79
|
-
const precision = assertPositiveInteger(options.precision, 'precision');
|
|
80
|
-
const roundingMode = mapRoundingMode(options.roundingMode);
|
|
81
|
-
if (maxDecimals !== undefined && maxDecimals < minDecimals) {
|
|
82
|
-
throw (0, errors_1.toRangeError)(errors_1.FormatError.MaxDecimalsLessThanMinimum);
|
|
83
|
-
}
|
|
84
|
-
let bigValue = (0, exports.normalizeNumeric)(value);
|
|
85
|
-
if (precision !== undefined) {
|
|
86
|
-
bigValue = bigValue.prec(precision, roundingMode);
|
|
87
|
-
}
|
|
88
|
-
if (maxDecimals !== undefined) {
|
|
89
|
-
bigValue = bigValue.round(maxDecimals, roundingMode);
|
|
90
|
-
}
|
|
91
|
-
const isZero = bigValue.eq(0);
|
|
92
|
-
const isNegative = !isZero && bigValue.s < 0;
|
|
93
|
-
const canonical = (0, exports.bigToDecimalString)(bigValue.abs());
|
|
94
|
-
let [integerPart, fractionPart = constants_1.DECIMAL_EMPTY] = canonical.split(constants_1.DECIMAL_DOT);
|
|
95
|
-
integerPart = integerPart.replace(/^(0+)(\d)/, '$2');
|
|
96
|
-
if (!integerPart) {
|
|
97
|
-
integerPart = constants_1.DECIMAL_ZERO;
|
|
98
|
-
}
|
|
99
|
-
if (!options.trimTrailingZeros && fractionPart.length < minDecimals) {
|
|
100
|
-
fractionPart = fractionPart.padEnd(minDecimals, constants_1.DECIMAL_ZERO);
|
|
101
|
-
}
|
|
102
|
-
if (maxDecimals !== undefined && fractionPart.length > maxDecimals) {
|
|
103
|
-
fractionPart = fractionPart.slice(0, maxDecimals);
|
|
104
|
-
}
|
|
105
|
-
if (options.trimTrailingZeros) {
|
|
106
|
-
const minKeep = minDecimals;
|
|
107
|
-
while (fractionPart.length > minKeep && fractionPart.endsWith(constants_1.DECIMAL_ZERO)) {
|
|
108
|
-
fractionPart = fractionPart.slice(0, -1);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
return {
|
|
112
|
-
big: bigValue,
|
|
113
|
-
integer: integerPart,
|
|
114
|
-
fraction: fractionPart,
|
|
115
|
-
isNegative,
|
|
116
|
-
isZero
|
|
117
|
-
};
|
|
118
|
-
};
|
|
119
|
-
exports.computeNumericParts = computeNumericParts;
|
|
120
|
-
const bigToDecimalString = (value) => {
|
|
121
|
-
const coefficient = (value.c ?? [0]);
|
|
122
|
-
const exponent = value.e ?? 0;
|
|
123
|
-
const sign = value.s < 0 ? constants_1.DEFAULT_SIGN_MINUS : constants_1.DECIMAL_EMPTY;
|
|
124
|
-
if (coefficient.every((digit) => digit === 0)) {
|
|
125
|
-
return constants_1.DECIMAL_ZERO;
|
|
126
|
-
}
|
|
127
|
-
const digits = coefficient.join('');
|
|
128
|
-
const decimalIndex = exponent + 1;
|
|
129
|
-
if (decimalIndex <= 0) {
|
|
130
|
-
const zeros = constants_1.DECIMAL_ZERO.repeat(Math.abs(decimalIndex));
|
|
131
|
-
return `${sign}${constants_1.DECIMAL_ZERO}${constants_1.DECIMAL_DOT}${zeros}${digits}`.replace(/\.$/, constants_1.DECIMAL_EMPTY);
|
|
132
|
-
}
|
|
133
|
-
if (decimalIndex >= digits.length) {
|
|
134
|
-
const zeros = constants_1.DECIMAL_ZERO.repeat(decimalIndex - digits.length);
|
|
135
|
-
return `${sign}${digits}${zeros}`;
|
|
136
|
-
}
|
|
137
|
-
const integerPart = digits.slice(0, decimalIndex);
|
|
138
|
-
const fractionPart = digits.slice(decimalIndex);
|
|
139
|
-
return `${sign}${integerPart}${constants_1.DECIMAL_DOT}${fractionPart}`;
|
|
140
|
-
};
|
|
141
|
-
exports.bigToDecimalString = bigToDecimalString;
|
|
142
|
-
const applyGrouping = (integer, grouping, enableGrouping) => {
|
|
143
|
-
if (!enableGrouping || grouping.primary === 0 || integer.length <= grouping.primary) {
|
|
144
|
-
return integer;
|
|
145
|
-
}
|
|
146
|
-
const groups = [];
|
|
147
|
-
const primary = grouping.primary;
|
|
148
|
-
const secondary = grouping.secondary ?? primary;
|
|
149
|
-
let index = integer.length;
|
|
150
|
-
let usePrimary = true;
|
|
151
|
-
while (index > 0) {
|
|
152
|
-
const size = usePrimary ? primary : secondary;
|
|
153
|
-
if (size <= 0) {
|
|
154
|
-
groups.unshift(integer.slice(0, index));
|
|
155
|
-
break;
|
|
156
|
-
}
|
|
157
|
-
const start = Math.max(index - size, 0);
|
|
158
|
-
groups.unshift(integer.slice(start, index));
|
|
159
|
-
index = start;
|
|
160
|
-
if (index <= 0) {
|
|
161
|
-
break;
|
|
162
|
-
}
|
|
163
|
-
usePrimary = false;
|
|
164
|
-
}
|
|
165
|
-
return groups.join(grouping.separator);
|
|
166
|
-
};
|
|
167
|
-
exports.applyGrouping = applyGrouping;
|
package/dist/cjs/package.json
DELETED
package/dist/cjs/types.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.COMPACT_UNITS = exports.SIGN_DISPLAYS = exports.NUMBER_STYLES = void 0;
|
|
4
|
-
exports.NUMBER_STYLES = {
|
|
5
|
-
decimal: 'decimal',
|
|
6
|
-
currency: 'currency',
|
|
7
|
-
percent: 'percent'
|
|
8
|
-
};
|
|
9
|
-
exports.SIGN_DISPLAYS = {
|
|
10
|
-
auto: 'auto',
|
|
11
|
-
always: 'always',
|
|
12
|
-
exceptZero: 'exceptZero',
|
|
13
|
-
never: 'never',
|
|
14
|
-
negative: 'negative'
|
|
15
|
-
};
|
|
16
|
-
exports.COMPACT_UNITS = ['K', 'M', 'B', 'T'];
|
package/dist/esm/constants.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { COMPACT_UNITS, NUMBER_STYLES } from './types';
|
|
2
|
-
export const STYLE_DECIMAL = NUMBER_STYLES.decimal;
|
|
3
|
-
export const STYLE_CURRENCY = NUMBER_STYLES.currency;
|
|
4
|
-
export const STYLE_PERCENT = NUMBER_STYLES.percent;
|
|
5
|
-
export const DEFAULT_LOCALE = 'en-US';
|
|
6
|
-
export const DISPLAY_SIGNS = {
|
|
7
|
-
minus: 'minus',
|
|
8
|
-
plus: 'plus',
|
|
9
|
-
none: 'none'
|
|
10
|
-
};
|
|
11
|
-
export const DISPLAY_SIGN_MINUS = DISPLAY_SIGNS.minus;
|
|
12
|
-
export const DISPLAY_SIGN_PLUS = DISPLAY_SIGNS.plus;
|
|
13
|
-
export const DISPLAY_SIGN_NONE = DISPLAY_SIGNS.none;
|
|
14
|
-
export const COMPACT_ORDER = [...COMPACT_UNITS].reverse();
|
|
15
|
-
export const DEFAULT_SIGN_MINUS = '-';
|
|
16
|
-
export const DEFAULT_SIGN_PLUS = '+';
|
|
17
|
-
export const DECIMAL_ZERO = '0';
|
|
18
|
-
export const DECIMAL_EMPTY = '';
|
|
19
|
-
export const DECIMAL_DOT = '.';
|
|
20
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,aAAa,EACb,aAAa,EACd,MAAkC,SAAS,CAAA;AAE5C,MAAM,CAAC,MAAM,aAAa,GAAkB,aAAa,CAAC,OAAO,CAAA;AACjE,MAAM,CAAC,MAAM,cAAc,GAAiB,aAAa,CAAC,QAAQ,CAAA;AAClE,MAAM,CAAC,MAAM,aAAa,GAAkB,aAAa,CAAC,OAAO,CAAA;AAEjE,MAAM,CAAC,MAAM,cAAc,GAAK,OAAO,CAAA;AAEvC,MAAM,CAAC,MAAM,aAAa,GAAM;IAE9B,KAAK,EAAuB,OAAO;IACnC,IAAI,EAAwB,MAAM;IAClC,IAAI,EAAwB,MAAM;CAE1B,CAAA;AAIV,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAAC,KAAK,CAAA;AACrD,MAAM,CAAC,MAAM,iBAAiB,GAAI,aAAa,CAAC,IAAI,CAAA;AACpD,MAAM,CAAC,MAAM,iBAAiB,GAAI,aAAa,CAAC,IAAI,CAAA;AAEpD,MAAM,CAAC,MAAM,aAAa,GAAkB,CAAC,GAAG,aAAa,CAAC,CAAC,OAAO,EAAmB,CAAA;AAEzF,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAA;AACrC,MAAM,CAAC,MAAM,iBAAiB,GAAI,GAAG,CAAA;AAErC,MAAM,CAAC,MAAM,YAAY,GAAS,GAAG,CAAA;AACrC,MAAM,CAAC,MAAM,aAAa,GAAQ,EAAE,CAAA;AACpC,MAAM,CAAC,MAAM,WAAW,GAAU,GAAG,CAAA"}
|
package/dist/esm/csv.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { DECIMAL_DOT, DECIMAL_EMPTY, DECIMAL_ZERO, DEFAULT_SIGN_MINUS, STYLE_DECIMAL } from './constants';
|
|
2
|
-
import { formatCsvDate } from './date';
|
|
3
|
-
import { computeNumericParts, normalizeNumeric } from './internal/numeric';
|
|
4
|
-
import { getNumberFormatPattern } from './internal/intl-cache';
|
|
5
|
-
import { resolveLocale } from './internal/locale';
|
|
6
|
-
const resolveDecimalDelimiter = (options) => {
|
|
7
|
-
if (options.decimalDelimiter !== undefined) {
|
|
8
|
-
return options.decimalDelimiter;
|
|
9
|
-
}
|
|
10
|
-
if (options.locale) {
|
|
11
|
-
const locale = resolveLocale(options.locale);
|
|
12
|
-
const pattern = getNumberFormatPattern(locale, { style: STYLE_DECIMAL });
|
|
13
|
-
return pattern.decimalSeparator;
|
|
14
|
-
}
|
|
15
|
-
return DECIMAL_DOT;
|
|
16
|
-
};
|
|
17
|
-
const stringifyNumericParts = (parts, decimalDelimiter = DECIMAL_DOT) => {
|
|
18
|
-
const fraction = parts.fraction.length > 0 ? `${decimalDelimiter}${parts.fraction}` : DECIMAL_EMPTY;
|
|
19
|
-
const integer = parts.integer || DECIMAL_ZERO;
|
|
20
|
-
const prefix = parts.isNegative ? DEFAULT_SIGN_MINUS : DECIMAL_EMPTY;
|
|
21
|
-
const value = `${prefix}${integer}${fraction}`;
|
|
22
|
-
return value;
|
|
23
|
-
};
|
|
24
|
-
export const formatCsvNumber = (value, options = {}) => {
|
|
25
|
-
const parts = computeNumericParts(value, options);
|
|
26
|
-
const delimiter = resolveDecimalDelimiter(options);
|
|
27
|
-
return stringifyNumericParts(parts, delimiter);
|
|
28
|
-
};
|
|
29
|
-
export const formatCsvPercent = (value, options = {}) => {
|
|
30
|
-
const scaled = normalizeNumeric(value).times(100);
|
|
31
|
-
const parts = computeNumericParts(scaled, options);
|
|
32
|
-
const delimiter = resolveDecimalDelimiter(options);
|
|
33
|
-
return stringifyNumericParts(parts, delimiter);
|
|
34
|
-
};
|
|
35
|
-
export const csvCurrencyCode = (code, customSymbols, useSymbol) => {
|
|
36
|
-
const trimmed = code.trim();
|
|
37
|
-
if (!trimmed) {
|
|
38
|
-
return DECIMAL_EMPTY;
|
|
39
|
-
}
|
|
40
|
-
const normalized = trimmed.toUpperCase();
|
|
41
|
-
if (useSymbol) {
|
|
42
|
-
const symbol = customSymbols?.[normalized];
|
|
43
|
-
if (symbol) {
|
|
44
|
-
return symbol;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return normalized;
|
|
48
|
-
};
|
|
49
|
-
const escapeCsvField = (value, delimiter) => {
|
|
50
|
-
const needsQuoting = value.includes(delimiter)
|
|
51
|
-
|| value.includes('\n')
|
|
52
|
-
|| value.includes('\r')
|
|
53
|
-
|| value.includes('"');
|
|
54
|
-
if (!needsQuoting) {
|
|
55
|
-
return value;
|
|
56
|
-
}
|
|
57
|
-
const escaped = value.replace(/"/g, '""');
|
|
58
|
-
return `"${escaped}"`;
|
|
59
|
-
};
|
|
60
|
-
const defaultFormatter = (value) => {
|
|
61
|
-
if (value === null || value === undefined) {
|
|
62
|
-
return DECIMAL_EMPTY;
|
|
63
|
-
}
|
|
64
|
-
if (value instanceof Date) {
|
|
65
|
-
return formatCsvDate(value);
|
|
66
|
-
}
|
|
67
|
-
if (typeof value === 'number') {
|
|
68
|
-
return formatCsvNumber(value);
|
|
69
|
-
}
|
|
70
|
-
if (typeof value === 'string') {
|
|
71
|
-
return value;
|
|
72
|
-
}
|
|
73
|
-
if (typeof value === 'boolean') {
|
|
74
|
-
return value ? 'true' : 'false';
|
|
75
|
-
}
|
|
76
|
-
return String(value);
|
|
77
|
-
};
|
|
78
|
-
export const buildCsv = (rows, columns, delimiter = ',', lineEnding = '\n') => {
|
|
79
|
-
const headerLine = columns.map((col) => escapeCsvField(col.header, delimiter)).join(delimiter);
|
|
80
|
-
const lines = [headerLine];
|
|
81
|
-
for (const row of rows) {
|
|
82
|
-
const fields = columns.map((col) => {
|
|
83
|
-
const raw = col.accessor(row);
|
|
84
|
-
const formatted = col.formatter ? col.formatter(raw) : defaultFormatter(raw);
|
|
85
|
-
const stringValue = formatted ?? DECIMAL_EMPTY;
|
|
86
|
-
return escapeCsvField(stringValue, delimiter);
|
|
87
|
-
});
|
|
88
|
-
lines.push(fields.join(delimiter));
|
|
89
|
-
}
|
|
90
|
-
return `${lines.join(lineEnding)}${lineEnding}`;
|
|
91
|
-
};
|
|
92
|
-
//# sourceMappingURL=csv.js.map
|
package/dist/esm/csv.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"csv.js","sourceRoot":"","sources":["../../src/csv.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,WAAW,EACX,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACd,MAAkC,aAAa,CAAA;AAChD,OAAO,EACL,aAAa,EACd,MAAkC,QAAQ,CAAA;AAC3C,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EACjB,MAAkC,oBAAoB,CAAA;AACvD,OAAO,EACL,sBAAsB,EACvB,MAAkC,uBAAuB,CAAA;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAW,mBAAmB,CAAA;AAEtD,MAAM,uBAAuB,GAAG,CAAC,OAAkC,EAAU,EAAE;IAE7E,IAAI,OAAO,CAAC,gBAAgB,KAAK,SAAS,EAAE,CAAC;QAE3C,OAAO,OAAO,CAAC,gBAAgB,CAAA;IACjC,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QAEnB,MAAM,MAAM,GAAgB,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QACzD,MAAM,OAAO,GAAe,sBAAsB,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC,CAAA;QAEpF,OAAO,OAAO,CAAC,gBAAgB,CAAA;IACjC,CAAC;IAED,OAAO,WAAW,CAAA;AACpB,CAAC,CAAA;AAED,MAAM,qBAAqB,GAAK,CAAC,KAAyD,EACzD,mBAA4B,WAAW,EAAU,EAAE;IAElF,MAAM,QAAQ,GAAgB,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,gBAAgB,GAAG,KAAK,CAAC,QAAQ,EAAE,C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CAAC,OAAO,CAAA;IACjC,CAAC;IAED,OAAO,MAAM,CAAC,KAAK,CAAC,CAAA;AACtB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAW,CAAI,IAAgB,EAChB,OAA+B,EAC/B,YAAsB,GAAG,EACzB,aAAsB,IAAI,EAAU,EAAE;IAExE,MAAM,UAAU,GAAc,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IACzG,MAAM,KAAK,GAAmB,CAAC,UAAU,CAAC,CAAA;IAE1C,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QAEvB,MAAM,MAAM,GAAgB,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;YAE9C,MAAM,GAAG,GAAiB,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;YAC3C,MAAM,SAAS,GAAW,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAA;YACpF,MAAM,WAAW,GAAS,SAAS,IAAI,aAAa,CAAA;YAEpD,OAAO,cAAc,CAAC,WAAW,EAAE,SAAS,CAAC,CAAA;QAC/C,CAAC,CAAC,CAAA;QAEF,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAA;IACpC,CAAC;IAED,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,UAAU,EAAE,CAAA;AACjD,CAAC,CAAA"}
|
package/dist/esm/date.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { FormatError, toRangeError, toTypeError } from './errors';
|
|
2
|
-
import { getDateFormat } from './internal/intl-cache';
|
|
3
|
-
import { resolveLocale } from './internal/locale';
|
|
4
|
-
const toDate = (value) => {
|
|
5
|
-
if (value instanceof Date) {
|
|
6
|
-
const timestamp = value.getTime();
|
|
7
|
-
if (Number.isNaN(timestamp)) {
|
|
8
|
-
throw toRangeError(FormatError.DateValueInvalid);
|
|
9
|
-
}
|
|
10
|
-
return new Date(timestamp);
|
|
11
|
-
}
|
|
12
|
-
if (typeof value === 'number') {
|
|
13
|
-
if (!Number.isFinite(value)) {
|
|
14
|
-
throw toRangeError(FormatError.DateNumberNonFinite);
|
|
15
|
-
}
|
|
16
|
-
const date = new Date(value);
|
|
17
|
-
if (Number.isNaN(date.getTime())) {
|
|
18
|
-
throw toRangeError(FormatError.DateValueInvalid);
|
|
19
|
-
}
|
|
20
|
-
return date;
|
|
21
|
-
}
|
|
22
|
-
if (typeof value === 'string') {
|
|
23
|
-
const trimmed = value.trim();
|
|
24
|
-
if (!trimmed) {
|
|
25
|
-
throw toRangeError(FormatError.DateStringEmpty);
|
|
26
|
-
}
|
|
27
|
-
const date = new Date(trimmed);
|
|
28
|
-
if (Number.isNaN(date.getTime())) {
|
|
29
|
-
throw toRangeError(FormatError.InvalidDateString);
|
|
30
|
-
}
|
|
31
|
-
return date;
|
|
32
|
-
}
|
|
33
|
-
throw toTypeError(FormatError.UnsupportedDateInput);
|
|
34
|
-
};
|
|
35
|
-
export const formatDisplayDate = (date, locale, options) => {
|
|
36
|
-
const resolvedLocale = resolveLocale(locale);
|
|
37
|
-
const parsed = toDate(date);
|
|
38
|
-
const formatter = getDateFormat(resolvedLocale, options);
|
|
39
|
-
return formatter.format(parsed);
|
|
40
|
-
};
|
|
41
|
-
export const formatCsvDate = (date, options) => {
|
|
42
|
-
const parsed = toDate(date);
|
|
43
|
-
const format = options?.format ?? 'iso';
|
|
44
|
-
if (format === 'utc-datetime') {
|
|
45
|
-
const year = parsed.getUTCFullYear();
|
|
46
|
-
const month = String(parsed.getUTCMonth() + 1).padStart(2, '0');
|
|
47
|
-
const day = String(parsed.getUTCDate()).padStart(2, '0');
|
|
48
|
-
const hours = String(parsed.getUTCHours()).padStart(2, '0');
|
|
49
|
-
const minutes = String(parsed.getUTCMinutes()).padStart(2, '0');
|
|
50
|
-
const seconds = String(parsed.getUTCSeconds()).padStart(2, '0');
|
|
51
|
-
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
52
|
-
}
|
|
53
|
-
const iso = parsed.toISOString();
|
|
54
|
-
const datePart = iso.slice(0, 10);
|
|
55
|
-
const hasTime = parsed.getUTCHours() !== 0
|
|
56
|
-
|| parsed.getUTCMinutes() !== 0
|
|
57
|
-
|| parsed.getUTCSeconds() !== 0
|
|
58
|
-
|| parsed.getUTCMilliseconds() !== 0;
|
|
59
|
-
if (!hasTime) {
|
|
60
|
-
return datePart;
|
|
61
|
-
}
|
|
62
|
-
const timePart = iso.slice(11);
|
|
63
|
-
const withoutMillis = timePart.replace(/\.\d+Z$/, 'Z');
|
|
64
|
-
return `${datePart}T${withoutMillis}`;
|
|
65
|
-
};
|
|
66
|
-
//# sourceMappingURL=date.js.map
|
package/dist/esm/date.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"date.js","sourceRoot":"","sources":["../../src/date.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,YAAY,EACZ,WAAW,EACZ,MAAkC,UAAU,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAW,uBAAuB,CAAA;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAW,mBAAmB,CAAA;AAEtD,MAAM,MAAM,GAAoB,CAAC,KAA6B,EAAQ,EAAE;IAEtE,IAAI,KAAK,YAAY,IAAI,EAAE,CAAC;QAE1B,MAAM,SAAS,GAAa,KAAK,CAAC,OAAO,EAAE,CAAA;QAE3C,IAAI,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC;YAE5B,MAAM,YAAY,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAA;QAClD,CAAC;QAED,OAAO,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