Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@phosphor/commands

Package Overview
Dependencies
Maintainers
2
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@phosphor/commands - npm Package Compare versions

Comparing version 0.1.5 to 1.0.0

30

lib/index.d.ts

@@ -149,2 +149,13 @@ import { JSONObject } from '@phosphor/coreutils';

/**
* Get the dataset for a specific command.
*
* @param id - The id of the command of interest.
*
* @param args - The arguments for the command.
*
* @returns The dataset for the command, or an empty dataset if
* the command is not registered.
*/
dataset(id: string, args?: JSONObject): CommandRegistry.Dataset;
/**
* Test whether a specific command is enabled.

@@ -278,2 +289,8 @@ *

/**
* A type alias for a simple immutable string dataset.
*/
type Dataset = {
readonly [key: string]: string;
};
/**
* An options object for creating a command.

@@ -389,2 +406,15 @@ *

/**
* The dataset for the command.
*
* #### Notes
* The dataset values will be added to the primary node for the
* visual representation of the command.
*
* This can be a dataset object, or a function which returns the
* dataset object based on the provided command arguments.
*
* The default value is an empty dataset.
*/
dataset?: Dataset | CommandFunc<Dataset>;
/**
* A function which indicates whether the command is enabled.

@@ -391,0 +421,0 @@ *

@@ -246,2 +246,17 @@ "use strict";

/**
* Get the dataset for a specific command.
*
* @param id - The id of the command of interest.
*
* @param args - The arguments for the command.
*
* @returns The dataset for the command, or an empty dataset if
* the command is not registered.
*/
CommandRegistry.prototype.dataset = function (id, args) {
if (args === void 0) { args = coreutils_1.JSONExt.emptyObject; }
var cmd = this._commands[id];
return cmd ? cmd.dataset.call(undefined, args) : {};
};
/**
* Test whether a specific command is enabled.

@@ -641,2 +656,3 @@ *

className: asFunc(options.className, emptyStringFunc),
dataset: asFunc(options.dataset, emptyDatasetFunc),
isEnabled: options.isEnabled || trueFunc,

@@ -738,2 +754,6 @@ isToggled: options.isToggled || falseFunc,

/**
* A singleton empty dataset function.
*/
var emptyDatasetFunc = function () { return ({}); };
/**
* Cast a value or command func to a command func.

@@ -740,0 +760,0 @@ */

14

package.json
{
"name": "@phosphor/commands",
"version": "0.1.5",
"version": "1.0.0",
"description": "PhosphorJS - Commands",

@@ -15,8 +15,8 @@ "main": "lib/index.js",

"dependencies": {
"@phosphor/algorithm": "^0.1.1",
"@phosphor/coreutils": "^0.1.5",
"@phosphor/disposable": "^0.1.1",
"@phosphor/domutils": "^0.1.2",
"@phosphor/keyboard": "^0.1.1",
"@phosphor/signaling": "^0.1.2"
"@phosphor/algorithm": "^1.0.0",
"@phosphor/coreutils": "^1.0.0",
"@phosphor/disposable": "^1.0.0",
"@phosphor/domutils": "^1.0.0",
"@phosphor/keyboard": "^1.0.0",
"@phosphor/signaling": "^1.0.0"
},

@@ -23,0 +23,0 @@ "devDependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc