@markuplint/ml-core
Advanced tools
Comparing version 2.1.2 to 2.2.0
@@ -5,3 +5,3 @@ "use strict"; | ||
const tslib_1 = require("tslib"); | ||
const ruleset_1 = (0, tslib_1.__importDefault)(require("./ruleset")); | ||
const ruleset_1 = tslib_1.__importDefault(require("./ruleset")); | ||
function convertRuleset(config = {}) { | ||
@@ -8,0 +8,0 @@ return new ruleset_1.default(config); |
@@ -5,3 +5,3 @@ "use strict"; | ||
const tslib_1 = require("tslib"); | ||
const debug_1 = (0, tslib_1.__importDefault)(require("debug")); | ||
const debug_1 = tslib_1.__importDefault(require("debug")); | ||
const CLI_NS = 'markuplint-cli'; | ||
@@ -8,0 +8,0 @@ exports.log = (0, debug_1.default)('ml-core'); |
@@ -7,16 +7,16 @@ "use strict"; | ||
Object.defineProperty(exports, "getAttrSpecs", { enumerable: true, get: function () { return ml_spec_1.getAttrSpecs; } }); | ||
(0, tslib_1.__exportStar)(require("./convert-ruleset"), exports); | ||
(0, tslib_1.__exportStar)(require("./ml-core"), exports); | ||
(0, tslib_1.__exportStar)(require("./ml-rule"), exports); | ||
tslib_1.__exportStar(require("./convert-ruleset"), exports); | ||
tslib_1.__exportStar(require("./ml-core"), exports); | ||
tslib_1.__exportStar(require("./ml-rule"), exports); | ||
var ruleset_1 = require("./ruleset"); | ||
Object.defineProperty(exports, "Ruleset", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(ruleset_1).default; } }); | ||
(0, tslib_1.__exportStar)(require("./ml-dom"), exports); | ||
(0, tslib_1.__exportStar)(require("./plugin"), exports); | ||
Object.defineProperty(exports, "Ruleset", { enumerable: true, get: function () { return tslib_1.__importDefault(ruleset_1).default; } }); | ||
tslib_1.__exportStar(require("./ml-dom"), exports); | ||
tslib_1.__exportStar(require("./plugin"), exports); | ||
var getIndent_1 = require("./ml-dom/helper/getIndent"); | ||
Object.defineProperty(exports, "getIndent", { enumerable: true, get: function () { return getIndent_1.getIndent; } }); | ||
(0, tslib_1.__exportStar)(require("./utils"), exports); | ||
(0, tslib_1.__exportStar)(require("./types"), exports); | ||
(0, tslib_1.__exportStar)(require("./configs"), exports); | ||
(0, tslib_1.__exportStar)(require("./test"), exports); | ||
tslib_1.__exportStar(require("./utils"), exports); | ||
tslib_1.__exportStar(require("./types"), exports); | ||
tslib_1.__exportStar(require("./configs"), exports); | ||
tslib_1.__exportStar(require("./test"), exports); | ||
var debug_1 = require("./debug"); | ||
Object.defineProperty(exports, "enableDebug", { enumerable: true, get: function () { return debug_1.enableDebug; } }); |
@@ -26,6 +26,6 @@ "use strict"; | ||
} | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLCore_parser, parser, "f"); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLCore_sourceCode, sourceCode, "f"); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLCore_ignoreFrontMatter, !!parserOptions.ignoreFrontMatter, "f"); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLCore_ruleset, { | ||
tslib_1.__classPrivateFieldSet(this, _MLCore_parser, parser, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLCore_sourceCode, sourceCode, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLCore_ignoreFrontMatter, !!parserOptions.ignoreFrontMatter, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLCore_ruleset, { | ||
rules: (_a = ruleset.rules) !== null && _a !== void 0 ? _a : {}, | ||
@@ -35,6 +35,6 @@ nodeRules: (_b = ruleset.nodeRules) !== null && _b !== void 0 ? _b : [], | ||
}, "f"); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLCore_locale, locale, "f"); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLCore_schemas, schemas, "f"); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLCore_filename, filename, "f"); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLCore_rules, rules, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLCore_locale, locale, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLCore_schemas, schemas, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLCore_filename, filename, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLCore_rules, rules, "f"); | ||
this._parse(); | ||
@@ -44,3 +44,3 @@ this._createDocument(); | ||
get document() { | ||
return (0, tslib_1.__classPrivateFieldGet)(this, _MLCore_document, "f"); | ||
return tslib_1.__classPrivateFieldGet(this, _MLCore_document, "f"); | ||
} | ||
@@ -50,16 +50,16 @@ async verify(fix = false) { | ||
const violations = []; | ||
if ((0, tslib_1.__classPrivateFieldGet)(this, _MLCore_document, "f") instanceof parser_utils_1.ParserError) { | ||
if (tslib_1.__classPrivateFieldGet(this, _MLCore_document, "f") instanceof parser_utils_1.ParserError) { | ||
violations.push({ | ||
ruleId: 'parse-error', | ||
severity: 'error', | ||
message: (0, tslib_1.__classPrivateFieldGet)(this, _MLCore_document, "f").message, | ||
col: (0, tslib_1.__classPrivateFieldGet)(this, _MLCore_document, "f").col, | ||
line: (0, tslib_1.__classPrivateFieldGet)(this, _MLCore_document, "f").line, | ||
raw: (0, tslib_1.__classPrivateFieldGet)(this, _MLCore_document, "f").raw, | ||
message: tslib_1.__classPrivateFieldGet(this, _MLCore_document, "f").message, | ||
col: tslib_1.__classPrivateFieldGet(this, _MLCore_document, "f").col, | ||
line: tslib_1.__classPrivateFieldGet(this, _MLCore_document, "f").line, | ||
raw: tslib_1.__classPrivateFieldGet(this, _MLCore_document, "f").raw, | ||
}); | ||
(0, debug_1.log)('verify: error %o', (0, tslib_1.__classPrivateFieldGet)(this, _MLCore_document, "f").message); | ||
(0, debug_1.log)('verify: error %o', tslib_1.__classPrivateFieldGet(this, _MLCore_document, "f").message); | ||
return violations; | ||
} | ||
for (const rule of (0, tslib_1.__classPrivateFieldGet)(this, _MLCore_rules, "f")) { | ||
const ruleInfo = rule.getRuleInfo((0, tslib_1.__classPrivateFieldGet)(this, _MLCore_ruleset, "f"), rule.name); | ||
for (const rule of tslib_1.__classPrivateFieldGet(this, _MLCore_rules, "f")) { | ||
const ruleInfo = rule.getRuleInfo(tslib_1.__classPrivateFieldGet(this, _MLCore_ruleset, "f"), rule.name); | ||
if (ruleInfo.disabled && ruleInfo.nodeRules.length === 0 && ruleInfo.childNodeRules.length === 0) { | ||
@@ -69,3 +69,3 @@ continue; | ||
(0, debug_1.log)('%s Rule: verify', rule.name); | ||
const results = await rule.verify((0, tslib_1.__classPrivateFieldGet)(this, _MLCore_document, "f"), (0, tslib_1.__classPrivateFieldGet)(this, _MLCore_locale, "f"), ruleInfo, fix).catch(e => { | ||
const results = await rule.verify(tslib_1.__classPrivateFieldGet(this, _MLCore_document, "f"), tslib_1.__classPrivateFieldGet(this, _MLCore_locale, "f"), ruleInfo, fix).catch(e => { | ||
if (e instanceof parser_utils_1.ParserError) { | ||
@@ -110,3 +110,3 @@ return e; | ||
setCode(sourceCode) { | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLCore_sourceCode, sourceCode, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLCore_sourceCode, sourceCode, "f"); | ||
this._parse(); | ||
@@ -117,12 +117,12 @@ this._createDocument(); | ||
var _a, _b, _c; | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLCore_parser, parser !== null && parser !== void 0 ? parser : (0, tslib_1.__classPrivateFieldGet)(this, _MLCore_parser, "f"), "f"); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLCore_ruleset, { | ||
rules: (_a = ruleset === null || ruleset === void 0 ? void 0 : ruleset.rules) !== null && _a !== void 0 ? _a : (0, tslib_1.__classPrivateFieldGet)(this, _MLCore_ruleset, "f").rules, | ||
nodeRules: (_b = ruleset === null || ruleset === void 0 ? void 0 : ruleset.nodeRules) !== null && _b !== void 0 ? _b : (0, tslib_1.__classPrivateFieldGet)(this, _MLCore_ruleset, "f").nodeRules, | ||
childNodeRules: (_c = ruleset === null || ruleset === void 0 ? void 0 : ruleset.childNodeRules) !== null && _c !== void 0 ? _c : (0, tslib_1.__classPrivateFieldGet)(this, _MLCore_ruleset, "f").childNodeRules, | ||
tslib_1.__classPrivateFieldSet(this, _MLCore_parser, parser !== null && parser !== void 0 ? parser : tslib_1.__classPrivateFieldGet(this, _MLCore_parser, "f"), "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLCore_ruleset, { | ||
rules: (_a = ruleset === null || ruleset === void 0 ? void 0 : ruleset.rules) !== null && _a !== void 0 ? _a : tslib_1.__classPrivateFieldGet(this, _MLCore_ruleset, "f").rules, | ||
nodeRules: (_b = ruleset === null || ruleset === void 0 ? void 0 : ruleset.nodeRules) !== null && _b !== void 0 ? _b : tslib_1.__classPrivateFieldGet(this, _MLCore_ruleset, "f").nodeRules, | ||
childNodeRules: (_c = ruleset === null || ruleset === void 0 ? void 0 : ruleset.childNodeRules) !== null && _c !== void 0 ? _c : tslib_1.__classPrivateFieldGet(this, _MLCore_ruleset, "f").childNodeRules, | ||
}, "f"); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLCore_rules, rules !== null && rules !== void 0 ? rules : (0, tslib_1.__classPrivateFieldGet)(this, _MLCore_rules, "f"), "f"); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLCore_locale, locale !== null && locale !== void 0 ? locale : (0, tslib_1.__classPrivateFieldGet)(this, _MLCore_locale, "f"), "f"); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLCore_schemas, schemas !== null && schemas !== void 0 ? schemas : (0, tslib_1.__classPrivateFieldGet)(this, _MLCore_schemas, "f"), "f"); | ||
if (parserOptions && parserOptions.ignoreFrontMatter !== (0, tslib_1.__classPrivateFieldGet)(this, _MLCore_ignoreFrontMatter, "f")) { | ||
tslib_1.__classPrivateFieldSet(this, _MLCore_rules, rules !== null && rules !== void 0 ? rules : tslib_1.__classPrivateFieldGet(this, _MLCore_rules, "f"), "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLCore_locale, locale !== null && locale !== void 0 ? locale : tslib_1.__classPrivateFieldGet(this, _MLCore_locale, "f"), "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLCore_schemas, schemas !== null && schemas !== void 0 ? schemas : tslib_1.__classPrivateFieldGet(this, _MLCore_schemas, "f"), "f"); | ||
if (parserOptions && parserOptions.ignoreFrontMatter !== tslib_1.__classPrivateFieldGet(this, _MLCore_ignoreFrontMatter, "f")) { | ||
this._parse(); | ||
@@ -134,9 +134,9 @@ } | ||
try { | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLCore_ast, (0, tslib_1.__classPrivateFieldGet)(this, _MLCore_parser, "f").parse((0, tslib_1.__classPrivateFieldGet)(this, _MLCore_sourceCode, "f"), 0, 0, 0, (0, tslib_1.__classPrivateFieldGet)(this, _MLCore_ignoreFrontMatter, "f")), "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLCore_ast, tslib_1.__classPrivateFieldGet(this, _MLCore_parser, "f").parse(tslib_1.__classPrivateFieldGet(this, _MLCore_sourceCode, "f"), 0, 0, 0, tslib_1.__classPrivateFieldGet(this, _MLCore_ignoreFrontMatter, "f")), "f"); | ||
} | ||
catch (err) { | ||
(0, debug_1.log)('Caught the parse error: %O', err); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLCore_ast, null, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLCore_ast, null, "f"); | ||
if (err instanceof parser_utils_1.ParserError) { | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLCore_document, err, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLCore_document, err, "f"); | ||
} | ||
@@ -149,10 +149,10 @@ else { | ||
_createDocument() { | ||
if (!(0, tslib_1.__classPrivateFieldGet)(this, _MLCore_ast, "f")) { | ||
if (!tslib_1.__classPrivateFieldGet(this, _MLCore_ast, "f")) { | ||
return; | ||
} | ||
try { | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLCore_document, new ml_dom_1.Document((0, tslib_1.__classPrivateFieldGet)(this, _MLCore_ast, "f"), (0, tslib_1.__classPrivateFieldGet)(this, _MLCore_ruleset, "f"), (0, tslib_1.__classPrivateFieldGet)(this, _MLCore_schemas, "f"), { | ||
filename: (0, tslib_1.__classPrivateFieldGet)(this, _MLCore_filename, "f"), | ||
tagNameCaseSensitive: (0, tslib_1.__classPrivateFieldGet)(this, _MLCore_parser, "f").tagNameCaseSensitive, | ||
endTag: (0, tslib_1.__classPrivateFieldGet)(this, _MLCore_parser, "f").endTag, | ||
tslib_1.__classPrivateFieldSet(this, _MLCore_document, new ml_dom_1.Document(tslib_1.__classPrivateFieldGet(this, _MLCore_ast, "f"), tslib_1.__classPrivateFieldGet(this, _MLCore_ruleset, "f"), tslib_1.__classPrivateFieldGet(this, _MLCore_schemas, "f"), { | ||
filename: tslib_1.__classPrivateFieldGet(this, _MLCore_filename, "f"), | ||
tagNameCaseSensitive: tslib_1.__classPrivateFieldGet(this, _MLCore_parser, "f").tagNameCaseSensitive, | ||
endTag: tslib_1.__classPrivateFieldGet(this, _MLCore_parser, "f").endTag, | ||
}), "f"); | ||
@@ -162,3 +162,3 @@ } | ||
if (err instanceof parser_utils_1.ParserError) { | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLCore_document, err, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLCore_document, err, "f"); | ||
} | ||
@@ -165,0 +165,0 @@ else { |
@@ -54,3 +54,3 @@ "use strict"; | ||
this.endTag = (_a = options === null || options === void 0 ? void 0 : options.endTag) !== null && _a !== void 0 ? _a : 'omittable'; | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLDOMDocument_filename, options === null || options === void 0 ? void 0 : options.filename, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLDOMDocument_filename, options === null || options === void 0 ? void 0 : options.filename, "f"); | ||
// console.log(ast.nodeList.map((n, i) => `${i}: ${n.uuid} "${n.raw.trim()}"(${n.type})`)); | ||
@@ -69,3 +69,3 @@ this.nodeList = Object.freeze(ast.nodeList.map(astNode => { | ||
get filename() { | ||
return (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMDocument_filename, "f"); | ||
return tslib_1.__classPrivateFieldGet(this, _MLDOMDocument_filename, "f"); | ||
} | ||
@@ -72,0 +72,0 @@ get doctype() { |
@@ -6,3 +6,3 @@ "use strict"; | ||
const tokens_1 = require("../tokens"); | ||
const preprocessor_specific_block_1 = (0, tslib_1.__importDefault)(require("../tokens/preprocessor-specific-block")); | ||
const preprocessor_specific_block_1 = tslib_1.__importDefault(require("../tokens/preprocessor-specific-block")); | ||
function createNode(astNode, document, pearNode) { | ||
@@ -9,0 +9,0 @@ const _astNode = astNode; |
@@ -59,30 +59,30 @@ "use strict"; | ||
this.line = line; | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLDOMIndentation_node, originTextNode, "f"); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLDOMIndentation_parent, parentNode, "f"); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLDOMIndentation_fixed, raw, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLDOMIndentation_node, originTextNode, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLDOMIndentation_parent, parentNode, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLDOMIndentation_fixed, raw, "f"); | ||
} | ||
get type() { | ||
if ((0, tslib_1.__classPrivateFieldGet)(this, _MLDOMIndentation_parent, "f").type !== 'Text' && this.line !== (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMIndentation_node, "f").endLine) { | ||
if (tslib_1.__classPrivateFieldGet(this, _MLDOMIndentation_parent, "f").type !== 'Text' && this.line !== tslib_1.__classPrivateFieldGet(this, _MLDOMIndentation_node, "f").endLine) { | ||
return 'none'; | ||
} | ||
const raw = (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMIndentation_fixed, "f"); | ||
const raw = tslib_1.__classPrivateFieldGet(this, _MLDOMIndentation_fixed, "f"); | ||
return raw === '' ? 'none' : /^\t+$/.test(raw) ? 'tab' : /^[^\t]+$/.test(raw) ? 'space' : 'mixed'; | ||
} | ||
get width() { | ||
if ((0, tslib_1.__classPrivateFieldGet)(this, _MLDOMIndentation_parent, "f").type !== 'Text' && this.line !== (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMIndentation_node, "f").endLine) { | ||
if (tslib_1.__classPrivateFieldGet(this, _MLDOMIndentation_parent, "f").type !== 'Text' && this.line !== tslib_1.__classPrivateFieldGet(this, _MLDOMIndentation_node, "f").endLine) { | ||
return 0; | ||
} | ||
return (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMIndentation_fixed, "f").length; | ||
return tslib_1.__classPrivateFieldGet(this, _MLDOMIndentation_fixed, "f").length; | ||
} | ||
get raw() { | ||
if ((0, tslib_1.__classPrivateFieldGet)(this, _MLDOMIndentation_parent, "f").type !== 'Text' && this.line !== (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMIndentation_node, "f").endLine) { | ||
if (tslib_1.__classPrivateFieldGet(this, _MLDOMIndentation_parent, "f").type !== 'Text' && this.line !== tslib_1.__classPrivateFieldGet(this, _MLDOMIndentation_node, "f").endLine) { | ||
return ''; | ||
} | ||
return (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMIndentation_fixed, "f"); | ||
return tslib_1.__classPrivateFieldGet(this, _MLDOMIndentation_fixed, "f"); | ||
} | ||
fix(raw) { | ||
const current = (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMIndentation_fixed, "f"); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLDOMIndentation_fixed, raw, "f"); | ||
if ((0, tslib_1.__classPrivateFieldGet)(this, _MLDOMIndentation_node, "f")) { | ||
const node = (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMIndentation_node, "f"); | ||
const current = tslib_1.__classPrivateFieldGet(this, _MLDOMIndentation_fixed, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLDOMIndentation_fixed, raw, "f"); | ||
if (tslib_1.__classPrivateFieldGet(this, _MLDOMIndentation_node, "f")) { | ||
const node = tslib_1.__classPrivateFieldGet(this, _MLDOMIndentation_node, "f"); | ||
const line = node.startLine; | ||
@@ -92,3 +92,3 @@ const lines = node.raw.split(/\r?\n/); | ||
if (lines[index] != null) { | ||
lines[index] = lines[index].replace(current, (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMIndentation_fixed, "f")); | ||
lines[index] = lines[index].replace(current, tslib_1.__classPrivateFieldGet(this, _MLDOMIndentation_fixed, "f")); | ||
} | ||
@@ -95,0 +95,0 @@ node.fix(lines.join('\n')); |
@@ -11,7 +11,7 @@ "use strict"; | ||
setNode(astNode, node) { | ||
(0, tslib_1.__classPrivateFieldGet)(this, _NodeStore_store, "f").set(astNode.uuid, node); | ||
tslib_1.__classPrivateFieldGet(this, _NodeStore_store, "f").set(astNode.uuid, node); | ||
} | ||
getNode(astNode) { | ||
// console.log(`Get: ${astNode.uuid} -> ${astNode.raw.trim()}(${astNode.type})`); | ||
const node = (0, tslib_1.__classPrivateFieldGet)(this, _NodeStore_store, "f").get(astNode.uuid); | ||
const node = tslib_1.__classPrivateFieldGet(this, _NodeStore_store, "f").get(astNode.uuid); | ||
if (!node) { | ||
@@ -18,0 +18,0 @@ throw new parser_utils_1.ParserError('Broke mapping nodes.', { |
@@ -6,3 +6,3 @@ "use strict"; | ||
const tslib_1 = require("tslib"); | ||
const postcss_selector_parser_1 = (0, tslib_1.__importDefault)(require("postcss-selector-parser")); | ||
const postcss_selector_parser_1 = tslib_1.__importDefault(require("postcss-selector-parser")); | ||
const debug_1 = require("../../debug"); | ||
@@ -40,6 +40,6 @@ const log = debug_1.log.extend('selector'); | ||
_Selector_ruleset.set(this, void 0); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _Selector_ruleset, Ruleset.parse(selector, tagNameCaseSensitive), "f"); | ||
tslib_1.__classPrivateFieldSet(this, _Selector_ruleset, Ruleset.parse(selector, tagNameCaseSensitive), "f"); | ||
} | ||
match(el, caller = el) { | ||
const results = (0, tslib_1.__classPrivateFieldGet)(this, _Selector_ruleset, "f").match(el, caller); | ||
const results = tslib_1.__classPrivateFieldGet(this, _Selector_ruleset, "f").match(el, caller); | ||
for (const result of results) { | ||
@@ -57,3 +57,3 @@ if (result.matched) { | ||
_Ruleset_selectorGroup.set(this, []); | ||
(0, tslib_1.__classPrivateFieldGet)(this, _Ruleset_selectorGroup, "f").push(...selectors.map(selector => new StructuredSelector(selector, tagNameCaseSensitive))); | ||
tslib_1.__classPrivateFieldGet(this, _Ruleset_selectorGroup, "f").push(...selectors.map(selector => new StructuredSelector(selector, tagNameCaseSensitive))); | ||
} | ||
@@ -69,3 +69,3 @@ static parse(selector, tagNameCaseSensitive) { | ||
log('%s', el.raw); | ||
return (0, tslib_1.__classPrivateFieldGet)(this, _Ruleset_selectorGroup, "f").map(selector => { | ||
return tslib_1.__classPrivateFieldGet(this, _Ruleset_selectorGroup, "f").map(selector => { | ||
const res = selector.match(el, caller); | ||
@@ -82,10 +82,10 @@ resLog('%s => %o', selector.selector, res); | ||
_StructuredSelector_selector.set(this, void 0); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _StructuredSelector_selector, selector, "f"); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _StructuredSelector_edge, new SelectorTarget(tagNameCaseSensitive), "f"); | ||
(0, tslib_1.__classPrivateFieldGet)(this, _StructuredSelector_selector, "f").nodes.forEach(node => { | ||
tslib_1.__classPrivateFieldSet(this, _StructuredSelector_selector, selector, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _StructuredSelector_edge, new SelectorTarget(tagNameCaseSensitive), "f"); | ||
tslib_1.__classPrivateFieldGet(this, _StructuredSelector_selector, "f").nodes.forEach(node => { | ||
switch (node.type) { | ||
case 'combinator': { | ||
const combinatedTarget = new SelectorTarget(tagNameCaseSensitive); | ||
combinatedTarget.from((0, tslib_1.__classPrivateFieldGet)(this, _StructuredSelector_edge, "f"), node); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _StructuredSelector_edge, combinatedTarget, "f"); | ||
combinatedTarget.from(tslib_1.__classPrivateFieldGet(this, _StructuredSelector_edge, "f"), node); | ||
tslib_1.__classPrivateFieldSet(this, _StructuredSelector_edge, combinatedTarget, "f"); | ||
break; | ||
@@ -104,3 +104,3 @@ } | ||
default: { | ||
(0, tslib_1.__classPrivateFieldGet)(this, _StructuredSelector_edge, "f").add(node); | ||
tslib_1.__classPrivateFieldGet(this, _StructuredSelector_edge, "f").add(node); | ||
} | ||
@@ -111,6 +111,6 @@ } | ||
get selector() { | ||
return (0, tslib_1.__classPrivateFieldGet)(this, _StructuredSelector_selector, "f").nodes.join(''); | ||
return tslib_1.__classPrivateFieldGet(this, _StructuredSelector_selector, "f").nodes.join(''); | ||
} | ||
match(el, caller) { | ||
return (0, tslib_1.__classPrivateFieldGet)(this, _StructuredSelector_edge, "f").match(el, caller); | ||
return tslib_1.__classPrivateFieldGet(this, _StructuredSelector_edge, "f").match(el, caller); | ||
} | ||
@@ -129,3 +129,3 @@ } | ||
_SelectorTarget_combinatedFrom.set(this, null); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _SelectorTarget_tagNameCaseSensitive, tagNameCaseSensitive, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _SelectorTarget_tagNameCaseSensitive, tagNameCaseSensitive, "f"); | ||
} | ||
@@ -137,6 +137,6 @@ match(el, caller) { | ||
} | ||
if (!(0, tslib_1.__classPrivateFieldGet)(this, _SelectorTarget_combinatedFrom, "f")) { | ||
if (!tslib_1.__classPrivateFieldGet(this, _SelectorTarget_combinatedFrom, "f")) { | ||
return unitCheck; | ||
} | ||
const { target, combinator } = (0, tslib_1.__classPrivateFieldGet)(this, _SelectorTarget_combinatedFrom, "f"); | ||
const { target, combinator } = tslib_1.__classPrivateFieldGet(this, _SelectorTarget_combinatedFrom, "f"); | ||
switch (combinator.value) { | ||
@@ -259,3 +259,3 @@ // Descendant combinator | ||
default: { | ||
throw new Error(`Unsupported ${(0, tslib_1.__classPrivateFieldGet)(this, _SelectorTarget_combinatedFrom, "f").combinator.value} combinator in selector`); | ||
throw new Error(`Unsupported ${tslib_1.__classPrivateFieldGet(this, _SelectorTarget_combinatedFrom, "f").combinator.value} combinator in selector`); | ||
} | ||
@@ -267,3 +267,3 @@ } | ||
let matched = true; | ||
if (!(0, tslib_1.__classPrivateFieldGet)(this, _SelectorTarget_isAdded, "f") && !isScope(el, caller)) { | ||
if (!tslib_1.__classPrivateFieldGet(this, _SelectorTarget_isAdded, "f") && !isScope(el, caller)) { | ||
matched = false; | ||
@@ -284,3 +284,3 @@ } | ||
for (const pseudo of this.pseudo) { | ||
const pseudoRes = pseudoMatch(pseudo, el, caller, (0, tslib_1.__classPrivateFieldGet)(this, _SelectorTarget_tagNameCaseSensitive, "f")); | ||
const pseudoRes = pseudoMatch(pseudo, el, caller, tslib_1.__classPrivateFieldGet(this, _SelectorTarget_tagNameCaseSensitive, "f")); | ||
specificity[0] += pseudoRes.specificity[0]; | ||
@@ -297,3 +297,3 @@ specificity[1] += pseudoRes.specificity[1]; | ||
let b = el.nodeName; | ||
if (!(0, tslib_1.__classPrivateFieldGet)(this, _SelectorTarget_tagNameCaseSensitive, "f")) { | ||
if (!tslib_1.__classPrivateFieldGet(this, _SelectorTarget_tagNameCaseSensitive, "f")) { | ||
a = a.toLowerCase(); | ||
@@ -312,3 +312,3 @@ b = b.toLowerCase(); | ||
add(selector) { | ||
(0, tslib_1.__classPrivateFieldSet)(this, _SelectorTarget_isAdded, true, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _SelectorTarget_isAdded, true, "f"); | ||
switch (selector.type) { | ||
@@ -339,3 +339,3 @@ case 'tag': | ||
from(target, combinator) { | ||
(0, tslib_1.__classPrivateFieldSet)(this, _SelectorTarget_combinatedFrom, { target, combinator }, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _SelectorTarget_combinatedFrom, { target, combinator }, "f"); | ||
} | ||
@@ -342,0 +342,0 @@ } |
@@ -15,3 +15,3 @@ "use strict"; | ||
_RuleMapper_ruleMap.set(this, new Map()); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _RuleMapper_nodeList, nodeList, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _RuleMapper_nodeList, nodeList, "f"); | ||
} | ||
@@ -22,3 +22,3 @@ set(node, ruleName, rule) { | ||
} | ||
const rules = (0, tslib_1.__classPrivateFieldGet)(this, _RuleMapper_ruleMap, "f").get(node.uuid) || {}; | ||
const rules = tslib_1.__classPrivateFieldGet(this, _RuleMapper_ruleMap, "f").get(node.uuid) || {}; | ||
const currentRule = rules[ruleName]; | ||
@@ -34,5 +34,5 @@ if (currentRule) { | ||
rules[ruleName] = rule; | ||
(0, tslib_1.__classPrivateFieldGet)(this, _RuleMapper_ruleMap, "f").set(node.uuid, rules); | ||
tslib_1.__classPrivateFieldGet(this, _RuleMapper_ruleMap, "f").set(node.uuid, rules); | ||
if (node.type === 'Element' && node.closeTag) { | ||
(0, tslib_1.__classPrivateFieldGet)(this, _RuleMapper_ruleMap, "f").set(node.closeTag.uuid, rules); | ||
tslib_1.__classPrivateFieldGet(this, _RuleMapper_ruleMap, "f").set(node.closeTag.uuid, rules); | ||
} | ||
@@ -43,4 +43,4 @@ ruleMapperLog('Set to %s from %s (%o): %O', node.raw, rule.from, rule.specificity, rule.rule); | ||
ruleMapperLog('ruleTree:'); | ||
(0, tslib_1.__classPrivateFieldGet)(this, _RuleMapper_nodeList, "f").forEach(node => { | ||
const rules = (0, tslib_1.__classPrivateFieldGet)(this, _RuleMapper_ruleMap, "f").get(node.uuid); | ||
tslib_1.__classPrivateFieldGet(this, _RuleMapper_nodeList, "f").forEach(node => { | ||
const rules = tslib_1.__classPrivateFieldGet(this, _RuleMapper_ruleMap, "f").get(node.uuid); | ||
if (!rules) { | ||
@@ -47,0 +47,0 @@ return; |
@@ -9,3 +9,3 @@ "use strict"; | ||
const walkers_1 = require("../helper/walkers"); | ||
const node_1 = (0, tslib_1.__importDefault)(require("./node")); | ||
const node_1 = tslib_1.__importDefault(require("./node")); | ||
class MLDOMAbstractElement extends node_1.default { | ||
@@ -24,3 +24,3 @@ constructor(astNode, document) { | ||
this.nodeName = astNode.nodeName; | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLDOMAbstractElement_fixedNodeName, astNode.nodeName, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLDOMAbstractElement_fixedNodeName, astNode.nodeName, "f"); | ||
this.namespaceURI = astNode.namespace; | ||
@@ -103,3 +103,3 @@ this.isForeignElement = this.namespaceURI !== 'http://www.w3.org/1999/xhtml'; | ||
get fixedNodeName() { | ||
return (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMAbstractElement_fixedNodeName, "f"); | ||
return tslib_1.__classPrivateFieldGet(this, _MLDOMAbstractElement_fixedNodeName, "f"); | ||
} | ||
@@ -167,7 +167,7 @@ get textContent() { | ||
fixNodeName(name) { | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLDOMAbstractElement_fixedNodeName, name, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLDOMAbstractElement_fixedNodeName, name, "f"); | ||
} | ||
getChildElementsAndTextNodeWithoutWhitespaces() { | ||
if ((0, tslib_1.__classPrivateFieldGet)(this, _MLDOMAbstractElement_getChildElementsAndTextNodeWithoutWhitespacesCache, "f")) { | ||
return (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMAbstractElement_getChildElementsAndTextNodeWithoutWhitespacesCache, "f"); | ||
if (tslib_1.__classPrivateFieldGet(this, _MLDOMAbstractElement_getChildElementsAndTextNodeWithoutWhitespacesCache, "f")) { | ||
return tslib_1.__classPrivateFieldGet(this, _MLDOMAbstractElement_getChildElementsAndTextNodeWithoutWhitespacesCache, "f"); | ||
} | ||
@@ -187,3 +187,3 @@ const filteredNodes = []; | ||
}); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLDOMAbstractElement_getChildElementsAndTextNodeWithoutWhitespacesCache, filteredNodes, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLDOMAbstractElement_getChildElementsAndTextNodeWithoutWhitespacesCache, filteredNodes, "f"); | ||
return filteredNodes; | ||
@@ -238,4 +238,4 @@ } | ||
toNormalizeString() { | ||
if ((0, tslib_1.__classPrivateFieldGet)(this, _MLDOMAbstractElement_normalizedString, "f")) { | ||
return (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMAbstractElement_normalizedString, "f"); | ||
if (tslib_1.__classPrivateFieldGet(this, _MLDOMAbstractElement_normalizedString, "f")) { | ||
return tslib_1.__classPrivateFieldGet(this, _MLDOMAbstractElement_normalizedString, "f"); | ||
} | ||
@@ -254,3 +254,3 @@ const children = this.getChildElementsAndTextNodeWithoutWhitespaces(); | ||
const normalizedString = `${startTag}${childNodes.join('')}${endTag}`; | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLDOMAbstractElement_normalizedString, normalizedString, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLDOMAbstractElement_normalizedString, normalizedString, "f"); | ||
return normalizedString; | ||
@@ -257,0 +257,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const token_1 = (0, tslib_1.__importDefault)(require("./token")); | ||
const token_1 = tslib_1.__importDefault(require("./token")); | ||
class MLDOMAttribute extends token_1.default { | ||
@@ -6,0 +6,0 @@ constructor(astToken) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const node_1 = (0, tslib_1.__importDefault)(require("./node")); | ||
const node_1 = tslib_1.__importDefault(require("./node")); | ||
class MLDOMComment extends node_1.default { | ||
@@ -6,0 +6,0 @@ constructor() { |
@@ -5,3 +5,3 @@ "use strict"; | ||
const tslib_1 = require("tslib"); | ||
const node_1 = (0, tslib_1.__importDefault)(require("./node")); | ||
const node_1 = tslib_1.__importDefault(require("./node")); | ||
class MLDOMDoctype extends node_1.default { | ||
@@ -15,14 +15,14 @@ constructor(astNode, document) { | ||
_MLDOMDoctype_systemId.set(this, void 0); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLDOMDoctype_name, astNode.name, "f"); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLDOMDoctype_publicId, astNode.publicId, "f"); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLDOMDoctype_systemId, astNode.systemId, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLDOMDoctype_name, astNode.name, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLDOMDoctype_publicId, astNode.publicId, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLDOMDoctype_systemId, astNode.systemId, "f"); | ||
} | ||
get name() { | ||
return (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMDoctype_name, "f"); | ||
return tslib_1.__classPrivateFieldGet(this, _MLDOMDoctype_name, "f"); | ||
} | ||
get publicId() { | ||
return (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMDoctype_publicId, "f"); | ||
return tslib_1.__classPrivateFieldGet(this, _MLDOMDoctype_publicId, "f"); | ||
} | ||
get systemId() { | ||
return (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMDoctype_systemId, "f"); | ||
return tslib_1.__classPrivateFieldGet(this, _MLDOMDoctype_systemId, "f"); | ||
} | ||
@@ -29,0 +29,0 @@ get textContent() { |
@@ -6,3 +6,3 @@ "use strict"; | ||
const string_splice_1 = require("../../utils/string-splice"); | ||
const node_1 = (0, tslib_1.__importDefault)(require("./node")); | ||
const node_1 = tslib_1.__importDefault(require("./node")); | ||
class MLDOMElementCloseTag extends node_1.default { | ||
@@ -17,7 +17,7 @@ constructor(astNode, document, startTag) { | ||
this.nodeName = astNode.nodeName; | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLDOMElementCloseTag_fixedNodeName, astNode.nodeName, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLDOMElementCloseTag_fixedNodeName, astNode.nodeName, "f"); | ||
this.startTag = startTag; | ||
this.isForeignElement = startTag.isForeignElement; | ||
this.isCustomElement = astNode.isCustomElement; | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLDOMElementCloseTag_tagOpenChar, astNode.tagOpenChar, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLDOMElementCloseTag_tagOpenChar, astNode.tagOpenChar, "f"); | ||
// this.#tagCloseChar = astNode.tagCloseChar; | ||
@@ -27,4 +27,4 @@ } | ||
let fixed = this.originRaw; | ||
if (this.nodeName !== (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMElementCloseTag_fixedNodeName, "f")) { | ||
fixed = (0, string_splice_1.stringSplice)(fixed, (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMElementCloseTag_tagOpenChar, "f").length, this.nodeName.length, (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMElementCloseTag_fixedNodeName, "f")); | ||
if (this.nodeName !== tslib_1.__classPrivateFieldGet(this, _MLDOMElementCloseTag_fixedNodeName, "f")) { | ||
fixed = (0, string_splice_1.stringSplice)(fixed, tslib_1.__classPrivateFieldGet(this, _MLDOMElementCloseTag_tagOpenChar, "f").length, this.nodeName.length, tslib_1.__classPrivateFieldGet(this, _MLDOMElementCloseTag_fixedNodeName, "f")); | ||
} | ||
@@ -37,3 +37,3 @@ return fixed; | ||
fixNodeName(name) { | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLDOMElementCloseTag_fixedNodeName, name, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLDOMElementCloseTag_fixedNodeName, name, "f"); | ||
} | ||
@@ -44,3 +44,3 @@ getNameLocation() { | ||
line: this.startLine, | ||
col: this.startCol + (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMElementCloseTag_tagOpenChar, "f").length, | ||
col: this.startCol + tslib_1.__classPrivateFieldGet(this, _MLDOMElementCloseTag_tagOpenChar, "f").length, | ||
}; | ||
@@ -47,0 +47,0 @@ } |
@@ -8,6 +8,6 @@ "use strict"; | ||
const walkers_1 = require("../helper/walkers"); | ||
const abstract_element_1 = (0, tslib_1.__importDefault)(require("./abstract-element")); | ||
const attribute_1 = (0, tslib_1.__importDefault)(require("./attribute")); | ||
const preprocessor_specific_attribute_1 = (0, tslib_1.__importDefault)(require("./preprocessor-specific-attribute")); | ||
const token_1 = (0, tslib_1.__importDefault)(require("./token")); | ||
const abstract_element_1 = tslib_1.__importDefault(require("./abstract-element")); | ||
const attribute_1 = tslib_1.__importDefault(require("./attribute")); | ||
const preprocessor_specific_attribute_1 = tslib_1.__importDefault(require("./preprocessor-specific-attribute")); | ||
const token_1 = tslib_1.__importDefault(require("./token")); | ||
class MLDOMElement extends abstract_element_1.default { | ||
@@ -24,4 +24,4 @@ constructor(astNode, document) { | ||
this.closeTag = astNode.pearNode ? (0, helper_1.createNode)(astNode.pearNode, document, this) : null; | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLDOMElement_tagOpenChar, astNode.tagOpenChar, "f"); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLDOMElement_tagCloseChar, astNode.tagCloseChar, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLDOMElement_tagOpenChar, astNode.tagOpenChar, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLDOMElement_tagCloseChar, astNode.tagCloseChar, "f"); | ||
} | ||
@@ -32,3 +32,3 @@ get raw() { | ||
if (this.nodeName !== this.fixedNodeName) { | ||
fixed = (0, string_splice_1.stringSplice)(fixed, (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMElement_tagOpenChar, "f").length, this.nodeName.length, this.fixedNodeName); | ||
fixed = (0, string_splice_1.stringSplice)(fixed, tslib_1.__classPrivateFieldGet(this, _MLDOMElement_tagOpenChar, "f").length, this.nodeName.length, this.fixedNodeName); | ||
gap = gap + this.fixedNodeName.length - this.nodeName.length; | ||
@@ -64,3 +64,3 @@ } | ||
line: this.startLine, | ||
col: this.startCol + (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMElement_tagOpenChar, "f").length, | ||
col: this.startCol + tslib_1.__classPrivateFieldGet(this, _MLDOMElement_tagOpenChar, "f").length, | ||
}; | ||
@@ -67,0 +67,0 @@ } |
@@ -5,3 +5,3 @@ "use strict"; | ||
const tslib_1 = require("tslib"); | ||
const token_1 = (0, tslib_1.__importDefault)(require("./token")); | ||
const token_1 = tslib_1.__importDefault(require("./token")); | ||
class MLDOMNode extends token_1.default { | ||
@@ -59,4 +59,4 @@ constructor(astNode, document) { | ||
get prevToken() { | ||
if ((0, tslib_1.__classPrivateFieldGet)(this, _MLDOMNode_prevToken, "f") !== undefined) { | ||
return (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMNode_prevToken, "f"); | ||
if (tslib_1.__classPrivateFieldGet(this, _MLDOMNode_prevToken, "f") !== undefined) { | ||
return tslib_1.__classPrivateFieldGet(this, _MLDOMNode_prevToken, "f"); | ||
} | ||
@@ -78,7 +78,7 @@ let index = -1; | ||
if (index === -1) { | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLDOMNode_prevToken, null, "f"); | ||
return (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMNode_prevToken, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLDOMNode_prevToken, null, "f"); | ||
return tslib_1.__classPrivateFieldGet(this, _MLDOMNode_prevToken, "f"); | ||
} | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLDOMNode_prevToken, this.ownerDocument.nodeList[index - 1] || null, "f"); | ||
return (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMNode_prevToken, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLDOMNode_prevToken, this.ownerDocument.nodeList[index - 1] || null, "f"); | ||
return tslib_1.__classPrivateFieldGet(this, _MLDOMNode_prevToken, "f"); | ||
} | ||
@@ -85,0 +85,0 @@ get nodeStore() { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const abstract_element_1 = (0, tslib_1.__importDefault)(require("./abstract-element")); | ||
const abstract_element_1 = tslib_1.__importDefault(require("./abstract-element")); | ||
class MLDOMOmittedElement extends abstract_element_1.default { | ||
@@ -6,0 +6,0 @@ constructor(astNode, document) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const token_1 = (0, tslib_1.__importDefault)(require("./token")); | ||
const token_1 = tslib_1.__importDefault(require("./token")); | ||
class MLDOMPreprocessorSpecificAttribute extends token_1.default { | ||
@@ -6,0 +6,0 @@ constructor(astToken) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const node_1 = (0, tslib_1.__importDefault)(require("./node")); | ||
const node_1 = tslib_1.__importDefault(require("./node")); | ||
class MLDOMPreprocessorSpecificBlock extends node_1.default { | ||
@@ -6,0 +6,0 @@ constructor(astNode, document) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const node_1 = (0, tslib_1.__importDefault)(require("./node")); | ||
const node_1 = tslib_1.__importDefault(require("./node")); | ||
/** | ||
@@ -6,0 +6,0 @@ * Raw text elements |
@@ -16,38 +16,38 @@ "use strict"; | ||
this._astToken = astToken; | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLDOMToken_raw, astToken.raw, "f"); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLDOMToken_fixed, astToken.raw, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLDOMToken_raw, astToken.raw, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLDOMToken_fixed, astToken.raw, "f"); | ||
this.uuid = astToken.uuid; | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLDOMToken_startLine, astToken.startLine, "f"); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLDOMToken_endLine, astToken.endLine, "f"); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLDOMToken_startCol, astToken.startCol, "f"); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLDOMToken_endCol, astToken.endCol, "f"); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLDOMToken_startOffset, astToken.startOffset, "f"); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLDOMToken_endOffset, astToken.endOffset, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLDOMToken_startLine, astToken.startLine, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLDOMToken_endLine, astToken.endLine, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLDOMToken_startCol, astToken.startCol, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLDOMToken_endCol, astToken.endCol, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLDOMToken_startOffset, astToken.startOffset, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLDOMToken_endOffset, astToken.endOffset, "f"); | ||
} | ||
get originRaw() { | ||
return (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMToken_raw, "f"); | ||
return tslib_1.__classPrivateFieldGet(this, _MLDOMToken_raw, "f"); | ||
} | ||
get raw() { | ||
return (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMToken_fixed, "f"); | ||
return tslib_1.__classPrivateFieldGet(this, _MLDOMToken_fixed, "f"); | ||
} | ||
get startOffset() { | ||
return (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMToken_startOffset, "f"); | ||
return tslib_1.__classPrivateFieldGet(this, _MLDOMToken_startOffset, "f"); | ||
} | ||
get endOffset() { | ||
return (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMToken_endOffset, "f"); | ||
return tslib_1.__classPrivateFieldGet(this, _MLDOMToken_endOffset, "f"); | ||
} | ||
get startLine() { | ||
return (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMToken_startLine, "f"); | ||
return tslib_1.__classPrivateFieldGet(this, _MLDOMToken_startLine, "f"); | ||
} | ||
get endLine() { | ||
return (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMToken_endLine, "f"); | ||
return tslib_1.__classPrivateFieldGet(this, _MLDOMToken_endLine, "f"); | ||
} | ||
get startCol() { | ||
return (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMToken_startCol, "f"); | ||
return tslib_1.__classPrivateFieldGet(this, _MLDOMToken_startCol, "f"); | ||
} | ||
get endCol() { | ||
return (0, tslib_1.__classPrivateFieldGet)(this, _MLDOMToken_endCol, "f"); | ||
return tslib_1.__classPrivateFieldGet(this, _MLDOMToken_endCol, "f"); | ||
} | ||
fix(raw) { | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLDOMToken_fixed, raw, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLDOMToken_fixed, raw, "f"); | ||
} | ||
@@ -54,0 +54,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
(0, tslib_1.__exportStar)(require("./create-rule"), exports); | ||
(0, tslib_1.__exportStar)(require("./ml-rule"), exports); | ||
(0, tslib_1.__exportStar)(require("./types"), exports); | ||
tslib_1.__exportStar(require("./create-rule"), exports); | ||
tslib_1.__exportStar(require("./ml-rule"), exports); | ||
tslib_1.__exportStar(require("./types"), exports); |
@@ -16,3 +16,3 @@ "use strict"; | ||
get reports() { | ||
return (0, tslib_1.__classPrivateFieldGet)(this, _MLRuleContext_reports, "f").map(report => ({ | ||
return tslib_1.__classPrivateFieldGet(this, _MLRuleContext_reports, "f").map(report => ({ | ||
...report, | ||
@@ -23,3 +23,3 @@ message: finish(report.message), | ||
report(report) { | ||
(0, tslib_1.__classPrivateFieldGet)(this, _MLRuleContext_reports, "f").push(report); | ||
tslib_1.__classPrivateFieldGet(this, _MLRuleContext_reports, "f").push(report); | ||
} | ||
@@ -26,0 +26,0 @@ provide() { |
@@ -16,4 +16,4 @@ "use strict"; | ||
this.defaultOptions = (_b = o.defaultOptions) !== null && _b !== void 0 ? _b : null; | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLRule_v, o.verify, "f"); | ||
(0, tslib_1.__classPrivateFieldSet)(this, _MLRule_f, o.fix, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLRule_v, o.verify, "f"); | ||
tslib_1.__classPrivateFieldSet(this, _MLRule_f, o.fix, "f"); | ||
} | ||
@@ -25,3 +25,3 @@ /** | ||
get v() { | ||
return (0, tslib_1.__classPrivateFieldGet)(this, _MLRule_v, "f"); | ||
return tslib_1.__classPrivateFieldGet(this, _MLRule_v, "f"); | ||
} | ||
@@ -33,6 +33,6 @@ /** | ||
get f() { | ||
return (0, tslib_1.__classPrivateFieldGet)(this, _MLRule_f, "f"); | ||
return tslib_1.__classPrivateFieldGet(this, _MLRule_f, "f"); | ||
} | ||
async verify(document, locale, globalRule, fix) { | ||
if (!(0, tslib_1.__classPrivateFieldGet)(this, _MLRule_v, "f")) { | ||
if (!tslib_1.__classPrivateFieldGet(this, _MLRule_v, "f")) { | ||
return []; | ||
@@ -43,5 +43,5 @@ } | ||
const providableContext = context.provide(); | ||
await (0, tslib_1.__classPrivateFieldGet)(this, _MLRule_v, "f").call(this, providableContext); | ||
if ((0, tslib_1.__classPrivateFieldGet)(this, _MLRule_f, "f") && fix) { | ||
await (0, tslib_1.__classPrivateFieldGet)(this, _MLRule_f, "f").call(this, providableContext); | ||
await tslib_1.__classPrivateFieldGet(this, _MLRule_v, "f").call(this, providableContext); | ||
if (tslib_1.__classPrivateFieldGet(this, _MLRule_f, "f") && fix) { | ||
await tslib_1.__classPrivateFieldGet(this, _MLRule_f, "f").call(this, providableContext); | ||
} | ||
@@ -48,0 +48,0 @@ const violation = context.reports.map(report => { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
(0, tslib_1.__exportStar)(require("./plugin"), exports); | ||
(0, tslib_1.__exportStar)(require("./types"), exports); | ||
tslib_1.__exportStar(require("./plugin"), exports); | ||
tslib_1.__exportStar(require("./types"), exports); |
{ | ||
"name": "@markuplint/ml-core", | ||
"version": "2.1.2", | ||
"version": "2.2.0", | ||
"description": "The core module of markuplint", | ||
@@ -20,17 +20,17 @@ "repository": "git@github.com:markuplint/markuplint.git", | ||
"dependencies": { | ||
"@markuplint/i18n": "2.0.1-dev.20220307.0", | ||
"@markuplint/i18n": "2.1.0", | ||
"@markuplint/ml-ast": "2.0.1-dev.20220307.0", | ||
"@markuplint/ml-config": "2.0.1-dev.20220307.0", | ||
"@markuplint/ml-spec": "^2.0.2", | ||
"@markuplint/parser-utils": "2.0.1-dev.20220307.0", | ||
"debug": "^4.3.3", | ||
"@markuplint/ml-spec": "2.1.0", | ||
"@markuplint/parser-utils": "2.1.0", | ||
"debug": "^4.3.4", | ||
"dom-accessibility-api": "^0.5.13", | ||
"postcss-selector-parser": "^6.0.9", | ||
"postcss-selector-parser": "^6.0.10", | ||
"tslib": "^2.3.1" | ||
}, | ||
"devDependencies": { | ||
"@markuplint/html-parser": "2.0.1-dev.20220307.0", | ||
"@markuplint/html-parser": "2.1.0", | ||
"@types/debug": "^4.1.7" | ||
}, | ||
"gitHead": "76939e9a8278829f1871a117f8c0cbc9777db7c2" | ||
"gitHead": "0321513e36cc74929c41e06e1f58c43ff7602556" | ||
} |
Sorry, the diff of this file is not supported yet
209058
3627
+ Added@markuplint/i18n@2.1.0(transitive)
+ Added@markuplint/ml-spec@2.1.0(transitive)
+ Added@markuplint/parser-utils@2.1.0(transitive)
+ Added@markuplint/types@2.1.0(transitive)
- Removed@markuplint/i18n@2.0.1-dev.20220307.0(transitive)
- Removed@markuplint/ml-spec@2.1.3(transitive)
- Removed@markuplint/parser-utils@2.0.1-dev.20220307.0(transitive)
- Removed@markuplint/types@2.0.1-dev.20220307.0(transitive)
Updated@markuplint/i18n@2.1.0
Updated@markuplint/ml-spec@2.1.0
Updateddebug@^4.3.4