i18next-fs-backend
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -13,3 +13,3 @@ "use strict"; | ||
var YAMLDummy = _interopRequireWildcard(require("./formats/yaml.js")); | ||
var _yaml = _interopRequireDefault(require("./formats/yaml.js")); | ||
@@ -27,3 +27,3 @@ var fsMod = _interopRequireWildcard(require("./fs.js")); | ||
var isDeno = typeof Deno !== 'undefined'; | ||
var YAML = typeof YAMLDummy !== 'undefined' && YAMLDummy.safeLoad ? YAMLDummy : typeof global !== 'undefined' ? global.jsyaml : typeof window !== 'undefined' ? window.jsyaml : undefined; | ||
var YAML = typeof _yaml.default !== 'undefined' && _yaml.default.load ? _yaml.default : undefined; | ||
var fs = fsMod ? fsMod.default || fsMod : undefined; | ||
@@ -82,3 +82,3 @@ | ||
case '.yaml': | ||
result = YAML.safeLoad(data); | ||
result = YAML.load(data); | ||
break; | ||
@@ -85,0 +85,0 @@ |
@@ -13,3 +13,3 @@ "use strict"; | ||
var YAMLDummy = _interopRequireWildcard(require("./formats/yaml.js")); | ||
var _yaml = _interopRequireDefault(require("./formats/yaml.js")); | ||
@@ -27,3 +27,3 @@ var fsMod = _interopRequireWildcard(require("./fs.js")); | ||
var isDeno = typeof Deno !== 'undefined'; | ||
var YAML = typeof YAMLDummy !== 'undefined' && YAMLDummy.safeLoad ? YAMLDummy : typeof global !== 'undefined' ? global.jsyaml : typeof window !== 'undefined' ? window.jsyaml : undefined; | ||
var YAML = typeof _yaml.default !== 'undefined' && _yaml.default.load ? _yaml.default : undefined; | ||
var fs = fsMod ? fsMod.default || fsMod : undefined; | ||
@@ -75,3 +75,3 @@ | ||
case '.yaml': | ||
result = YAML.safeDump(data, { | ||
result = YAML.dump(data, { | ||
ident: options.indent | ||
@@ -78,0 +78,0 @@ }); |
import JSON5 from './formats/json5.js'; | ||
import * as YAMLDummy from './formats/yaml.js'; | ||
import jsYaml from './formats/yaml.js'; | ||
import * as fsMod from './fs.cjs'; | ||
import extname from './extname.js'; | ||
var isDeno = typeof Deno !== 'undefined'; | ||
var YAML = typeof YAMLDummy !== 'undefined' && YAMLDummy.safeLoad ? YAMLDummy : typeof global !== 'undefined' ? global.jsyaml : typeof window !== 'undefined' ? window.jsyaml : undefined; | ||
var YAML = typeof jsYaml !== 'undefined' && jsYaml.load ? jsYaml : undefined; | ||
var fs = fsMod ? fsMod.default || fsMod : undefined; | ||
@@ -60,3 +60,3 @@ | ||
case '.yaml': | ||
result = YAML.safeLoad(data); | ||
result = YAML.load(data); | ||
break; | ||
@@ -63,0 +63,0 @@ |
import JSON5 from './formats/json5.js'; | ||
import * as YAMLDummy from './formats/yaml.js'; | ||
import jsYaml from './formats/yaml.js'; | ||
import * as fsMod from './fs.cjs'; | ||
import extname from './extname.js'; | ||
var isDeno = typeof Deno !== 'undefined'; | ||
var YAML = typeof YAMLDummy !== 'undefined' && YAMLDummy.safeLoad ? YAMLDummy : typeof global !== 'undefined' ? global.jsyaml : typeof window !== 'undefined' ? window.jsyaml : undefined; | ||
var YAML = typeof jsYaml !== 'undefined' && jsYaml.load ? jsYaml : undefined; | ||
var fs = fsMod ? fsMod.default || fsMod : undefined; | ||
@@ -53,3 +53,3 @@ | ||
case '.yaml': | ||
result = YAML.safeDump(data, { | ||
result = YAML.dump(data, { | ||
ident: options.indent | ||
@@ -56,0 +56,0 @@ }); |
@@ -33,3 +33,3 @@ import { defaults, debounce, getPath, setPath, pushPath } from './utils.js' | ||
read (language, namespace, callback) { | ||
var loadPath = this.options.loadPath | ||
let loadPath = this.options.loadPath | ||
if (typeof this.options.loadPath === 'function') { | ||
@@ -36,0 +36,0 @@ loadPath = this.options.loadPath(language, namespace) |
import JSON5 from './formats/json5.js' | ||
// eslint-disable-next-line no-unused-vars | ||
import * as YAMLDummy from './formats/yaml.js' | ||
import jsYaml from './formats/yaml.js' | ||
import * as fsMod from './fs.cjs' | ||
import extname from './extname.js' | ||
const isDeno = typeof Deno !== 'undefined' | ||
const YAML = typeof YAMLDummy !== 'undefined' && YAMLDummy.safeLoad ? YAMLDummy : typeof global !== 'undefined' ? global.jsyaml : (typeof window !== 'undefined' ? window.jsyaml : undefined) | ||
const YAML = typeof jsYaml !== 'undefined' && jsYaml.load ? jsYaml : undefined | ||
const fs = fsMod ? (fsMod.default || fsMod) : undefined // because of strange export | ||
@@ -55,3 +55,3 @@ | ||
case '.yaml': | ||
result = YAML.safeLoad(data) | ||
result = YAML.load(data) | ||
break | ||
@@ -58,0 +58,0 @@ default: |
@@ -8,3 +8,3 @@ const arr = [] | ||
if (source) { | ||
for (var prop in source) { | ||
for (const prop in source) { | ||
if (obj[prop] === undefined) obj[prop] = source[prop] | ||
@@ -18,10 +18,11 @@ } | ||
export function debounce (func, wait, immediate) { | ||
var timeout | ||
let timeout | ||
return function () { | ||
var context = this; var args = arguments | ||
var later = function () { | ||
const context = this | ||
const args = arguments | ||
const later = function () { | ||
timeout = null | ||
if (!immediate) func.apply(context, args) | ||
} | ||
var callNow = immediate && !timeout | ||
const callNow = immediate && !timeout | ||
clearTimeout(timeout) | ||
@@ -28,0 +29,0 @@ timeout = setTimeout(later, wait) |
import JSON5 from './formats/json5.js' | ||
// eslint-disable-next-line no-unused-vars | ||
import * as YAMLDummy from './formats/yaml.js' | ||
import jsYaml from './formats/yaml.js' | ||
import * as fsMod from './fs.cjs' | ||
import extname from './extname.js' | ||
const isDeno = typeof Deno !== 'undefined' | ||
const YAML = typeof YAMLDummy !== 'undefined' && YAMLDummy.safeLoad ? YAMLDummy : typeof global !== 'undefined' ? global.jsyaml : (typeof window !== 'undefined' ? window.jsyaml : undefined) | ||
const YAML = typeof jsYaml !== 'undefined' && jsYaml.load ? jsYaml : undefined | ||
const fs = fsMod ? (fsMod.default || fsMod) : undefined // because of strange export | ||
@@ -48,3 +48,3 @@ | ||
case '.yaml': | ||
result = YAML.safeDump(data, { ident: options.indent }) | ||
result = YAML.dump(data, { ident: options.indent }) | ||
break | ||
@@ -51,0 +51,0 @@ default: |
{ | ||
"name": "i18next-fs-backend", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"private": false, | ||
@@ -21,21 +21,20 @@ "type": "module", | ||
"module": "./esm/index.js", | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@babel/cli": "7.10.4", | ||
"@babel/core": "7.10.4", | ||
"@babel/preset-env": "7.10.4", | ||
"babel-plugin-add-module-exports": "1.0.2", | ||
"eslint": "7.3.1", | ||
"eslint-config-standard": "14.1.1", | ||
"eslint-plugin-import": "2.22.0", | ||
"@babel/cli": "7.12.10", | ||
"@babel/core": "7.12.10", | ||
"@babel/preset-env": "7.12.11", | ||
"babel-plugin-add-module-exports": "1.0.4", | ||
"eslint": "7.18.0", | ||
"eslint-config-standard": "16.0.2", | ||
"eslint-plugin-import": "2.22.1", | ||
"eslint-plugin-node": "11.1.0", | ||
"eslint-plugin-promise": "4.2.1", | ||
"eslint-plugin-require-path-exists": "1.1.9", | ||
"eslint-plugin-standard": "4.0.1", | ||
"eslint-plugin-standard": "5.0.0", | ||
"expect.js": "0.3.1", | ||
"i18next": "19.5.2", | ||
"js-yaml": "3.14.0", | ||
"i18next": "19.8.4", | ||
"js-yaml": "4.0.0", | ||
"json5": "2.1.3", | ||
"mocha": "8.0.1", | ||
"uglify-js": "3.10.0" | ||
"mocha": "8.2.1", | ||
"uglify-js": "3.12.4" | ||
}, | ||
@@ -64,3 +63,3 @@ "description": "i18next-fs-backend is a backend layer for i18next using in Node.js and for Deno to load translations from the filesystem.", | ||
"copy:json5": "cp node_modules/json5/dist/index.mjs lib/formats/json5.js", | ||
"copy:yaml": "cp node_modules/js-yaml/dist/js-yaml.min.js lib/formats/yaml.js", | ||
"copy:yaml": "cp node_modules/js-yaml/dist/js-yaml.mjs lib/formats/yaml.js", | ||
"copy": "rm -rf lib/formats && mkdir lib/formats && npm run copy:json5 && npm run copy:yaml", | ||
@@ -73,3 +72,3 @@ "lint": "eslint .", | ||
"test": "npm run lint && npm run build && mocha test -R spec --exit --experimental-modules", | ||
"test:deno": "deno test test/deno/*.js --allow-read --allow-write", | ||
"test:deno": "deno test test/deno/*.js --allow-read --allow-write --no-check", | ||
"preversion": "npm run test && npm run build && git push", | ||
@@ -76,0 +75,0 @@ "postversion": "git push && git push --tags" |
@@ -20,3 +20,3 @@ # Introduction | ||
``` | ||
```bash | ||
# npm package | ||
@@ -125,2 +125,2 @@ $ npm install i18next-fs-backend | ||
</a> | ||
</p> | ||
</p> |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
471510
13134
0
125
9
3