Comparing version 4.5.0 to 4.6.0
@@ -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 && |
{ | ||
"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'); | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
538598
3485
662