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

@flourish/controls

Package Overview
Dependencies
Maintainers
8
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flourish/controls - npm Package Compare versions

Comparing version 0.3.1 to 0.4.0-prerelease.1

2

package.json
{
"name": "@flourish/controls",
"version": "0.3.1",
"version": "0.4.0-prerelease.1",
"description": "Switchable dropdown/buttons/slider control",

@@ -5,0 +5,0 @@ "main": "controls.js",

@@ -60,6 +60,8 @@ import { select } from "d3-selection";

output_obj.index = function(index) {
if (index === undefined) return props.index;
if (!Number.isFinite(index)) throw TypeError("index must be a number greater than or equal to 0.");
if (index < 0) throw RangeError("index must be greater than or equal to 0.");
props.index = Math.floor(index);
if (index === undefined) return props.n_options ? props.index : null;
if (index !== null) {
if (!Number.isFinite(index)) throw TypeError("index must be a number greater than or equal to 0.");
if (index < 0) throw RangeError("index must be greater than or equal to 0.");
props.index = Math.floor(index);
}
return output_obj;

@@ -83,3 +85,3 @@ };

Object.defineProperty(props, "value", {
get: function() { return props.options[props.index]; },
get: function() { return props.n_options ? props.options[props.index] : null; },
set: function() { console.warn("Nothing changed: value is read only"); }

@@ -90,5 +92,7 @@ });

if (value === undefined) return props.value;
var index = props.options.indexOf(value);
if (index !== -1) props.index = index;
else console.warn("Nothing changed: value not in options list");
if (value !== null) {
var index = props.options.indexOf(value);
if (index !== -1) props.index = index;
else console.warn("Nothing changed: value not in options list");
}
return output_obj;

@@ -95,0 +99,0 @@ };

Sorry, the diff of this file is too big to display

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