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

angular-html-parser

Package Overview
Dependencies
Maintainers
4
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-html-parser - npm Package Compare versions

Comparing version 7.0.1 to 8.0.0

4

lib/angular-html-parser/src/index.d.ts

@@ -1,3 +0,3 @@

import { TagContentType } from '../../compiler/src/ml_parser/tags.js';
import { ParseTreeResult } from "../../compiler/src/ml_parser/parser.js";
import { TagContentType } from '../../compiler/src/ml_parser/tags.ts';
import { ParseTreeResult } from "../../compiler/src/ml_parser/parser.ts";
export interface ParseOptions {

@@ -4,0 +4,0 @@ /**

import { HtmlParser } from "../../compiler/src/ml_parser/html_parser.js";
import { TagContentType } from '../../compiler/src/ml_parser/tags.js';
import { TagContentType } from "../../compiler/src/ml_parser/tags.js";
let parser = null;

@@ -4,0 +4,0 @@ const getParser = () => {

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -13,3 +13,3 @@ /**

// be compiled with the compiler.
import { CssSelector } from "./selector.js";
import { CssSelector } from './selector';
// Stores the default value of `emitDistinctChangesOnly` when the `emitDistinctChangesOnly` is not

@@ -16,0 +16,0 @@ // explicitly set.

@@ -8,3 +8,3 @@ /**

*/
import { ParseSourceSpan } from "../parse_util.js";
import { ParseSourceSpan } from '../parse_util';
/**

@@ -11,0 +11,0 @@ * Describes the text contents of a placeholder as it appears in an ICU expression, including its

@@ -8,5 +8,5 @@ /**

*/
import { I18nMeta } from "../i18n/i18n_ast.js";
import { ParseSourceSpan } from "../parse_util.js";
import { InterpolatedAttributeToken, InterpolatedTextToken } from "./tokens.js";
import { I18nMeta } from '../i18n/i18n_ast';
import { ParseSourceSpan } from '../parse_util';
import { InterpolatedAttributeToken, InterpolatedTextToken } from './tokens';
interface BaseNode {

@@ -16,3 +16,3 @@ sourceSpan: ParseSourceSpan;

}
export type Node = Attribute | CDATA | Comment | DocType | Element | Text | Block | BlockParameter | LetDeclaration;
export type Node = Attribute | CDATA | Comment | DocType | Element | Expansion | ExpansionCase | Text | Block | BlockParameter | LetDeclaration;
export declare abstract class NodeWithI18n implements BaseNode {

@@ -19,0 +19,0 @@ sourceSpan: ParseSourceSpan;

@@ -8,3 +8,3 @@ /**

*/
import { assertInterpolationSymbols } from "../assertions.js";
import { assertInterpolationSymbols } from '../assertions';
export class InterpolationConfig {

@@ -11,0 +11,0 @@ static fromArray(markers) {

@@ -8,5 +8,5 @@ /**

*/
import { TokenizeOptions } from "./lexer.js";
import { Parser, ParseTreeResult } from "./parser.js";
import { TagContentType } from "./tags.js";
import { TokenizeOptions } from './lexer';
import { Parser, ParseTreeResult } from './parser';
import { TagContentType } from './tags';
export declare class HtmlParser extends Parser {

@@ -13,0 +13,0 @@ constructor();

@@ -8,4 +8,4 @@ /**

*/
import { getHtmlTagDefinition } from "./html_tags.js";
import { Parser } from "./parser.js";
import { getHtmlTagDefinition } from './html_tags';
import { Parser } from './parser';
export class HtmlParser extends Parser {

@@ -12,0 +12,0 @@ constructor() {

@@ -8,3 +8,3 @@ /**

*/
import { TagContentType, TagDefinition } from "./tags.js";
import { TagContentType, TagDefinition } from './tags';
export declare class HtmlTagDefinition implements TagDefinition {

@@ -11,0 +11,0 @@ private closedByChildren;

@@ -8,4 +8,4 @@ /**

*/
import { DomElementSchemaRegistry } from "../schema/dom_element_schema_registry.js";
import { getNsPrefix, TagContentType } from "./tags.js";
import { DomElementSchemaRegistry } from '../schema/dom_element_schema_registry';
import { getNsPrefix, TagContentType } from './tags';
export class HtmlTagDefinition {

@@ -12,0 +12,0 @@ constructor({ closedByChildren, implicitNamespacePrefix, contentType = TagContentType.PARSABLE_DATA, closedByParent = false, isVoid = false, ignoreFirstLf = false, preventNamespaceInheritance = false, canSelfClose = false, } = {}) {

@@ -8,6 +8,6 @@ /**

*/
import { ParseError, ParseSourceSpan } from "../parse_util.js";
import { InterpolationConfig } from "./defaults.js";
import { TagContentType } from "./tags.js";
import { Token, TokenType } from "./tokens.js";
import { ParseError, ParseSourceSpan } from '../parse_util';
import { InterpolationConfig } from './defaults';
import { TagContentType } from './tags';
import { Token, TokenType } from './tokens';
export declare class TokenError extends ParseError {

@@ -14,0 +14,0 @@ tokenType: TokenType | null;

@@ -8,7 +8,7 @@ /**

*/
import * as chars from "../chars.js";
import { ParseError, ParseLocation, ParseSourceFile, ParseSourceSpan } from "../parse_util.js";
import { DEFAULT_INTERPOLATION_CONFIG } from "./defaults.js";
import { NAMED_ENTITIES } from "./entities.js";
import { mergeNsAndName, TagContentType } from "./tags.js";
import * as chars from '../chars';
import { ParseError, ParseLocation, ParseSourceFile, ParseSourceSpan } from '../parse_util';
import { DEFAULT_INTERPOLATION_CONFIG } from './defaults';
import { NAMED_ENTITIES } from './entities';
import { mergeNsAndName, TagContentType } from './tags';
export class TokenError extends ParseError {

@@ -957,8 +957,10 @@ constructor(errorMsg, tokenType, span) {

_isInExpansionCase() {
return (this._expansionCaseStack.length > 0 && this._expansionCaseStack[this._expansionCaseStack.length - 1] ===
22) /* TokenType.EXPANSION_CASE_EXP_START */;
return (this._expansionCaseStack.length > 0 &&
this._expansionCaseStack[this._expansionCaseStack.length - 1] ===
22 /* TokenType.EXPANSION_CASE_EXP_START */);
}
_isInExpansionForm() {
return (this._expansionCaseStack.length > 0 && this._expansionCaseStack[this._expansionCaseStack.length - 1] ===
20) /* TokenType.EXPANSION_FORM_START */;
return (this._expansionCaseStack.length > 0 &&
this._expansionCaseStack[this._expansionCaseStack.length - 1] ===
20 /* TokenType.EXPANSION_FORM_START */);
}

@@ -1036,5 +1038,6 @@ isExpansionFormStart() {

const token = srcTokens[i];
if (((lastDstToken && lastDstToken.type === 5 /* TokenType.TEXT */ && token.type === 5) /* TokenType.TEXT */) ||
((lastDstToken &&
lastDstToken.type === 16 /* TokenType.ATTR_VALUE_TEXT */ && token.type === 16) /* TokenType.ATTR_VALUE_TEXT */)) {
if ((lastDstToken && lastDstToken.type === 5 /* TokenType.TEXT */ && token.type === 5 /* TokenType.TEXT */) ||
(lastDstToken &&
lastDstToken.type === 16 /* TokenType.ATTR_VALUE_TEXT */ &&
token.type === 16 /* TokenType.ATTR_VALUE_TEXT */)) {
lastDstToken.parts[0] += token.parts[0];

@@ -1041,0 +1044,0 @@ lastDstToken.sourceSpan.end = token.sourceSpan.end;

@@ -8,6 +8,6 @@ /**

*/
import { ParseError, ParseSourceSpan } from "../parse_util.js";
import * as html from "./ast.js";
import { TokenizeOptions } from "./lexer.js";
import { TagContentType, TagDefinition } from "./tags.js";
import { ParseError, ParseSourceSpan } from '../parse_util';
import * as html from './ast';
import { TokenizeOptions } from './lexer';
import { TagContentType, TagDefinition } from './tags';
export declare class TreeError extends ParseError {

@@ -14,0 +14,0 @@ elementName: string | null;

@@ -8,7 +8,7 @@ /**

*/
import { ParseError, ParseSourceSpan } from "../parse_util.js";
import * as html from "./ast.js";
import { NAMED_ENTITIES } from "./entities.js";
import { tokenize } from "./lexer.js";
import { getNsPrefix, mergeNsAndName, splitNsName } from "./tags.js";
import { ParseError, ParseSourceSpan } from '../parse_util';
import * as html from './ast';
import { NAMED_ENTITIES } from './entities';
import { tokenize } from './lexer';
import { getNsPrefix, mergeNsAndName, splitNsName } from './tags';
export class TreeError extends ParseError {

@@ -372,4 +372,6 @@ static create(elementName, span, msg) {

const node = this._containerStack[stackIndex];
if (( /* isForeignElement */(getNsPrefix(node.name) ? node.name === expectedName : (expectedName == null || node.name.toLowerCase() === expectedName.toLowerCase()) &&
node instanceof expectedType))) {
if (( /* isForeignElement */getNsPrefix(node.name) ?
node.name === expectedName :
(expectedName == null || node.name.toLowerCase() === expectedName.toLowerCase()) &&
node instanceof expectedType)) {
// Record the parse span with the element that is being closed. Any elements that are

@@ -376,0 +378,0 @@ // removed from the element stack at this point are closed implicitly, so they won't get

@@ -8,3 +8,3 @@ /**

*/
import { ParseSourceSpan } from "../parse_util.js";
import { ParseSourceSpan } from '../parse_util';
export declare const enum TokenType {

@@ -11,0 +11,0 @@ TAG_OPEN_START = 0,

@@ -0,0 +0,0 @@ export declare class ParseLocation {

@@ -8,4 +8,4 @@ /**

*/
import * as chars from "./chars.js";
import { stringify } from "./util.js";
import * as chars from './chars';
import { stringify } from './util';
export class ParseLocation {

@@ -12,0 +12,0 @@ constructor(file, offset, line, col) {

@@ -8,4 +8,4 @@ /**

*/
import { SchemaMetadata, SecurityContext } from "../core.js";
import { ElementSchemaRegistry } from "./element_schema_registry.js";
import { SchemaMetadata, SecurityContext } from '../core';
import { ElementSchemaRegistry } from './element_schema_registry';
export declare class DomElementSchemaRegistry extends ElementSchemaRegistry {

@@ -12,0 +12,0 @@ private _schema;

@@ -8,7 +8,7 @@ /**

*/
import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA, SecurityContext } from "../core.js";
import { isNgContainer, isNgContent } from "../ml_parser/tags.js";
import { dashCaseToCamelCase } from "../util.js";
import { SECURITY_SCHEMA } from "./dom_security_schema.js";
import { ElementSchemaRegistry } from "./element_schema_registry.js";
import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA, SecurityContext } from '../core';
import { isNgContainer, isNgContent } from '../ml_parser/tags';
import { dashCaseToCamelCase } from '../util';
import { SECURITY_SCHEMA } from './dom_security_schema';
import { ElementSchemaRegistry } from './element_schema_registry';
const BOOLEAN = 'boolean';

@@ -15,0 +15,0 @@ const NUMBER = 'number';

@@ -8,3 +8,3 @@ /**

*/
import { SecurityContext } from "../core.js";
import { SecurityContext } from '../core';
export declare function SECURITY_SCHEMA(): {

@@ -11,0 +11,0 @@ [k: string]: SecurityContext;

@@ -8,3 +8,3 @@ /**

*/
import { SecurityContext } from "../core.js";
import { SecurityContext } from '../core';
// =================================================================================================

@@ -11,0 +11,0 @@ // =================================================================================================

@@ -8,3 +8,3 @@ /**

*/
import { SchemaMetadata, SecurityContext } from "../core.js";
import { SchemaMetadata, SecurityContext } from '../core';
export declare abstract class ElementSchemaRegistry {

@@ -11,0 +11,0 @@ abstract hasProperty(tagName: string, propName: string, schemaMetas: SchemaMetadata[]): boolean;

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ /**

@@ -43,1 +43,2 @@ /**

export declare function partitionArray<T, F = T>(arr: (T | F)[], conditionFn: (value: T | F) => boolean): [T[], F[]];
export declare function getJitStandaloneDefaultForVersion(version: string): boolean;

@@ -124,1 +124,14 @@ /**

}
const V1_TO_18 = /^([1-9]|1[0-8])\./;
export function getJitStandaloneDefaultForVersion(version) {
if (version.startsWith('0.')) {
// 0.0.0 is always "latest", default is true.
return true;
}
if (V1_TO_18.test(version)) {
// Angular v2 - v18 default is false.
return false;
}
// All other Angular versions (v19+) default to true.
return true;
}
{
"name": "angular-html-parser",
"version": "7.0.1",
"version": "8.0.0",
"description": "A HTML parser extracted from Angular with some modifications",

@@ -13,6 +13,6 @@ "repository": "https://github.com/prettier/angular-html-parser",

"exports": {
".":{
"types": "./lib/angular-html-parser/src/index.d.ts",
"default":"./lib/angular-html-parser/src/index.js"
},
".": {
"types": "./lib/angular-html-parser/src/index.d.ts",
"default": "./lib/angular-html-parser/src/index.js"
},
"./*": "./*"

@@ -23,6 +23,5 @@ },

"prepublish": "yarn run build",
"build": "yarn clean && yarn build-lib && yarn codemod",
"build": "yarn clean && yarn build-lib",
"clean": "del-cli ./lib",
"build-lib": "tsc -p tsconfig.build.json",
"codemod": "node ./node_modules/jscodeshift/bin/jscodeshift.js -t postbuild-codemod.ts lib --extensions=js,ts --parser=ts",
"test": "ts-node --project tsconfig.test.json -r tsconfig-paths/register node_modules/jasmine/bin/jasmine.js ../compiler/test/ml_parser/*_spec.ts ./test/*_spec.ts",

@@ -32,3 +31,3 @@ "release": "standard-version"

"dependencies": {
"tslib": "^2.7.0"
"tslib": "^2.8.1"
},

@@ -38,8 +37,8 @@ "devDependencies": {

"del-cli": "6.0.0",
"jasmine": "5.3.1",
"jscodeshift": "17.0.0",
"jasmine": "5.4.0",
"jscodeshift": "17.1.1",
"standard-version": "9.5.0",
"ts-node": "10.9.2",
"tsconfig-paths": "4.2.0",
"typescript": "5.6.2"
"typescript": "5.7.2"
},

@@ -46,0 +45,0 @@ "engines": {

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