chore: add prefix to console messages

This commit is contained in:
Braks
2022-04-11 11:30:10 +02:00
parent 158be8a515
commit 06b0c143b5
3 changed files with 10 additions and 11 deletions
-1
View File
@@ -40,7 +40,6 @@ export const getHandle = (bounds: HandleElement[] = [], handleId?: string | null
if (!handleId && bounds.length === 1) handle = bounds[0]
else if (handleId) handle = bounds.find((d) => d.id === handleId)
console.log(handleId, handle, bounds)
return handle
}
+3 -3
View File
@@ -147,7 +147,7 @@ export const connectionExists = (edge: Edge, elements: Elements) =>
*/
export const addEdge = (edgeParams: Edge | Connection, elements: Elements, defaults?: DefaultEdgeOptions) => {
if (!edgeParams.source || !edgeParams.target) {
console.warn("Can't create edge. An edge needs a source and a target.")
console.warn("[vueflow]: Can't create edge. An edge needs a source and a target.")
return elements
}
@@ -172,14 +172,14 @@ export const addEdge = (edgeParams: Edge | Connection, elements: Elements, defau
*/
export const updateEdge = (oldEdge: Edge, newConnection: Connection, elements: Elements) => {
if (!newConnection.source || !newConnection.target) {
console.warn("Can't create new edge. An edge needs a source and a target.")
console.warn("[vueflow]: Can't create new edge. An edge needs a source and a target.")
return elements
}
const foundEdge = elements.find((e) => isEdge(e) && e.id === oldEdge.id)
if (!foundEdge) {
console.warn(`The old edge with id=${oldEdge.id} does not exist.`)
console.warn(`[vueflow]: The old edge with id=${oldEdge.id} does not exist.`)
return elements
}