refactor(core): log warnings for non-prod node envs

This commit is contained in:
Braks
2022-10-18 19:04:22 +02:00
parent 48366780ce
commit 395fcd2aab
10 changed files with 34 additions and 18 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
import { defaultEdgeTypes, defaultNodeTypes } from './state'
import type { ComputedGetters, GraphEdge, GraphNode, State } from '~/types'
import { getNodesInside, isEdgeVisible } from '~/utils'
import { getNodesInside, isEdgeVisible, warn } from '~/utils'
export default (state: State): ComputedGetters => {
const nodeIds = computed(() => state.nodes.map((n) => n.id))
@@ -61,7 +61,7 @@ export default (state: State): ComputedGetters => {
if (!source || !target) {
state.edges = state.edges.filter((edge) => edge.id !== e.id)
console.warn(`[vue-flow]: Orphaned edge ${e.id} removed.`)
warn(`Orphaned edge ${e.id} removed.`)
return
}