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

@spare/bracket

Package Overview
Dependencies
Maintainers
1
Versions
187
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spare/bracket - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

21

dist/index.cjs.js

@@ -11,3 +11,3 @@ 'use strict';

const anglebr = x => '<' + x + '>';
const br = (x, mode = enumBrackets.BRK) => {
const br = (x, mode) => {
if (mode === enumBrackets.PAR) return parenth(x);

@@ -20,2 +20,21 @@ if (mode === enumBrackets.BRK) return bracket(x);

const SelectBr = mode => {
if (mode === enumBrackets.PAR) return parenth;
if (mode === enumBrackets.BRK) return bracket;
if (mode === enumBrackets.BRC) return brace;
if (mode === enumBrackets.ANBR) return anglebr;
return null;
};
const Br = (read, mode) => {
const br = SelectBr(mode);
if (!mode) return read;
if (!read) return br;
return x => {
var _ref, _x;
return _ref = (_x = x, read(_x)), br(_ref);
};
};
exports.Br = Br;
exports.anglebr = anglebr;

@@ -22,0 +41,0 @@ exports.br = br;

@@ -1,2 +0,2 @@

import { BRK, PAR, BRC, ANBR } from '@spare/enum-brackets';
import { PAR, BRK, BRC, ANBR } from '@spare/enum-brackets';

@@ -7,3 +7,3 @@ const parenth = x => '(' + x + ')';

const anglebr = x => '<' + x + '>';
const br = (x, mode = BRK) => {
const br = (x, mode) => {
if (mode === PAR) return parenth(x);

@@ -16,2 +16,20 @@ if (mode === BRK) return bracket(x);

export { anglebr, br, brace, bracket, parenth };
const SelectBr = mode => {
if (mode === PAR) return parenth;
if (mode === BRK) return bracket;
if (mode === BRC) return brace;
if (mode === ANBR) return anglebr;
return null;
};
const Br = (read, mode) => {
const br = SelectBr(mode);
if (!mode) return read;
if (!read) return br;
return x => {
var _ref, _x;
return _ref = (_x = x, read(_x)), br(_ref);
};
};
export { Br, anglebr, br, brace, bracket, parenth };

6

package.json
{
"name": "@spare/bracket",
"version": "0.3.1",
"version": "0.3.2",
"description": "Add parenthesis/bracket/brace/angle-bracket to string",

@@ -18,3 +18,3 @@ "main": "dist/index.cjs.js",

"dependencies": {
"@spare/enum-brackets": "^0.3.1"
"@spare/enum-brackets": "^0.3.2"
},

@@ -37,3 +37,3 @@ "repository": {

"homepage": "https://github.com/hoyeungw/spare#readme",
"gitHead": "122450f91d790a6bbec4c9bb57463a9b3e368153"
"gitHead": "70612d85879c19830da8aee6142f78c984a42c68"
}
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