simmerjs
Version:
A pure Javascript reverse CSS selector engine which calculates a DOM element's unique CSS selector on the current page.
50 lines (35 loc) • 1.63 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
var _inspectElementID = require('./inspectElementID');
var _inspectElementID2 = _interopRequireDefault(_inspectElementID);
var _inspectTags = require('./inspectTags');
var _inspectTags2 = _interopRequireDefault(_inspectTags);
var _inspectSiblings = require('./inspectSiblings');
var _inspectSiblings2 = _interopRequireDefault(_inspectSiblings);
var _inspectNthChild = require('./inspectNthChild');
var _inspectNthChild2 = _interopRequireDefault(_inspectNthChild);
var _inspectSpecialAttributes = require('./inspectSpecialAttributes');
var _inspectSpecialAttributes2 = _interopRequireDefault(_inspectSpecialAttributes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* The ParsingMethods are the key methods for the parsing process. They provide the various ways by which we analyze an element.
* This object is a wrapper for building the list of available parsing methods and managing the context in which they are run so
* that they all have access to basic parsing helper methods
* */
var parsingMethods = {
methods: [],
getMethods: function getMethods() {
return this.methods.slice(0);
},
addMethod: function addMethod(fn) {
this.methods.push(fn);
}
};
parsingMethods.addMethod(_inspectElementID2.default);
parsingMethods.addMethod(_inspectTags2.default);
parsingMethods.addMethod(_inspectSpecialAttributes2.default);
parsingMethods.addMethod(_inspectSiblings2.default);
parsingMethods.addMethod(_inspectNthChild2.default);
exports.default = parsingMethods;
;