| Conditions | 5 |
| Paths | 5 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | var utils = require('./utils'); |
||
| 9 | var Identifiers = function(json){ |
||
| 10 | |||
| 11 | // Protect against forgetting the new keyword when calling the constructor |
||
| 12 | if(!(this instanceof Identifiers)){ |
||
| 13 | return new Identifiers(json); |
||
| 14 | } |
||
| 15 | |||
| 16 | // If the given object is already an instance then just return it. DON'T copy it. |
||
| 17 | if(Identifiers.isInstance(json)){ |
||
| 18 | return json; |
||
| 19 | } |
||
| 20 | |||
| 21 | this.identifiers = {}; |
||
| 22 | |||
| 23 | if(json){ |
||
| 24 | if(json instanceof Identifiers){ |
||
| 25 | this.identifiers = json.identifiers; |
||
| 26 | } else { |
||
| 27 | this.identifiers = json; |
||
| 28 | } |
||
| 29 | } |
||
| 30 | }; |
||
| 31 | |||
| 54 | module.exports = Identifiers; |