@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 CHANGED
@@ -10,6 +10,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
10
10
 
11
11
  ## [Unreleased]
12
12
 
13
+ ## [2.11.1] - 2026-10-27
14
+
15
+ ### Fixed
16
+
17
+ - **An explicit `{value: <string>}` cell is now written as a string, exactly
18
+ as given**, matching PHP holy-sheet and holy-sheet-py. Numeric-string
19
+ coercion used to run on the object form too, so `{value: "+1"}` was written
20
+ as the number 1, `{value: "007"}` as 7 and `{value: "1e5"}` as 100000: a
21
+ phone prefix, zip code or part number lost its characters with no error.
22
+ This applies in `rows` and in the sparse `cells` map, under any column type
23
+ or number format, and to a `set_cell` op's `value`. Unchanged: a BARE string
24
+ in a row or a `cells` entry is still coerced (`"+1"` is still 1) and a bare
25
+ `"=..."` is still a formula; an object value that is already a number is
26
+ still a number; and a string under a `date` / `datetime` display format is
27
+ still converted to a date serial. `read()` returns such a cell as the same
28
+ string.
29
+ **What a consumer must do:** if you relied on `{value: "100"}` becoming a
30
+ number, pass the number (`{value: 100}`) or the bare string (`"100"`).
31
+ Otherwise nothing.
32
+
13
33
  ## [2.11.0] - 2026-10-27
14
34
 
15
35
  ### Added
@@ -780,7 +780,7 @@ var Normalizer = class {
780
780
  address,
781
781
  new Cell(
782
782
  address,
783
- this.coerceValue(rawValue, format, address, sheetName2),
783
+ this.coerceValue(rawValue, format, address, sheetName2, true),
784
784
  cellData?.formula ?? null,
785
785
  format,
786
786
  comment,
@@ -873,7 +873,7 @@ var Normalizer = class {
873
873
  const rawValue = value.value ?? null;
874
874
  return new Cell(
875
875
  address,
876
- this.coerceValue(rawValue, merged, address, sheetName2),
876
+ this.coerceValue(rawValue, merged, address, sheetName2, true),
877
877
  value.formula ?? null,
878
878
  merged,
879
879
  comment,
@@ -888,7 +888,15 @@ var Normalizer = class {
888
888
  columnFormat
889
889
  );
890
890
  }
891
- coerceValue(value, format, address = "?", sheetName2) {
891
+ /**
892
+ * `explicit`: the value came from an object cell's `value` key. An explicit
893
+ * string is the caller saying "this text, exactly", so it is never coerced
894
+ * to a number: `{value: "+1"}` stays "+1" and `{value: "007"}` stays "007".
895
+ * Only a date/datetime display format still turns a string into a serial,
896
+ * because that conversion is what the format asks for. Bare values keep
897
+ * numeric-string coercion. Mirrors PHP `Normalizer::coerceValue`.
898
+ */
899
+ coerceValue(value, format, address = "?", sheetName2, explicit = false) {
892
900
  if (value === null || value === void 0) return null;
893
901
  const df = format?.displayFormat;
894
902
  if (df === "date" || df === "datetime") {
@@ -896,6 +904,9 @@ var Normalizer = class {
896
904
  return DateConverter.toSerial(value, df === "datetime");
897
905
  }
898
906
  }
907
+ if (explicit && typeof value === "string") {
908
+ return value;
909
+ }
899
910
  if (typeof value === "string" && isNumericString(value)) {
900
911
  return numericStringToNumber(value);
901
912
  }
@@ -6252,7 +6263,7 @@ var holy_sheet_schema_default = {
6252
6263
  };
6253
6264
 
6254
6265
  // src/agent.ts
6255
- var VERSION = "2.11.0";
6266
+ var VERSION = "2.11.1";
6256
6267
  function toU8(input) {
6257
6268
  return input instanceof Uint8Array ? input : new Uint8Array(input);
6258
6269
  }
@@ -6824,5 +6835,5 @@ function unencodable(reason) {
6824
6835
  }
6825
6836
 
6826
6837
  export { Agent, ArchiveRefused, ArrayBuilder, CellAddress, CsvBuilder, FormatSniffer, FormulaLinter, Inference, Normalizer, OdsReader, OfficeTemplateRefused, Repairer, SchemaException, SheetDiff, SheetOpSchema, SheetReducer, SourceArchive, Theme, UnsupportedFormatException, VERSION, Validator, XlsxReader, XlsxWriter, readFileBounded, sourceKind, unzipSync, zipSync };
6827
- //# sourceMappingURL=chunk-OL6E7DE5.js.map
6828
- //# sourceMappingURL=chunk-OL6E7DE5.js.map
6838
+ //# sourceMappingURL=chunk-NQRZFV32.js.map
6839
+ //# sourceMappingURL=chunk-NQRZFV32.js.map