create-html-element 4.0.0 → 5.0.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.
- package/index.d.ts +10 -8
- package/index.js +2 -2
- package/package.json +13 -9
package/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {MergeExclusive} from 'type-fest';
|
|
2
|
-
import stringifyAttributes, {HTMLAttributes} from 'stringify-attributes';
|
|
1
|
+
import {type MergeExclusive} from 'type-fest';
|
|
2
|
+
import stringifyAttributes, {type HTMLAttributes} from 'stringify-attributes';
|
|
3
3
|
|
|
4
|
-
export
|
|
4
|
+
export type BaseOptions = {
|
|
5
5
|
/**
|
|
6
6
|
HTML tag attributes.
|
|
7
7
|
*/
|
|
@@ -13,21 +13,21 @@ export interface BaseOptions {
|
|
|
13
13
|
@default 'div'
|
|
14
14
|
*/
|
|
15
15
|
readonly name?: string;
|
|
16
|
-
}
|
|
16
|
+
};
|
|
17
17
|
|
|
18
|
-
export
|
|
18
|
+
export type HtmlOptions = {
|
|
19
19
|
/**
|
|
20
20
|
HTML tag value in unescaped HTML.
|
|
21
21
|
*/
|
|
22
22
|
readonly html?: string;
|
|
23
|
-
}
|
|
23
|
+
};
|
|
24
24
|
|
|
25
|
-
export
|
|
25
|
+
export type TextOptions = {
|
|
26
26
|
/**
|
|
27
27
|
HTML tag value in escaped HTML.
|
|
28
28
|
*/
|
|
29
29
|
readonly text?: string;
|
|
30
|
-
}
|
|
30
|
+
};
|
|
31
31
|
|
|
32
32
|
export type Options = BaseOptions & MergeExclusive<HtmlOptions, TextOptions>;
|
|
33
33
|
|
|
@@ -59,3 +59,5 @@ createHtmlElement({text: 'Hello <em>World</em>'});
|
|
|
59
59
|
```
|
|
60
60
|
*/
|
|
61
61
|
export default function createHtmlElement(options?: Options): string;
|
|
62
|
+
|
|
63
|
+
export {HTMLAttributes} from 'stringify-attributes';
|
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import stringifyAttributes from 'stringify-attributes';
|
|
2
|
-
import
|
|
2
|
+
import {voidHtmlTags as voidHtmlTagsArray} from 'html-tags';
|
|
3
3
|
import {htmlEscape} from 'escape-goat';
|
|
4
4
|
|
|
5
|
-
const voidHtmlTags = new Set(
|
|
5
|
+
const voidHtmlTags = new Set(voidHtmlTagsArray);
|
|
6
6
|
|
|
7
7
|
export default function createHtmlElement(
|
|
8
8
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-html-element",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Create a HTML element string",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "sindresorhus/create-html-element",
|
|
@@ -11,9 +11,13 @@
|
|
|
11
11
|
"url": "https://sindresorhus.com"
|
|
12
12
|
},
|
|
13
13
|
"type": "module",
|
|
14
|
-
"exports":
|
|
14
|
+
"exports": {
|
|
15
|
+
"types": "./index.d.ts",
|
|
16
|
+
"default": "./index.js"
|
|
17
|
+
},
|
|
18
|
+
"sideEffects": false,
|
|
15
19
|
"engines": {
|
|
16
|
-
"node": "^
|
|
20
|
+
"node": "^18.20.0 || >=20.10.0"
|
|
17
21
|
},
|
|
18
22
|
"scripts": {
|
|
19
23
|
"test": "xo && ava && tsd"
|
|
@@ -33,13 +37,13 @@
|
|
|
33
37
|
],
|
|
34
38
|
"dependencies": {
|
|
35
39
|
"escape-goat": "^4.0.0",
|
|
36
|
-
"html-tags": "^
|
|
37
|
-
"stringify-attributes": "^
|
|
38
|
-
"type-fest": "^
|
|
40
|
+
"html-tags": "^4.0.0",
|
|
41
|
+
"stringify-attributes": "^4.0.0",
|
|
42
|
+
"type-fest": "^4.27.0"
|
|
39
43
|
},
|
|
40
44
|
"devDependencies": {
|
|
41
|
-
"ava": "^
|
|
42
|
-
"tsd": "^0.
|
|
43
|
-
"xo": "^0.
|
|
45
|
+
"ava": "^6.2.0",
|
|
46
|
+
"tsd": "^0.31.2",
|
|
47
|
+
"xo": "^0.59.3"
|
|
44
48
|
}
|
|
45
49
|
}
|