simple-html-tokenizer
Advanced tools
Comparing version 0.4.2 to 0.4.3
@@ -28,2 +28,2 @@ var HEXCHARCODE = /^#[xX]([A-Fa-f0-9]+)$/; | ||
export default EntityParser; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW50aXR5LXBhcnNlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImVudGl0eS1wYXJzZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBSUEsSUFBTSxXQUFXLEdBQUcsdUJBQXVCLENBQUM7QUFDNUMsSUFBTSxRQUFRLEdBQU0sYUFBYSxDQUFDO0FBQ2xDLElBQU0sS0FBSyxHQUFTLGtCQUFrQixDQUFDO0FBRXZDO0lBQ0Usc0JBQW9CLEtBQW1CO1FBQW5CLFVBQUssR0FBTCxLQUFLLENBQWM7SUFDdkMsQ0FBQztJQUVELDRCQUFLLEdBQUwsVUFBTSxNQUFjO1FBQ2xCLEVBQUUsQ0FBQyxDQUFDLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQztZQUNaLE1BQU0sQ0FBQztRQUNULENBQUM7UUFDRCxJQUFJLE9BQU8sR0FBRyxNQUFNLENBQUMsS0FBSyxDQUFDLFdBQVcsQ0FBQyxDQUFDO1FBQ3hDLEVBQUUsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUM7WUFDWixNQUFNLENBQUMsTUFBTSxDQUFDLFlBQVksQ0FBQyxRQUFRLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxDQUFDLENBQUM7UUFDdkQsQ0FBQztRQUNELE9BQU8sR0FBRyxNQUFNLENBQUMsS0FBSyxDQUFDLFFBQVEsQ0FBQyxDQUFDO1FBQ2pDLEVBQUUsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUM7WUFDWixNQUFNLENBQUMsTUFBTSxDQUFDLFlBQVksQ0FBQy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yA9IGVudGl0eS5tYXRjaChIRVhDSEFSQ09ERSk7XG4gICAgaWYgKG1hdGNoZXMpIHtcbiAgICAgIHJldHVybiBTdHJpbmcuZnJvbUNoYXJDb2RlKHBhcnNlSW50KG1hdGNoZXNbMV0sIDE2KSk7XG4gICAgfVxuICAgIG1hdGNoZXMgPSBlbnRpdHkubWF0Y2goQ0hBUkNPREUpO1xuICAgIGlmIChtYXRjaGVzKSB7XG4gICAgICByZXR1cm4gU3RyaW5nLmZyb21DaGFyQ29kZShwYXJzZUludChtYXRjaGVzWzFdLCAxMCkpO1xuICAgIH1cbiAgICBtYXRjaGVzID0gZW50aXR5Lm1hdGNoKE5BTUVEKTtcbiAgICBpZiAobWF0Y2hlcykge1xuICAgICAgcmV0dXJuIHRoaXMubmFtZWRbbWF0Y2hlc1sxXV07XG4gICAgfVxuICB9XG59XG4iXX0= |
@@ -25,3 +25,3 @@ export interface TokenizerOptions { | ||
private options; | ||
private token; | ||
private _token; | ||
private startLine; | ||
@@ -33,2 +33,3 @@ private startColumn; | ||
constructor(entityParser: any, options?: TokenizerOptions); | ||
token: Token; | ||
tokenize(input: any): Token[]; | ||
@@ -35,0 +36,0 @@ tokenizePart(input: any): Token[]; |
import EventedTokenizer from './evented-tokenizer'; | ||
import { unwrap } from './utils'; | ||
; | ||
@@ -7,3 +8,3 @@ var Tokenizer = /** @class */ (function () { | ||
this.options = options; | ||
this.token = null; | ||
this._token = null; | ||
this.startLine = 1; | ||
@@ -15,2 +16,12 @@ this.startColumn = 0; | ||
} | ||
Object.defineProperty(Tokenizer.prototype, "token", { | ||
get: function () { | ||
return unwrap(this._token); | ||
}, | ||
set: function (value) { | ||
this._token = value; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Tokenizer.prototype.tokenize = function (input) { | ||
@@ -32,3 +43,3 @@ this.tokens = []; | ||
Tokenizer.prototype.reset = function () { | ||
this.token = null; | ||
this._token = null; | ||
this.startLine = 1; | ||
@@ -110,14 +121,18 @@ this.startColumn = 0; | ||
Tokenizer.prototype.beginAttribute = function () { | ||
var attributes = unwrap(this.token.attributes, "current token's attributs"); | ||
this.currentAttribute = ["", "", false]; | ||
this.token.attributes.push(this.currentAttribute); | ||
attributes.push(this.currentAttribute); | ||
}; | ||
Tokenizer.prototype.appendToAttributeName = function (char) { | ||
this.currentAttribute[0] += char; | ||
var currentAttribute = unwrap(this.currentAttribute); | ||
currentAttribute[0] += char; | ||
}; | ||
Tokenizer.prototype.beginAttributeValue = function (isQuoted) { | ||
this.currentAttribute[2] = isQuoted; | ||
var currentAttribute = unwrap(this.currentAttribute); | ||
currentAttribute[2] = isQuoted; | ||
}; | ||
Tokenizer.prototype.appendToAttributeValue = function (char) { | ||
this.currentAttribute[1] = this.currentAttribute[1] || ""; | ||
this.currentAttribute[1] += char; | ||
var currentAttribute = unwrap(this.currentAttribute); | ||
currentAttribute[1] = currentAttribute[1] || ""; | ||
currentAttribute[1] += char; | ||
}; | ||
@@ -132,2 +147,2 @@ Tokenizer.prototype.finishAttributeValue = function () { | ||
export default Tokenizer; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9rZW5pemVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsidG9rZW5pemVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sZ0JBQWdCLE1BQU0scUJBQXFCLENBQUM7QUFJbEQsQ0FBQztBQXVCRjtJQVFFLG1CQUFZLFlBQVksRUFBVSxPQUE4QjtRQUE5Qix3QkFBQSxFQUFBLFlBQThCO1FBQTlCLFlBQU8sR0FBUCxPQUFPLENBQXVCO1FBUHhELFVBQUssR0FBVSxJQUFJLENBQUM7UUFDcEIsY0FBUyxHQUFHLENBQUMsQ0FBQztRQUNkLGdCQUFXLEdBQUcsQ0FBQyxDQUFDO1FBRWhCLFdBQU0sR0FBWSxFQUFFLENBQUM7UUFDckIscUJBQWdCLEdBQWMsSUFBS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xcbiAgICAgICAgICBjb2x1bW46IHRoaXMudG9rZW5pemVyLmNvbHVtblxuICAgICAgICB9XG4gICAgICB9O1xuICAgIH1cbiAgICB0aGlzLnN0YXJ0TGluZSA9IHRoaXMudG9rZW5pemVyLmxpbmU7XG4gICAgdGhpcy5zdGFydENvbHVtbiA9IHRoaXMudG9rZW5pemVyLmNvbHVtbjtcbiAgfVxuXG4gIC8vIERhdGFcblxuICBiZWdpbkRhdGEoKSB7XG4gICAgdGhpcy50b2tlbiA9IHtcbiAgICAgIHR5cGU6ICdDaGFycycsXG4gICAgICBjaGFyczogJydcbiAgICB9O1xuICAgIHRoaXMudG9rZW5zLnB1c2godGhpcy50b2tlbik7XG4gIH1cblxuICBhcHBlbmRUb0RhdGEoY2hhcikge1xuICAgIHRoaXMudG9rZW4uY2hhcnMgKz0gY2hhcjtcbiAgfVxuXG4gIGZpbmlzaERhdGEoKSB7XG4gICAgdGhpcy5hZGRMb2NJbmZvKCk7XG4gIH1cblxuICAvLyBDb21tZW50XG5cbiAgYmVnaW5Db21tZW50KCkge1xuICAgIHRoaXMudG9rZW4gPSB7XG4gICAgICB0eXBlOiAnQ29tbWVudCcsXG4gICAgICBjaGFyczogJydcbiAgICB9O1xuICAgIHRoaXMudG9rZW5zLnB1c2godGhpcy50b2tlbik7XG4gIH1cblxuICBhcHBlbmRUb0NvbW1lbnREYXRhKGNoYXIpIHtcbiAgICB0aGlzLnRva2VuLmNoYXJzICs9IGNoYXI7XG4gIH1cblxuICBmaW5pc2hDb21tZW50KCkge1xuICAgIHRoaXMuYWRkTG9jSW5mbygpO1xuICB9XG5cbiAgLy8gVGFncyAtIGJhc2ljXG5cbiAgYmVnaW5TdGFydFRhZygpIHtcbiAgICB0aGlzLnRva2VuID0ge1xuICAgICAgdHlwZTogJ1N0YXJ0VGFnJyxcbiAgICAgIHRhZ05hbWU6ICcnLFxuICAgICAgYXR0cmlidXRlczogW10sXG4gICAgICBzZWxmQ2xvc2luZzogZmFsc2VcbiAgICB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MuY3VycmVudEF0dHJpYnV0ZSk7XG4gICAgY3VycmVudEF0dHJpYnV0ZVsyXSA9IGlzUXVvdGVkO1xuICB9XG5cbiAgYXBwZW5kVG9BdHRyaWJ1dGVWYWx1ZShjaGFyKSB7XG4gICAgbGV0IGN1cnJlbnRBdHRyaWJ1dGUgPSB1bndyYXAodGhpcy5jdXJyZW50QXR0cmlidXRlKTtcbiAgICBjdXJyZW50QXR0cmlidXRlWzFdID0gY3VycmVudEF0dHJpYnV0ZVsxXSB8fCBcIlwiO1xuICAgIGN1cnJlbnRBdHRyaWJ1dGVbMV0gKz0gY2hhcjtcbiAgfVxuXG4gIGZpbmlzaEF0dHJpYnV0ZVZhbHVlKCkge1xuICB9XG5cbiAgcmVwb3J0U3ludGF4RXJyb3IobWVzc2FnZTogc3RyaW5nKSB7XG4gICAgdGhpcy50b2tlbi5zeW50YXhFcnJvciA9IG1lc3NhZ2U7XG4gIH1cbn1cbiJdfQ== |
@@ -6,4 +6,4 @@ export declare function isSpace(char: string): boolean; | ||
export declare type Option<T> = T | null; | ||
export declare type Maybe<T> = Option<T> | null; | ||
export declare type Maybe<T> = Option<T> | undefined | void; | ||
export declare function unwrap<T>(maybe: Maybe<T>, msg?: string): T; | ||
export declare function or<T, U>(maybe: Maybe<T>, otherwise: U): T | U; |
@@ -21,2 +21,2 @@ var WSP = /[\t\n\f ]/; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJ1dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxJQUFNLEdBQUcsR0FBRyxXQUFXLENBQUM7QUFDeEIsSUFBTSxLQUFLLEdBQUcsVUFBVSxDQUFDO0FBQ3pCLElBQU0sSUFBSSxHQUFHLFFBQVEsQ0FBQztBQUV0QixNQUFNLGtCQUFrQixJQUFZO0lBQ2xDLE1BQU0sQ0FBQyx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gdm9pZDtcblxuZXhwb3J0IGZ1bmN0aW9uIHVud3JhcDxUPihtYXliZTogTWF5YmU8VD4sIG1zZz86IHN0cmluZyk6IFQge1xuICBpZiAoIW1heWJlKSB0aHJvdyBuZXcgRXJyb3IoYCR7bXNnIHx8ICd2YWx1ZSd9IHdhcyBudWxsYCk7XG4gIHJldHVybiBtYXliZTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIG9yPFQsIFU+KG1heWJlOiBNYXliZTxUPiwgb3RoZXJ3aXNlOiBVKTogVCB8IFUge1xuICByZXR1cm4gbWF5YmUgfHwgb3RoZXJ3aXNlO1xufSJdfQ== |
@@ -50,2 +50,7 @@ (function (global, factory) { | ||
} | ||
function unwrap(maybe, msg) { | ||
if (!maybe) | ||
throw new Error((msg || 'value') + " was null"); | ||
return maybe; | ||
} | ||
@@ -479,3 +484,3 @@ var EventedTokenizer = /** @class */ (function () { | ||
this.options = options; | ||
this.token = null; | ||
this._token = null; | ||
this.startLine = 1; | ||
@@ -487,2 +492,12 @@ this.startColumn = 0; | ||
} | ||
Object.defineProperty(Tokenizer.prototype, "token", { | ||
get: function () { | ||
return unwrap(this._token); | ||
}, | ||
set: function (value) { | ||
this._token = value; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Tokenizer.prototype.tokenize = function (input) { | ||
@@ -504,3 +519,3 @@ this.tokens = []; | ||
Tokenizer.prototype.reset = function () { | ||
this.token = null; | ||
this._token = null; | ||
this.startLine = 1; | ||
@@ -582,14 +597,18 @@ this.startColumn = 0; | ||
Tokenizer.prototype.beginAttribute = function () { | ||
var attributes = unwrap(this.token.attributes, "current token's attributs"); | ||
this.currentAttribute = ["", "", false]; | ||
this.token.attributes.push(this.currentAttribute); | ||
attributes.push(this.currentAttribute); | ||
}; | ||
Tokenizer.prototype.appendToAttributeName = function (char) { | ||
this.currentAttribute[0] += char; | ||
var currentAttribute = unwrap(this.currentAttribute); | ||
currentAttribute[0] += char; | ||
}; | ||
Tokenizer.prototype.beginAttributeValue = function (isQuoted) { | ||
this.currentAttribute[2] = isQuoted; | ||
var currentAttribute = unwrap(this.currentAttribute); | ||
currentAttribute[2] = isQuoted; | ||
}; | ||
Tokenizer.prototype.appendToAttributeValue = function (char) { | ||
this.currentAttribute[1] = this.currentAttribute[1] || ""; | ||
this.currentAttribute[1] += char; | ||
var currentAttribute = unwrap(this.currentAttribute); | ||
currentAttribute[1] = currentAttribute[1] || ""; | ||
currentAttribute[1] += char; | ||
}; | ||
@@ -596,0 +615,0 @@ Tokenizer.prototype.finishAttributeValue = function () { |
{ | ||
"name": "simple-html-tokenizer", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Simple HTML Tokenizer is a lightweight JavaScript library that can be used to tokenize the kind of HTML normally found in templates.", |
@@ -1,2 +0,2 @@ | ||
interface Dict<T> { | ||
export interface Dict<T> { | ||
[index: string]: T; | ||
@@ -3,0 +3,0 @@ } |
import EventedTokenizer from './evented-tokenizer'; | ||
import { unwrap } from './utils'; | ||
@@ -28,4 +29,8 @@ export interface TokenizerOptions { | ||
interface TokenWithAttributes extends Token { | ||
attributes: Attribute[]; | ||
} | ||
export default class Tokenizer { | ||
private token: Token = null; | ||
private _token: Token | null = null; | ||
private startLine = 1; | ||
@@ -35,3 +40,3 @@ private startColumn = 0; | ||
private tokens: Token[] = []; | ||
private currentAttribute: Attribute = null; | ||
private currentAttribute: Attribute | null = null; | ||
@@ -42,2 +47,10 @@ constructor(entityParser, private options: TokenizerOptions = {}) { | ||
get token(): Token { | ||
return unwrap(this._token); | ||
} | ||
set token(value: Token) { | ||
this._token = value; | ||
} | ||
tokenize(input) { | ||
@@ -62,3 +75,3 @@ this.tokens = []; | ||
reset() { | ||
this.token = null; | ||
this._token = null; | ||
this.startLine = 1; | ||
@@ -158,17 +171,22 @@ this.startColumn = 0; | ||
beginAttribute() { | ||
let attributes = unwrap(this.token.attributes, "current token's attributs"); | ||
this.currentAttribute = ["", "", false]; | ||
this.token.attributes.push(this.currentAttribute); | ||
attributes.push(this.currentAttribute); | ||
} | ||
appendToAttributeName(char) { | ||
this.currentAttribute[0] += char; | ||
let currentAttribute = unwrap(this.currentAttribute); | ||
currentAttribute[0] += char; | ||
} | ||
beginAttributeValue(isQuoted) { | ||
this.currentAttribute[2] = isQuoted; | ||
let currentAttribute = unwrap(this.currentAttribute); | ||
currentAttribute[2] = isQuoted; | ||
} | ||
appendToAttributeValue(char) { | ||
this.currentAttribute[1] = this.currentAttribute[1] || ""; | ||
this.currentAttribute[1] += char; | ||
let currentAttribute = unwrap(this.currentAttribute); | ||
currentAttribute[1] = currentAttribute[1] || ""; | ||
currentAttribute[1] += char; | ||
} | ||
@@ -175,0 +193,0 @@ |
@@ -19,3 +19,3 @@ const WSP = /[\t\n\f ]/; | ||
export type Option<T> = T | null; | ||
export type Maybe<T> = Option<T> | null; | ||
export type Maybe<T> = Option<T> | undefined | void; | ||
@@ -29,2 +29,2 @@ export function unwrap<T>(maybe: Maybe<T>, msg?: string): T { | ||
return maybe || otherwise; | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
777095
29
4465