Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Validate whether the address is valid
let pattern = /^(0x)?[0-9a-fA-F]{40}$/
if (pattern.test(address)) {
return errors
} else {
return errors.push(
immutable.fromJS({
path,
message: `\
Contract address is invalid: ${address}
Must be 40 hexadecimal characters, with an optional '0x' prefix.`,
}),
)
}
}, immutable.List())
}
const CustomColorPickerInner = ColorWrap((props) => {
const styles = buildStyles(props);
// To fill space when customColors is less than 7.
const dummySwatchListLength = Math.max(MAX_CUSTOM_COLORS - props.customColors.size, 0);
const dummySwatchList = new List(Array(dummySwatchListLength)).map((_, i) => (
<span>
<div style="{styles.swatch}">
));
return (
<div style="{styles.picker}">
<div style="{styles.saturation}">
</div>
</div></div></span>
let names = "";
let pubkey = address_to_pubkey.get(v.owner);
let private_key_object = private_keys.get(pubkey);
// Imported Account Names (just a visual aid, helps to auto select a real account)
if (
private_key_object &&
private_key_object.import_account_names
)
names = private_key_object.import_account_names.join(
", "
);
// Signing is very slow, further divide the groups based on the number of signatures required
let batch_number = Math.ceil(
groupCount(
Immutable.List([names, v.balance.asset_id]),
v.owner
) / 60
);
let name_asset_key = Immutable.List([
names,
v.balance.asset_id,
batch_number
]);
return name_asset_key;
})
.map(l =>
export const convertFromCRDApplication = (c: V1alpha1Application): Application => {
const spec = c.spec!;
const metadata = c.metadata!;
const sharedEnv = spec.sharedEnv
? List(
spec.sharedEnv.map(x =>
Map({
name: x.name,
value: x.value
})
)
)
: List([]);
const components: List = spec.components
? List(spec.components.map(convertFromCRDApplicationComponent))
: List();
const res: Application = Map({
id: metadata.name!,
isActive: c.status?.isActive,
export function contentTypeValues(state, pathMethod) {
pathMethod = pathMethod || []
let op = specJsonWithResolvedSubtrees(state).getIn(["paths", ...pathMethod], fromJS({}))
let meta = state.getIn(["meta", "paths", ...pathMethod], fromJS({}))
let producesValue = currentProducesFor(state, pathMethod)
const parameters = op.get("parameters") || new List()
const requestContentType = (
meta.get("consumes_value") ? meta.get("consumes_value")
: parametersIncludeType(parameters, "file") ? "multipart/form-data"
: parametersIncludeType(parameters, "formData") ? "application/x-www-form-urlencoded"
: undefined
)
return fromJS({
requestContentType,
responseContentType: producesValue
})
}
export const getCurrentValues = (fields = [], initialListValues, options, fieldPath, parentPath) => {
return (initialListValues || List()).map((item, index) => {
return getFields(fields, item, options, fieldPath, index, parentPath)
})
}
for (const headerLine of headerLines) {
const match = headerLine.match(/^([^\s\:]*)\s*\:\s*(.*)$/)
if (match) {
headerSet = headerSet.set(match[1],
this._referenceEnvironmentVariable(match[2])
)
}
}
headerSet.forEach((value, key) => {
const param = this._extractParam(key, value)
headers.push(param)
})
return new Immutable.List(headers)
}
let layerID = state.getIn(['drawingSupport', 'layerID']);
let layer = state.getIn(['scene','layers', layerID]);
let lineID = state.getIn(['scene', 'layers', layerID, 'selected', 'lines']).first();
let line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
let v0 = layer.vertices.get(line.vertices.get(0));
state = Line.remove( state, layerID, lineID ).updatedState;
state = Line.createAvoidingIntersections( state, layerID, line.type, v0.x, v0.y, x, y ).updatedState;
state = Layer.detectAndUpdateAreas( state, layerID ).updatedState;
state = state.merge({
mode: MODE_WAITING_DRAWING_LINE,
snapElements: new List(),
activeSnapElement: null
});
return { updatedState: state };
}
const runCompleted = props.app.run.status === statusConstants.COMPLETED;
let selection;
if (!props.hideContent) {
if (props.selection.taskIndex === props.app.tasks.size) {
const outputResultsIndex = ioUtils.getIndexByExtension(
props.app.run.outputs, 'results.json',
);
let resultValues;
if (outputResultsIndex !== -1) {
const outputResults = props.app.run.outputs.get(outputResultsIndex)
.fetchedValue;
if (outputResults.output_values) {
resultValues = new IList(outputResults.output_values);
}
}
const pdbIndex = ioUtils.getIndexByExtension(
props.app.run.outputs, '.pdb',
);
const outputPdbUrl = props.app.run.outputs.get(pdbIndex).value;
selection = (