Skip to content

Commit 9541b58

Browse files
BendingBendersindresorhus
authored andcommitted
Require Node.js 8, add TypeScript definition (#3)
1 parent cb1d76e commit 9541b58

File tree

10 files changed

+94
-41
lines changed

10 files changed

+94
-41
lines changed

.gitattributes

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
* text=auto
2-
*.js text eol=lf
1+
* text=auto eol=lf

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
node_modules
2+
yarn.lock

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
language: node_js
22
node_js:
3+
- '10'
34
- '8'
4-
- '6'
5-
- '4'

html-tags-void.json.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
declare const voidHtmlTags: readonly string[];
2+
3+
export = voidHtmlTags;

html-tags.json.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
declare const htmlTags: readonly string[];
2+
3+
export = htmlTags;

index.d.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
List of standard HTML tags.
3+
4+
@example
5+
```
6+
import htmlTags = require('html-tags');
7+
8+
console.log(htmlTags);
9+
//=> ['a', 'abbr', 'acronym', ...]
10+
```
11+
*/
12+
declare const htmlTags: readonly string[];
13+
14+
export = htmlTags;

index.test-d.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import {expectType, expectError} from 'tsd';
2+
import htmlTags = require('.');
3+
import voidHtmlTags = require('./void');
4+
import htmlTagsJson = require('./html-tags.json');
5+
import voidHtmlTagsJson = require('./html-tags-void.json');
6+
7+
expectType<readonly string[]>(htmlTags);
8+
expectError(htmlTags.push(""));
9+
expectType<readonly string[]>(voidHtmlTags);
10+
expectError(voidHtmlTags.push(""));
11+
expectType<readonly string[]>(htmlTagsJson);
12+
expectError(htmlTagsJson.push(""));
13+
expectType<readonly string[]>(voidHtmlTagsJson);
14+
expectError(voidHtmlTagsJson.push(""));

package.json

Lines changed: 42 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,44 @@
11
{
2-
"name": "html-tags",
3-
"version": "2.0.0",
4-
"description": "List of standard HTML tags",
5-
"license": "MIT",
6-
"repository": "sindresorhus/html-tags",
7-
"author": {
8-
"name": "Sindre Sorhus",
9-
"email": "sindresorhus@gmail.com",
10-
"url": "sindresorhus.com"
11-
},
12-
"engines": {
13-
"node": ">=4"
14-
},
15-
"scripts": {
16-
"test": "xo && ava"
17-
},
18-
"files": [
19-
"index.js",
20-
"void.js",
21-
"html-tags.json",
22-
"html-tags-void.json"
23-
],
24-
"keywords": [
25-
"html",
26-
"html5",
27-
"tags",
28-
"elements",
29-
"list",
30-
"whatwg",
31-
"w3c",
32-
"void",
33-
"self-closing"
34-
],
35-
"devDependencies": {
36-
"ava": "*",
37-
"xo": "*"
38-
}
2+
"name": "html-tags",
3+
"version": "2.0.0",
4+
"description": "List of standard HTML tags",
5+
"license": "MIT",
6+
"repository": "sindresorhus/html-tags",
7+
"author": {
8+
"name": "Sindre Sorhus",
9+
"email": "sindresorhus@gmail.com",
10+
"url": "sindresorhus.com"
11+
},
12+
"engines": {
13+
"node": ">=8"
14+
},
15+
"scripts": {
16+
"test": "xo && ava && tsd"
17+
},
18+
"files": [
19+
"index.js",
20+
"index.d.ts",
21+
"void.js",
22+
"void.d.ts",
23+
"html-tags.json",
24+
"html-tags.json.d.ts",
25+
"html-tags-void.json",
26+
"html-tags-void.json.d.ts"
27+
],
28+
"keywords": [
29+
"html",
30+
"html5",
31+
"tags",
32+
"elements",
33+
"list",
34+
"whatwg",
35+
"w3c",
36+
"void",
37+
"self-closing"
38+
],
39+
"devDependencies": {
40+
"ava": "^1.4.1",
41+
"tsd": "^0.7.2",
42+
"xo": "^0.24.0"
43+
}
3944
}

void.d.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
List of void (self-closing) HTML tags.
3+
4+
@example
5+
```
6+
import voidHtmlTags = require('html-tags/void');
7+
8+
console.log(voidHtmlTags);
9+
//=> ['area', 'base', 'br', ...]
10+
```
11+
*/
12+
declare const voidHtmlTags: readonly string[];
13+
14+
export = voidHtmlTags;

0 commit comments

Comments
 (0)