raml-1-parser
Advanced tools
Comparing version 1.1.39 to 1.1.40
@@ -202,3 +202,3 @@ "use strict"; | ||
var master = node.getMaster(); | ||
node = master ? master.asElement() : null; | ||
node = master && master !== node ? master.asElement() : null; | ||
} | ||
@@ -205,0 +205,0 @@ return x.wrapperNode(); |
@@ -303,3 +303,3 @@ "use strict"; | ||
var includePath; | ||
if (path.isAbsolute(value) || ll.isWebPath(value)) { | ||
if (ll.isWebPath(value)) { | ||
includePath = libUnit.absolutePath(); | ||
@@ -306,0 +306,0 @@ } |
@@ -106,1 +106,2 @@ import hl = require("../../parser/highLevelAST"); | ||
export declare function isParametersProperty(p: hl.IProperty): boolean; | ||
export declare function canBeFragment(type: hl.INodeDefinition | hl.ITypeDefinition): boolean; |
@@ -650,2 +650,6 @@ "use strict"; | ||
exports.isParametersProperty = isParametersProperty; | ||
function canBeFragment(type) { | ||
return isResourceTypeType(type) || isTraitType(type) || isExampleSpecType(type) || isSecuritySchemaType(type) || isTypeDeclarationDescendant(type); | ||
} | ||
exports.canBeFragment = canBeFragment; | ||
//# sourceMappingURL=universeHelpers.js.map |
@@ -14,2 +14,5 @@ import lowLevel = require("../parser/lowLevelAST"); | ||
promiseResolve(arg: any): Promise<any>; | ||
rootPath(): string; | ||
isWebPath(p: string): boolean; | ||
relativePath(from: any, to: any): string; | ||
} |
@@ -84,2 +84,11 @@ "use strict"; | ||
}; | ||
ContentProvider.prototype.rootPath = function () { | ||
return this.unit.project().getRootPath(); | ||
}; | ||
ContentProvider.prototype.isWebPath = function (p) { | ||
return ll.isWebPath(p); | ||
}; | ||
ContentProvider.prototype.relativePath = function (from, to) { | ||
return path.relative(from, to); | ||
}; | ||
return ContentProvider; | ||
@@ -86,0 +95,0 @@ }()); |
@@ -55,1 +55,2 @@ import coreApi = require("../parser/wrapped-ast/parserCoreApi"); | ||
} | ||
export declare function isEmpty(nc: nominals.ITypeDefinition): boolean; |
@@ -17,2 +17,3 @@ "use strict"; | ||
var def = require("raml-definition-system"); | ||
var yaml = require("yaml-ast-parser"); | ||
var hlImpl = require("../parser/highLevelImpl"); | ||
@@ -366,5 +367,29 @@ var builder = require("../parser/ast.core/builder"); | ||
var hasType = highLevelNode.definition().universe().type(universe.Universe10.LibraryBase.name); | ||
var tNode = new hlImpl.ASTNodeImpl(x, highLevelNode, td, hasType.property(universe.Universe10.LibraryBase.properties.types.name)); | ||
tNode.patchType(builder.doDescrimination(tNode)); | ||
value = _this.dumpInternal(tNode.wrapperNode(), false, nodeProperty); | ||
var tNode = void 0; | ||
var llNode = x; | ||
var itemType = void 0; | ||
var stop_1; | ||
do { | ||
stop_1 = true; | ||
tNode = new hlImpl.ASTNodeImpl(llNode, highLevelNode, td, hasType.property(universe.Universe10.LibraryBase.properties.types.name)); | ||
itemType = builder.doDescrimination(tNode); | ||
var itemsLocalType = tNode.localType(); | ||
if (itemsLocalType && isEmpty(itemsLocalType) && itemType.superTypes().length == 1) { | ||
var tChildren = llNode.children().filter(function (y) { return y.key() == "type"; }); | ||
if (tChildren.length == 1) { | ||
if (tChildren[0].resolvedValueKind() == yaml.Kind.SCALAR) { | ||
value = tChildren[0].value(); | ||
break; | ||
} | ||
else { | ||
llNode = tChildren[0]; | ||
stop_1 = false; | ||
} | ||
} | ||
} | ||
} while (!stop_1); | ||
if (value == null) { | ||
tNode.patchType(itemType); | ||
value = _this.dumpInternal(tNode.wrapperNode(), false, nodeProperty); | ||
} | ||
propName = x.key(); | ||
@@ -1228,2 +1253,26 @@ } | ||
}()); | ||
function isEmpty(nc) { | ||
if (nc.properties().length) { | ||
return false; | ||
} | ||
if (nc.annotations().length) { | ||
return false; | ||
} | ||
if (nc.facets().length) { | ||
return false; | ||
} | ||
var fixedFacets = nc.fixedFacets(); | ||
if (fixedFacets && Object.keys(fixedFacets).length) { | ||
return false; | ||
} | ||
var fixedBuiltinFacets = nc.fixedBuiltInFacets(); | ||
if (fixedBuiltinFacets && Object.keys(fixedBuiltinFacets).length) { | ||
return false; | ||
} | ||
if (nc.description()) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
exports.isEmpty = isEmpty; | ||
//# sourceMappingURL=jsonSerializer.js.map |
{ | ||
"name": "raml-1-parser", | ||
"version": "1.1.39", | ||
"version": "1.1.40", | ||
"main": "dist/index.js", | ||
@@ -37,3 +37,2 @@ "scripts": { | ||
"promise-polyfill": "6.0.2", | ||
"marked": "0.3.6", | ||
"media-typer": "0.3.0", | ||
@@ -43,3 +42,3 @@ "mkdirp": "0.5.1", | ||
"q": "1.5.0", | ||
"raml-definition-system": "0.0.77", | ||
"raml-definition-system": "0.0.78", | ||
"ts-structure-parser": "0.0.16", | ||
@@ -93,2 +92,3 @@ "ts-model": "0.0.17", | ||
"json-loader": "0.5.7", | ||
"marked": "0.3.9", | ||
"dev-env-installer": "0.0.14", | ||
@@ -95,0 +95,0 @@ "atom-text-typer" : "0.0.1", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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 too big to display
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
Sorry, the diff of this file is too big to display
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
5543720
25
74184
25
+ Addedraml-definition-system@0.0.78(transitive)
+ Addedraml-typesystem@0.0.83(transitive)
- Removedmarked@0.3.6
- Removedmarked@0.3.6(transitive)
- Removedraml-definition-system@0.0.77(transitive)
- Removedraml-typesystem@0.0.82(transitive)