@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/dist/cli.cjs CHANGED
@@ -791,7 +791,7 @@ var Normalizer = class {
791
791
  address,
792
792
  new Cell(
793
793
  address,
794
- this.coerceValue(rawValue, format, address, sheetName2),
794
+ this.coerceValue(rawValue, format, address, sheetName2, true),
795
795
  cellData?.formula ?? null,
796
796
  format,
797
797
  comment,
@@ -884,7 +884,7 @@ var Normalizer = class {
884
884
  const rawValue = value.value ?? null;
885
885
  return new Cell(
886
886
  address,
887
- this.coerceValue(rawValue, merged, address, sheetName2),
887
+ this.coerceValue(rawValue, merged, address, sheetName2, true),
888
888
  value.formula ?? null,
889
889
  merged,
890
890
  comment,
@@ -899,7 +899,15 @@ var Normalizer = class {
899
899
  columnFormat
900
900
  );
901
901
  }
902
- coerceValue(value, format, address = "?", sheetName2) {
902
+ /**
903
+ * `explicit`: the value came from an object cell's `value` key. An explicit
904
+ * string is the caller saying "this text, exactly", so it is never coerced
905
+ * to a number: `{value: "+1"}` stays "+1" and `{value: "007"}` stays "007".
906
+ * Only a date/datetime display format still turns a string into a serial,
907
+ * because that conversion is what the format asks for. Bare values keep
908
+ * numeric-string coercion. Mirrors PHP `Normalizer::coerceValue`.
909
+ */
910
+ coerceValue(value, format, address = "?", sheetName2, explicit = false) {
903
911
  if (value === null || value === void 0) return null;
904
912
  const df = format?.displayFormat;
905
913
  if (df === "date" || df === "datetime") {
@@ -907,6 +915,9 @@ var Normalizer = class {
907
915
  return DateConverter.toSerial(value, df === "datetime");
908
916
  }
909
917
  }
918
+ if (explicit && typeof value === "string") {
919
+ return value;
920
+ }
910
921
  if (typeof value === "string" && isNumericString(value)) {
911
922
  return numericStringToNumber(value);
912
923
  }
@@ -6681,7 +6692,7 @@ var holy_sheet_schema_default = {
6681
6692
  };
6682
6693
 
6683
6694
  // src/agent.ts
6684
- var VERSION = "2.11.0";
6695
+ var VERSION = "2.11.1";
6685
6696
  function toU8(input) {
6686
6697
  return input instanceof Uint8Array ? input : new Uint8Array(input);
6687
6698
  }