beautiful-dom
Advanced tools
Comparing version 1.0.0 to 1.0.1
import HTMLElementData from './htmlelement'; | ||
declare class Beautifulstew { | ||
declare class BeautifulDom { | ||
private patterns; | ||
@@ -19,2 +19,2 @@ private data; | ||
} | ||
export default Beautifulstew; | ||
export default BeautifulDom; |
@@ -7,4 +7,4 @@ "use strict"; | ||
var htmlelement_1 = __importDefault(require("./htmlelement")); | ||
var Beautifulstew = /** @class */ (function () { | ||
function Beautifulstew(data_source) { | ||
var BeautifulDom = /** @class */ (function () { | ||
function BeautifulDom(data_source) { | ||
var _this = this; | ||
@@ -427,7 +427,7 @@ this.patterns = [ | ||
} | ||
Beautifulstew.prototype.reInit = function () { | ||
BeautifulDom.prototype.reInit = function () { | ||
this.parsedData = []; | ||
return this; | ||
}; | ||
Beautifulstew.prototype.getAllTags = function (data) { | ||
BeautifulDom.prototype.getAllTags = function (data) { | ||
var tagsRegex = /<\s*(\w+)\s*.*?>/mi; | ||
@@ -446,3 +446,3 @@ var match; | ||
}; | ||
Beautifulstew.prototype.createTagRegExp = function (tagType) { | ||
BeautifulDom.prototype.createTagRegExp = function (tagType) { | ||
var tagRegExp = new RegExp("<\\s*" + tagType + "(\\s*|\\s+).*?>|<\\s*/" + tagType + ">", "mi"); | ||
@@ -453,3 +453,3 @@ var openingRegExp = new RegExp("<\\s*" + tagType + "(\\s*|\\s+).*?>"); | ||
}; | ||
Beautifulstew.prototype.getElementsByTagName = function (tag) { | ||
BeautifulDom.prototype.getElementsByTagName = function (tag) { | ||
var data_copy; | ||
@@ -498,3 +498,3 @@ this.parsedData = []; | ||
}; | ||
Beautifulstew.prototype.parseAllTags = function () { | ||
BeautifulDom.prototype.parseAllTags = function () { | ||
var tags = this.getAllTags(this.data); | ||
@@ -522,3 +522,3 @@ var elements = []; | ||
}; | ||
Beautifulstew.prototype.getByAttribute = function (attribute, attributeValue) { | ||
BeautifulDom.prototype.getByAttribute = function (attribute, attributeValue) { | ||
var attributeRegExp = new RegExp(attribute + "=\\s*('|\")(\\s*" + attributeValue + "\\s+.*?)|(.*?\\s+" + attributeValue + "\\s+.*?)|(.*?\\s+" + attributeValue + "\\s*)(\"|')", 'mi'); | ||
@@ -541,6 +541,6 @@ var matchingTags = []; | ||
}; | ||
Beautifulstew.prototype.getElementsByClassName = function (classValue) { | ||
BeautifulDom.prototype.getElementsByClassName = function (classValue) { | ||
return this.getByAttribute('class', classValue.trim()); | ||
}; | ||
Beautifulstew.prototype.getElementById = function (id) { | ||
BeautifulDom.prototype.getElementById = function (id) { | ||
var matchingElements = this.getByAttribute("id", id.trim()); | ||
@@ -550,6 +550,6 @@ var element = matchingElements.length > 0 ? matchingElements[0] : null; | ||
}; | ||
Beautifulstew.prototype.getElementsByName = function (name) { | ||
BeautifulDom.prototype.getElementsByName = function (name) { | ||
return this.getByAttribute("name", name.trim()); | ||
}; | ||
Beautifulstew.prototype.querySelectorAll = function (query) { | ||
BeautifulDom.prototype.querySelectorAll = function (query) { | ||
if (this.parsedData.length == 0) { | ||
@@ -578,7 +578,7 @@ this.parseAllTags(); | ||
}; | ||
Beautifulstew.prototype.querySelector = function (query) { | ||
BeautifulDom.prototype.querySelector = function (query) { | ||
return this.querySelectorAll(query).slice(0, 1)[0]; | ||
}; | ||
return Beautifulstew; | ||
return BeautifulDom; | ||
}()); | ||
exports.default = Beautifulstew; | ||
exports.default = BeautifulDom; |
@@ -1,2 +0,2 @@ | ||
import Beautifulstew from './beautifuldom'; | ||
export default Beautifulstew; | ||
import BeautifulDom from './beautifuldom'; | ||
export default BeautifulDom; |
@@ -7,2 +7,2 @@ "use strict"; | ||
var beautifuldom_1 = __importDefault(require("./beautifuldom")); | ||
exports.default = beautifuldom_1.default; | ||
module.exports = beautifuldom_1.default; |
{ | ||
"name": "beautiful-dom", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
69767
10
1228