slackmark 0.3.0 → 0.4.0

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.
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Surrogate-pair-safe string truncation.
3
+ *
4
+ * `String.prototype.slice` counts UTF-16 code units, so a cut can land between
5
+ * the high and low half of a surrogate pair (astral chars: emoji, some CJK).
6
+ * A lone surrogate is malformed UTF-16 — Slack rejects such payloads with
7
+ * `invalid_blocks` — so every truncation site must back off one unit instead.
8
+ * Unicode ranges: https://unicode.org/faq/utf_bom.html#utf16-2
9
+ */
10
+ /**
11
+ * Largest cut index ≤ `end` that does not split a surrogate pair in `text`.
12
+ * `end` is clamped into `[0, text.length]`.
13
+ */
14
+ export declare function surrogateSafeEnd(text: string, end: number): number;
15
+ /**
16
+ * `text.slice(0, max)` that never splits a surrogate pair: when the cut would
17
+ * land mid-pair, the whole pair is dropped (result is `max - 1` units).
18
+ */
19
+ export declare function sliceSurrogateSafe(text: string, max: number): string;
20
+ //# sourceMappingURL=utf16.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utf16.d.ts","sourceRoot":"","sources":["../src/utf16.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAkBlE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEpE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slackmark",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Compile SlackMark (CommonMark and GFM plus Slack extensions) to Slack Block Kit JSON",
5
5
  "keywords": [
6
6
  "block kit",