@particle-academy/holy-sheet 2.11.0 → 2.11.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/CHANGELOG.md +20 -0
- package/dist/{chunk-OL6E7DE5.js → chunk-NQRZFV32.js} +17 -6
- package/dist/chunk-NQRZFV32.js.map +1 -0
- package/dist/cli.cjs +15 -4
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.cjs +15 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -2
- package/dist/index.d.ts +10 -2
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-OL6E7DE5.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { Agent, readFileBounded, OfficeTemplateRefused, ArchiveRefused, UnsupportedFormatException, sourceKind, SourceArchive } from './chunk-
|
|
2
|
+
import { Agent, readFileBounded, OfficeTemplateRefused, ArchiveRefused, UnsupportedFormatException, sourceKind, SourceArchive } from './chunk-NQRZFV32.js';
|
|
3
3
|
import { existsSync, realpathSync, statSync, writeFileSync, renameSync, unlinkSync } from 'fs';
|
|
4
4
|
import { randomBytes } from 'crypto';
|
|
5
5
|
|
package/dist/index.cjs
CHANGED
|
@@ -787,7 +787,7 @@ var Normalizer = class {
|
|
|
787
787
|
address,
|
|
788
788
|
new Cell(
|
|
789
789
|
address,
|
|
790
|
-
this.coerceValue(rawValue, format, address, sheetName2),
|
|
790
|
+
this.coerceValue(rawValue, format, address, sheetName2, true),
|
|
791
791
|
cellData?.formula ?? null,
|
|
792
792
|
format,
|
|
793
793
|
comment,
|
|
@@ -880,7 +880,7 @@ var Normalizer = class {
|
|
|
880
880
|
const rawValue = value.value ?? null;
|
|
881
881
|
return new Cell(
|
|
882
882
|
address,
|
|
883
|
-
this.coerceValue(rawValue, merged, address, sheetName2),
|
|
883
|
+
this.coerceValue(rawValue, merged, address, sheetName2, true),
|
|
884
884
|
value.formula ?? null,
|
|
885
885
|
merged,
|
|
886
886
|
comment,
|
|
@@ -895,7 +895,15 @@ var Normalizer = class {
|
|
|
895
895
|
columnFormat
|
|
896
896
|
);
|
|
897
897
|
}
|
|
898
|
-
|
|
898
|
+
/**
|
|
899
|
+
* `explicit`: the value came from an object cell's `value` key. An explicit
|
|
900
|
+
* string is the caller saying "this text, exactly", so it is never coerced
|
|
901
|
+
* to a number: `{value: "+1"}` stays "+1" and `{value: "007"}` stays "007".
|
|
902
|
+
* Only a date/datetime display format still turns a string into a serial,
|
|
903
|
+
* because that conversion is what the format asks for. Bare values keep
|
|
904
|
+
* numeric-string coercion. Mirrors PHP `Normalizer::coerceValue`.
|
|
905
|
+
*/
|
|
906
|
+
coerceValue(value, format, address = "?", sheetName2, explicit = false) {
|
|
899
907
|
if (value === null || value === void 0) return null;
|
|
900
908
|
const df = format?.displayFormat;
|
|
901
909
|
if (df === "date" || df === "datetime") {
|
|
@@ -903,6 +911,9 @@ var Normalizer = class {
|
|
|
903
911
|
return DateConverter.toSerial(value, df === "datetime");
|
|
904
912
|
}
|
|
905
913
|
}
|
|
914
|
+
if (explicit && typeof value === "string") {
|
|
915
|
+
return value;
|
|
916
|
+
}
|
|
906
917
|
if (typeof value === "string" && isNumericString(value)) {
|
|
907
918
|
return numericStringToNumber(value);
|
|
908
919
|
}
|
|
@@ -6677,7 +6688,7 @@ var holy_sheet_schema_default = {
|
|
|
6677
6688
|
};
|
|
6678
6689
|
|
|
6679
6690
|
// src/agent.ts
|
|
6680
|
-
var VERSION = "2.11.
|
|
6691
|
+
var VERSION = "2.11.1";
|
|
6681
6692
|
function toU8(input) {
|
|
6682
6693
|
return input instanceof Uint8Array ? input : new Uint8Array(input);
|
|
6683
6694
|
}
|