Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@markuplint/parser-utils

Package Overview
Dependencies
Maintainers
1
Versions
139
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@markuplint/parser-utils - npm Package Compare versions

Comparing version 3.8.0 to 3.9.0

2

lib/const.d.ts

@@ -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"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc