@alosha/xlsx 0.3.0 → 0.3.1
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/README.md +3 -2
- package/dist/compat.cjs +32 -0
- package/dist/compat.cjs.map +1 -1
- package/dist/compat.js +32 -0
- package/dist/compat.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -159,8 +159,9 @@ behavioural notes to check before porting.
|
|
|
159
159
|
- **No drawings, images, or charts.** These parts are ignored on read and not emitted on write.
|
|
160
160
|
- **No data validation, conditional formatting, or comments** yet.
|
|
161
161
|
|
|
162
|
-
See [`BENCHMARKS.md`](
|
|
163
|
-
|
|
162
|
+
See [`BENCHMARKS.md`](https://github.com/avlisodraude/alosha-xlsx/blob/main/BENCHMARKS.md) for
|
|
163
|
+
write/read throughput and output-size numbers against ExcelJS, and
|
|
164
|
+
[`CHANGELOG.md`](https://github.com/avlisodraude/alosha-xlsx/blob/main/CHANGELOG.md) for release notes.
|
|
164
165
|
|
|
165
166
|
## Development
|
|
166
167
|
|
package/dist/compat.cjs
CHANGED
|
@@ -3814,6 +3814,14 @@ function reflectGet(target, prop) {
|
|
|
3814
3814
|
}
|
|
3815
3815
|
return wrap(value);
|
|
3816
3816
|
}
|
|
3817
|
+
function eachWithEmptyFilter(each, isEmpty, optsOrCb, maybeCb) {
|
|
3818
|
+
const includeEmpty = typeof optsOrCb === "object" ? optsOrCb.includeEmpty === true : false;
|
|
3819
|
+
const cb = typeof optsOrCb === "function" ? optsOrCb : maybeCb;
|
|
3820
|
+
each({ includeEmpty }, (item, n) => {
|
|
3821
|
+
if (!includeEmpty && isEmpty(item)) return;
|
|
3822
|
+
cb(wrap(item), n);
|
|
3823
|
+
});
|
|
3824
|
+
}
|
|
3817
3825
|
function proxyCell(cell) {
|
|
3818
3826
|
const cached = cellProxies.get(cell);
|
|
3819
3827
|
if (cached) return cached;
|
|
@@ -3849,6 +3857,14 @@ function proxyRow(row) {
|
|
|
3849
3857
|
const proxy = new Proxy(row, {
|
|
3850
3858
|
get(target, prop) {
|
|
3851
3859
|
if (prop === RAW) return target;
|
|
3860
|
+
if (prop === "eachCell") {
|
|
3861
|
+
return (optsOrCb, maybeCb) => eachWithEmptyFilter(
|
|
3862
|
+
(o, cb) => target.eachCell(o, cb),
|
|
3863
|
+
(cell) => cell.type === 0 /* Null */,
|
|
3864
|
+
optsOrCb,
|
|
3865
|
+
maybeCb
|
|
3866
|
+
);
|
|
3867
|
+
}
|
|
3852
3868
|
return reflectGet(target, prop);
|
|
3853
3869
|
},
|
|
3854
3870
|
set(target, prop, value) {
|
|
@@ -3864,6 +3880,14 @@ function proxyColumn(column) {
|
|
|
3864
3880
|
const proxy = new Proxy(column, {
|
|
3865
3881
|
get(target, prop) {
|
|
3866
3882
|
if (prop === RAW) return target;
|
|
3883
|
+
if (prop === "eachCell") {
|
|
3884
|
+
return (optsOrCb, maybeCb) => eachWithEmptyFilter(
|
|
3885
|
+
(o, cb) => target.eachCell(o, cb),
|
|
3886
|
+
(cell) => cell.type === 0 /* Null */,
|
|
3887
|
+
optsOrCb,
|
|
3888
|
+
maybeCb
|
|
3889
|
+
);
|
|
3890
|
+
}
|
|
3867
3891
|
return reflectGet(target, prop);
|
|
3868
3892
|
},
|
|
3869
3893
|
set(target, prop, value) {
|
|
@@ -3888,6 +3912,14 @@ function proxyWorksheet(worksheet) {
|
|
|
3888
3912
|
COMPAT_DEFER
|
|
3889
3913
|
);
|
|
3890
3914
|
}
|
|
3915
|
+
if (prop === "eachRow") {
|
|
3916
|
+
return (optsOrCb, maybeCb) => eachWithEmptyFilter(
|
|
3917
|
+
(o, cb) => target.eachRow(o, cb),
|
|
3918
|
+
(row) => !row.hasValues,
|
|
3919
|
+
optsOrCb,
|
|
3920
|
+
maybeCb
|
|
3921
|
+
);
|
|
3922
|
+
}
|
|
3891
3923
|
return reflectGet(target, prop);
|
|
3892
3924
|
},
|
|
3893
3925
|
set(target, prop, value) {
|