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 4.4.0 to 4.5.0

6

lib/MagicPen.js

@@ -212,2 +212,8 @@ /*global window*/

MagicPen.prototype.isBlock = function () {
return this.output.length === 1 &&
this.output[0].length === 1 &&
this.output[0][0].style === 'block';
};
MagicPen.prototype.block = function () {

@@ -214,0 +220,0 @@ var pen = this.getContentFromArguments(arguments);

@@ -525,2 +525,8 @@ /*!

MagicPen.prototype.isBlock = function () {
return this.output.length === 1 &&
this.output[0].length === 1 &&
this.output[0][0].style === 'block';
};
MagicPen.prototype.block = function () {

@@ -527,0 +533,0 @@ var pen = this.getContentFromArguments(arguments);

2

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

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

@@ -300,3 +300,3 @@ # MagicPen

'amend text to\n' +
'it');
'it!');
```

@@ -321,3 +321,3 @@

'amend text to\n' +
'it');
'it!');
```

@@ -340,3 +340,3 @@

'amend text to\n' +
'it');
'it!');
```

@@ -453,2 +453,12 @@

### isBlock()
Returns `true` if the output only contains a block.
```js
expect(magicpen().block(function () {
this.text('foo');
}).isBlock(), 'to be true');
```
### installPlugin(plugin)

@@ -455,0 +465,0 @@

@@ -1241,2 +1241,28 @@ /*global describe, it, beforeEach*/

});
describe('#isBlock', function () {
it('should return false for an empty pen', function () {
expect(magicpen().isBlock(), 'to be false');
});
it('should return true for a pen with only a block', function () {
expect(magicpen().block(function () {
this.text('foo');
}).isBlock(), 'to be true');
});
it('should return false for a pen with a block and then some', function () {
expect(magicpen().block(function () {
this.text('foo');
}).text(',').isBlock(), 'to be false');
});
it('should return false for a pen with two blocks', function () {
expect(magicpen().block(function () {
this.text('foo');
}).block(function () {
this.text('bar');
}).isBlock(), 'to be false');
});
});
});
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