Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-Authored-By: Piotrek Koszuliński <pkoszulinski@gmail.com>
  • Loading branch information
msamsel and Reinmar authored Jul 25, 2019
1 parent b961330 commit 76f8a51
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/model/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ export default class Element extends Node {
* @returns {Boolean}
*/
is( type, name = null ) {
const cutType = type.replace( 'model:', '' );
const cutType = type.replace( /^model:/, '' );

if ( !name ) {
return cutType == 'element' || cutType == this.name || super.is( type );
} else {
Expand Down
3 changes: 2 additions & 1 deletion src/view/attributeelement.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ export default class AttributeElement extends Element {
* @inheritDoc
*/
is( type, name = null ) {
const cutType = type && type.replace( 'view:', '' );
const cutType = type && type.replace( /^view:/, '' );

if ( !name ) {
return cutType == 'attributeElement' || super.is( type );
} else {
Expand Down

0 comments on commit 76f8a51

Please sign in to comment.