mirror of
https://github.com/google/blockly.git
synced 2026-06-17 08:35:12 +02:00
Formatter
This commit is contained in:
+5
-2
@@ -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<T>(
|
||||
* @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') {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 '),
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user