Skip to content

Commit ee1684d

Browse files
committed
parameter groupings work
1 parent 9811790 commit ee1684d

File tree

13 files changed

+160
-367
lines changed

13 files changed

+160
-367
lines changed

src/generators/json/constants.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
// Grabs the default value if present
4-
export const DEFAULT_EXPRESSION = /^(D|d)efault(s|):$/;
4+
export const DEFAULT_EXPRESSION = /^(?:D|d)efault(?:s|):$/;
55

66
// Grabs the type and description of one of the formats for event types
77
export const EVENT_TYPE_DESCRIPTION_EXTRACTOR = /{(.*)}(.*)/;
@@ -17,7 +17,7 @@ export const METHOD_TYPE_EXTRACTOR = /^{(.*)}( .*)?$/;
1717
export const METHOD_RETURN_TYPE_EXTRACTOR = /^Returns(:?) {(.*)}( .*)?$/;
1818

1919
// Grabs the parameters from a method's signature
20-
// ex/ 'new buffer.Blob([sources[, options]])'.match(PARAM_EXPRESSION) === ['([sources[, options]])', '[sources[, options]]']
20+
// ex/ 'new buffer.Blob([sources[, options]])'.match(PARAM_EXPRESSION) === ['([sources[, options]])', '[sources[, options]]']
2121
export const METHOD_PARAM_EXPRESSION = /\((.+)\);?$/;
2222

2323
/**

src/generators/json/utils/__tests__/createParameterGroupings.test.mjs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,16 @@ describe('createParameterGroupings', () => {
142142
['max', 'callback'],
143143
['min', 'max', 'callback'],
144144
]);
145+
});
146+
147+
test('onsession,[options]', () => {
148+
const groupings = createParameterGroupings(
149+
'onsession,[options]'.split(',')
150+
);
145151

146-
console.log(groupings);
152+
assert.deepStrictEqual(groupings, [
153+
['onsession'],
154+
['onsession', 'options'],
155+
]);
147156
});
148157
});

src/generators/json/utils/__tests__/stringifyNode.test.mjs

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

0 commit comments

Comments
 (0)