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

@coorpacademy/translate

Package Overview
Dependencies
Maintainers
14
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.6daaa06c to 3.0.0-beta.3-alpha.9c490b6d

.nyc_output/427907851aac0a14e2eef242da6ef4e1.json

5

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';

@@ -11,6 +12,6 @@ var interpolation = /\{\{([\s\S]+?)\}\}/g;

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 @@ };

8

lib/translate.js

@@ -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 }; }

@@ -26,6 +30,6 @@

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.6daaa06c",
"version": "3.0.0-beta.3-alpha.9c490b6d",
"description": "",

@@ -5,0 +5,0 @@ "main": "lib/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';

@@ -10,3 +11,3 @@ const interpolation = /\{\{([\s\S]+?)\}\}/g;

return template.replace(
return replace(
interpolation,

@@ -18,3 +19,4 @@ (token, value) => {

token;
}
},
template
);

@@ -21,0 +23,0 @@ };

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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