alemonjs 2.1.37 → 2.1.39

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.
@@ -13,6 +13,7 @@ export declare class SinglyLinkedList<T> {
13
13
  popNext(): ListNode<T> | null;
14
14
  removeCurrent(): void;
15
15
  getSize(): number;
16
+ resetCursor(): void;
16
17
  forEach(callback: (node: ListNode<T>) => boolean | undefined): void;
17
18
  }
18
19
  export {};
@@ -70,6 +70,9 @@ class SinglyLinkedList {
70
70
  getSize() {
71
71
  return this.size;
72
72
  }
73
+ resetCursor() {
74
+ this.current = null;
75
+ }
73
76
  forEach(callback) {
74
77
  let node = this.head;
75
78
  while (node) {
@@ -3,6 +3,7 @@ import { SubscribeStatus } from './config.js';
3
3
 
4
4
  const expendSubscribe = (valueEvent, select, next, choose) => {
5
5
  const subListValue = getSubscribeList(choose, select);
6
+ subListValue.resetCursor();
6
7
  const nextObserver = (cn, ...cns) => {
7
8
  if (cn) {
8
9
  next(...cns);
package/lib/client.js CHANGED
@@ -61,6 +61,12 @@ const main = () => {
61
61
  loadModels();
62
62
  };
63
63
  const mainProcess = () => {
64
+ process.on('unhandledRejection', (reason) => {
65
+ logger.error('[alemonjs][unhandledRejection] 未捕获的 Promise 拒绝:', reason);
66
+ });
67
+ process.on('uncaughtException', (error) => {
68
+ logger.error('[alemonjs][uncaughtException] 未捕获的异常:', error);
69
+ });
64
70
  ['SIGINT', 'SIGTERM', 'SIGQUIT', 'disconnect'].forEach(sig => {
65
71
  process?.on?.(sig, () => {
66
72
  logger.info?.(`[alemonjs][${sig}] 收到信号,正在关闭...`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alemonjs",
3
- "version": "2.1.37",
3
+ "version": "2.1.39",
4
4
  "description": "bot script",
5
5
  "author": "lemonade",
6
6
  "license": "MIT",
@@ -1,50 +0,0 @@
1
- import { DataMention, DataImage, DataText, DataImageURL, DataImageFile, ButtonRow, DataButtonGroup, DataButton, DataArkList, DataArkListTip, DataArkListContent, DataArkListItem, DataArkCard, DataArkBigCard, DataMarkdownTemplate, DataMarkDown, DataMarkdownTitle, DataMarkdownSubtitle, DataMarkdownBold, DataMarkdownItalic, DataMarkdownItalicStar, DataMarkdownStrikethrough, DataMarkdownLink, DataMarkdownImage, DataMarkdownList, DataMarkdownListItem, DataMarkdownBlockquote, DataMarkdownDivider, DataMarkdownNewline, DataLink, DataMarkdownText, DataButtonTemplate, DataMarkdownCode } from '../types';
2
- export declare const Text: (val: DataText["value"], options?: DataText["options"]) => DataText;
3
- export declare const Link: (val: DataLink["value"], options?: DataText["options"]) => DataText;
4
- export declare const ImageURL: (val: DataImageURL["value"]) => DataImageURL;
5
- export declare const ImageFile: (val: DataImageFile["value"]) => DataImageFile;
6
- declare const Image: {
7
- (val: Buffer): DataImage;
8
- url: (val: DataImageURL["value"]) => DataImageURL;
9
- file: (val: DataImageFile["value"]) => DataImageFile;
10
- };
11
- export { Image };
12
- export declare const Mention: (UserId?: DataMention["value"], options?: DataMention["options"]) => DataMention;
13
- declare const BT: {
14
- (title: string, data: DataButton["options"]["data"], options?: Omit<DataButton["options"], "data">): DataButton;
15
- group(...rows: ButtonRow[]): DataButtonGroup;
16
- template(templateId: DataButtonTemplate["value"]): DataButtonTemplate;
17
- row(...buttons: DataButton[]): ButtonRow;
18
- };
19
- export { BT };
20
- export declare const Ark: {
21
- list: (values_0: DataArkListTip, values_1: DataArkListContent) => DataArkList;
22
- listTip: (options: DataArkListTip["value"]) => DataArkListTip;
23
- listContent: (...values: DataArkListContent["value"]) => DataArkListContent;
24
- listItem: (value: DataArkListItem["value"]) => DataArkListItem;
25
- Card: (value: DataArkCard["value"]) => DataArkCard;
26
- BigCard: (value: DataArkBigCard["value"]) => DataArkBigCard;
27
- };
28
- declare const MD: {
29
- (...values: DataMarkDown["value"]): DataMarkDown;
30
- template(templateId: DataMarkdownTemplate["value"], params?: DataMarkdownTemplate["options"]["params"]): DataMarkdownTemplate;
31
- text(text: string): DataMarkdownText;
32
- title(text: string): DataMarkdownTitle;
33
- subtitle(text: string): DataMarkdownSubtitle;
34
- bold(text: string): DataMarkdownBold;
35
- italic(text: string): DataMarkdownItalic;
36
- italicStar(text: string): DataMarkdownItalicStar;
37
- strikethrough(text: string): DataMarkdownStrikethrough;
38
- link(text: string, url: string): DataMarkdownLink;
39
- image(url: string, options?: {
40
- width?: number;
41
- height?: number;
42
- }): DataMarkdownImage;
43
- list(...items: any[]): DataMarkdownList;
44
- listItem(indexOrText: number | string, text?: string): DataMarkdownListItem;
45
- blockquote(text: string): DataMarkdownBlockquote;
46
- divider(): DataMarkdownDivider;
47
- newline(value?: boolean): DataMarkdownNewline;
48
- code(value: DataMarkdownCode["value"], options?: DataMarkdownCode["options"]): DataMarkdownCode;
49
- };
50
- export { MD };
@@ -1,217 +0,0 @@
1
- const Text = (val, options) => {
2
- return {
3
- type: 'Text',
4
- value: val,
5
- options
6
- };
7
- };
8
- const Link = (val, options) => {
9
- return {
10
- type: 'Text',
11
- value: val,
12
- options
13
- };
14
- };
15
- const ImageURL = (val) => {
16
- return {
17
- type: 'ImageURL',
18
- value: val
19
- };
20
- };
21
- const ImageFile = (val) => {
22
- return {
23
- type: 'ImageFile',
24
- value: val
25
- };
26
- };
27
- const Image = (val) => {
28
- return {
29
- type: 'Image',
30
- value: val.toString('base64')
31
- };
32
- };
33
- Image.url = ImageURL;
34
- Image.file = ImageFile;
35
- const Mention = (UserId, options) => {
36
- return {
37
- type: 'Mention',
38
- value: UserId,
39
- options: options ?? {
40
- belong: 'user'
41
- }
42
- };
43
- };
44
- const BT = (title, data, options) => {
45
- return {
46
- type: 'Button',
47
- value: title,
48
- options: {
49
- data,
50
- ...options
51
- }
52
- };
53
- };
54
- BT.group = function Group(...rows) {
55
- return {
56
- type: 'BT.group',
57
- value: rows
58
- };
59
- };
60
- BT.template = function Template(templateId) {
61
- return {
62
- type: 'ButtonTemplate',
63
- value: templateId
64
- };
65
- };
66
- BT.row = function Row(...buttons) {
67
- return {
68
- type: 'BT.row',
69
- value: buttons
70
- };
71
- };
72
- const Ark = {
73
- list: (...values) => {
74
- return {
75
- type: 'Ark.list',
76
- value: values
77
- };
78
- },
79
- listTip: (options) => {
80
- return {
81
- type: 'Ark.listTip',
82
- value: options
83
- };
84
- },
85
- listContent: (...values) => {
86
- return {
87
- type: 'Ark.listContent',
88
- value: values
89
- };
90
- },
91
- listItem: (value) => {
92
- return {
93
- type: 'Ark.listItem',
94
- value: value
95
- };
96
- },
97
- Card: (value) => {
98
- return {
99
- type: 'Ark.Card',
100
- value: value
101
- };
102
- },
103
- BigCard: (value) => {
104
- return {
105
- type: 'Ark.BigCard',
106
- value
107
- };
108
- }
109
- };
110
- const MD = (...values) => {
111
- return {
112
- type: 'Markdown',
113
- value: values
114
- };
115
- };
116
- MD.template = (templateId, params) => {
117
- return {
118
- type: 'MarkdownTemplate',
119
- value: templateId,
120
- options: {
121
- params
122
- }
123
- };
124
- };
125
- MD.text = (text) => {
126
- return {
127
- type: 'MD.text',
128
- value: text
129
- };
130
- };
131
- MD.title = (text) => {
132
- return {
133
- type: 'MD.title',
134
- value: text
135
- };
136
- };
137
- MD.subtitle = (text) => {
138
- return {
139
- type: 'MD.subtitle',
140
- value: text
141
- };
142
- };
143
- MD.bold = (text) => {
144
- return {
145
- type: 'MD.bold',
146
- value: text
147
- };
148
- };
149
- MD.italic = (text) => {
150
- return {
151
- type: 'MD.italic',
152
- value: text
153
- };
154
- };
155
- MD.italicStar = (text) => {
156
- return {
157
- type: 'MD.italicStar',
158
- value: text
159
- };
160
- };
161
- MD.strikethrough = (text) => {
162
- return {
163
- type: 'MD.strikethrough',
164
- value: text
165
- };
166
- };
167
- MD.link = (text, url) => {
168
- return {
169
- type: 'MD.link',
170
- value: { text, url }
171
- };
172
- };
173
- MD.image = (url, options) => {
174
- return {
175
- type: 'MD.image',
176
- value: url,
177
- options
178
- };
179
- };
180
- MD.list = (...items) => {
181
- return {
182
- type: 'MD.list',
183
- value: items
184
- };
185
- };
186
- MD.listItem = (indexOrText, text) => {
187
- return {
188
- type: 'MD.listItem',
189
- value: typeof indexOrText === 'number' ? { index: indexOrText, text } : indexOrText
190
- };
191
- };
192
- MD.blockquote = (text) => {
193
- return {
194
- type: 'MD.blockquote',
195
- value: text
196
- };
197
- };
198
- MD.divider = () => {
199
- return {
200
- type: 'MD.divider'
201
- };
202
- };
203
- MD.newline = (value = false) => {
204
- return {
205
- type: 'MD.newline',
206
- value: value
207
- };
208
- };
209
- MD.code = (value, options) => {
210
- return {
211
- type: 'MD.code',
212
- value: value,
213
- options: options
214
- };
215
- };
216
-
217
- export { Ark, BT, Image, ImageFile, ImageURL, Link, MD, Mention, Text };
@@ -1,3 +0,0 @@
1
- import { Result } from '../../core';
2
- import type { Apis } from '../../types';
3
- export declare const sendAPI: (data: Apis) => Promise<Result[]>;
@@ -1,32 +0,0 @@
1
- import { ResultCode } from '../../core/variable.js';
2
- import 'fs';
3
- import 'path';
4
- import 'yaml';
5
- import { createResult } from '../../core/utils.js';
6
- import { generateUniqueId, deviceId, apiResolves, apiTimeouts, timeoutTime } from './config.js';
7
- import * as flattedJSON from 'flatted';
8
-
9
- const sendAPI = (data) => {
10
- const ApiId = generateUniqueId();
11
- return new Promise(resolve => {
12
- if (!global.chatbotClient?.send) {
13
- resolve([createResult(ResultCode.Fail, 'Chatbot client is not available', null)]);
14
- return;
15
- }
16
- data.apiId = ApiId;
17
- data.DeviceId = deviceId;
18
- global.chatbotClient?.send(flattedJSON.stringify(data));
19
- apiResolves.set(ApiId, resolve);
20
- const timeout = setTimeout(() => {
21
- if (!apiResolves.has(ApiId) || !apiTimeouts.has(ApiId)) {
22
- return;
23
- }
24
- apiResolves.delete(ApiId);
25
- apiTimeouts.delete(ApiId);
26
- resolve([createResult(ResultCode.Fail, '接口超时', null)]);
27
- }, timeoutTime);
28
- apiTimeouts.set(ApiId, timeout);
29
- });
30
- };
31
-
32
- export { sendAPI };
@@ -1,105 +0,0 @@
1
- import { DataText, DataLink, DataImage, DataImageURL, DataImageFile, DataMention, DataButton, ButtonRow, DataButtonGroup, DataMarkDown, DataMarkdownTitle, DataMarkdownSubtitle, DataMarkdownText, DataMarkdownBold, DataMarkdownCode } from '../types/index.js';
2
- export interface FormatProps {
3
- name?: string;
4
- children?: any;
5
- [key: string]: any;
6
- }
7
- export interface TextProps {
8
- children?: any;
9
- style?: DataText['options']['style'];
10
- }
11
- export interface LinkProps {
12
- children?: any;
13
- link: string;
14
- }
15
- export interface ImageProps {
16
- children?: Buffer;
17
- }
18
- export interface ImageURLProps {
19
- children?: string;
20
- }
21
- export interface ImageFileProps {
22
- children?: string;
23
- }
24
- export interface MentionProps {
25
- children?: string;
26
- belong?: 'user' | 'guild' | 'channel' | 'everyone';
27
- payload?: any;
28
- }
29
- export interface ButtonProps {
30
- children?: any;
31
- data?: DataButton['options']['data'];
32
- command?: string;
33
- toolTip?: string;
34
- autoEnter?: boolean;
35
- showList?: boolean;
36
- type?: 'command' | 'link' | 'call';
37
- }
38
- export interface RowProps {
39
- children?: any;
40
- }
41
- export interface ButtonGroupProps {
42
- children?: any;
43
- }
44
- export interface MarkdownProps {
45
- children?: any;
46
- }
47
- export interface MarkdownTitleProps {
48
- children?: any;
49
- }
50
- export interface MarkdownSubtitleProps {
51
- children?: any;
52
- }
53
- export interface MarkdownTextProps {
54
- children?: any;
55
- }
56
- export interface MarkdownBoldProps {
57
- children?: any;
58
- }
59
- export interface MarkdownCodeProps {
60
- children?: any;
61
- language?: string;
62
- }
63
- export interface CustomProps {
64
- name: string;
65
- children?: any;
66
- [key: string]: any;
67
- }
68
- declare function FormatComponent(props: FormatProps): any;
69
- declare namespace FormatComponent {
70
- var Text: typeof FormatText;
71
- var Link: typeof FormatLink;
72
- var Image: typeof FormatImage;
73
- var ImageURL: typeof FormatImageURL;
74
- var ImageFile: typeof FormatImageFile;
75
- var Mention: typeof FormatMention;
76
- var Button: typeof FormatButton;
77
- var Row: typeof FormatRow;
78
- var ButtonGroup: typeof FormatButtonGroup;
79
- var Markdown: typeof FormatMarkdown;
80
- var Custom: typeof FormatCustomComponent;
81
- }
82
- declare function FormatText(props: TextProps): DataText;
83
- declare function FormatLink(props: LinkProps): DataLink;
84
- declare function FormatImage(props: ImageProps): DataImage;
85
- declare function FormatImageURL(props: ImageURLProps): DataImageURL;
86
- declare function FormatImageFile(props: ImageFileProps): DataImageFile;
87
- declare function FormatMention(props: MentionProps): DataMention;
88
- declare function FormatButton(props: ButtonProps): DataButton;
89
- declare function FormatRow(props: RowProps): ButtonRow;
90
- declare function FormatButtonGroup(props: ButtonGroupProps): DataButtonGroup;
91
- declare function FormatMarkdownTitle(props: MarkdownTitleProps): DataMarkdownTitle;
92
- declare function FormatMarkdownSubtitle(props: MarkdownSubtitleProps): DataMarkdownSubtitle;
93
- declare function FormatMarkdownText(props: MarkdownTextProps): DataMarkdownText;
94
- declare function FormatMarkdownBold(props: MarkdownBoldProps): DataMarkdownBold;
95
- declare function FormatMarkdownCode(props: MarkdownCodeProps): DataMarkdownCode;
96
- declare function FormatMarkdown(props: MarkdownProps): DataMarkDown;
97
- declare namespace FormatMarkdown {
98
- var Title: typeof FormatMarkdownTitle;
99
- var Subtitle: typeof FormatMarkdownSubtitle;
100
- var Text: typeof FormatMarkdownText;
101
- var Bold: typeof FormatMarkdownBold;
102
- var Code: typeof FormatMarkdownCode;
103
- }
104
- declare function FormatCustomComponent(props: CustomProps): any;
105
- export { FormatComponent as Component, FormatCustomComponent as Custom };
package/lib/jsx/index.js DELETED
@@ -1,211 +0,0 @@
1
- function childrenToString(children) {
2
- if (children === null || children === undefined) {
3
- return '';
4
- }
5
- if (typeof children === 'string') {
6
- return children;
7
- }
8
- if (typeof children === 'number' || typeof children === 'boolean') {
9
- return String(children);
10
- }
11
- if (Array.isArray(children)) {
12
- return children.map(childrenToString).join('');
13
- }
14
- return String(children);
15
- }
16
- function flattenChildren(children) {
17
- if (children === null || children === undefined) {
18
- return [];
19
- }
20
- if (Array.isArray(children)) {
21
- const result = [];
22
- for (const child of children) {
23
- if (Array.isArray(child)) {
24
- result.push(...flattenChildren(child));
25
- }
26
- else if (child !== null && child !== undefined && typeof child === 'object' && 'type' in child) {
27
- result.push(child);
28
- }
29
- }
30
- return result;
31
- }
32
- if (typeof children === 'object' && children !== null && children !== undefined && 'type' in children) {
33
- return [children];
34
- }
35
- return [];
36
- }
37
- function collectChildren(children, typeCheck) {
38
- const flat = flattenChildren(children);
39
- return flat.filter(c => c.type === typeCheck);
40
- }
41
- function extractOptions(props, excludeKeys = []) {
42
- const exclude = new Set(['children', ...excludeKeys]);
43
- const options = {};
44
- let hasKeys = false;
45
- for (const key of Object.keys(props)) {
46
- if (!exclude.has(key)) {
47
- options[key] = props[key];
48
- hasKeys = true;
49
- }
50
- }
51
- return hasKeys ? options : undefined;
52
- }
53
- function FormatComponent(props) {
54
- if (props.name !== undefined) {
55
- const { name, children, ...rest } = props;
56
- const options = Object.keys(rest).length > 0 ? rest : undefined;
57
- return {
58
- type: name,
59
- value: children !== null && children !== undefined ? childrenToString(children) : undefined,
60
- options
61
- };
62
- }
63
- return flattenChildren(props.children);
64
- }
65
- function FormatText(props) {
66
- return {
67
- type: 'Text',
68
- value: childrenToString(props.children),
69
- options: extractOptions(props)
70
- };
71
- }
72
- function FormatLink(props) {
73
- return {
74
- type: 'Link',
75
- value: childrenToString(props.children),
76
- options: extractOptions(props)
77
- };
78
- }
79
- function FormatImage(props) {
80
- const buf = props.children;
81
- return {
82
- type: 'Image',
83
- value: buf instanceof Buffer ? buf.toString('base64') : ''
84
- };
85
- }
86
- function FormatImageURL(props) {
87
- return {
88
- type: 'ImageURL',
89
- value: childrenToString(props.children)
90
- };
91
- }
92
- function FormatImageFile(props) {
93
- return {
94
- type: 'ImageFile',
95
- value: childrenToString(props.children)
96
- };
97
- }
98
- function FormatMention(props) {
99
- return {
100
- type: 'Mention',
101
- value: props.children !== null && props.children !== undefined ? childrenToString(props.children) : undefined,
102
- options: extractOptions(props)
103
- };
104
- }
105
- function FormatButton(props) {
106
- const options = {};
107
- if (props.command !== undefined) {
108
- options.data = props.command;
109
- options.type = 'command';
110
- }
111
- else {
112
- if (props.data !== undefined) {
113
- options.data = props.data;
114
- }
115
- if (props.type !== undefined) {
116
- options.type = props.type;
117
- }
118
- }
119
- if (props.toolTip !== undefined) {
120
- options.toolTip = props.toolTip;
121
- }
122
- if (props.autoEnter !== undefined) {
123
- options.autoEnter = props.autoEnter;
124
- }
125
- if (props.showList !== undefined) {
126
- options.showList = props.showList;
127
- }
128
- return {
129
- type: 'Button',
130
- value: childrenToString(props.children),
131
- options: Object.keys(options).length > 0 ? options : undefined
132
- };
133
- }
134
- function FormatRow(props) {
135
- return {
136
- type: 'BT.row',
137
- value: collectChildren(props.children, 'Button')
138
- };
139
- }
140
- function FormatButtonGroup(props) {
141
- return {
142
- type: 'BT.group',
143
- value: collectChildren(props.children, 'BT.row')
144
- };
145
- }
146
- function FormatMarkdownTitle(props) {
147
- return {
148
- type: 'MD.title',
149
- value: childrenToString(props.children)
150
- };
151
- }
152
- function FormatMarkdownSubtitle(props) {
153
- return {
154
- type: 'MD.subtitle',
155
- value: childrenToString(props.children)
156
- };
157
- }
158
- function FormatMarkdownText(props) {
159
- return {
160
- type: 'MD.text',
161
- value: childrenToString(props.children)
162
- };
163
- }
164
- function FormatMarkdownBold(props) {
165
- return {
166
- type: 'MD.bold',
167
- value: childrenToString(props.children)
168
- };
169
- }
170
- function FormatMarkdownCode(props) {
171
- return {
172
- type: 'MD.code',
173
- value: childrenToString(props.children),
174
- options: extractOptions(props)
175
- };
176
- }
177
- function FormatMarkdown(props) {
178
- const flat = flattenChildren(props.children);
179
- const items = flat.filter(c => typeof c.type === 'string' && c.type.startsWith('MD.'));
180
- return {
181
- type: 'Markdown',
182
- value: items
183
- };
184
- }
185
- FormatMarkdown.Title = FormatMarkdownTitle;
186
- FormatMarkdown.Subtitle = FormatMarkdownSubtitle;
187
- FormatMarkdown.Text = FormatMarkdownText;
188
- FormatMarkdown.Bold = FormatMarkdownBold;
189
- FormatMarkdown.Code = FormatMarkdownCode;
190
- function FormatCustomComponent(props) {
191
- const { name, children, ...rest } = props;
192
- const options = Object.keys(rest).length > 0 ? rest : undefined;
193
- return {
194
- type: name,
195
- value: children !== null && children !== undefined ? childrenToString(children) : undefined,
196
- options
197
- };
198
- }
199
- FormatComponent.Text = FormatText;
200
- FormatComponent.Link = FormatLink;
201
- FormatComponent.Image = FormatImage;
202
- FormatComponent.ImageURL = FormatImageURL;
203
- FormatComponent.ImageFile = FormatImageFile;
204
- FormatComponent.Mention = FormatMention;
205
- FormatComponent.Button = FormatButton;
206
- FormatComponent.Row = FormatRow;
207
- FormatComponent.ButtonGroup = FormatButtonGroup;
208
- FormatComponent.Markdown = FormatMarkdown;
209
- FormatComponent.Custom = FormatCustomComponent;
210
-
211
- export { FormatComponent as Component, FormatCustomComponent as Custom };
@@ -1,2 +0,0 @@
1
- export { jsx, jsxs, Fragment } from './jsx-runtime.js';
2
- export type { JSX } from './jsx-runtime.js';
@@ -1 +0,0 @@
1
- export { Fragment, jsx, jsxs } from './jsx-runtime.js';
@@ -1,18 +0,0 @@
1
- type JsxChild = any;
2
- type JsxProps = Record<string, any>;
3
- type JsxComponent = (props: JsxProps) => any;
4
- export declare function jsx(type: string | JsxComponent, props: JsxProps, _key?: string): any;
5
- export declare function jsxs(type: string | JsxComponent, props: JsxProps, _key?: string): any;
6
- export declare function Fragment(props: {
7
- children?: JsxChild;
8
- }): any[];
9
- export declare namespace JSX {
10
- type Element = any;
11
- interface ElementChildrenAttribute {
12
- children: object;
13
- }
14
- interface IntrinsicElements {
15
- [elemName: string]: any;
16
- }
17
- }
18
- export {};
@@ -1,24 +0,0 @@
1
- function jsx(type, props, _key) {
2
- if (typeof type === 'function') {
3
- return type(props);
4
- }
5
- return { type, props };
6
- }
7
- function jsxs(type, props, _key) {
8
- if (typeof type === 'function') {
9
- return type(props);
10
- }
11
- return { type, props };
12
- }
13
- function Fragment(props) {
14
- const { children } = props;
15
- if (children === null || children === undefined) {
16
- return [];
17
- }
18
- if (Array.isArray(children)) {
19
- return children;
20
- }
21
- return [children];
22
- }
23
-
24
- export { Fragment, jsx, jsxs };