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

printf

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

printf - npm Package Compare versions

Comparing version 0.2.4 to 0.2.5

18

lib/printf.js

@@ -39,3 +39,2 @@

var Formatter = function(/*String*/ format){
var tokens = [];
this._mapped = false;

@@ -46,3 +45,3 @@ this._format = format;

Formatter.prototype._re = /\%(?:\(([\w_]+)\)|([1-9]\d*)\$)?([0 +\-\#]*)(\*|\d+)?(\.)?(\*|\d+)?[hlL]?([\%bscdeEfFgGioOuxX])/g;
Formatter.prototype._re = /\%(?:\(([\w_.]+)\)|([1-9]\d*)\$)?([0 +\-\#]*)(\*|\d+)?(\.)?(\*|\d+)?[hlL]?([\%bscdeEfFgGioOuxX])/g;
Formatter.prototype._parseDelim = function(mapping, intmapping, flags, minWidth, period, precision, specifier){

@@ -131,3 +130,3 @@ if(mapping){

isObject: true
},
}
};

@@ -148,6 +147,15 @@ Formatter.prototype.format = function(/*mixed...*/ filler){

if(this._mapped){
if(typeof filler[token.mapping] == 'undefined'){
// Identify value of property defined in `token.mapping`
var tokens = token.mapping.split('.');
var value = filler;
for (var j = 0, c = tokens.length; j < c; j++) {
value = value[tokens[j]];
if (typeof value === 'undefined') {
break
}
}
if(typeof value == 'undefined'){
throw new Error('missing key ' + token.mapping);
}
token.arg = filler[token.mapping];
token.arg = value;
}else{

@@ -154,0 +162,0 @@ if(token.intmapping){

{
"name": "printf",
"version": "0.2.4",
"version": "0.2.5",
"description": "Full implementation of the `printf` family in pure JS.",

@@ -5,0 +5,0 @@ "keywords": ["printf", "formatting", "sprintf", "format", "output", "print"],

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