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

@observablehq/runtime

Package Overview
Dependencies
Maintainers
7
Versions
134
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@observablehq/runtime - npm Package Compare versions

Comparing version 5.7.4 to 5.8.0

2

package.json
{
"name": "@observablehq/runtime",
"version": "5.7.4",
"version": "5.8.0",
"author": {

@@ -5,0 +5,0 @@ "name": "Observable, Inc.",

@@ -53,4 +53,4 @@ import {constant} from "./constant.js";

function module_variable(observer) {
return new Variable(TYPE_NORMAL, this, observer);
function module_variable(observer, options) {
return new Variable(TYPE_NORMAL, this, observer, options);
}

@@ -57,0 +57,0 @@

@@ -13,3 +13,3 @@ import {map} from "./array.js";

export function Variable(type, module, observer) {
export function Variable(type, module, observer, options) {
if (!observer) observer = no_observer;

@@ -30,2 +30,3 @@ Object.defineProperties(this, {

_rejector: {value: variable_rejector(this)},
_shadow: {value: initShadow(module, options)},
_type: {value: type},

@@ -41,2 +42,3 @@ _value: {value: undefined, writable: true},

_rejected: {value: variable_rejected, writable: true, configurable: true},
_resolve: {value: variable_resolve, writable: true, configurable: true},
define: {value: variable_define, writable: true, configurable: true},

@@ -47,2 +49,10 @@ delete: {value: variable_delete, writable: true, configurable: true},

function initShadow(module, options) {
if (!options?.shadow) return null;
return new Map(
Object.entries(options.shadow)
.map(([name, definition]) => [name, (new Variable(TYPE_IMPLICIT, module)).define([], definition)])
);
}
function variable_attach(variable) {

@@ -96,3 +106,3 @@ variable._module._runtime._dirty.add(variable);

name == null ? null : String(name),
inputs == null ? [] : map.call(inputs, this._module._resolve, this._module),
inputs == null ? [] : map.call(inputs, this._resolve, this),
typeof definition === "function" ? definition : constant(definition)

@@ -102,2 +112,6 @@ );

function variable_resolve(name) {
return this._shadow?.get(name) ?? this._module._resolve(name);
}
function variable_defineImpl(name, inputs, definition) {

@@ -104,0 +118,0 @@ const scope = this._module._scope, runtime = this._module._runtime;

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

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