@bian-womp/spark-graph 0.1.23 → 0.1.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/cjs/index.cjs CHANGED
@@ -121,8 +121,8 @@ class Registry {
121
121
  nonTransitive: !!opts?.nonTransitive,
122
122
  });
123
123
  // If both source and target have array variants, add derived array->array coercion
124
- const fromArr = `${fromTypeId}[]`;
125
- const toArr = `${toTypeId}[]`;
124
+ const fromArr = fromTypeId === "base.object" ? fromTypeId : `${fromTypeId}[]`;
125
+ const toArr = toTypeId === "base.object" ? toTypeId : `${toTypeId}[]`;
126
126
  const arrKey = `${fromArr}->${toArr}`;
127
127
  if (this.types.has(fromArr) && this.types.has(toArr)) {
128
128
  if (!this.coercions.has(arrKey) && !this.asyncCoercions.has(arrKey)) {
@@ -147,8 +147,8 @@ class Registry {
147
147
  nonTransitive: !!opts?.nonTransitive,
148
148
  });
149
149
  // If both source and target have array variants, add derived array->array async coercion
150
- const fromArr = `${fromTypeId}[]`;
151
- const toArr = `${toTypeId}[]`;
150
+ const fromArr = fromTypeId === "base.object" ? fromTypeId : `${fromTypeId}[]`;
151
+ const toArr = toTypeId === "base.object" ? toTypeId : `${toTypeId}[]`;
152
152
  const arrKey = `${fromArr}->${toArr}`;
153
153
  if (this.types.has(fromArr) && this.types.has(toArr)) {
154
154
  if (!this.coercions.has(arrKey) && !this.asyncCoercions.has(arrKey)) {
@@ -1950,7 +1950,7 @@ function setupBasicGraphRegistry() {
1950
1950
  return String(v);
1951
1951
  }
1952
1952
  });
1953
- registry.registerCoercion("base.vec3", "base.json", (v) => {
1953
+ registry.registerCoercion("base.vec3", "base.object", (v) => {
1954
1954
  try {
1955
1955
  return v ? JSON.stringify(v) : undefined;
1956
1956
  }
@@ -1958,7 +1958,7 @@ function setupBasicGraphRegistry() {
1958
1958
  return undefined;
1959
1959
  }
1960
1960
  });
1961
- registry.registerCoercion("base.json", "base.vec3", (v) => {
1961
+ registry.registerCoercion("base.object", "base.vec3", (v) => {
1962
1962
  try {
1963
1963
  const result = JSON.parse(v);
1964
1964
  if (result.length === 3 &&