Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

feat(xml-namespace-loader): add ignore option #605

Merged
merged 4 commits into from
Jul 23, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion xml-namespace-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const { convertSlashesInPath } = require("./projectHelpers");

module.exports = function (source) {
this.value = source;
const { ignore } = this.query;

const { XmlParser } = require("tns-core-modules/xml");

Expand All @@ -14,7 +15,8 @@ module.exports = function (source) {
if (
namespace &&
!namespace.startsWith("http") &&
!namespaces.some(n => n.name === moduleName)
!namespaces.some(n => n.name === moduleName) &&
(!ignore || !moduleName.match(ignore))
) {
const localNamespacePath = join(this.rootContext, namespace);
const localModulePath = join(localNamespacePath, elementName);
Expand Down