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:
933 bytes
|
Line | |
---|
1 | "use strict";
|
---|
2 |
|
---|
3 | exports.__esModule = true;
|
---|
4 | exports.default = void 0;
|
---|
5 | var _minim = require("minim");
|
---|
6 | class SourceMap extends _minim.ArrayElement {
|
---|
7 | constructor(content, meta, attributes) {
|
---|
8 | super(content, meta, attributes);
|
---|
9 | this.element = 'sourceMap';
|
---|
10 | }
|
---|
11 | get positionStart() {
|
---|
12 | return this.children.filter(item => item.classes.contains('position')).get(0);
|
---|
13 | }
|
---|
14 | get positionEnd() {
|
---|
15 | return this.children.filter(item => item.classes.contains('position')).get(1);
|
---|
16 | }
|
---|
17 | set position(position) {
|
---|
18 | if (typeof position === 'undefined') {
|
---|
19 | return;
|
---|
20 | }
|
---|
21 | const start = new _minim.ArrayElement([position.start.row, position.start.column, position.start.char]);
|
---|
22 | const end = new _minim.ArrayElement([position.end.row, position.end.column, position.end.char]);
|
---|
23 | start.classes.push('position');
|
---|
24 | end.classes.push('position');
|
---|
25 | this.push(start).push(end);
|
---|
26 | }
|
---|
27 | }
|
---|
28 | var _default = exports.default = SourceMap; |
---|
Note:
See
TracBrowser
for help on using the repository browser.