gulp-i18n-update-localization-ids
Advanced tools
Comparing version 1.3.1 to 1.4.0
@@ -46,3 +46,3 @@ 'use strict'; | ||
if (attr.name === name) { | ||
return attr.value; | ||
return ignore.attrValue(attr.value) ? undefined : attr.value; | ||
} | ||
@@ -57,2 +57,5 @@ } | ||
if (attr.name === name) { | ||
if (ignore.attrValue(attr.value)) { | ||
return; | ||
} | ||
attr.value = value; | ||
@@ -74,2 +77,5 @@ return; | ||
if (attr.name === name) { | ||
if (ignore.attrValue(attr.value)) { | ||
return false; | ||
} | ||
return true; | ||
@@ -76,0 +82,0 @@ } |
@@ -0,1 +1,2 @@ | ||
// @ts-check | ||
'use strict'; | ||
@@ -7,2 +8,3 @@ | ||
this._tagName = new Scope(); | ||
this._attr = new Scope(); | ||
} | ||
@@ -14,3 +16,3 @@ | ||
} else if (options && typeof options === 'object') { | ||
const {content, tagName} = options; | ||
const {content, tagName, attr} = options; | ||
if (content) { | ||
@@ -22,2 +24,5 @@ this._content.use(content, `${optionPath}.content`); | ||
} | ||
if (attr) { | ||
this._attr.use(attr, `${optionPath}.attr`); | ||
} | ||
} else { | ||
@@ -36,2 +41,6 @@ throw new TypeError(`${optionPath} must be an array or an object.`); | ||
} | ||
attrValue(value) { | ||
return this._attr.test(value); | ||
} | ||
} | ||
@@ -38,0 +47,0 @@ |
{ | ||
"name": "gulp-i18n-update-localization-ids", | ||
"version": "1.3.1", | ||
"version": "1.4.0", | ||
"description": "Update i18n localization ids in html files.", | ||
@@ -22,6 +22,6 @@ "keywords": [ | ||
"devDependencies": { | ||
"ava": "^1.1.0", | ||
"coveralls": "^3.0.2", | ||
"ava": "^1.4.1", | ||
"coveralls": "^3.0.3", | ||
"gulp": "^4.0.0", | ||
"nyc": "^13.1.0" | ||
"nyc": "^14.1.1" | ||
}, | ||
@@ -28,0 +28,0 @@ "peerDependencies": { |
@@ -62,3 +62,6 @@ # gulp-i18n-update-localization-ids | ||
// Ignore <code> tags and all children: | ||
{tagName: 'code'} | ||
{tagName: 'code'}, | ||
// Ignore attributes that contain aurelia-like interpolation: | ||
{attr: v => /\$\{[^\}]+\}/} | ||
] | ||
@@ -71,2 +74,3 @@ ``` | ||
+ tagName `<Rule>` - Ignore a tag and it's subtree if it matches the rule. | ||
+ attr `<Rule>` - Ignore attributes if the value matches the rule. No `t` attributes will created for ignored attributes and they will not be modified or removed. | ||
+ `<Rule>` can be one of the following: | ||
@@ -73,0 +77,0 @@ + `<string>` - If the value matches the specified one. |
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
43113
562
268