raml-typesystem
Advanced tools
Comparing version 0.0.34 to 0.0.35
@@ -632,3 +632,3 @@ "use strict"; | ||
AbstractType.prototype.isUserDefined = function () { | ||
return this.getExtra(tsInterfaces.USER_DEFINED_EXTRA); | ||
return this.getExtra(tsInterfaces.USER_DEFINED_EXTRA) && !this.buildIn; | ||
}; | ||
@@ -635,0 +635,0 @@ AbstractType.prototype.putExtra = function (extraName, value) { |
@@ -60,3 +60,4 @@ "use strict"; | ||
} | ||
t.typeFamily().forEach(function (x) { | ||
t.putExtra(NOMINAL, ut); | ||
t.options().forEach(function (x) { | ||
if (ut.left == null) { | ||
@@ -63,0 +64,0 @@ ut.left = toNominal(x, callback); |
@@ -223,3 +223,15 @@ "use strict"; | ||
}); | ||
it("to nominal passes with intersting union types", function () { | ||
var tps = ps.parseJSONTypeCollection({ | ||
types: { | ||
A: { type: "string" }, | ||
B: { type: "string | A" }, | ||
C: { type: ["B", "A"] } | ||
} | ||
}, ts.builtInRegistry()); | ||
var tp = tps.getType("C"); | ||
var nt = nm.toNominal(tp, function (x) { return null; }); | ||
assert.isTrue(nt.superTypes().length == 2); | ||
}); | ||
}); | ||
//# sourceMappingURL=toNominalTests.js.map |
{ | ||
"name": "raml-typesystem", | ||
"version": "0.0.34", | ||
"version": "0.0.35", | ||
"main": "dist/src/index.js", | ||
@@ -48,3 +48,3 @@ "scripts": { | ||
"typings": "^0.5.1", | ||
"dev-env-installer": "^0.0.2", | ||
"dev-env-installer": "0.0.5", | ||
"json-loader": "^0.5.1", | ||
@@ -51,0 +51,0 @@ "rimraf": "*" |
@@ -741,3 +741,3 @@ import ti = require("./nominal-interfaces") | ||
isUserDefined() : boolean { | ||
return this.getExtra(tsInterfaces.USER_DEFINED_EXTRA); | ||
return this.getExtra(tsInterfaces.USER_DEFINED_EXTRA)&&!this.buildIn; | ||
} | ||
@@ -744,0 +744,0 @@ |
@@ -79,3 +79,4 @@ import ts=require("./typesystem") | ||
} | ||
t.typeFamily().forEach(x=>{ | ||
t.putExtra(NOMINAL, ut); | ||
t.options().forEach(x=>{ | ||
if (ut.left==null){ | ||
@@ -82,0 +83,0 @@ ut.left=toNominal(x,callback); |
@@ -238,2 +238,14 @@ import ps= require("./actualParse") | ||
}); | ||
it("to nominal passes with intersting union types", function () { | ||
var tps = ps.parseJSONTypeCollection({ | ||
types:{ | ||
A: { type: "string"}, | ||
B: { type: "string | A"}, | ||
C: { type: ["B" ,"A"]} | ||
} | ||
},ts.builtInRegistry()); | ||
var tp=tps.getType("C") | ||
var nt=nm.toNominal(tp,x=>null); | ||
assert.isTrue(nt.superTypes().length==2); | ||
}); | ||
}); |
@@ -17,2 +17,3 @@ { | ||
"gitUrl" : "https://github.com/raml-org/typesystem-ts.git", | ||
"gitBranch" : false, | ||
"installTypings" : true | ||
@@ -19,0 +20,0 @@ }, |
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
1787937
40202