@algebraic/type
Advanced tools
Comparing version 1.0.0-alpha.18 to 1.0.0-alpha.19
@@ -78,3 +78,3 @@ const typenameStack = []; | ||
function declare({ is, create, typename, unscopedTypename, serialize, deserialize }) | ||
function declare({ is, create, typename, unscopedTypename, serialize, deserialize, kind }) | ||
{ | ||
@@ -93,2 +93,3 @@ const type = fNamed(typename, function (...args) | ||
type[DeserializeSymbol] = deserialize; | ||
type[KindSymbol] = kind; | ||
@@ -95,0 +96,0 @@ return type; |
@@ -13,2 +13,3 @@ const { is, fNamed } = require("./declaration"); | ||
const fail = require("./fail"); | ||
const of = require("./of"); | ||
@@ -133,3 +134,8 @@ | ||
return fail("Failed to parse computed property, you must pass an array"); | ||
/* | ||
if (computed && !tuple) | ||
return toComputedIC( | ||
of(definition), | ||
{ compute:() => definition, dependencies:[] }); | ||
*/ | ||
const type = tuple ? definition[0] : definition; | ||
@@ -136,0 +142,0 @@ const fallback = tuple ? |
{ | ||
"name": "@algebraic/type", | ||
"version": "1.0.0-alpha.18", | ||
"version": "1.0.0-alpha.19", | ||
"description": "", | ||
@@ -13,4 +13,4 @@ "main": "type.js", | ||
"dependencies": { | ||
"@climb/partition": "1.0.0-alpha.3" | ||
"@climb/partition": "1.0.0-alpha.4" | ||
} | ||
} |
@@ -64,2 +64,4 @@ const { declaration, declare, getTypename, fNamed } = require("./declaration"); | ||
}), | ||
symbol: primitive `symbol` ([]), | ||
@@ -66,0 +68,0 @@ object: primitive `object` ( |
@@ -7,2 +7,3 @@ const fNameRegExp = /(is|or)\s*=>/; | ||
(false); | ||
const UnionComponents = Symbol("union.components"); | ||
@@ -14,3 +15,7 @@ module.exports = tagged((name, ...fields) => | ||
return declare({ is: isUnion, typename: name }); | ||
return Object.assign( | ||
declare({ is: isUnion, typename: name, kind: module.exports }), | ||
{ [UnionComponents]: types }); | ||
}); | ||
module.exports.components = type => type[UnionComponents](); |
33586
871
+ Added@climb/partition@1.0.0-alpha.4(transitive)
- Removed@climb/partition@1.0.0-alpha.3(transitive)