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

@superset-ui/core

Package Overview
Dependencies
Maintainers
12
Versions
126
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@superset-ui/core - npm Package Compare versions

Comparing version 0.13.0 to 0.13.3

lib/.DS_Store

77

esm/index.js

@@ -1,11 +0,66 @@

export { default as ExtensibleFunction } from './models/ExtensibleFunction';
export { default as Plugin } from './models/Plugin';
export { default as Preset } from './models/Preset';
export { default as Registry } from './models/Registry';
export { default as RegistryWithDefaultKey } from './models/RegistryWithDefaultKey';
export { default as convertKeysToCamelCase } from './utils/convertKeysToCamelCase';
export { default as isDefined } from './utils/isDefined';
export { default as isRequired } from './utils/isRequired';
export { default as makeSingleton } from './utils/makeSingleton';
export { default as promiseTimeout } from './utils/promiseTimeout';
export * from './types';
"use strict";
exports.__esModule = true;
var _exportNames = {
ExtensibleFunction: true,
Plugin: true,
Preset: true,
Registry: true,
RegistryWithDefaultKey: true,
convertKeysToCamelCase: true,
isDefined: true,
isRequired: true,
makeSingleton: true,
promiseTimeout: true
};
exports.promiseTimeout = exports.makeSingleton = exports.isRequired = exports.isDefined = exports.convertKeysToCamelCase = exports.RegistryWithDefaultKey = exports.Registry = exports.Preset = exports.Plugin = exports.ExtensibleFunction = void 0;
var _ExtensibleFunction = _interopRequireDefault(require("./models/ExtensibleFunction"));
exports.ExtensibleFunction = _ExtensibleFunction.default;
var _Plugin = _interopRequireDefault(require("./models/Plugin"));
exports.Plugin = _Plugin.default;
var _Preset = _interopRequireDefault(require("./models/Preset"));
exports.Preset = _Preset.default;
var _Registry = _interopRequireDefault(require("./models/Registry"));
exports.Registry = _Registry.default;
var _RegistryWithDefaultKey = _interopRequireDefault(require("./models/RegistryWithDefaultKey"));
exports.RegistryWithDefaultKey = _RegistryWithDefaultKey.default;
var _convertKeysToCamelCase = _interopRequireDefault(require("./utils/convertKeysToCamelCase"));
exports.convertKeysToCamelCase = _convertKeysToCamelCase.default;
var _isDefined = _interopRequireDefault(require("./utils/isDefined"));
exports.isDefined = _isDefined.default;
var _isRequired = _interopRequireDefault(require("./utils/isRequired"));
exports.isRequired = _isRequired.default;
var _makeSingleton = _interopRequireDefault(require("./utils/makeSingleton"));
exports.makeSingleton = _makeSingleton.default;
var _promiseTimeout = _interopRequireDefault(require("./utils/promiseTimeout"));
exports.promiseTimeout = _promiseTimeout.default;
var _types = require("./types");
Object.keys(_types).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
exports[key] = _types[key];
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -0,5 +1,10 @@

"use strict";
exports.__esModule = true;
exports.default = void 0;
/**
* From https://stackoverflow.com/questions/36871299/how-to-extend-function-with-es6-classes
*/
export default class ExtensibleFunction extends Function {
class ExtensibleFunction extends Function {
constructor(fn) {

@@ -11,2 +16,4 @@ super(); // eslint-disable-next-line @typescript-eslint/no-unsafe-return, no-constructor-return

}
}
exports.default = ExtensibleFunction;

@@ -0,1 +1,6 @@

"use strict";
exports.__esModule = true;
exports.default = void 0;
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

@@ -5,3 +10,3 @@

export default class Plugin {
class Plugin {
constructor() {

@@ -33,2 +38,4 @@ _defineProperty(this, "config", void 0);

}
}
exports.default = Plugin;

@@ -0,4 +1,9 @@

"use strict";
exports.__esModule = true;
exports.default = void 0;
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
export default class Preset {
class Preset {
constructor(config = {}) {

@@ -35,2 +40,4 @@ _defineProperty(this, "name", void 0);

}
}
exports.default = Preset;

26

esm/models/Registry.js

@@ -0,6 +1,10 @@

"use strict";
exports.__esModule = true;
exports.default = void 0;
var _types = require("../types");
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
/* eslint no-console: 0 */
import { OverwritePolicy } from '../types';
/**

@@ -17,3 +21,3 @@ * Registry class

*/
export default class Registry {
class Registry {
constructor(config = {}) {

@@ -30,3 +34,3 @@ _defineProperty(this, "name", void 0);

name = '',
overwritePolicy = OverwritePolicy.ALLOW
overwritePolicy = _types.OverwritePolicy.ALLOW
} = config;

@@ -55,5 +59,5 @@ this.name = name;

if (willOverwrite) {
if (this.overwritePolicy === OverwritePolicy.WARN) {
if (this.overwritePolicy === _types.OverwritePolicy.WARN) {
console.warn("Item with key \"" + key + "\" already exists. You are assigning a new value.");
} else if (this.overwritePolicy === OverwritePolicy.PROHIBIT) {
} else if (this.overwritePolicy === _types.OverwritePolicy.PROHIBIT) {
throw new Error("Item with key \"" + key + "\" already exists. Cannot overwrite.");

@@ -78,5 +82,5 @@ }

if (willOverwrite) {
if (this.overwritePolicy === OverwritePolicy.WARN) {
if (this.overwritePolicy === _types.OverwritePolicy.WARN) {
console.warn("Item with key \"" + key + "\" already exists. You are assigning a new value.");
} else if (this.overwritePolicy === OverwritePolicy.PROHIBIT) {
} else if (this.overwritePolicy === _types.OverwritePolicy.PROHIBIT) {
throw new Error("Item with key \"" + key + "\" already exists. Cannot overwrite.");

@@ -178,2 +182,4 @@ }

}
}
exports.default = Registry;

@@ -0,5 +1,13 @@

"use strict";
exports.__esModule = true;
exports.default = void 0;
var _Registry = _interopRequireDefault(require("./Registry"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
import Registry from './Registry';
export default class RegistryWithDefaultKey extends Registry {
class RegistryWithDefaultKey extends _Registry.default {
constructor(config = {}) {

@@ -68,2 +76,4 @@ super(config);

}
}
exports.default = RegistryWithDefaultKey;

@@ -0,3 +1,9 @@

"use strict";
exports.__esModule = true;
exports.OverwritePolicy = void 0;
/* eslint-disable import/prefer-default-export */
export let OverwritePolicy;
let OverwritePolicy;
exports.OverwritePolicy = OverwritePolicy;

@@ -8,2 +14,2 @@ (function (OverwritePolicy) {

OverwritePolicy["WARN"] = "WARN";
})(OverwritePolicy || (OverwritePolicy = {}));
})(OverwritePolicy || (exports.OverwritePolicy = OverwritePolicy = {}));

@@ -1,5 +0,15 @@

import camelCase from 'lodash/camelCase';
import isPlainObject from 'lodash/isPlainObject';
import mapKeys from 'lodash/mapKeys';
export default function convertKeysToCamelCase(object) {
"use strict";
exports.__esModule = true;
exports.default = convertKeysToCamelCase;
var _camelCase = _interopRequireDefault(require("lodash/camelCase"));
var _isPlainObject = _interopRequireDefault(require("lodash/isPlainObject"));
var _mapKeys = _interopRequireDefault(require("lodash/mapKeys"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function convertKeysToCamelCase(object) {
if (object === null || object === undefined) {

@@ -9,4 +19,4 @@ return object;

if (isPlainObject(object)) {
return mapKeys(object, (_, k) => camelCase(k));
if ((0, _isPlainObject.default)(object)) {
return (0, _mapKeys.default)(object, (_, k) => (0, _camelCase.default)(k));
}

@@ -13,0 +23,0 @@

@@ -1,3 +0,8 @@

export default function isDefined(x) {
"use strict";
exports.__esModule = true;
exports.default = isDefined;
function isDefined(x) {
return x !== null && x !== undefined;
}

@@ -1,3 +0,8 @@

export default function isRequired(field) {
"use strict";
exports.__esModule = true;
exports.default = isRequired;
function isRequired(field) {
throw new Error(field + " is required.");
}

@@ -1,2 +0,7 @@

export default function makeSingleton(BaseClass, ...args) {
"use strict";
exports.__esModule = true;
exports.default = makeSingleton;
function makeSingleton(BaseClass, ...args) {
let singleton;

@@ -3,0 +8,0 @@ return function getInstance() {

@@ -0,3 +1,8 @@

"use strict";
exports.__esModule = true;
exports.default = promiseTimeout;
/** setTimeout that returns a promise */
export default function promiseTimeout(
function promiseTimeout(
/** A function to be executed after the timer expires. */

@@ -4,0 +9,0 @@ func,

@@ -1,11 +0,66 @@

export { default as ExtensibleFunction } from './models/ExtensibleFunction';
export { default as Plugin } from './models/Plugin';
export { default as Preset } from './models/Preset';
export { default as Registry } from './models/Registry';
export { default as RegistryWithDefaultKey } from './models/RegistryWithDefaultKey';
export { default as convertKeysToCamelCase } from './utils/convertKeysToCamelCase';
export { default as isDefined } from './utils/isDefined';
export { default as isRequired } from './utils/isRequired';
export { default as makeSingleton } from './utils/makeSingleton';
export { default as promiseTimeout } from './utils/promiseTimeout';
export * from './types';
"use strict";
exports.__esModule = true;
var _exportNames = {
ExtensibleFunction: true,
Plugin: true,
Preset: true,
Registry: true,
RegistryWithDefaultKey: true,
convertKeysToCamelCase: true,
isDefined: true,
isRequired: true,
makeSingleton: true,
promiseTimeout: true
};
exports.promiseTimeout = exports.makeSingleton = exports.isRequired = exports.isDefined = exports.convertKeysToCamelCase = exports.RegistryWithDefaultKey = exports.Registry = exports.Preset = exports.Plugin = exports.ExtensibleFunction = void 0;
var _ExtensibleFunction = _interopRequireDefault(require("./models/ExtensibleFunction"));
exports.ExtensibleFunction = _ExtensibleFunction.default;
var _Plugin = _interopRequireDefault(require("./models/Plugin"));
exports.Plugin = _Plugin.default;
var _Preset = _interopRequireDefault(require("./models/Preset"));
exports.Preset = _Preset.default;
var _Registry = _interopRequireDefault(require("./models/Registry"));
exports.Registry = _Registry.default;
var _RegistryWithDefaultKey = _interopRequireDefault(require("./models/RegistryWithDefaultKey"));
exports.RegistryWithDefaultKey = _RegistryWithDefaultKey.default;
var _convertKeysToCamelCase = _interopRequireDefault(require("./utils/convertKeysToCamelCase"));
exports.convertKeysToCamelCase = _convertKeysToCamelCase.default;
var _isDefined = _interopRequireDefault(require("./utils/isDefined"));
exports.isDefined = _isDefined.default;
var _isRequired = _interopRequireDefault(require("./utils/isRequired"));
exports.isRequired = _isRequired.default;
var _makeSingleton = _interopRequireDefault(require("./utils/makeSingleton"));
exports.makeSingleton = _makeSingleton.default;
var _promiseTimeout = _interopRequireDefault(require("./utils/promiseTimeout"));
exports.promiseTimeout = _promiseTimeout.default;
var _types = require("./types");
Object.keys(_types).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
exports[key] = _types[key];
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -0,5 +1,10 @@

"use strict";
exports.__esModule = true;
exports.default = void 0;
/**
* From https://stackoverflow.com/questions/36871299/how-to-extend-function-with-es6-classes
*/
export default class ExtensibleFunction extends Function {
class ExtensibleFunction extends Function {
constructor(fn) {

@@ -11,2 +16,4 @@ super(); // eslint-disable-next-line @typescript-eslint/no-unsafe-return, no-constructor-return

}
}
exports.default = ExtensibleFunction;

@@ -0,1 +1,6 @@

"use strict";
exports.__esModule = true;
exports.default = void 0;
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

@@ -5,3 +10,3 @@

export default class Plugin {
class Plugin {
constructor() {

@@ -33,2 +38,4 @@ _defineProperty(this, "config", void 0);

}
}
exports.default = Plugin;

@@ -0,4 +1,9 @@

"use strict";
exports.__esModule = true;
exports.default = void 0;
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
export default class Preset {
class Preset {
constructor(config = {}) {

@@ -35,2 +40,4 @@ _defineProperty(this, "name", void 0);

}
}
exports.default = Preset;

@@ -0,6 +1,10 @@

"use strict";
exports.__esModule = true;
exports.default = void 0;
var _types = require("../types");
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
/* eslint no-console: 0 */
import { OverwritePolicy } from '../types';
/**

@@ -17,3 +21,3 @@ * Registry class

*/
export default class Registry {
class Registry {
constructor(config = {}) {

@@ -30,3 +34,3 @@ _defineProperty(this, "name", void 0);

name = '',
overwritePolicy = OverwritePolicy.ALLOW
overwritePolicy = _types.OverwritePolicy.ALLOW
} = config;

@@ -55,5 +59,5 @@ this.name = name;

if (willOverwrite) {
if (this.overwritePolicy === OverwritePolicy.WARN) {
if (this.overwritePolicy === _types.OverwritePolicy.WARN) {
console.warn("Item with key \"" + key + "\" already exists. You are assigning a new value.");
} else if (this.overwritePolicy === OverwritePolicy.PROHIBIT) {
} else if (this.overwritePolicy === _types.OverwritePolicy.PROHIBIT) {
throw new Error("Item with key \"" + key + "\" already exists. Cannot overwrite.");

@@ -78,5 +82,5 @@ }

if (willOverwrite) {
if (this.overwritePolicy === OverwritePolicy.WARN) {
if (this.overwritePolicy === _types.OverwritePolicy.WARN) {
console.warn("Item with key \"" + key + "\" already exists. You are assigning a new value.");
} else if (this.overwritePolicy === OverwritePolicy.PROHIBIT) {
} else if (this.overwritePolicy === _types.OverwritePolicy.PROHIBIT) {
throw new Error("Item with key \"" + key + "\" already exists. Cannot overwrite.");

@@ -178,2 +182,4 @@ }

}
}
exports.default = Registry;

@@ -0,5 +1,13 @@

"use strict";
exports.__esModule = true;
exports.default = void 0;
var _Registry = _interopRequireDefault(require("./Registry"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
import Registry from './Registry';
export default class RegistryWithDefaultKey extends Registry {
class RegistryWithDefaultKey extends _Registry.default {
constructor(config = {}) {

@@ -68,2 +76,4 @@ super(config);

}
}
exports.default = RegistryWithDefaultKey;

@@ -0,3 +1,9 @@

"use strict";
exports.__esModule = true;
exports.OverwritePolicy = void 0;
/* eslint-disable import/prefer-default-export */
export let OverwritePolicy;
let OverwritePolicy;
exports.OverwritePolicy = OverwritePolicy;

@@ -8,2 +14,2 @@ (function (OverwritePolicy) {

OverwritePolicy["WARN"] = "WARN";
})(OverwritePolicy || (OverwritePolicy = {}));
})(OverwritePolicy || (exports.OverwritePolicy = OverwritePolicy = {}));

@@ -1,5 +0,15 @@

import camelCase from 'lodash/camelCase';
import isPlainObject from 'lodash/isPlainObject';
import mapKeys from 'lodash/mapKeys';
export default function convertKeysToCamelCase(object) {
"use strict";
exports.__esModule = true;
exports.default = convertKeysToCamelCase;
var _camelCase = _interopRequireDefault(require("lodash/camelCase"));
var _isPlainObject = _interopRequireDefault(require("lodash/isPlainObject"));
var _mapKeys = _interopRequireDefault(require("lodash/mapKeys"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function convertKeysToCamelCase(object) {
if (object === null || object === undefined) {

@@ -9,4 +19,4 @@ return object;

if (isPlainObject(object)) {
return mapKeys(object, (_, k) => camelCase(k));
if ((0, _isPlainObject.default)(object)) {
return (0, _mapKeys.default)(object, (_, k) => (0, _camelCase.default)(k));
}

@@ -13,0 +23,0 @@

@@ -1,3 +0,8 @@

export default function isDefined(x) {
"use strict";
exports.__esModule = true;
exports.default = isDefined;
function isDefined(x) {
return x !== null && x !== undefined;
}

@@ -1,3 +0,8 @@

export default function isRequired(field) {
"use strict";
exports.__esModule = true;
exports.default = isRequired;
function isRequired(field) {
throw new Error(field + " is required.");
}

@@ -1,2 +0,7 @@

export default function makeSingleton(BaseClass, ...args) {
"use strict";
exports.__esModule = true;
exports.default = makeSingleton;
function makeSingleton(BaseClass, ...args) {
let singleton;

@@ -3,0 +8,0 @@ return function getInstance() {

@@ -0,3 +1,8 @@

"use strict";
exports.__esModule = true;
exports.default = promiseTimeout;
/** setTimeout that returns a promise */
export default function promiseTimeout(
function promiseTimeout(
/** A function to be executed after the timer expires. */

@@ -4,0 +9,0 @@ func,

{
"name": "@superset-ui/core",
"version": "0.13.0",
"version": "0.13.3",
"description": "Superset UI core",

@@ -35,3 +35,3 @@ "sideEffects": false,

},
"gitHead": "72b0c99f843add947371c6ee45cc32d57db6b027"
"gitHead": "f72e2d6e13333b55b5d6f1e2d7d5ccaec3868da6"
}
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