New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

formatplus

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

formatplus - npm Package Compare versions

Comparing version 1.1.0 to 2.0.0

21

index.js
module.exports=function(){
String.prototype.FormatPlus = String.prototype.FormatPlus || function(){
"use strict";
String.prototype.FormatPlus = function(){
let str = this.toString();
if (arguments.length) {
let t = typeof arguments[0];
let key;
let args = ("string" === t || "number" === t) ? Array.prototype.slice.call(arguments) : arguments[0];
for (key in args) {
str = str.replace(new RegExp("\\{" + key + "\\}", "gi"), args[key]);
if (arguments.length){
const t = typeof arguments[0];
const args = ("string" === t || "number" === t) ? arguments : arguments[0];
for (let key in args) {
str=str.replace(new RegExp("\\{" + key + "\\}", "gi"), args[key]);
}
return str;
}
}
return str;
}
}
{
"name": "formatplus",
"version": "1.1.0",
"description": "Format strings with EASE!",
"version": "2.0.0",
"description": "Format strings inline!",
"main": "index.js",

@@ -9,4 +9,4 @@ "scripts": {

},
"author": "Meeee",
"author": "Tyler Kinney Publishing",
"license": "ISC"
}

@@ -7,2 +7,3 @@ <h1 align="center">formatplus</h1>

## Install
### Regular Install (RECOMMENDED)
```sh

@@ -12,3 +13,17 @@ npm i formatplus

### Global Install
```sh
sudo npm i -g formatplus
```
## 2.0 Changelog
- New readme
## How-to-Use
### Initalization
To actually give strings a `FormatPlus` method, you need to call `formatplus()` like so:
```javascript
require("formatplus")();
```
### Method 1

@@ -30,5 +45,52 @@ Method one involves numbers and can be used like this:

## Author
Meee Studios
### Source
If you would like to modify it, here is the base code:
```javascript
module.exports=function(){
String.prototype.FormatPlus = function(){
let str = this.toString();
if (arguments.length){
const t = typeof arguments[0];
const args = ("string" === t || "number" === t) ? arguments : arguments[0];
for (let key in args) {
str=str.replace(new RegExp("\\{" + key + "\\}", "gi"), args[key]);
}
}
return str;
}
}
```
#### Raw Form
```
module.exports=function(){
String.prototype.FormatPlus = function(){
let str = this.toString();
if (arguments.length){
const t = typeof arguments[0];
const args = ("string" === t || "number" === t) ? arguments : arguments[0];
for (let key in args) {
str=str.replace(new RegExp("\\{" + key + "\\}", "gi"), args[key]);
}
}
return str;
}
}
```
## Developer(s)
### Tyler Kinney Studios
- Tyler Kinney
- Tyson Joe
- Sean (REDACTED)
## Publisher(s)
- Tyler Kinney Publishing
##### Thanks for visiting
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