New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gulp-i18n-update-localization-ids

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-i18n-update-localization-ids - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

lib/merge-options.js

8

lib/localization-key.js

@@ -58,3 +58,3 @@ 'use strict';

static parse(spec) {
const lkey = new LocalizationKey();
const key = new LocalizationKey();
ENTRY_REGEXP.lastIndex = 0;

@@ -70,9 +70,9 @@ while (ENTRY_REGEXP.lastIndex < spec.length) {

.forEach(attr => {
if (lkey.has(attr)) {
if (key.has(attr)) {
throw new SyntaxError(`${attr} has multiple localization keys.`);
}
lkey.set(attr, entry[2]);
key.set(attr, entry[2]);
});
}
return lkey;
return key;
}

@@ -79,0 +79,0 @@

{
"name": "gulp-i18n-update-localization-ids",
"version": "1.0.1",
"version": "1.1.0",
"description": "Update i18n localization ids in html files.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -105,2 +105,51 @@ # gulp-i18n-update-localization-ids

### `mergeOptions(defaults, overrides)`
Utility for merging plugin options.
```js
const mergeOptions = require('gulp-i18n-update-localization-ids/lib/merge-options');
const task = i18nUpdateLocalizationIds(mergeOptions(defaults, overrides));
```
+ defaults `<object>` - Default plugin options.
+ overrides `<object>` - Plugin options to override.
+ returns `<object>` - Merged plugin options.
Options are merged as follows:
+ `whitelist` will contain all entries from defaults and overrides.
+ `ignore` will contain all ignore items from defaults and overrides.
+ all other options will be set from `overrides` or `defaults` if specified.
```js
merge({
emit: 'onChangeOnly',
whitelist: [ {tagName: 'foo'} ],
ignore: {content: 'bar'}
}, {
idTemplate: x => `foo-${x}`,
whitelist: [ {tagName: 'bar'} ],
ignore: [
{content: 'foo'},
{tagName: 'code'}
]
});
// will be merged to:
{
whitelist: [
{tagName: 'foo'},
{tagName: 'bar'}
],
ignore: [
{content: 'bar'},
[
{content: 'foo'},
{tagName: 'code'}
]
],
emit: 'onChangeOnly',
idTemplate: x => `foo-${x}`
}
```
<br>
# Example

@@ -107,0 +156,0 @@ The following example will watch and process your html files during development.<br/>

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc