@superset-ui/core
Advanced tools
Comparing version 0.12.21 to 0.13.0
@@ -1,66 +0,11 @@ | ||
"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 }; } | ||
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'; |
@@ -1,10 +0,5 @@ | ||
"use strict"; | ||
exports.__esModule = true; | ||
exports.default = void 0; | ||
/** | ||
* From https://stackoverflow.com/questions/36871299/how-to-extend-function-with-es6-classes | ||
*/ | ||
class ExtensibleFunction extends Function { | ||
export default class ExtensibleFunction extends Function { | ||
constructor(fn) { | ||
@@ -16,4 +11,2 @@ super(); // eslint-disable-next-line @typescript-eslint/no-unsafe-return, no-constructor-return | ||
} | ||
exports.default = ExtensibleFunction; | ||
} |
@@ -1,6 +0,1 @@ | ||
"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); } | ||
@@ -10,3 +5,3 @@ | ||
class Plugin { | ||
export default class Plugin { | ||
constructor() { | ||
@@ -38,4 +33,2 @@ _defineProperty(this, "config", void 0); | ||
} | ||
exports.default = Plugin; | ||
} |
@@ -1,9 +0,4 @@ | ||
"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; } | ||
class Preset { | ||
export default class Preset { | ||
constructor(config = {}) { | ||
@@ -40,4 +35,2 @@ _defineProperty(this, "name", void 0); | ||
} | ||
exports.default = Preset; | ||
} |
@@ -1,10 +0,6 @@ | ||
"use strict"; | ||
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; } | ||
exports.__esModule = true; | ||
exports.default = void 0; | ||
/* eslint no-console: 0 */ | ||
import { OverwritePolicy } from '../types'; | ||
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; } | ||
/** | ||
@@ -21,3 +17,3 @@ * Registry class | ||
*/ | ||
class Registry { | ||
export default class Registry { | ||
constructor(config = {}) { | ||
@@ -34,3 +30,3 @@ _defineProperty(this, "name", void 0); | ||
name = '', | ||
overwritePolicy = _types.OverwritePolicy.ALLOW | ||
overwritePolicy = OverwritePolicy.ALLOW | ||
} = config; | ||
@@ -59,5 +55,5 @@ this.name = name; | ||
if (willOverwrite) { | ||
if (this.overwritePolicy === _types.OverwritePolicy.WARN) { | ||
if (this.overwritePolicy === OverwritePolicy.WARN) { | ||
console.warn("Item with key \"" + key + "\" already exists. You are assigning a new value."); | ||
} else if (this.overwritePolicy === _types.OverwritePolicy.PROHIBIT) { | ||
} else if (this.overwritePolicy === OverwritePolicy.PROHIBIT) { | ||
throw new Error("Item with key \"" + key + "\" already exists. Cannot overwrite."); | ||
@@ -82,5 +78,5 @@ } | ||
if (willOverwrite) { | ||
if (this.overwritePolicy === _types.OverwritePolicy.WARN) { | ||
if (this.overwritePolicy === OverwritePolicy.WARN) { | ||
console.warn("Item with key \"" + key + "\" already exists. You are assigning a new value."); | ||
} else if (this.overwritePolicy === _types.OverwritePolicy.PROHIBIT) { | ||
} else if (this.overwritePolicy === OverwritePolicy.PROHIBIT) { | ||
throw new Error("Item with key \"" + key + "\" already exists. Cannot overwrite."); | ||
@@ -182,4 +178,2 @@ } | ||
} | ||
exports.default = Registry; | ||
} |
@@ -1,13 +0,5 @@ | ||
"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; } | ||
class RegistryWithDefaultKey extends _Registry.default { | ||
import Registry from './Registry'; | ||
export default class RegistryWithDefaultKey extends Registry { | ||
constructor(config = {}) { | ||
@@ -76,4 +68,2 @@ super(config); | ||
} | ||
exports.default = RegistryWithDefaultKey; | ||
} |
@@ -1,9 +0,3 @@ | ||
"use strict"; | ||
exports.__esModule = true; | ||
exports.OverwritePolicy = void 0; | ||
/* eslint-disable import/prefer-default-export */ | ||
let OverwritePolicy; | ||
exports.OverwritePolicy = OverwritePolicy; | ||
export let OverwritePolicy; | ||
@@ -14,2 +8,2 @@ (function (OverwritePolicy) { | ||
OverwritePolicy["WARN"] = "WARN"; | ||
})(OverwritePolicy || (exports.OverwritePolicy = OverwritePolicy = {})); | ||
})(OverwritePolicy || (OverwritePolicy = {})); |
@@ -1,15 +0,5 @@ | ||
"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) { | ||
import camelCase from 'lodash/camelCase'; | ||
import isPlainObject from 'lodash/isPlainObject'; | ||
import mapKeys from 'lodash/mapKeys'; | ||
export default function convertKeysToCamelCase(object) { | ||
if (object === null || object === undefined) { | ||
@@ -19,4 +9,4 @@ return object; | ||
if ((0, _isPlainObject.default)(object)) { | ||
return (0, _mapKeys.default)(object, (_, k) => (0, _camelCase.default)(k)); | ||
if (isPlainObject(object)) { | ||
return mapKeys(object, (_, k) => camelCase(k)); | ||
} | ||
@@ -23,0 +13,0 @@ |
@@ -1,8 +0,3 @@ | ||
"use strict"; | ||
exports.__esModule = true; | ||
exports.default = isDefined; | ||
function isDefined(x) { | ||
export default function isDefined(x) { | ||
return x !== null && x !== undefined; | ||
} |
@@ -1,8 +0,3 @@ | ||
"use strict"; | ||
exports.__esModule = true; | ||
exports.default = isRequired; | ||
function isRequired(field) { | ||
export default function isRequired(field) { | ||
throw new Error(field + " is required."); | ||
} |
@@ -1,7 +0,2 @@ | ||
"use strict"; | ||
exports.__esModule = true; | ||
exports.default = makeSingleton; | ||
function makeSingleton(BaseClass, ...args) { | ||
export default function makeSingleton(BaseClass, ...args) { | ||
let singleton; | ||
@@ -8,0 +3,0 @@ return function getInstance() { |
@@ -1,8 +0,3 @@ | ||
"use strict"; | ||
exports.__esModule = true; | ||
exports.default = promiseTimeout; | ||
/** setTimeout that returns a promise */ | ||
function promiseTimeout( | ||
export default function promiseTimeout( | ||
/** A function to be executed after the timer expires. */ | ||
@@ -9,0 +4,0 @@ func, |
{ | ||
"name": "@superset-ui/core", | ||
"version": "0.12.21", | ||
"version": "0.13.0", | ||
"description": "Superset UI core", | ||
@@ -35,3 +35,3 @@ "sideEffects": false, | ||
}, | ||
"gitHead": "fb9cce364fa6046e774d76dda07947be62347c2f" | ||
"gitHead": "72b0c99f843add947371c6ee45cc32d57db6b027" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43758
735