New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

stringf

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stringf - npm Package Compare versions

Comparing version
1.0.0
to
1.0.1
+4
-11
index.js

@@ -15,5 +15,3 @@ exports.Format = function(s, m) {

}
if ((j - i) %2 == 0) {
output = output + s[j];
} else {
if ((j - i) %2 != 0) {
var param = "";

@@ -30,14 +28,9 @@ while (j < s.length && s[j] != ' ') {

}
if (s[j] == ' ') {
output = output + ' ';
}
}
i = j + 1;
} else {
output = output + s[i];
i++;
i = j;
}
output = output + s[i];
i++;
}
return output;
}
{
"name": "stringf",
"version": "1.0.0",
"version": "1.0.1",
"description": "Dead simple string formatter",

@@ -5,0 +5,0 @@ "main": "index.js",

+14
-17

@@ -1,4 +0,6 @@

# Sringf
# Sringf [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![npm version](https://badge.fury.io/js/stringf.svg)](https://badge.fury.io/js/stringf)
Dead simple cross-language string formatter
No dependencies, O(N*m)
# Usage

@@ -23,3 +25,3 @@ ## go

## js
```
```js
var stringf = require("stringf")

@@ -35,12 +37,12 @@

# Pseudocode for implement in your own language
```
input:
# Pseudocode to implement in your own language
### input:
a string, s
a map string to string, paramMap
output:
### output:
a string with param replaced
```
let ESCCHAR ← '#', i ← 0, output ← ""
while i < length(s) do

@@ -53,6 +55,4 @@ if s[i] = ESCCHAR then

output ← output + ESCCHAR
if (j - i) mod 2 = 0 then
output ← output + s[j]
else
let param ← ""
if (j - i) mod 2 ≠ 0 then
let param ← "" (parse parameter key)
while j < length(s) and s[j] ≠ ' ' do

@@ -65,9 +65,6 @@ param ← param + s[j]

return output
if s[j] = ' ' then
output ← output + ' '
i ← j + 1
else
output ← output + s[i]
i ← i + 1
i ← j
output ← output + s[i]
i ← i + 1
return output
```

@@ -18,5 +18,3 @@ package stringf

}
if (j - i) % 2 == 0 {
output = output + string(s[j])
} else {
if (j - i) % 2 != 0 {
param := ""

@@ -31,16 +29,10 @@ for j < len(s) && s[j] != byte(' ') {

}
if j == len(s) { return output }
if s[j] == byte(' ') {
output = output + " "
}
}
i = j + 1
} else {
output = output + string(s[i])
i++
i = j
}
output = output + string(s[i])
i++
}
return output
}