Skip to content

Commit 30e08e7

Browse files
committed
Got rid of typescript warnings
1 parent 25d14ee commit 30e08e7

File tree

2 files changed

+4
-26
lines changed

2 files changed

+4
-26
lines changed

src/blocks/mrc_component.ts

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,11 @@ import { MRC_STYLE_COMPONENTS } from '../themes/styles'
2626
import { createFieldNonEditableText } from '../fields/FieldNonEditableText';
2727
import { Editor } from '../editor/editor';
2828
import { ExtendedPythonGenerator } from '../editor/extended_python_generator';
29-
import { getAllowedTypesForSetCheck, getClassData, getModuleData, getSubclassNames } from './utils/python';
29+
import { getAllowedTypesForSetCheck, getClassData, getSubclassNames } from './utils/python';
3030
import * as toolboxItems from '../toolbox/items';
3131
import * as storageModule from '../storage/module';
3232
import * as storageModuleContent from '../storage/module_content';
33-
import * as storageNames from '../storage/names';
3433
import { createPort } from './mrc_port';
35-
import { createNumberShadowValue } from './utils/value';
3634
import { ClassData, FunctionData } from './utils/python_json_types';
3735
import { renameMethodCallers } from './mrc_call_python_function'
3836

@@ -166,11 +164,11 @@ const COMPONENT = {
166164
ports: ports,
167165
};
168166
},
169-
getArgName: function (this: ComponentBlock, i: number): string {
167+
getArgName: function (this: ComponentBlock, _: number): string {
170168
return this.getFieldValue(FIELD_NAME) + '__' + 'port';
171169
},
172170

173-
171+
174172
getComponentPorts: function (this: ComponentBlock, ports: {[argName: string]: string}): void {
175173
// Collect the ports for this component block.
176174
for (let i = 0; i < this.mrcArgs.length; i++) {
@@ -263,23 +261,4 @@ function createComponentBlock(
263261
}
264262
}
265263
return new toolboxItems.Block(BLOCK_NAME, extraState, fields, Object.keys(inputs).length ? inputs : null);
266-
}
267-
268-
function getPortTypeForArgument(argName: string): string | null {
269-
const argNameLower = argName.toLowerCase();
270-
const moduleData = getModuleData('component');
271-
if (moduleData) {
272-
for (const enumData of moduleData.enums) {
273-
if (enumData.enumClassName === 'component.PortType') {
274-
for (const value of enumData.enumValues) {
275-
if (argNameLower === value.toLowerCase()) {
276-
return value;
277-
}
278-
}
279-
break;
280-
}
281-
}
282-
}
283-
284-
return null;
285-
}
264+
}

src/blocks/mrc_mechanism.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import * as toolboxItems from '../toolbox/items';
3131
import * as storageModule from '../storage/module';
3232
import * as storageModuleContent from '../storage/module_content';
3333
import * as storageNames from '../storage/names';
34-
import * as value from './utils/value';
3534
import { renameMethodCallers } from './mrc_call_python_function'
3635
import { renameMechanismName as renameMechanismNameInEventHandlers } from './mrc_event_handler'
3736
import { createPort } from './mrc_port';

0 commit comments

Comments
 (0)