main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
466 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | const Element = require('./Element');
|
---|
| 2 |
|
---|
| 3 | /**
|
---|
| 4 | * @class StringElement
|
---|
| 5 | *
|
---|
| 6 | * @param {string} content
|
---|
| 7 | * @param meta
|
---|
| 8 | * @param attributes
|
---|
| 9 | */
|
---|
| 10 | module.exports = class StringElement extends Element {
|
---|
| 11 | constructor(content, meta, attributes) {
|
---|
| 12 | super(content, meta, attributes);
|
---|
| 13 | this.element = 'string';
|
---|
| 14 | }
|
---|
| 15 |
|
---|
| 16 | primitive() {
|
---|
| 17 | return 'string';
|
---|
| 18 | }
|
---|
| 19 |
|
---|
| 20 | /**
|
---|
| 21 | * The length of the string.
|
---|
| 22 | * @type number
|
---|
| 23 | */
|
---|
| 24 | get length() {
|
---|
| 25 | return this.content.length;
|
---|
| 26 | }
|
---|
| 27 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.