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

cruks-lib-string-builder

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

cruks-lib-string-builder - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

13

node_libs/cruks-lib-string-builder/StringBuilder.js

@@ -38,2 +38,15 @@ /**

/**
* @param {Array} collection list of variables to be appended individually
* @param {String} [separator] fragment separator
* @returns {cruks-lib-string-builder/StringBuilder} chained object
*/
StringBuilder.prototype.appendCollection = function (collection, separator) {
collection.forEach(function (item) {
this.append(item, separator);
}, this);
return this;
};
/**
* @param {String} fragment message fragment

@@ -40,0 +53,0 @@ * @param {Array} format list of variables to be used as string formatters

@@ -94,2 +94,20 @@ /**

describe("#appendCollection()", function () {
it("appends formatted string", function () {
var sb = new StringBuilder(".");
sb.append(1).appendCollection([2, 3]).append(4);
assert.strictEqual("1.2.3.4", sb.toString());
});
it("appends formatted string with custom separator", function () {
var sb = new StringBuilder(".");
sb.append(1).appendCollection([2, 3], "->").append(4);
assert.strictEqual("1->2->3.4", sb.toString());
});
});
describe("#format()", function () {

@@ -96,0 +114,0 @@ it("builds string and then formats it accordingly", function () {

2

package.json
{
"author": "Mateusz Charytoniuk <mateusz.charytoniuk@gmail.com>",
"name": "cruks-lib-string-builder",
"version": "1.0.1",
"version": "1.1.0",
"main": "node_libs/cruks-lib-string-builder",

@@ -6,0 +6,0 @@ "scripts": {

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