Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function getCa (options) {
var caOption = options.getIn(["https", "ca"]);
// if not provided, use Browsersync self-signed
if (typeof caOption === "undefined") {
return fs.readFileSync(join(__dirname, "certs", "server.csr"));
}
// if a string was given, read that file from disk
if (typeof caOption === "string") {
return fs.readFileSync(caOption);
}
// if an array was given, read all
if (List.isList(caOption)) {
return caOption.toArray().map(function (x) {
return fs.readFileSync(x);
});
}
}
demo.link('TestLibrary', 'test', 'account0', 'linkLib').then((output) => {
assert(Map.isMap(output), "Linking should produce a map")
const output2 = demo.getLink(networkId, "TestLibrary-linkLib")
assert(List.isList(output.get('abi')))
assert(List.isList(output2.get('abi')))
assert(output2.equals(output), 'Link output should equal the map read from link file.')
done()
}).catch((error) => {
assert.fail(error)
for (let i = 0, n = keys.length; i < n; i++) {
let mKeys = [...keys].splice(0, i + 1);
if (!state.hasIn(mKeys)) {
mKeys.pop();
if (!state.hasIn(mKeys)) {
if (keys[i].constructor === Number) {
state = state.setIn(mKeys, List());
}
else {
state = state.setIn(mKeys, Map());
}
}
}
else if (i < n) {
let data = state.getIn(mKeys);
if (!Map.isMap(data) && !List.isList(data)) {
if (keys[i + 1].constructor === Number) {
state = state.setIn(mKeys, List());
}
else {
state = state.setIn(mKeys, Map());
}
}
}
}
return state;
}
createFormHandle(state, { key, data }) {
const stripTypename = (obj) => {
if (Map.isMap(obj)) {
return obj.remove('__typename').map(stripTypename)
} else if (List.isList(obj)) {
return obj.map(stripTypename)
} else {
return obj
}
}
export default function isImmutableList(data) {
return List.isList(data)
}
static isTextList(any) {
return List.isList(any) && any.every(item => Text.isText(item))
}
return obj.keySeq().reduce((acc, current) => {
if (defaultGroupValues[current] && List.isList(obj.get(current))) {
const formatted = obj.get(current).reduce((acc2, curr, index) => {
return acc2.set(index, curr.set('_temp__id', index));
}, List([]));
return acc.set(current, formatted);
}
return acc;
}, obj);
}
([key, value]) => {
let isDeprecated = isOAS3() && value.get("deprecated")
let isRequired = List.isList(requiredProperties) && requiredProperties.contains(key)
let propertyStyle = { verticalAlign: "top", paddingRight: "0.2em" }
if ( isRequired ) {
propertyStyle.fontWeight = "bold"
}
return (
{ key }{ isRequired && <span style="{{">*</span> }
for (let i = 0, n = keys.length; i < n; i++) {
let mKeys = [].concat(keys).splice(0, i + 1);
if (!state.hasIn(mKeys)) {
mKeys.pop();
if (!state.hasIn(mKeys)) {
if (keys[i].constructor === Number) {
state = state.setIn(mKeys, List());
}
else {
state = state.setIn(mKeys, Map());
}
}
}
else if (i < n) {
let data = state.getIn(mKeys);
if (!Map.isMap(data) && !List.isList(data)) {
if (keys[i + 1].constructor === Number) {
state = state.setIn(mKeys, List());
}
else {
state = state.setIn(mKeys, Map());
}
}
}
}
return state;
}
createFormHandle(state, { key, data }) {
export const isArrayOrList = value =>
Array.isArray(value) || List.isList(value);