source: node_modules/@swagger-api/apidom-core/es/namespace.mjs

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
Line 
1import { Namespace as MinimNamespace } from 'minim';
2import { isPlainObject } from 'ramda-adjunct';
3import AnnotationElement from "./elements/Annotation.mjs";
4import CommentElement from "./elements/Comment.mjs";
5import ParseResultElement from "./elements/ParseResult.mjs";
6import SourceMapElement from "./elements/SourceMap.mjs";
7export 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}
16const namespace = new Namespace();
17export const createNamespace = namespacePlugin => {
18 const namespaceInstance = new Namespace();
19 if (isPlainObject(namespacePlugin)) {
20 namespaceInstance.use(namespacePlugin);
21 }
22 return namespaceInstance;
23};
24export default namespace;
Note: See TracBrowser for help on using the repository browser.