From 499650301072216facd2a124b109f0c088e43559 Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Thu, 11 Jan 2024 23:42:05 +0900 Subject: [PATCH 1/2] Update JSXSlackTemplateTag type: Accept readonly string array as template --- src/tag.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tag.ts b/src/tag.ts index 4815c6d..6a798f6 100644 --- a/src/tag.ts +++ b/src/tag.ts @@ -4,7 +4,7 @@ import { createElementInternal } from './jsx-internals' import { he } from './prebundles/he' type JSXSlackTemplateTag = ( - template: TemplateStringsArray, + template: readonly string[], ...substitutions: any[] ) => any @@ -91,7 +91,7 @@ const render = htm.bind((type, props, ...children) => */ export const jsxslack: JSXSlackTemplateTag = (template, ...substitutions) => render( - template, + template as TemplateStringsArray, ...substitutions.map((s) => isString(s) ? Object.defineProperty(new String(s), strSubSymbol, { value: true }) From e54456f82154eb49d397641c651d26073d2d0d01 Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Sun, 11 Feb 2024 16:16:03 +0900 Subject: [PATCH 2/2] [ci skip] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b90e634..1fdbb80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Fixed + +- `JSXSlackTemplateTag` type now accepts pure readonly string array ([#312](https://github.com/yhatt/jsx-slack/pull/312)) + ## v6.1.1 - 2023-12-14 ### Fixed