Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private createKernel(video: HTMLVideoElement, config: {
box: string;
isLive: boolean;
kernels: UserKernelsConfig;
preset: {
flv?: IVideoKernelConstructor;
hls?: IVideoKernelConstructor;
mp4?: IVideoKernelConstructor;
};
src: string;
}) {
const { kernels, preset } = config;
/* istanbul ignore else */
if (process.env.NODE_ENV !== 'production' && isEmpty(kernels) && !isEmpty(preset)) { chimeeLog.warn('preset will be deprecated in next major version, please use kernels instead.'); }
const presetConfig: { [key: string]: SingleKernelConfig } = {};
let newPreset: UserKernelsConstructorMap = {};
if (isArray(kernels)) {
// SKC means SingleKernelConfig
newPreset = (kernels as (Array< SupportedKernelType | SingleKernelConfig >)).reduce((kernels: UserKernelsConstructorMap, keyOrSKC: SupportedKernelType | SingleKernelConfig) => {
// if it is a string key, it means the kernel has been pre installed.
if (isString(keyOrSKC)) {
if (!isSupportedKernelType(keyOrSKC)) {
throw new Error(`We have not support ${keyOrSKC} kernel type`);
}
const kernelFn = kernelsSet[keyOrSKC];
if (!isFunction(kernelFn)) {
chimeeLog.warn(`You have not installed kernel for ${keyOrSKC}.`);
return kernels;
}
kernels[keyOrSKC] = kernelFn;
setQueryParameters(selected) {
// Ensure something is always active
if (!_.isEmpty(selected)) {
try {
const recognized = _.filter(selected, (id) => _.find(this.props.items, { id }));
setQueryArgument(this.storageKey, recognized.join(','));
} catch (ignored) {
// ignore
}
const allSelected = _.isEmpty(_.xor(selected, _.map(this.props.items, 'id')));
this.setState({ allSelected, selected }, () => this.applyFilter());
}
}
render() {
const {
metadata: { namespace },
spec: { selector },
} = this.props.obj;
if (_.isEmpty(selector)) {
return ;
}
// Hide the create button to avoid confusion when showing pods for an object.
// Otherwise it might seem like you click "Create Pod" to add replicas instead
// of scaling the owner.
return (
);
}
}
getFormValueForSubmit() {
this.validate()
if (!isEmpty(this.localErrors)) {
this.$message({
message: 'Please check that you entered metadata correctly!',
type: 'warning',
})
return null
}
return {
datasetId: this.datasetId ? this.datasetId : '',
metadataJson: JSON.stringify(this.value),
metaspaceOptions: this.metaspaceOptions,
initialMetadataJson: JSON.stringify(this.initialValue),
initialMetaspaceOptions: this.initialMetaspaceOptions,
}
},
render() {
const effects = {
NoSchedule: 'NoSchedule',
PreferNoSchedule: 'PreferNoSchedule',
NoExecute: 'NoExecute',
};
const { taints, errorMessage, inProgress } = this.state;
return (
<form name="form">
Edit Taints
{_.isEmpty(taints) ? (
) : (
<div>
<div>Key</div>
<div>Value</div>
<div>Effect</div>
<div>
</div>
{_.map(taints, (c, i) => (
<div>
<div>
<div>
Key
</div>
</div></div></div></form>
function inferAction(obj: Handler) {
if (_.isEmpty(obj)) {
return;
}
const keys = _.keys(obj);
if (_.isEmpty(keys)) {
return;
}
return HookAction[keys[0]];
}
getAssetsToPurchaseWith,
assetToPurchaseWith,
assetToPurchase,
amountToPurchaseFor,
getPurchaseableAssets,
updateField,
inputErrorMessage,
}: Props) => {
const maxBalance = assetBalances[assetToPurchaseWith]
return (
<section>
<div>
<h3>ICO Token</h3>
updateField({ name: 'assetToPurchase', value: option.value })
}
options={getPurchaseableAssets().map(asset => ({
label: asset,
value: asset,
}))}
isSearchable={false}
/>
</div>
<div>
<h3>Contribution</h3>
</div></section>
.then(d => {
const configDotYaml = safeLoad(d.data['config.yaml']) || {};
const connectorIndex = _.findIndex(configDotYaml.connectors, connector => connector.type === 'ldap' && connector.id === 'tectonic-ldap');
this.setState({configDotYaml, connectorIndex, loadError: null, tectonicIdentityConfig: d});
if (connectorIndex === -1) {
return;
}
const formData = connectorToRedux(configDotYaml.connectors[connectorIndex]);
if (_.isEmpty(formData)) {
return;
}
this.props.initialize(formData);
})
.catch(loadError => this.setState({loadError}));
export const resourceURL = (model, options) => {
let q = '';
let u = getK8sAPIPath(model);
if (options.ns) {
u += `/namespaces/${options.ns}`;
}
u += `/${model.plural}`;
if (options.name) {
u += `/${options.name}`;
}
if (options.path) {
u += `/${options.path}`;
}
if (!_.isEmpty(options.queryParams)) {
q = _.map(options.queryParams, function(v, k) {
return `${k}=${v}`;
});
u += `?${q.join('&')}`;
}
return u;
};
_onDirCreateBlur = (event) => {
if (isEmpty(event.target.value)) {
this.props.onCancelCreateDir()
} else {
this.props.onCreateDir()
}
}