@markuplint/parser-utils
Advanced tools
Comparing version 3.8.0 to 3.9.0
@@ -1,2 +0,2 @@ | ||
export declare const MASK_CHAR = '\uE000'; | ||
export declare const MASK_CHAR = "\uE000"; | ||
/** | ||
@@ -3,0 +3,0 @@ * SVG Element list |
import type { MLToken } from '@markuplint/ml-ast'; | ||
export declare function tokenizer( | ||
raw: string | null, | ||
startLine: number, | ||
startCol: number, | ||
startOffset: number, | ||
): MLToken; | ||
export declare function tokenizer(raw: string | null, startLine: number, startCol: number, startOffset: number): MLToken; | ||
export declare function createTokenFromRawCode(raw: string | null, startOffset: number, rawCode: string): MLToken; | ||
export declare function uuid(): string; |
import type { ElementType, ParserAuthoredElementNameDistinguishing } from '@markuplint/ml-ast'; | ||
export declare function detectElementType( | ||
name: string, | ||
option?: ParserAuthoredElementNameDistinguishing, | ||
defaultPattern?: ParserAuthoredElementNameDistinguishing, | ||
): ElementType; | ||
export declare function detectElementType(name: string, option?: ParserAuthoredElementNameDistinguishing, defaultPattern?: ParserAuthoredElementNameDistinguishing): ElementType; |
@@ -5,14 +5,10 @@ export declare function getLine(html: string, startOffset: number): number; | ||
export declare function getEndCol(html: string, col: number): number; | ||
export declare function sliceFragment( | ||
rawHtml: string, | ||
start: number, | ||
end: number, | ||
): { | ||
startOffset: number; | ||
endOffset: number; | ||
startLine: number; | ||
endLine: number; | ||
startCol: number; | ||
endCol: number; | ||
raw: string; | ||
export declare function sliceFragment(rawHtml: string, start: number, end: number): { | ||
startOffset: number; | ||
endOffset: number; | ||
startLine: number; | ||
endLine: number; | ||
startCol: number; | ||
endCol: number; | ||
raw: string; | ||
}; |
@@ -1,1 +0,1 @@ | ||
export declare function getSpaceBefore(offset: number, rawCode: string): import('@markuplint/ml-ast').MLToken; | ||
export declare function getSpaceBefore(offset: number, rawCode: string): import("@markuplint/ml-ast").MLToken; |
export declare function searchIDLAttribute(name: string): { | ||
idlPropName: string | undefined; | ||
contentAttrName: string | undefined; | ||
idlPropName: string | undefined; | ||
contentAttrName: string | undefined; | ||
}; |
import type { MLASTHTMLAttr } from '@markuplint/ml-ast'; | ||
type ParseAttrOptions = { | ||
readonly booleanish?: boolean; | ||
readonly valueDelimiters?: readonly ValueDelimiter[]; | ||
readonly equal?: string; | ||
readonly booleanish?: boolean; | ||
readonly valueDelimiters?: readonly ValueDelimiter[]; | ||
readonly equal?: string; | ||
}; | ||
type ValueDelimiter = { | ||
readonly start: string; | ||
readonly end: string; | ||
readonly start: string; | ||
readonly end: string; | ||
}; | ||
export declare const defaultValueDelimiters: readonly ValueDelimiter[]; | ||
export declare function parseAttr(raw: string, offset: number, html: string, options?: ParseAttrOptions): MLASTHTMLAttr; | ||
export declare function tokenize( | ||
raw: string, | ||
options?: ParseAttrOptions, | ||
): { | ||
beforeName: string; | ||
name: string; | ||
afterName: string; | ||
equal: string; | ||
beforeValue: string; | ||
startQuote: string; | ||
value: string; | ||
endQuote: string; | ||
afterAttr: string; | ||
export declare function tokenize(raw: string, options?: ParseAttrOptions): { | ||
beforeName: string; | ||
name: string; | ||
afterName: string; | ||
equal: string; | ||
beforeValue: string; | ||
startQuote: string; | ||
value: string; | ||
endQuote: string; | ||
afterAttr: string; | ||
}; | ||
export {}; |
@@ -0,21 +1,26 @@ | ||
export type ParserErrorInfo = { | ||
readonly line?: number; | ||
readonly col?: number; | ||
readonly raw?: string; | ||
}; | ||
export declare class ParserError extends Error { | ||
readonly col: number; | ||
readonly line: number; | ||
name: string; | ||
readonly nodeName: string | null; | ||
readonly raw: string; | ||
constructor( | ||
message: string, | ||
{ | ||
line, | ||
col, | ||
raw, | ||
nodeName, | ||
}: { | ||
readonly line?: number; | ||
readonly col?: number; | ||
readonly raw?: string; | ||
readonly nodeName?: string | null; | ||
}, | ||
); | ||
readonly col: number; | ||
readonly line: number; | ||
name: string; | ||
readonly raw: string; | ||
constructor(message: string, info: ParserErrorInfo); | ||
} | ||
export declare class TargetParserError extends ParserError { | ||
name: string; | ||
readonly nodeName: string | null; | ||
constructor(message: string, info: ParserErrorInfo & { | ||
readonly nodeName?: string | null; | ||
}); | ||
} | ||
export declare class ConfigParserError extends ParserError { | ||
readonly filePath: string; | ||
name: string; | ||
constructor(message: string, info: ParserErrorInfo & { | ||
readonly filePath: string; | ||
}); | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ParserError = void 0; | ||
exports.ConfigParserError = exports.TargetParserError = exports.ParserError = void 0; | ||
class ParserError extends Error { | ||
constructor(message, { line = 1, col = 0, raw = '', nodeName = null, }) { | ||
super(nodeName ? `The ${nodeName} is invalid element (${line}:${col}): ${message}` : message); | ||
constructor(message, info) { | ||
var _a, _b, _c; | ||
super(message); | ||
this.name = 'ParserError'; | ||
this.line = line; | ||
this.col = col; | ||
this.raw = raw; | ||
this.nodeName = nodeName; | ||
this.line = (_a = info.line) !== null && _a !== void 0 ? _a : 1; | ||
this.col = (_b = info.col) !== null && _b !== void 0 ? _b : 0; | ||
this.raw = (_c = info.raw) !== null && _c !== void 0 ? _c : ''; | ||
} | ||
} | ||
exports.ParserError = ParserError; | ||
class TargetParserError extends ParserError { | ||
constructor(message, info) { | ||
var _a; | ||
const errMsg = info.nodeName | ||
? `The ${info.nodeName} is invalid element (${info.line}:${info.col}): ${message}` | ||
: message; | ||
super(errMsg, info); | ||
this.name = 'TargetParserError'; | ||
this.nodeName = (_a = info.nodeName) !== null && _a !== void 0 ? _a : null; | ||
} | ||
} | ||
exports.TargetParserError = TargetParserError; | ||
class ConfigParserError extends ParserError { | ||
constructor(message, info) { | ||
const pos = info.line != null && info.line != null ? `(${info.line}:${info.col})` : ''; | ||
const file = ` in ${info.filePath}${pos}`; | ||
const errMsg = `${message}${file}`; | ||
super(errMsg, info); | ||
this.name = 'ConfigParserError'; | ||
this.filePath = info.filePath; | ||
} | ||
} | ||
exports.ConfigParserError = ConfigParserError; |
export interface N { | ||
type: 'text' | 'starttag' | 'endtag' | 'comment' | 'boguscomment'; | ||
raw: string; | ||
line: number; | ||
col: number; | ||
type: 'text' | 'starttag' | 'endtag' | 'comment' | 'boguscomment'; | ||
raw: string; | ||
line: number; | ||
col: number; | ||
} | ||
export default function tagSplitter(raw: string, line: number, col: number): N[]; |
export type Code = { | ||
readonly type: string; | ||
readonly index: number; | ||
readonly startTag: string; | ||
readonly taggedCode: string; | ||
readonly endTag: string | null; | ||
readonly type: string; | ||
readonly index: number; | ||
readonly startTag: string; | ||
readonly taggedCode: string; | ||
readonly endTag: string | null; | ||
}; | ||
export type IgnoreTag = { | ||
readonly type: string; | ||
readonly start: Readonly<RegExp>; | ||
readonly end: Readonly<RegExp>; | ||
readonly type: string; | ||
readonly start: Readonly<RegExp>; | ||
readonly end: Readonly<RegExp>; | ||
}; | ||
export type IgnoreBlock = { | ||
readonly source: string; | ||
readonly replaced: string; | ||
readonly stack: readonly Code[]; | ||
readonly maskChar: string; | ||
readonly source: string; | ||
readonly replaced: string; | ||
readonly stack: readonly Code[]; | ||
readonly maskChar: string; | ||
}; |
{ | ||
"name": "@markuplint/parser-utils", | ||
"version": "3.8.0", | ||
"version": "3.9.0", | ||
"description": "Utility module for markuplint parser plugin", | ||
@@ -22,13 +22,10 @@ "repository": "git@github.com:markuplint/markuplint.git", | ||
"dependencies": { | ||
"@markuplint/ml-ast": "3.1.0", | ||
"@markuplint/types": "3.7.0", | ||
"@types/uuid": "^9.0.1", | ||
"tslib": "^2.5.0", | ||
"type-fest": "^3.10.0", | ||
"@markuplint/ml-ast": "3.2.0", | ||
"@markuplint/types": "3.8.0", | ||
"@types/uuid": "^9.0.2", | ||
"tslib": "^2.5.3", | ||
"type-fest": "^3.11.1", | ||
"uuid": "^9.0.0" | ||
}, | ||
"peerDependencies": { | ||
"@markuplint/ml-core": "3.x" | ||
}, | ||
"gitHead": "af370797bfc887e5a5a2ff57fbaa8392ac98ead2" | ||
"gitHead": "9547b8dca20736a93e4d01af2d61bee314ba5718" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
77700
6
2241
+ Added@markuplint/types@3.8.0(transitive)
- Removed@markuplint/config-presets@3.9.0(transitive)
- Removed@markuplint/html-parser@3.13.0(transitive)
- Removed@markuplint/html-spec@3.14.0(transitive)
- Removed@markuplint/i18n@3.12.0(transitive)
- Removed@markuplint/ml-ast@3.1.0(transitive)
- Removed@markuplint/ml-config@3.14.0(transitive)
- Removed@markuplint/ml-core@3.15.0(transitive)
- Removed@markuplint/ml-spec@3.14.0(transitive)
- Removed@markuplint/parser-utils@3.13.0(transitive)
- Removed@markuplint/selector@3.14.0(transitive)
- Removed@markuplint/shared@3.8.0(transitive)
- Removed@markuplint/types@3.12.03.7.0(transitive)
- Removed@types/mustache@4.2.5(transitive)
- Removed@types/whatwg-mimetype@3.0.2(transitive)
- Removedcssesc@3.0.0(transitive)
- Removeddeepmerge@4.3.1(transitive)
- Removeddom-accessibility-api@0.6.3(transitive)
- Removedentities@4.5.0(transitive)
- Removedhtml-entities@2.5.2(transitive)
- Removedis-plain-object@5.0.0(transitive)
- Removedmustache@4.2.0(transitive)
- Removedparse5@7.1.2(transitive)
- Removedpostcss-selector-parser@6.1.2(transitive)
- Removedtype-fest@4.30.2(transitive)
- Removedutil-deprecate@1.0.2(transitive)
Updated@markuplint/ml-ast@3.2.0
Updated@markuplint/types@3.8.0
Updated@types/uuid@^9.0.2
Updatedtslib@^2.5.3
Updatedtype-fest@^3.11.1