From e0efd4cf29293dd5ee348ccde3674c171be8905a Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Mon, 26 Jul 2021 09:47:06 -0700 Subject: [PATCH] clang-format core/registry.js --- core/registry.js | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/core/registry.js b/core/registry.js index 8c29a6e3e..1be9b2a2b 100644 --- a/core/registry.js +++ b/core/registry.js @@ -83,8 +83,7 @@ Type.prototype.toString = function() { }; /** @type {!Type} */ -Type.CONNECTION_CHECKER = - new Type('connectionChecker'); +Type.CONNECTION_CHECKER = new Type('connectionChecker'); /** @type {!Type} */ Type.CURSOR = new Type('cursor'); @@ -108,20 +107,16 @@ Type.THEME = new Type('theme'); Type.TOOLBOX_ITEM = new Type('toolboxItem'); /** @type {!Type} */ -Type.FLYOUTS_VERTICAL_TOOLBOX = - new Type('flyoutsVerticalToolbox'); +Type.FLYOUTS_VERTICAL_TOOLBOX = new Type('flyoutsVerticalToolbox'); /** @type {!Type} */ -Type.FLYOUTS_HORIZONTAL_TOOLBOX = - new Type('flyoutsHorizontalToolbox'); +Type.FLYOUTS_HORIZONTAL_TOOLBOX = new Type('flyoutsHorizontalToolbox'); /** @type {!Type} */ -Type.METRICS_MANAGER = - new Type('metricsManager'); +Type.METRICS_MANAGER = new Type('metricsManager'); /** @type {!Type} */ -Type.BLOCK_DRAGGER = - new Type('blockDragger'); +Type.BLOCK_DRAGGER = new Type('blockDragger'); /** * Registers a class based on a type and name. @@ -137,8 +132,7 @@ Type.BLOCK_DRAGGER = * it's type. * @template T */ -const register = function( - type, name, registryItem, opt_allowOverrides) { +const register = function(type, name, registryItem, opt_allowOverrides) { if ((!(type instanceof Type) && typeof type != 'string') || String(type).trim() == '') { throw Error( @@ -203,8 +197,9 @@ const unregister = function(type, name) { name = name.toLowerCase(); const typeRegistry = typeMap[type]; if (!typeRegistry || !typeRegistry[name]) { - console.warn('Unable to unregister [' + name + '][' + type + '] from the ' + - 'registry.'); + console.warn( + 'Unable to unregister [' + name + '][' + type + '] from the ' + + 'registry.'); return; } delete typeMap[type][name]; @@ -230,8 +225,8 @@ const getItem = function(type, name, opt_throwIfMissing) { if (!typeRegistry || !typeRegistry[name]) { const msg = 'Unable to find [' + name + '][' + type + '] in the registry.'; if (opt_throwIfMissing) { - throw new Error(msg + ' You must require or register a ' + type + - ' plugin.'); + throw new Error( + msg + ' You must require or register a ' + type + ' plugin.'); } else { console.warn(msg); } @@ -274,7 +269,7 @@ exports.hasItem = hasItem; */ const getClass = function(type, name, opt_throwIfMissing) { return /** @type {?function(new:T, ...?)} */ ( - getItem(type, name, opt_throwIfMissing)); + getItem(type, name, opt_throwIfMissing)); }; exports.getClass = getClass; @@ -289,8 +284,7 @@ exports.getClass = getClass; * @template T */ const getObject = function(type, name, opt_throwIfMissing) { - return /** @type {T} */ ( - getItem(type, name, opt_throwIfMissing)); + return /** @type {T} */ (getItem(type, name, opt_throwIfMissing)); }; exports.getObject = getObject; @@ -305,8 +299,7 @@ exports.getObject = getObject; * @return {?function(new:T, ...?)} The class for the plugin. * @template T */ -const getClassFromOptions = function(type, options, - opt_throwIfMissing) { +const getClassFromOptions = function(type, options, opt_throwIfMissing) { const typeName = type.toString(); const plugin = options.plugins[typeName] || DEFAULT;