UNPKG

@rightcapital/phpdoc-parser

Version:

TypeScript version of PHPDoc parser with support for intersection types and generics

28 lines (27 loc) 667 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BaseNode = void 0; class BaseNode { constructor() { this.attributes = {}; } setAttribute(key, value) { this.attributes[key] = value; } hasAttribute(key) { return this.attributes.hasOwnProperty(key); } getAttribute(key) { if (this.hasAttribute(key)) { return this.attributes[key]; } return null; } toString() { throw new Error('Not yet implemented'); } toJSON() { return Object.assign({ nodeType: this.getNodeType() }, this); } } exports.BaseNode = BaseNode;