From b000e069328b697c5bcd3d01daafa12f7a439729 Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Tue, 26 Mar 2024 09:19:07 +0100 Subject: [PATCH] Formatter --- core/registry.ts | 7 +++++-- core/toolbox/collapsible_category.ts | 5 ++++- tests/mocha/registry_test.js | 6 +++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/core/registry.ts b/core/registry.ts index 8d0523c74..cf8769f76 100644 --- a/core/registry.ts +++ b/core/registry.ts @@ -43,7 +43,7 @@ export const TEST_ONLY = {typeMap}; * This enables an error to be thrown if a name of conflicting case is used. */ const noCaseNameMap: { - [key: string]: {[key: string]: string} + [key: string]: {[key: string]: string}; } = Object.create(null); /** @@ -168,7 +168,10 @@ export function register( * @param registryItem A class or object that we are checking for the required * properties. */ -function validateItem(type: string, registryItem: Function | AnyDuringMigration) { +function validateItem( + type: string, + registryItem: Function | AnyDuringMigration, +) { switch (type) { case String(Type.FIELD): if (typeof registryItem.fromJson !== 'function') { diff --git a/core/toolbox/collapsible_category.ts b/core/toolbox/collapsible_category.ts index c6d7e0895..e565c8c57 100644 --- a/core/toolbox/collapsible_category.ts +++ b/core/toolbox/collapsible_category.ts @@ -76,7 +76,10 @@ export class CollapsibleToolboxCategory // Separators can exist as either a flyout item or a toolbox item so // decide where it goes based on the type of the previous item. if ( - !registry.hasItem(registry.Type.TOOLBOX_ITEM, itemDef['kind'].toLowerCase()) || + !registry.hasItem( + registry.Type.TOOLBOX_ITEM, + itemDef['kind'].toLowerCase(), + ) || (itemDef['kind'].toLowerCase() === ToolboxSeparator.registrationName && prevIsFlyoutItem) diff --git a/tests/mocha/registry_test.js b/tests/mocha/registry_test.js index 029b9d788..ae2624a5a 100644 --- a/tests/mocha/registry_test.js +++ b/tests/mocha/registry_test.js @@ -93,7 +93,7 @@ suite('Registry', function () { suite('Name normalization', function () { test('Padded', function () { chai.assert.isTrue( - Blockly.registry.hasItem(' test ', ' test_name ') + Blockly.registry.hasItem(' test ', ' test_name '), ); }); @@ -143,7 +143,7 @@ suite('Registry', function () { suite('Name normalization', function () { test('Padded', function () { chai.assert.isNotNull( - Blockly.registry.getClass(' test ', ' test_name' ) + Blockly.registry.getClass(' test ', ' test_name'), ); }); @@ -193,7 +193,7 @@ suite('Registry', function () { suite('Name normalization', function () { test('Padded', function () { chai.assert.isNotNull( - Blockly.registry.getObject(' test ', ' test_name ') + Blockly.registry.getObject(' test ', ' test_name '), ); });