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

join-string

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

join-string - npm Package Compare versions

Comparing version 0.0.4 to 1.0.0

17

dist/index.js

@@ -10,6 +10,15 @@ "use strict";

}
return items
.filter(function (item) { return typesafe_is_1.isFilledString(item) || typesafe_is_1.isNumber(item) || typesafe_is_1.isArray(item); })
.map(function (item) { return (typesafe_is_1.isArray(item) ? joinFn.apply(void 0, item) : item); })
.join(delimiter);
var results = [];
for (var index = 0; index < items.length; index++) {
var item = items[index];
if (typesafe_is_1.isNumber(item) || typesafe_is_1.isFilledString(item)) {
results.push(item);
continue;
}
if (typesafe_is_1.isArray(item)) {
results.push(joinFn.apply(void 0, item));
continue;
}
}
return results.join(delimiter);
};

@@ -16,0 +25,0 @@ };

{
"name": "join-string",
"version": "0.0.4",
"version": "1.0.0",
"description": "A utility for joining strings",

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

@@ -5,6 +5,19 @@ import { isFilledString, isArray, isNumber } from 'typesafe-is';

function joinFn(...items: Array<any>): string {
return items
.filter(item => isFilledString(item) || isNumber(item) || isArray(item))
.map(item => (isArray(item) ? joinFn(...item) : item))
.join(delimiter);
const results: Array<string | number> = [];
for (let index = 0; index < items.length; index++) {
const item = items[index];
if (isNumber(item) || isFilledString(item)) {
results.push(item);
continue;
}
if (isArray(item)) {
results.push(joinFn(...item));
continue;
}
}
return results.join(delimiter);
};

@@ -11,0 +24,0 @@

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