@parcel/graph 3.2.1-dev.3171 → 3.2.1-dev.3238

Sign up to get free protection for your applications and to get access to all the features.
@@ -33,12 +33,12 @@ class ContentGraph extends _Graph.default {
33
33
 
34
34
  // $FlowFixMe[prop-missing]
35
35
  static deserialize(opts) {
36
+ // $FlowFixMe
36
37
  return new ContentGraph(opts);
37
38
  }
38
39
 
39
40
  // $FlowFixMe[prop-missing]
40
41
  serialize() {
41
- // $FlowFixMe[prop-missing]
42
42
  return {
43
43
  ...super.serialize(),
44
44
  _contentKeyToNodeId: this._contentKeyToNodeId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcel/graph",
3
- "version": "3.2.1-dev.3171+79b158883",
3
+ "version": "3.2.1-dev.3238+7f6b4dbbc",
4
4
  "description": "Blazing fast, zero configuration web application bundler",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -22,5 +22,5 @@
22
22
  "dependencies": {
23
23
  "nullthrows": "^1.1.1"
24
24
  },
25
- "gitHead": "79b158883170daac9cd17bdecfebff163bc99e52"
25
+ "gitHead": "7f6b4dbbc56a203e0fce8794856c03598c4f6708"
26
26
  }
@@ -12,6 +12,7 @@ export type ContentGraphOpts<TNode, TEdgeType: number = 1> = {|
12
12
  export type SerializedContentGraph<TNode, TEdgeType: number = 1> = {|
13
13
  ...SerializedGraph<TNode, TEdgeType>,
14
14
  _contentKeyToNodeId: Map<ContentKey, NodeId>,
15
+ _nodeIdToContentKey: Map<NodeId, ContentKey>,
15
16
  |};
16
17
 
17
18
  export default class ContentGraph<TNode, TEdgeType: number = 1> extends Graph<
@@ -36,14 +37,14 @@ export default class ContentGraph<TNode, TEdgeType: number = 1> extends Graph<
36
37
 
37
38
  // $FlowFixMe[prop-missing]
38
39
  static deserialize(
39
- opts: ContentGraphOpts<TNode, TEdgeType>,
40
+ opts: SerializedContentGraph<TNode, TEdgeType>,
40
41
  ): ContentGraph<TNode, TEdgeType> {
42
+ // $FlowFixMe
41
43
  return new ContentGraph(opts);
42
44
  }
43
45
 
44
46
  // $FlowFixMe[prop-missing]
45
47
  serialize(): SerializedContentGraph<TNode, TEdgeType> {
46
- // $FlowFixMe[prop-missing]
47
48
  return {
48
49
  ...super.serialize(),
49
50
  _contentKeyToNodeId: this._contentKeyToNodeId,
package/src/Graph.js CHANGED
@@ -49,7 +49,7 @@ export default class Graph<TNode, TEdgeType: number = 1> {
49
49
  }
50
50
 
51
51
  static deserialize(
52
- opts: GraphOpts<TNode, TEdgeType>,
52
+ opts: SerializedGraph<TNode, TEdgeType>,
53
53
  ): Graph<TNode, TEdgeType> {
54
54
  return new this({
55
55
  nodes: opts.nodes,
package/src/types.js CHANGED
@@ -9,7 +9,7 @@ export function fromNodeId(x: NodeId): number {
9
9
  return x;
10
10
  }
11
11
 
12
- export type ContentKey = string;
12
+ export type ContentKey = string | number;
13
13
 
14
14
  export type Edge<TEdgeType: number> = {|
15
15
  from: NodeId,