@api-modeling/graphlib
Advanced tools
+1
-1
| { | ||
| "name": "@api-modeling/graphlib", | ||
| "version": "3.0.2", | ||
| "version": "3.0.3", | ||
| "description": "A directed and undirected multi-graph library", | ||
@@ -5,0 +5,0 @@ "author": "Chris Pettitt <cpettitt@gmail.com>", |
@@ -12,2 +12,2 @@ import { Graph } from "../graph"; | ||
| */ | ||
| export default function components<N, E>(g: Graph<N, E>): NodeIdentifier[][]; | ||
| export default function components<G, N, E>(g: Graph<G, N, E>): NodeIdentifier[][]; |
+1
-1
@@ -12,2 +12,2 @@ import { Graph } from "../graph"; | ||
| */ | ||
| export default function dfs<N, E>(g: Graph<N, E>, vs: NodeIdentifier|NodeIdentifier[], order: 'pre'|'post'): NodeIdentifier[]; | ||
| export default function dfs<G, N, E>(g: Graph<G, N, E>, vs: NodeIdentifier|NodeIdentifier[], order: 'pre'|'post'): NodeIdentifier[]; |
@@ -18,2 +18,2 @@ import { Graph } from "../graph.js"; | ||
| */ | ||
| export default function dijkstraAll<N, E>(g: Graph<N, E>, weightFunc?: (edge: Edge<E>) => number, edgeFunc?: (v: NodeIdentifier) => Edge<E>[]): Record<NodeIdentifier, Record<NodeIdentifier, NodePath>>; | ||
| export default function dijkstraAll<G, N, E>(g: Graph<G, N, E>, weightFunc?: (edge: Edge<E>) => number, edgeFunc?: (v: NodeIdentifier) => Edge<E>[]): Record<NodeIdentifier, Record<NodeIdentifier, NodePath>>; |
@@ -22,2 +22,2 @@ import { Graph } from "../graph"; | ||
| */ | ||
| export default function dijkstra<N, E>(g: Graph<N, E>, source: NodeIdentifier, weightFn?: ((edge: Edge<E>) => number), edgeFn?: ((v: NodeIdentifier) => Edge<E>[])): Record<NodeIdentifier, NodePath>; | ||
| export default function dijkstra<G, N, E>(g: Graph<G, N, E>, source: NodeIdentifier, weightFn?: ((edge: Edge<E>) => number), edgeFn?: ((v: NodeIdentifier) => Edge<E>[])): Record<NodeIdentifier, NodePath>; |
@@ -15,2 +15,2 @@ import { Graph } from "../graph"; | ||
| */ | ||
| export default function findCycles<N, E>(g: Graph<N, E>): NodeIdentifier[][]; | ||
| export default function findCycles<G, N, E>(g: Graph<G, N, E>): NodeIdentifier[][]; |
@@ -23,2 +23,2 @@ import { Graph } from "../graph"; | ||
| */ | ||
| export default function floydWarshall<N, E>(g: Graph<N, E>, weightFn?: (edge: Edge<E>) => number, edgeFn?: (v: NodeIdentifier) => Edge<E>[]): FloydWarshallResult; | ||
| export default function floydWarshall<G, N, E>(g: Graph<G, N, E>, weightFn?: (edge: Edge<E>) => number, edgeFn?: (v: NodeIdentifier) => Edge<E>[]): FloydWarshallResult; |
@@ -11,2 +11,2 @@ import { Graph } from "../graph"; | ||
| */ | ||
| export default function isAcyclic<N, E>(g: Graph<N, E>): boolean; | ||
| export default function isAcyclic<G, N, E>(g: Graph<G, N, E>): boolean; |
@@ -13,2 +13,2 @@ import { Graph } from "../graph"; | ||
| */ | ||
| export default function postOrder<N, E>(g: Graph<N, E>, vs: NodeIdentifier|NodeIdentifier[]): NodeIdentifier[]; | ||
| export default function postOrder<G, N, E>(g: Graph<G, N, E>, vs: NodeIdentifier|NodeIdentifier[]): NodeIdentifier[]; |
@@ -13,2 +13,2 @@ import { Graph } from "../graph"; | ||
| */ | ||
| export default function preOrder<N, E>(g: Graph<N, E>, vs: NodeIdentifier|NodeIdentifier[]): NodeIdentifier[]; | ||
| export default function preOrder<G, N, E>(g: Graph<G, N, E>, vs: NodeIdentifier|NodeIdentifier[]): NodeIdentifier[]; |
@@ -15,2 +15,2 @@ import { Graph } from "../graph"; | ||
| */ | ||
| export default function prim<N, E>(g: Graph<N, E>, weightFunc: (edge: Edge<E>) => number): Graph<N, E>; | ||
| export default function prim<G, N, E>(g: Graph<G, N, E>, weightFunc: (edge: Edge<E>) => number): Graph<G, N, E>; |
@@ -17,2 +17,2 @@ import { Graph } from "../graph"; | ||
| */ | ||
| export default function tarjan<N, E>(g: Graph<N, E>): NodeIdentifier[][]; | ||
| export default function tarjan<G, N, E>(g: Graph<G, N, E>): NodeIdentifier[][]; |
@@ -14,2 +14,2 @@ import { Graph } from "../graph"; | ||
| */ | ||
| export default function topSort<N, E>(g: Graph<N, E>): NodeIdentifier[]; | ||
| export default function topSort<G, N, E>(g: Graph<G, N, E>): NodeIdentifier[]; |
+13
-13
@@ -7,7 +7,7 @@ import { CountedEdges, Edge, GraphInit, NodeChildren, NodeIdentifier, NodeParents } from "./types"; | ||
| */ | ||
| export declare class Graph<N, E> { | ||
| export declare class Graph<G, N, E> { | ||
| _isDirected: boolean; | ||
| _isMultigraph: boolean; | ||
| _isCompound: boolean; | ||
| _label: any; | ||
| _label: G; | ||
| /** | ||
@@ -96,3 +96,3 @@ * v -> label | ||
| */ | ||
| setGraph(label: any): Graph<N,E>; | ||
| setGraph(label: any): Graph<G,N,E>; | ||
@@ -119,3 +119,3 @@ /** | ||
| */ | ||
| setDefaultNodeLabel(newDefault: string|((node?: NodeIdentifier) => any)): Graph<N,E>; | ||
| setDefaultNodeLabel(newDefault: string|((node?: NodeIdentifier) => any)): Graph<G,N,E>; | ||
@@ -144,3 +144,3 @@ /** | ||
| */ | ||
| setNodes(vs: NodeIdentifier[], value?: N): Graph<N,E>; | ||
| setNodes(vs: NodeIdentifier[], value?: N): Graph<G,N,E>; | ||
@@ -156,3 +156,3 @@ /** | ||
| */ | ||
| setNode(v: NodeIdentifier, label?: N): Graph<N,E>; | ||
| setNode(v: NodeIdentifier, label?: N): Graph<G,N,E>; | ||
@@ -175,3 +175,3 @@ /** | ||
| */ | ||
| removeNode(v: NodeIdentifier): Graph<N,E>; | ||
| removeNode(v: NodeIdentifier): Graph<G,N,E>; | ||
@@ -185,3 +185,3 @@ /** | ||
| */ | ||
| setParent(v: NodeIdentifier, parent?: NodeIdentifier): Graph<N,E>; | ||
| setParent(v: NodeIdentifier, parent?: NodeIdentifier): Graph<G,N,E>; | ||
@@ -224,3 +224,3 @@ _removeFromParentsChildList(v: NodeIdentifier): void; | ||
| */ | ||
| filterNodes(filter: (id: NodeIdentifier) => boolean): Graph<N,E>; | ||
| filterNodes(filter: (id: NodeIdentifier) => boolean): Graph<G,N,E>; | ||
@@ -232,3 +232,3 @@ /** | ||
| */ | ||
| setDefaultEdgeLabel(newDefault: string|((v:NodeIdentifier, w:NodeIdentifier, name?: string|number) => any)): Graph<N,E>; | ||
| setDefaultEdgeLabel(newDefault: string|((v:NodeIdentifier, w:NodeIdentifier, name?: string|number) => any)): Graph<G,N,E>; | ||
@@ -245,3 +245,3 @@ /** | ||
| setPath(vs: NodeIdentifier[], value?: string): Graph<N,E>; | ||
| setPath(vs: NodeIdentifier[], value?: string): Graph<G,N,E>; | ||
@@ -264,3 +264,3 @@ /** | ||
| */ | ||
| setEdge(v: NodeIdentifier|Edge<E>, w?: NodeIdentifier|E, value?: E, name?: string|number): Graph<N,E>; | ||
| setEdge(v: NodeIdentifier|Edge<E>, w?: NodeIdentifier|E, value?: E, name?: string|number): Graph<G,N,E>; | ||
@@ -304,3 +304,3 @@ /** | ||
| */ | ||
| removeEdge(v: Edge<E>|NodeIdentifier, w?: NodeIdentifier|string, name?: string): Graph<N,E>; | ||
| removeEdge(v: Edge<E>|NodeIdentifier, w?: NodeIdentifier|string, name?: string): Graph<G,N,E>; | ||
@@ -307,0 +307,0 @@ /** |
+2
-2
@@ -11,3 +11,3 @@ import { Graph } from './graph'; | ||
| */ | ||
| export declare function write<N, E>(g: Graph<N, E>): GraphJson<N, E>; | ||
| export declare function write<G, N, E>(g: Graph<G, N, E>): GraphJson<G, N, E>; | ||
@@ -27,2 +27,2 @@ /** | ||
| */ | ||
| export declare function read<N, E>(json: GraphJson<N, E>): Graph<N, E>; | ||
| export declare function read<G, N, E>(json: GraphJson<G, N, E>): Graph<G, N, E>; |
+7
-2
@@ -68,7 +68,12 @@ export declare interface GraphInit { | ||
| export declare interface GraphJson<N, E> { | ||
| /** | ||
| * G - Graph value | ||
| * N - Node value | ||
| * E - Edge value | ||
| */ | ||
| export declare interface GraphJson<G, N, E> { | ||
| options: GraphInit; | ||
| nodes: Node<N>[]; | ||
| edges: JsonEdge<E>[]; | ||
| value?: string; | ||
| value?: G; | ||
| } | ||
@@ -75,0 +80,0 @@ |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
87160
0.2%2343
0.21%