@jupyterlab/settingregistry
Advanced tools
Comparing version 4.0.0-alpha.9 to 4.0.0-alpha.10
@@ -308,3 +308,5 @@ // Copyright (c) Jupyter Development Team. | ||
if (plugin in transformers) { | ||
throw new Error(`${plugin} already has a transformer.`); | ||
const error = new Error(`${plugin} already has a transformer.`); | ||
error.name = 'TransformError'; | ||
throw error; | ||
} | ||
@@ -855,35 +857,13 @@ transformers[plugin] = { | ||
addition.forEach(item => { | ||
switch (item.type) { | ||
case 'command': | ||
if (item.command) { | ||
const refIndex = items.findIndex(ref => { | ||
var _a, _b; | ||
return ref.name === item.name && | ||
ref.command === item.command && | ||
JSONExt.deepEqual((_a = ref.args) !== null && _a !== void 0 ? _a : {}, (_b = item.args) !== null && _b !== void 0 ? _b : {}); | ||
}); | ||
if (refIndex < 0) { | ||
items.push(Object.assign({}, item)); | ||
} | ||
else { | ||
if (warn) { | ||
console.warn(`Toolbar item for command '${item.command}' is duplicated.`); | ||
} | ||
items[refIndex] = Object.assign(Object.assign({}, items[refIndex]), item); | ||
} | ||
} | ||
break; | ||
case 'spacer': | ||
default: { | ||
const refIndex = items.findIndex(ref => ref.name === item.name); | ||
if (refIndex < 0) { | ||
items.push(Object.assign({}, item)); | ||
} | ||
else { | ||
if (warn) { | ||
console.warn(`Toolbar item '${item.name}' is duplicated.`); | ||
} | ||
items[refIndex] = Object.assign(Object.assign({}, items[refIndex]), item); | ||
} | ||
// Name must be unique so it's sufficient to only compare it | ||
const refIndex = items.findIndex(ref => ref.name === item.name); | ||
if (refIndex < 0) { | ||
items.push(Object.assign({}, item)); | ||
} | ||
else { | ||
if (warn && | ||
JSONExt.deepEqual(Object.keys(item), Object.keys(items[refIndex]))) { | ||
console.warn(`Toolbar item '${item.name}' is duplicated.`); | ||
} | ||
items[refIndex] = Object.assign(Object.assign({}, items[refIndex]), item); | ||
} | ||
@@ -890,0 +870,0 @@ }); |
@@ -219,2 +219,5 @@ import { IDataConnector } from '@jupyterlab/statedb'; | ||
} | ||
/** | ||
* An interface describing a context menu item | ||
*/ | ||
interface IContextMenuItem extends IMenuItem { | ||
@@ -221,0 +224,0 @@ /** |
{ | ||
"name": "@jupyterlab/settingregistry", | ||
"version": "4.0.0-alpha.9", | ||
"version": "4.0.0-alpha.10", | ||
"description": "Settings registry for Jupyterlab", | ||
@@ -38,3 +38,3 @@ "homepage": "https://github.com/jupyterlab/jupyterlab", | ||
"dependencies": { | ||
"@jupyterlab/statedb": "^4.0.0-alpha.9", | ||
"@jupyterlab/statedb": "^4.0.0-alpha.10", | ||
"@lumino/commands": "^1.20.0", | ||
@@ -48,3 +48,3 @@ "@lumino/coreutils": "^1.12.0", | ||
"devDependencies": { | ||
"@jupyterlab/testutils": "^4.0.0-alpha.9", | ||
"@jupyterlab/testutils": "^4.0.0-alpha.10", | ||
"@types/jest": "^26.0.10", | ||
@@ -51,0 +51,0 @@ "@types/json5": "^0.0.30", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
109390
2354
282
3
7
0
49