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

string.format

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

string.format - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

4

index.js

@@ -16,3 +16,5 @@ /* jslint node: true */

replace = eval('params'+capture);
replace = JSON.decycled(replace).replace(/(^\"|\"$)/g,'').replace(/(\\n|\\r)/g,'\n').replace(/\\t/g,'\t');
if(typeof replace === 'string'){
replace = JSON.decycled(replace).replace(/(^\"|\"$)/g,'').replace(/(\\n|\\r)/g,'\n').replace(/\\t/g,'\t');
}
return replace;

@@ -19,0 +21,0 @@ } catch(error){

{
"name": "string.format",
"description": "String prototype method -> 'Hello {name}!'.format({name:'Homer'});",
"version": "1.0.0",
"version": "1.0.1",
"author": {

@@ -6,0 +6,0 @@ "name": "Bifuer",

@@ -6,3 +6,8 @@ # String.format

Add to [JS String.prototype](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) `.format()` method which accepts as parameter an object or an array with values to be substituted in the string, based on a pattern.
Add to [JS String.prototype](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) `.format()` method which accepts as parameter an object or an array with values to be substituted in the string, based on a pattern.
> String.format uses [JSON.decycled](https://github.com/bifuer/JSON.decycled) for show Objects as String without circular references errors and some related problems.
> For Date object format you can use [Date.format](https://github.com/bifuer/Date.format)
[npm](https://www.npmjs.com/package/string.format)

@@ -68,5 +73,11 @@

Añade a [String.prototype de JS](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) el método `.format()` que acepta como parámetro un objeto o un array con valores que serán sustituidos en el string en base a un patrón de sustitución. [npm](https://www.npmjs.com/package/string.format)
Añade a [String.prototype de JS](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) el método `.format()` que acepta como parámetro un objeto o un array con valores que serán sustituidos en el string en base a un patrón de sustitución.
> String.format utiliza [JSON.decycled](https://github.com/bifuer/JSON.decycled) para monstar objetos como strings sin errores de referencia circular y otros problemas relacionados.
> Para ampliar las funciones de String.format en el caso de objetos Date puede resultarte util [Date.format](https://github.com/bifuer/Date.format)
[npm](https://www.npmjs.com/package/string.format)
## Licencia
MIT
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