Skip to content

Commit 2993e17

Browse files
committed
refactor: refactor visitor mechanism
Use babel + graphQL visitor style and decouple the visiting from the parsing where possible. Ref #9
1 parent 6078ed0 commit 2993e17

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+721
-721
lines changed

apidom/.editorconfig

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# http://editorconfig.org
2+
3+
# A special property that should be specified at the top of the file outside of
4+
# any sections. Set to true to stop .editor config file search on current file
5+
root = true
6+
7+
[*]
8+
# Indentation style
9+
# Possible values - tab, space
10+
indent_style = space
11+
12+
# Indentation size in single-spaced characters
13+
# Possible values - an integer, tab
14+
indent_size = 2
15+
16+
# Line ending file format
17+
# Possible values - lf, crlf, cr
18+
end_of_line = lf
19+
20+
# File character encoding
21+
# Possible values - latin1, utf-8, utf-16be, utf-16le
22+
charset = utf-8
23+
24+
# Denotes whether to trim whitespace at the end of lines
25+
# Possible values - true, false
26+
trim_trailing_whitespace = true
27+
28+
# Denotes whether file should end with a newline
29+
# Possible values - true, false
30+
insert_final_newline = true
31+
32+
[*.ts]
33+
indent_size = 4
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const { ObjectElement } = require('minim');
3+
const {ObjectElement} = require('minim');
44

55
/**
66
* @class Components
@@ -11,14 +11,14 @@ const { ObjectElement } = require('minim');
1111
* @extends ObjectElement
1212
*/
1313
class Components extends ObjectElement {
14-
constructor(...args) {
15-
super(...args);
16-
this.element = 'components';
17-
}
14+
constructor(...args) {
15+
super(...args);
16+
this.element = 'components';
17+
}
1818

19-
get schemas() {
20-
return this.get('schemas');
21-
}
19+
get schemas() {
20+
return this.get('schemas');
21+
}
2222
}
2323

2424
module.exports = Components;
Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const { ObjectElement } = require('minim');
3+
const {ObjectElement} = require('minim');
44

55
/**
66
* @class Contact
@@ -11,34 +11,34 @@ const { ObjectElement } = require('minim');
1111
* @extends ObjectElement
1212
*/
1313
class Contact extends ObjectElement {
14-
constructor(...args) {
15-
super(...args);
16-
this.element = 'contact';
17-
}
18-
19-
get name() {
20-
return this.get('name');
21-
}
22-
23-
get url() {
24-
return this.get('url');
25-
}
26-
27-
get email() {
28-
return this.get('email');
29-
}
30-
31-
set name(name) {
32-
return this.set('name', name);
33-
}
34-
35-
set url(url) {
36-
return this.set('url', url);
37-
}
38-
39-
set email(email) {
40-
return this.set('email', email);
41-
}
14+
constructor(...args) {
15+
super(...args);
16+
this.element = 'contact';
17+
}
18+
19+
get name() {
20+
return this.get('name');
21+
}
22+
23+
get url() {
24+
return this.get('url');
25+
}
26+
27+
get email() {
28+
return this.get('email');
29+
}
30+
31+
set name(name) {
32+
return this.set('name', name);
33+
}
34+
35+
set url(url) {
36+
return this.set('url', url);
37+
}
38+
39+
set email(email) {
40+
return this.set('email', email);
41+
}
4242
}
4343

4444
module.exports = Contact;
Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const { ObjectElement } = require('minim');
3+
const {ObjectElement} = require('minim');
44

55
/**
66
* @class Info
@@ -11,58 +11,58 @@ const { ObjectElement } = require('minim');
1111
* @extends ObjectElement
1212
*/
1313
class Info extends ObjectElement {
14-
constructor(...args) {
15-
super(...args);
16-
this.element = 'info';
17-
}
14+
constructor(...args) {
15+
super(...args);
16+
this.element = 'info';
17+
}
1818

19-
get title() {
20-
return this.get('title');
21-
}
19+
get title() {
20+
return this.get('title');
21+
}
2222

23-
get description() {
24-
return this.get('description');
25-
}
23+
get description() {
24+
return this.get('description');
25+
}
2626

27-
get termsOfService() {
28-
return this.get('termsOfService');
29-
}
27+
get termsOfService() {
28+
return this.get('termsOfService');
29+
}
3030

31-
get version() {
32-
return this.get('version');
33-
}
31+
get version() {
32+
return this.get('version');
33+
}
3434

35-
get license() {
36-
return this.get('license');
37-
}
35+
get license() {
36+
return this.get('license');
37+
}
3838

39-
get contact() {
40-
return this.get('contact');
41-
}
39+
get contact() {
40+
return this.get('contact');
41+
}
4242

43-
set title(title) {
44-
return this.set('title', title);
45-
}
43+
set title(title) {
44+
return this.set('title', title);
45+
}
4646

47-
set description(description) {
48-
return this.set('description', description);
49-
}
47+
set description(description) {
48+
return this.set('description', description);
49+
}
5050

51-
set termsOfService(tos) {
52-
return this.set('termsOfService', tos);
53-
}
51+
set termsOfService(tos) {
52+
return this.set('termsOfService', tos);
53+
}
5454

55-
set version(version) {
56-
return this.set('version', version);
57-
}
55+
set version(version) {
56+
return this.set('version', version);
57+
}
5858

59-
set license(licenseElement) {
60-
return this.set('license', licenseElement);
61-
}
59+
set license(licenseElement) {
60+
return this.set('license', licenseElement);
61+
}
6262

63-
set contact(contactElement) {
64-
return this.set('contact', contactElement);
65-
}
63+
set contact(contactElement) {
64+
return this.set('contact', contactElement);
65+
}
6666
}
6767

6868
module.exports = Info;
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const { ObjectElement } = require('minim');
3+
const {ObjectElement} = require('minim');
44

55
/**
66
* @class License
@@ -11,26 +11,26 @@ const { ObjectElement } = require('minim');
1111
* @extends ObjectElement
1212
*/
1313
class License extends ObjectElement {
14-
constructor(...args) {
15-
super(...args);
16-
this.element = 'license';
17-
}
14+
constructor(...args) {
15+
super(...args);
16+
this.element = 'license';
17+
}
1818

19-
get name() {
20-
return this.get('name');
21-
}
19+
get name() {
20+
return this.get('name');
21+
}
2222

23-
get url() {
24-
return this.get('url');
25-
}
23+
get url() {
24+
return this.get('url');
25+
}
2626

27-
set name(name) {
28-
return this.set('name', name);
29-
}
27+
set name(name) {
28+
return this.set('name', name);
29+
}
3030

31-
set url(url) {
32-
return this.set('url', url);
33-
}
31+
set url(url) {
32+
return this.set('url', url);
33+
}
3434
}
3535

3636
module.exports = License;
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const { ObjectElement } = require('minim');
3+
const {ObjectElement} = require('minim');
44

55
/**
66
* @class OpenApi3
@@ -11,19 +11,19 @@ const { ObjectElement } = require('minim');
1111
* @extends ObjectElement
1212
*/
1313
class OpenApi3 extends ObjectElement {
14-
constructor(...args) {
15-
super(...args);
16-
this.element = 'openapi3';
17-
this.classes.push('api');
18-
}
14+
constructor(...args) {
15+
super(...args);
16+
this.element = 'openapi3';
17+
this.classes.push('api');
18+
}
1919

20-
get openapi() {
21-
return this.get('openapi');
22-
}
20+
get openapi() {
21+
return this.get('openapi');
22+
}
2323

24-
get info() {
25-
return this.get('info');
26-
}
24+
get info() {
25+
return this.get('info');
26+
}
2727
}
2828

2929
module.exports = OpenApi3;
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const { StringElement } = require('minim');
3+
const {StringElement} = require('minim');
44

55
/**
66
* @class Openapi *
@@ -11,10 +11,10 @@ const { StringElement } = require('minim');
1111
* @extends StringElement
1212
*/
1313
class Openapi extends StringElement {
14-
constructor(...args) {
15-
super(...args);
16-
this.element = 'openapi';
17-
}
14+
constructor(...args) {
15+
super(...args);
16+
this.element = 'openapi';
17+
}
1818
}
1919

2020
module.exports = Openapi;
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const { ObjectElement } = require('minim');
3+
const {ObjectElement} = require('minim');
44

55
/**
66
* @class Schema
@@ -11,10 +11,10 @@ const { ObjectElement } = require('minim');
1111
* @extends ObjectElement
1212
*/
1313
class Schema extends ObjectElement {
14-
constructor(...args) {
15-
super(...args);
16-
this.element = 'schema';
17-
}
14+
constructor(...args) {
15+
super(...args);
16+
this.element = 'schema';
17+
}
1818
}
1919

2020
module.exports = Schema;

apidom/packages/apidom-ns-openapi3/src/elements/Schemas.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)