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

any-translate

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

any-translate - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

9

dist/createMapTokens.js

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

/*:: import type {
TokenizedTranslate,
Tr,
TokenSubject,

@@ -24,2 +24,7 @@ TokenizerParams,

var tokens /*: TranslateArgs*/ = {};
if (!params) {
return t(message, tokens);
}
var keys /*: Array<string>*/ = Object.keys(params);

@@ -62,3 +67,3 @@ for (var i = 0, l = keys.length; i < l; i++) {

function createMapTokens(t /*: Translate*/) /*: TokenizedTranslate*/ {
function createMapTokens(t /*: Translate*/) /*: Tr*/ {
return function _mapTokens(message /*: string*/, params /*: TokenizerParams*/) /*: Array<TokenSubject>|string*/ {

@@ -65,0 +70,0 @@ return mapTokens(t, message, params);

@@ -15,7 +15,7 @@ 'use strict';

Translator,
TokenizedTranslate,
Tr,
TranslateArgs,
HasTranslation
} from 'any-translate'*/
function createTranslate(bf /*: Translator*/) /*: TokenizedTranslate*/ {
function createTranslate(bf /*: Translator*/) /*: Tr*/ {
function translate(message /*: string*/, params /*: TranslateArgs*/) /*: string*/ {

@@ -22,0 +22,0 @@ return bf.translate(message, params);

@@ -12,5 +12,5 @@ /* @flow */

declare type TokenizedTranslate = (
declare type Tr = (
message: string,
params: TokenizerParams
params?: TokenizerParams
) => Array<TokenSubject>|string;

@@ -34,5 +34,5 @@

declare function createMapTokens(t: Translate): TokenizedTranslate;
declare function createTranslate(bf: Translator): TokenizedTranslate;
declare function createMapTokens(t: Translate): Tr;
declare function createTranslate(bf: Translator): Tr;
declare function createHasTranslation(bf: Translator): HasTranslation
}
{
"name": "any-translate",
"version": "0.0.3",
"version": "0.0.4",
"description": "Decorator for any i18n library",

@@ -5,0 +5,0 @@ "publishConfig": {

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