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

magicpen

Package Overview
Dependencies
Maintainers
2
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

magicpen - npm Package Compare versions

Comparing version 3.0.1 to 3.0.2

4

lib/MagicPen.js

@@ -367,2 +367,6 @@ /*global window*/

if (typeof regexp === 'string') {
regexp = new RegExp(utils.escapeRegExp(regexp), 'g');
}
if (typeof cb === 'string') {

@@ -369,0 +373,0 @@ var text = cb;

@@ -56,2 +56,6 @@ var utils = {

},
escapeRegExp: function (text){
return text.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
}

@@ -58,0 +62,0 @@ };

@@ -610,2 +610,6 @@ /*!

if (typeof regexp === 'string') {
regexp = new RegExp(utils.escapeRegExp(regexp), 'g');
}
if (typeof cb === 'string') {

@@ -756,2 +760,6 @@ var text = cb;

},
escapeRegExp: function (text){
return text.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
}

@@ -758,0 +766,0 @@ };

2

package.json
{
"name": "magicpen",
"version": "3.0.1",
"version": "3.0.2",
"description": "Styled output in both consoles and browsers",

@@ -5,0 +5,0 @@ "main": "./lib/MagicPen.js",

@@ -168,3 +168,3 @@ /*global describe, it, beforeEach*/

describe('with a given pattern and a callback', function () {
describe('with given a pattern and a callback', function () {
it('replaces text content maching pattern', function () {

@@ -180,3 +180,3 @@ pen.red('Hello').sp().green('world!').replaceText(/[a-z]{3}/, function (styles, text) {

describe('with a given pattern and a string', function () {
describe('with given a pattern and a string', function () {
it('replaces text content maching pattern', function () {

@@ -189,2 +189,10 @@ pen.text('Hello ').green('<placeholder>!').replaceText(/<placeholder>/, 'Jane Doe');

describe('with given a string and a string', function () {
it('replaces text content maching string', function () {
pen.text('Hello ').green('<placeholder>!').replaceText('<placeholder>', 'Jane Doe');
expect(pen, 'to equal',
magicpen().text('Hello ').green('Jane Doe!'));
});
});
it('collapses entries with similar styles', function () {

@@ -191,0 +199,0 @@ pen.green('Hello').sp().green('world!').replaceText(/ /, function (styles, text) {

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