2
0
mirror of https://github.com/tenrok/BBob.git synced 2026-06-20 20:00:33 +03:00

chore(benchmark): add ya-bbcode as benchmark target in benchmark suite (#62)

This commit is contained in:
Nikolay Kostyurin
2020-04-05 17:50:49 +02:00
committed by GitHub
parent 97ecba0af6
commit 22237c4500
3 changed files with 621 additions and 367 deletions
+15 -6
View File
@@ -9,16 +9,25 @@ suite
closable: true, closable: true,
}, },
})) }))
.add('ya-bbcode', () => {
const Yabbcode = require('ya-bbcode');
const parser = new Yabbcode();
parser.clearTags();
parser.registerTag('ch', {
type: 'replace',
open: () => '<div>',
close: () => '</div>',
});
return parser.parse(stub);
})
.add('xbbcode/parser', () => { .add('xbbcode/parser', () => {
const xbbcode = require('xbbcode-parser'); const xbbcode = require('xbbcode-parser');
xbbcode.addTags({ xbbcode.addTags({
ch: { ch: {
openTag(params, content) { openTag: () => '<div>',
return '<div>'; closeTag: () => '</div>',
},
closeTag(params, content) {
return '</div>';
},
restrictChildrenTo: [], restrictChildrenTo: [],
}, },
}); });
+604 -360
View File
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -51,7 +51,8 @@
"rollup-plugin-babel": "4.3.3", "rollup-plugin-babel": "4.3.3",
"rollup-plugin-terser": "5.2.0", "rollup-plugin-terser": "5.2.0",
"size-limit": "3.0.0", "size-limit": "3.0.0",
"xbbcode-parser": "0.1.2" "xbbcode-parser": "0.1.2",
"ya-bbcode": "1.0.12"
}, },
"publishConfig": { "publishConfig": {
"access": "public", "access": "public",