( mutable: MutableGraph<N, E, T> )
| 753 | * @since 3.18.0 |
| 754 | */ |
| 755 | export const endMutation = <N, E, T extends Kind = "directed">( |
| 756 | mutable: MutableGraph<N, E, T> |
| 757 | ): Graph<N, E, T> => { |
| 758 | assertMutable(mutable) |
| 759 | if (internal.isTransforming(mutable)) { |
| 760 | throw new GraphError({ message: "Cannot mutate graph during a transformation" }) |
| 761 | } |
| 762 | const source = internal.toImpl(mutable) |
| 763 | csr.invalidate(mutable) |
| 764 | const graph = internal.finalize(source) |
| 765 | source.mutable = false |
| 766 | |
| 767 | return graph as unknown as Graph<N, E, T> |
| 768 | } |
| 769 | |
| 770 | /** @internal */ |
| 771 | const mutateScoped = <N, E, T extends Kind>( |
no test coverage detected