find-tag-by-path.js 398 B

12345678910
  1. const findTagsByPath = require("./find-tags-by-path.js");
  2. function findTagByPath(xml, path, options) {
  3. const debug = (options && options.debug) || false;
  4. const found = findTagsByPath(xml, path, { debug, returnOnFirst: true });
  5. if (Array.isArray(found) && found.length === 1) return found[0];
  6. else return undefined;
  7. }
  8. module.exports = findTagByPath;
  9. module.exports.default = findTagByPath;