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

refactor(*): move helper fucntions from core and preset-html5 to separate package — plugin-helper

This commit is contained in:
Nikolay Kostyurin
2018-08-06 23:52:44 +02:00
parent 1aed2a684b
commit fb78c4fefb
13 changed files with 212 additions and 166 deletions
+2 -10
View File
@@ -1,5 +1,5 @@
const Tokenizer = require('./Tokenizer');
const TagNode = require('./TagNode');
const TagNode = require('@bbob/plugin-helper/lib/TagNode');
/**
* @private
@@ -28,14 +28,6 @@ let tokenizer = null;
// eslint-disable-next-line no-unused-vars
let tokens = null;
/**
*
* @param tag
* @param attrs
* @param content
*/
const newTagNode = (tag, attrs = {}, content = []) => new TagNode(tag, attrs, content);
const createTokenizer = (input, onToken) => new Tokenizer(input, { onToken });
/**
@@ -56,7 +48,7 @@ const getTagNode = () => (tagNodes.length ? tagNodes[tagNodes.length - 1] : null
* @param {Token} token
* @return {Array}
*/
const createTagNode = token => tagNodes.push(newTagNode(token.getValue()));
const createTagNode = token => tagNodes.push(TagNode.create(token.getValue()));
/**
* @private
* @param {Token} token