Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cd106e2

Browse files
committed
build: skip storing iana example template entries
1 parent 4c5aedd commit cd106e2

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

scripts/build.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ require('../src/iana.json').forEach(function (mime) {
77
// and i don't think we need to bother with the "Reference"
88
// just look at the site yourself!
99

10-
if (mime.template.substr(-8) === '/example') {
11-
// ignore example templates
12-
return
13-
}
14-
1510
var template = mime.template
1611

1712
if (!template) {

scripts/types.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ function* get(type) {
3333
var reduceRows = generateRowMapper(headers)
3434

3535
return mimes.map(function (row) {
36-
return row.reduce(reduceRows, {type: type})
36+
var data = row.reduce(reduceRows, {type: type})
37+
if (data.template !== type + '/example') return data
3738
})
3839
}
3940

4041
function concat(a, b) {
41-
return a.concat(b)
42+
return a.concat(b.filter(Boolean))
4243
}
4344

4445
function generateRowMapper(headers) {

src/iana.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)