Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

described-i18n-loader

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

described-i18n-loader - npm Package Compare versions

Comparing version 2.0.1 to 2.1.0

5

index.js

@@ -6,2 +6,4 @@ /*

const loaderUtils = require("loader-utils");
function descendIntoObject(target) {

@@ -36,2 +38,3 @@ const output = {};

this.cacheable(true);
const options = loaderUtils.getOptions(this) || {};

@@ -45,3 +48,3 @@ const locale = JSON.parse(str);

const module = this.version && this.version >= 2
const module = this.version && this.version >= 2 && !options.forceModuleExports
? `export default ${value};`

@@ -48,0 +51,0 @@ : `module.exports = ${value};`;

8

package.json
{
"name": "described-i18n-loader",
"version": "2.0.1",
"version": "2.1.0",
"description": "Load i18n json files with key value pairs while stripping the 'desc' key from all subkeys. eg: key = 'conf.title', value = { text: \"Configuration\", desc: \"Title for config screen\" }",

@@ -15,3 +15,4 @@ "main": "index.js",

"webpack": "webpack",
"test": "webpack test/index.js out/bundle.js"
"test-node": "webpack test/node.js out/bundle-node.js",
"test-es6": "webpack test/es6.js out/bundle-es6.js"
},

@@ -22,3 +23,6 @@ "author": "erdii <erdiicodes@gmail.com>",

"webpack": "^2.3.2"
},
"dependencies": {
"loader-utils": "^1.1.0"
}
}

@@ -46,2 +46,3 @@ # described-18n-loader

**(node)**
```JSON

@@ -56,1 +57,17 @@ module.exports = {

```
**(es6)**
```JSON
export default {
"conf.title": "Configuration",
"app.title": "MyApp",
"nav.button.home": "Home",
"nav.button.about": "About",
"another.pure.key": "Pure Key"
}
```
## Options
* `forceModuleExports`: force node style module `DEFAULT - webpack 1: true, webpack 2: false`
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