Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
auto-group-strings-array
Advanced tools
Small JS library to group array of strings by common substring
Small JS library to group array of strings by common substring
npm install auto-group-strings-array
Use auto-group-strings.min.js
file from dist/
inputStrings (type: Array<string>
)
options, type: Object
(optional), properties:
string
, default: " "
)RegExp
, default: undefined
)
string
) will only be used as a fallback when there is no match for delimiterRegExpstring
, default: "rtl"
)
"ltr"
for searching left to right or, "rtl"
for right to left.boolean
, default: false
)boolean
, default: false
)
Array<Object>
where
common
property is a string
members
property is an Array<number>
const autoGroupStrings = require("auto-group-strings");
const result = autoGroupStrings(
[
"hello code", // 0
"apple and orange", // 1
"for the happy code", // 2
"i don't know", // 3
"is it?", // 4
"it's a happy code", // 5
],
{
delimiter: " ",
direction: "rtl",
},
);
console.log(result);
/*
[
{ common: 'code', members: [ 0, 2, 5 ] },
{ common: 'happy code', members: [ 2, 5 ] }
]
*/
FAQs
Small JS library to group array of strings by common substring
The npm package auto-group-strings-array receives a total of 4 weekly downloads. As such, auto-group-strings-array popularity was classified as not popular.
We found that auto-group-strings-array demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.