File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# kittik-shape-basic
22
3- ![ Build Status] ( https://img.shields.io/travis/ghaiklor/kittik-shape-basic.svg )
4- ![ Coverage] ( https://img.shields.io/coveralls/ghaiklor/kittik-shape-basic.svg )
3+ ![ Build Status] ( https://img.shields.io/travis/kittikjs/shape-basic.svg )
4+ ![ Coverage] ( https://img.shields.io/coveralls/kittikjs/shape-basic.svg )
5+
56![ Downloads] ( https://img.shields.io/npm/dm/kittik-shape-basic.svg )
67![ Downloads] ( https://img.shields.io/npm/dt/kittik-shape-basic.svg )
78![ npm version] ( https://img.shields.io/npm/v/kittik-shape-basic.svg )
8- ![ dependencies] ( https://img.shields.io/david/ghaiklor/kittik-shape-basic.svg )
9- ![ dev dependencies] ( https://img.shields.io/david/dev/ghaiklor/kittik-shape-basic.svg )
109![ License] ( https://img.shields.io/npm/l/kittik-shape-basic.svg )
1110
11+ [ ![ semantic-release] ( https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg )] ( https://github.com/semantic-release/semantic-release )
12+ [ ![ Commitizen friendly] ( https://img.shields.io/badge/commitizen-friendly-brightgreen.svg )] ( http://commitizen.github.io/cz-cli/ )
13+ ![ dependencies] ( https://img.shields.io/david/kittikjs/shape-basic.svg )
14+ ![ dev dependencies] ( https://img.shields.io/david/dev/kittikjs/shape-basic.svg )
15+
1216Basic shape which is needed for creating other shapes
1317
1418## Getting Started
@@ -19,10 +23,16 @@ Install it via npm:
1923npm install kittik-shape-basic
2024```
2125
22- And include in your project :
26+ Import module and extend another one :
2327
2428``` javascript
25- import kittik -shape -basic from ' kittik-shape-basic' ;
29+ import { Shape } from ' kittik-shape-basic' ;
30+
31+ export class Rectangle extends Shape {
32+ constructor (... args ) {
33+ super (... args);
34+ }
35+ }
2636```
2737
2838## License
Original file line number Diff line number Diff line change 2727 "babel-preset-stage-0" : " 6.1.18" ,
2828 "chai" : " 3.4.1" ,
2929 "coveralls" : " 2.11.4" ,
30- "cz-conventional-changelog" : " ^ 1.1.4" ,
30+ "cz-conventional-changelog" : " 1.1.4" ,
3131 "isparta" : " 4.0.0" ,
3232 "mocha" : " 2.3.4" ,
33- "semantic-release" : " ^ 4.3.5" ,
33+ "semantic-release" : " 4.3.5" ,
3434 "sinon" : " 1.17.2"
3535 },
3636 "config" : {
Original file line number Diff line number Diff line change @@ -234,7 +234,7 @@ export class Shape {
234234 */
235235 static fromObject ( obj ) {
236236 if ( ! obj . name || ! obj . options ) throw new Error ( 'It looks like it is not an Object representation of the Shape' ) ;
237- if ( obj . name !== this . name ) throw new Error ( `It is not an Object representation of the ${ this . name } ` ) ;
237+ if ( obj . name !== this . name ) throw new Error ( `${ obj . name } is not an Object representation of the ${ this . name } ` ) ;
238238
239239 return this . create ( obj . options ) ;
240240 }
Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ describe('Shape', () => {
124124
125125 it ( 'Should properly throw error if trying to create Shape not from its representation' , ( ) => {
126126 let obj = { name : 'Rectangle' , options : { } } ;
127- assert . throws ( ( ) => Shape . fromObject ( obj ) , Error , 'It is not an Object representation of the Shape' ) ;
127+ assert . throws ( ( ) => Shape . fromObject ( obj ) , Error , 'Rectangle is not an Object representation of the Shape' ) ;
128128 } ) ;
129129
130130 it ( 'Should properly create Shape instance from Object representation' , ( ) => {
You can’t perform that action at this time.
0 commit comments