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

@coorpacademy/translate

Package Overview
Dependencies
Maintainers
15
Versions
271
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coorpacademy/translate - npm Package Compare versions

Comparing version 3.0.0-beta.3-alpha.eb88ee6c to 3.0.1

7

es/translate.js
import get from 'lodash/fp/get';
import has from 'lodash/fp/has';
import trim from 'lodash/fp/trim';
import replace from 'lodash/fp/replace';

@@ -9,8 +10,8 @@ var interpolation = /\{\{([\s\S]+?)\}\}/g;

return function (key, data) {
var template = locales[key] || key;
var template = locales[key] || key || '';
return template.replace(interpolation, function (token, value) {
return replace(interpolation, function (token, value) {
var _value = trim(value);
return has(_value, data) ? get(_value, data) : token;
});
}, template);
};

@@ -17,0 +18,0 @@ };

@@ -17,2 +17,6 @@ 'use strict';

var _replace = require('lodash/fp/replace');
var _replace2 = _interopRequireDefault(_replace);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -24,8 +28,8 @@

return function (key, data) {
var template = locales[key] || key;
var template = locales[key] || key || '';
return template.replace(interpolation, function (token, value) {
return (0, _replace2.default)(interpolation, function (token, value) {
var _value = (0, _trim2.default)(value);
return (0, _has2.default)(_value, data) ? (0, _get2.default)(_value, data) : token;
});
}, template);
};

@@ -32,0 +36,0 @@ };

{
"name": "@coorpacademy/translate",
"version": "3.0.0-beta.3-alpha.eb88ee6c",
"version": "3.0.1",
"description": "",
"main": "lib/translate.js",
"module": "es/translate.js",
"files": [
"lib",
"es",
"README.md"
],
"scripts": {

@@ -8,0 +13,0 @@ "build": "npm run build:commonjs && npm run build:es",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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