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

y18n

Package Overview
Dependencies
Maintainers
2
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

y18n - npm Package Compare versions

Comparing version 3.2.1 to 4.0.0

CHANGELOG.md

16

index.js

@@ -19,2 +19,5 @@ var fs = require('fs')

Y18N.prototype.__ = function () {
if (typeof arguments[0] !== 'string') {
return this._taggedLiteral.apply(this, arguments)
}
var args = Array.prototype.slice.call(arguments)

@@ -44,2 +47,15 @@ var str = args.shift()

Y18N.prototype._taggedLiteral = function (parts) {
var args = arguments
var str = ''
parts.forEach(function (part, i) {
var arg = args[i + 1]
str += part
if (typeof arg !== 'undefined') {
str += '%s'
}
})
return this.__.apply(null, [str].concat([].slice.call(arguments, 1)))
}
Y18N.prototype._enqueueWrite = function (work) {

@@ -46,0 +62,0 @@ this.writeQueue.push(work)

16

package.json
{
"name": "y18n",
"version": "3.2.1",
"version": "4.0.0",
"description": "the bare-bones internationalization library used by yargs",

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

"test": "nyc mocha",
"coverage": "nyc report --reporter=text-lcov | coveralls"
"coverage": "nyc report --reporter=text-lcov | coveralls",
"release": "standard-version"
},

@@ -31,9 +32,10 @@ "repository": {

"devDependencies": {
"chai": "^3.4.1",
"coveralls": "^2.11.6",
"mocha": "^2.3.4",
"nyc": "^6.1.1",
"chai": "^4.0.1",
"coveralls": "^3.0.0",
"mocha": "^4.0.1",
"nyc": "^11.0.1",
"rimraf": "^2.5.0",
"standard": "^5.4.1"
"standard": "^10.0.0-beta.0",
"standard-version": "^4.2.0"
}
}

@@ -7,2 +7,3 @@ # y18n

[![js-standard-style][standard-image]][standard-url]
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)

@@ -27,2 +28,15 @@ The bare-bones internationalization library used by yargs.

_using tagged template literals_
```js
var __ = require('y18n').__
var str = 'foo'
console.log(__`my awesome string ${str}`)
```
output:
`my awesome string foo`
_pluralization support:_

@@ -65,2 +79,6 @@

This function can also be used as a tag for a template literal. You can use it
like this: <code>__&#96;hello ${'world'}&#96;</code>. This will be equivalent to
`__('hello %s', 'world')`.
### y18n.\_\_n(singularString, pluralString, count, arg, arg, arg)

@@ -67,0 +85,0 @@

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