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:
893 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | import { Namespace as MinimNamespace } from 'minim';
|
---|
| 2 | import { isPlainObject } from 'ramda-adjunct';
|
---|
| 3 | import AnnotationElement from "./elements/Annotation.mjs";
|
---|
| 4 | import CommentElement from "./elements/Comment.mjs";
|
---|
| 5 | import ParseResultElement from "./elements/ParseResult.mjs";
|
---|
| 6 | import SourceMapElement from "./elements/SourceMap.mjs";
|
---|
| 7 | export class Namespace extends MinimNamespace {
|
---|
| 8 | constructor() {
|
---|
| 9 | super();
|
---|
| 10 | this.register('annotation', AnnotationElement);
|
---|
| 11 | this.register('comment', CommentElement);
|
---|
| 12 | this.register('parseResult', ParseResultElement);
|
---|
| 13 | this.register('sourceMap', SourceMapElement);
|
---|
| 14 | }
|
---|
| 15 | }
|
---|
| 16 | const namespace = new Namespace();
|
---|
| 17 | export const createNamespace = namespacePlugin => {
|
---|
| 18 | const namespaceInstance = new Namespace();
|
---|
| 19 | if (isPlainObject(namespacePlugin)) {
|
---|
| 20 | namespaceInstance.use(namespacePlugin);
|
---|
| 21 | }
|
---|
| 22 | return namespaceInstance;
|
---|
| 23 | };
|
---|
| 24 | export default namespace; |
---|
Note:
See
TracBrowser
for help on using the repository browser.