property-graph
Advanced tools
Comparing version 2.0.0-alpha.0 to 2.0.0-alpha.1
@@ -1,2 +0,3 @@ | ||
import type { Ref, RefList, RefMap, RefSet } from './refs.js'; | ||
import type { GraphNode } from './graph-node.js'; | ||
import type { RefList, RefMap, RefSet } from './refs.js'; | ||
/** TypeScript utility for nullable types. */ | ||
@@ -13,3 +14,3 @@ export type Nullable<T> = { | ||
export type RefKeys<T> = { | ||
[K in keyof T]-?: T[K] extends Ref ? K : never; | ||
[K in keyof T]-?: T[K] extends GraphNode ? K : never; | ||
}[keyof T]; | ||
@@ -16,0 +17,0 @@ export type RefListKeys<T> = { |
@@ -254,3 +254,2 @@ class EventDispatcher { | ||
const Ref = GraphEdge; | ||
/** | ||
@@ -261,3 +260,2 @@ * An ordered collection of {@link Ref Refs}, allowing duplicates. Removing | ||
*/ | ||
class RefList { | ||
@@ -531,3 +529,3 @@ constructor(refs) { | ||
if (value instanceof Ref) { | ||
if (value instanceof GraphEdge) { | ||
const ref = value; | ||
@@ -772,3 +770,3 @@ | ||
export { $attributes, $immutableKeys, EventDispatcher, Graph, GraphEdge, GraphNode, Ref, RefList, RefMap, RefSet }; | ||
export { $attributes, $immutableKeys, EventDispatcher, Graph, GraphEdge, GraphNode, RefList, RefMap, RefSet }; | ||
//# sourceMappingURL=property-graph.esm.js.map |
@@ -268,3 +268,2 @@ class EventDispatcher { | ||
const Ref = GraphEdge; | ||
/** | ||
@@ -275,3 +274,2 @@ * An ordered collection of {@link Ref Refs}, allowing duplicates. Removing | ||
*/ | ||
class RefList { | ||
@@ -545,3 +543,3 @@ constructor(refs) { | ||
if (value instanceof Ref) { | ||
if (value instanceof GraphEdge) { | ||
const ref = value; | ||
@@ -786,3 +784,3 @@ | ||
export { $attributes, $immutableKeys, EventDispatcher, Graph, GraphEdge, GraphNode, Ref, RefList, RefMap, RefSet }; | ||
export { $attributes, $immutableKeys, EventDispatcher, Graph, GraphEdge, GraphNode, RefList, RefMap, RefSet }; | ||
//# sourceMappingURL=property-graph.modern.js.map |
import { GraphEdge } from './graph-edge.js'; | ||
import { GraphNode } from './graph-node.js'; | ||
export declare const Ref: typeof GraphEdge; | ||
export type Ref<T extends GraphNode = GraphNode> = GraphEdge<GraphNode, T>; | ||
@@ -48,2 +47,1 @@ /** | ||
} | ||
export type UnknownRef = Ref | RefList | RefSet | RefMap | unknown; |
{ | ||
"name": "property-graph", | ||
"version": "2.0.0-alpha.0", | ||
"version": "2.0.0-alpha.1", | ||
"description": "Base for creating objects that behave like a Property Graph.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -1,2 +0,3 @@ | ||
import type { Ref, RefList, RefMap, RefSet } from './refs.js'; | ||
import type { GraphNode } from './graph-node.js'; | ||
import type { RefList, RefMap, RefSet } from './refs.js'; | ||
@@ -22,3 +23,3 @@ /** TypeScript utility for nullable types. */ | ||
export type RefKeys<T> = { [K in keyof T]-?: T[K] extends Ref ? K : never }[keyof T]; | ||
export type RefKeys<T> = { [K in keyof T]-?: T[K] extends GraphNode ? K : never }[keyof T]; | ||
export type RefListKeys<T> = { [K in keyof T]-?: T[K] extends RefList ? K : never }[keyof T]; | ||
@@ -25,0 +26,0 @@ export type RefListValue<List> = List extends RefList<infer V> ? V : never; |
@@ -156,4 +156,4 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
for (const attribute in this[$attributes]) { | ||
const value = this[$attributes][attribute] as Ref | Ref[] | RefMap; | ||
if (value instanceof Ref) { | ||
const value = this[$attributes][attribute] as Ref | RefList | RefSet | RefMap; | ||
if (value instanceof GraphEdge) { | ||
const ref = value as Ref; | ||
@@ -160,0 +160,0 @@ if (ref.getChild() === prevValue) { |
import { GraphEdge } from './graph-edge.js'; | ||
import { GraphNode } from './graph-node.js'; | ||
export const Ref = GraphEdge; | ||
export type Ref<T extends GraphNode = GraphNode> = GraphEdge<GraphNode, T>; | ||
@@ -119,3 +118,1 @@ | ||
} | ||
export type UnknownRef = Ref | RefList | RefSet | RefMap | unknown; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
220055
2818