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

jupyter-js-utils

Package Overview
Dependencies
Maintainers
2
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jupyter-js-utils - npm Package Compare versions

Comparing version 0.3.5 to 0.4.0

lib/mocksocket.d.ts

8

lib/index.d.ts

@@ -136,9 +136,9 @@ /**

/**
* Try to load a class.
* Try to load an object from a module or a registry.
*
* Try to load a class from a module asynchronously, if a module
* is specified, otherwise tries to load a class from the global
* Try to load an object from a module asynchronously if a module
* is specified, otherwise tries to load an object from the global
* registry, if the global registry is provided.
*/
export declare function loadClass(className: string, moduleName: string, registry?: {
export declare function loadObject(name: string, moduleName: string, registry?: {
[key: string]: any;

@@ -145,0 +145,0 @@ }): Promise<any>;

@@ -187,19 +187,22 @@ // Copyright (c) Jupyter Development Team.

/**
* Try to load a class.
* Try to load an object from a module or a registry.
*
* Try to load a class from a module asynchronously, if a module
* is specified, otherwise tries to load a class from the global
* Try to load an object from a module asynchronously if a module
* is specified, otherwise tries to load an object from the global
* registry, if the global registry is provided.
*/
function loadClass(className, moduleName, registry) {
function loadObject(name, moduleName, registry) {
return new Promise(function (resolve, reject) {
// Try loading the view module using require.js
if (moduleName) {
if (typeof requirejs === 'undefined') {
throw new Error('requirejs not found.');
}
requirejs([moduleName], function (mod) {
if (mod[className] === void 0) {
var msg = "Class " + className + " not found in module " + moduleName;
if (mod[name] === void 0) {
var msg = "Object '" + name + "' not found in module '" + moduleName + "'";
reject(new Error(msg));
}
else {
resolve(mod[className]);
resolve(mod[name]);
}

@@ -209,7 +212,7 @@ }, reject);

else {
if (registry && registry[className]) {
resolve(registry[className]);
if (registry && registry[name]) {
resolve(registry[name]);
}
else {
reject(new Error("Class " + className + " not found in registry"));
reject(new Error("Object '" + name + "' not found in registry"));
}

@@ -219,3 +222,3 @@ }

}
exports.loadClass = loadClass;
exports.loadObject = loadObject;
;

@@ -222,0 +225,0 @@ /**

{
"name": "jupyter-js-utils",
"version": "0.3.5",
"version": "0.4.0",
"description": "JavaScript utilities for the Jupyter frontend",

@@ -21,3 +21,3 @@ "main": "lib/index.js",

"scripts": {
"clean": "rimraf docs && rimraf lib && rimraf test/build",
"clean": "rimraf docs && rimraf lib && rimraf test/build && rimraf test/coverage",
"build:src": "tsc --project src",

@@ -28,4 +28,5 @@ "build:test": "tsc --project test/src",

"prepublish": "npm run build",
"test:coverage": "cd test && istanbul cover _mocha -- build/index.js --foo bar",
"test": "mocha test/build/index.js --foo bar"
"test:coverage": "istanbul cover --dir test/coverage _mocha -- test/build/test*.js --foo bar",
"test:debug": "mocha test/build/test*.js --foo bar --debug-brk",
"test": "mocha test/build/test*.js --foo bar"
},

@@ -32,0 +33,0 @@ "repository": {

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