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.5.0 to 4.6.0

4

lib/MagicPen.js

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

MagicPen.prototype.isMultiline = function () {
return this.output.length > 1 || this.size().height > 1;
};
MagicPen.prototype.isBlock = function () {

@@ -214,0 +218,0 @@ return this.output.length === 1 &&

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

MagicPen.prototype.isMultiline = function () {
return this.output.length > 1 || this.size().height > 1;
};
MagicPen.prototype.isBlock = function () {

@@ -527,0 +531,0 @@ return this.output.length === 1 &&

2

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

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

@@ -460,2 +460,11 @@ # MagicPen

### isMultiline()
Returns `true` if the output more than one line.
```js
expect(magicpen().text('line 1').isMultiline(), 'to be false');
expect(magicpen().text('line 1\nline 2').isMultiline(), 'to be true');
```
### installPlugin(plugin)

@@ -462,0 +471,0 @@

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

describe('#isBlock', function () {
describe('isBlock', function () {
it('should return false for an empty pen', function () {

@@ -1268,2 +1268,20 @@ expect(magicpen().isBlock(), 'to be false');

});
describe('isMultiline', function () {
it('returns false if the output is empty', function () {
expect(magicpen().isMultiline(), 'to be false');
});
it('returns false if the output is one line', function () {
expect(magicpen().text('line 1').isMultiline(), 'to be false');
});
it('returns true if the output is multiple lines', function () {
expect(magicpen().text('line 1\nline 2').isMultiline(), 'to be true');
});
it('returns true if the output is one line containing multiline block', function () {
expect(magicpen().block('text', 'line 1\nline 2').isMultiline(), 'to be true');
});
});
});
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