Skip to content

Commit 94bc8d7

Browse files
Bugfix: Function parameters get sorted, resolves #42
1 parent 3a80bc5 commit 94bc8d7

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

bin/typedoc.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2017,7 +2017,11 @@ var TypeDoc;
20172017
if (state.isDefaultPrevented)
20182018
return;
20192019

2020-
var children = Factories.ReflectionHandler.sortDeclarations(state.declaration.getChildDecls());
2020+
var children = state.declaration.getChildDecls();
2021+
if (!state.isSignature) {
2022+
children = Factories.ReflectionHandler.sortDeclarations(children);
2023+
}
2024+
20212025
children.forEach(function (declaration) {
20222026
_this.processState(state.createChildState(declaration));
20232027
});

examples/basic/src/classes.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export class BaseClass implements INameInterface
129129
* @param param2 The second parameter needed by this function.
130130
* @see https://github.com/sebastian-lenz/typedoc/issues/37
131131
*/
132-
public arrowFunction = (param1: string, param2: number): void => {
132+
public arrowFunction = (param2: string, param1: number): void => {
133133
};
134134

135135

@@ -150,6 +150,22 @@ export class BaseClass implements INameInterface
150150
static getInstance():BaseClass {
151151
return BaseClass.instance;
152152
}
153+
154+
155+
/**
156+
* @see https://github.com/sebastian-lenz/typedoc/issues/42
157+
*/
158+
public static caTest(originalValues:BaseClass, newRecord:any, fieldNames:string[], mandatoryFields:string[]): string {
159+
var returnval = "";
160+
var updates: string[] = [];
161+
var allFields: string[] = fieldNames;
162+
for (var j = 0; j < allFields.length; j++) {
163+
var field = allFields[j];
164+
var oldValue = originalValues[field];
165+
var newValue = newRecord[field];
166+
}
167+
return returnval;
168+
}
153169
}
154170

155171

src/typedoc/factories/Dispatcher.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,11 @@ module TypeDoc.Factories
257257
this.dispatch(Dispatcher.EVENT_DECLARATION, state);
258258
if (state.isDefaultPrevented) return;
259259

260-
var children = ReflectionHandler.sortDeclarations(state.declaration.getChildDecls());
260+
var children = state.declaration.getChildDecls();
261+
if (!state.isSignature) {
262+
children = ReflectionHandler.sortDeclarations(children);
263+
}
264+
261265
children.forEach((declaration) => {
262266
this.processState(state.createChildState(declaration));
263267
});

0 commit comments

Comments
 (0)