Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
addNode(id, nodeData) {
// Node initialisation shorthands
if (!nodeData) {
nodeData = isId(id) ? { id } : id
} else {
nodeData.id = id
}
if (!nodeData.id) {
nodeData.id = uuid()
// Don't create a new node if it already exists
} else if (this.nodes[nodeData.id]) {
return this.nodes[nodeData.id]
}
nodeData.edges = []
this.nodes[nodeData.id] = nodeData
return nodeData
}
import uuid from 'uuid'
import 'colors'
import loadFile from './loadFile'
import promptForConfirm from './promptForConfirm'
import {
setMetadata
} from './metadata'
import {
getPipeline,
deletePipeline
} from './pipeline'
const buildId = uuid().replace(/-/g, '')
let [ , , fileName, startIndex = 0 ] = process.argv
if (!fileName) {
console.error('Please run again with a filename')
process.exit(1)
}
let filePath = path.resolve(process.cwd(), fileName)
let file = loadFile(filePath)
if (!file.steps || file.steps.length === 0) {
console.error('Oops, your pipeline doesn\'t seem to have any steps!')
process.exit(1)
}
const addIdToItem = ({ id, ...item }) => ({ ...item, id: id || uuid() });
const readStreamEntries = async (options: ReadStreamOptions) => {
const [name, entries] = await stream.readStreamGroup('provider:event', 'event-processor', uuid(), '>', options)
return {
name,
entries: entries.map(asStreamEntry)
}
}
function storeElement(element) {
if (!element) {
throwError(7, 'No element found');
}
const elementID = uuid();
elements.set(elementID, element);
return {ELEMENT: elementID};
}
const driver = {
addTaskComment(taskID, ownerID, e) {
let input = e.target[`commentContents`];
let commentID = uuid();
let content = input.value;
e.preventDefault();
if (content !== ``) {
input.value = ``;
dispatch(addTaskComment(commentID, taskID, ownerID, content));
}
}
}
.then(_keys => {
id = uuid();
keys = _keys;
return Promise.all([
CryptoHelper.export(keys.publicKey),
CryptoHelper.export(keys.privateKey),
]);
})
.then(([ publicKey, privateKey ]) => ({ publicKey, privateKey }))
export default function CtaLink(props: PropTypes) {
const accessibilityHintId = props.id ? `accessibility-hint-${props.id}` : uuidv4();
return (
<a aria-describedby="{accessibilityHintId}" tabindex="{props.tabIndex}" href="{props.url}" id="{props.id}">
<span>{props.text}</span>
{props.svg}
<p id="{accessibilityHintId}">{props.accessibilityHint}</p>
</a>
);
createLoadingTextNode() {
return new VCache({
text: uuid()
}, VStateCompare, function() {
return h('li.leaf', [
h('span.title.icon.icon-more', ['Loading...'])
]);
});
}
static from({
id = uuid(),
title,
content = '',
currentDatabase,
pinnedResult = true,
}: Partial> &
Pick, 'title'>): EditorTabModel {
return new EditorTabModel({
type: TabType.Editor,
id,
title,
content,
currentDatabase: Option.of(currentDatabase),
codeEditor: None,
queriesResult: None,
pinnedResult,
tableData: None,