mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-29 03:45:15 +00:00
27 lines
528 B
JavaScript
27 lines
528 B
JavaScript
|
'use strict';
|
||
|
|
||
|
const Container = require('./container');
|
||
|
|
||
|
class AtWord extends Container {
|
||
|
constructor (opts) {
|
||
|
super(opts);
|
||
|
this.type = 'atword';
|
||
|
}
|
||
|
|
||
|
toString () {
|
||
|
let quote = this.quoted ? this.raws.quote : '';
|
||
|
return [
|
||
|
this.raws.before,
|
||
|
'@',
|
||
|
// we can't use String() here because it'll try using itself
|
||
|
// as the constructor
|
||
|
String.prototype.toString.call(this.value),
|
||
|
this.raws.after
|
||
|
].join('');
|
||
|
}
|
||
|
}
|
||
|
|
||
|
Container.registerWalker(AtWord);
|
||
|
|
||
|
module.exports = AtWord;
|