ng-typeview
Advanced tools
Comparing version
@@ -122,9 +122,8 @@ "use strict"; | ||
function parseModuleState(prop) { | ||
var objectLiteralFields = prop.properties | ||
.map(function (e) { return exports.maybeIdentifier(e.name); }) | ||
.filter(function (i) { return i.isSome(); }) | ||
.map(function (i) { return i.getOrThrow().text; }); | ||
if ((objectLiteralFields.indexOf("url") >= 0) && | ||
(objectLiteralFields.indexOf("templateUrl") >= 0) && | ||
(objectLiteralFields.indexOf("controller") >= 0)) { | ||
var objectLiteralFields = prelude_ts_1.Vector.ofIterable(prop.properties) | ||
.mapOption(function (e) { return exports.maybeIdentifier(e.name); }) | ||
.map(function (i) { return i.text; }); | ||
if ((objectLiteralFields.contains("url")) && | ||
(objectLiteralFields.contains("templateUrl")) && | ||
(objectLiteralFields.contains("controller"))) { | ||
// seems like I got a state controller/view declaration | ||
@@ -334,2 +333,8 @@ var controllerName = objectLiteralGetStringLiteralField("controller", prelude_ts_1.Vector.ofIterable(prop.properties)); | ||
} | ||
if (node.kind === ts.SyntaxKind.VariableStatement) { | ||
nonExportedDeclarations.push(node.getText()); | ||
} | ||
if (node.kind === ts.SyntaxKind.EnumDeclaration) { | ||
nonExportedDeclarations.push(node.getText()); | ||
} | ||
} | ||
@@ -336,0 +341,0 @@ if (node.kind === ts.SyntaxKind.ModuleDeclaration) { |
@@ -126,3 +126,6 @@ "use strict"; | ||
"interface NotScope2 extends NotScope {\n f1: (x:string)=>boolean;\n }", | ||
"class NotScopeClass {\n field?: number;\n constructor(public f2: number);\n }" | ||
"class NotScopeClass {\n field?: number;\n constructor(public f2: number) {\n field = myVarUsedByClass;\n }\n }", | ||
"const myVarUsedByClass = 5;", | ||
"enum X {\n A\n }", | ||
"const severityCellTemplate = checkViewFragment(`<div class=\"ngCellText\" ng-style=\"{'background-color': getColor(row.entity)}\">\n{{ row.entity.severity }}\n</div>`);" | ||
], scopeInfo.nonExportedDeclarations); | ||
@@ -129,0 +132,0 @@ return [2 /*return*/]; |
{ | ||
"name": "ng-typeview", | ||
"version": "0.0.36", | ||
"version": "0.0.37", | ||
"description": "library to enable type-checking of angular views when using typescript", | ||
@@ -33,3 +33,3 @@ "keywords": [ | ||
"@types/parsimmon": "1.3.0", | ||
"prelude.ts": "0.4.2" | ||
"prelude.ts": "0.5.0" | ||
}, | ||
@@ -36,0 +36,0 @@ "devDependencies": { |
@@ -83,3 +83,7 @@ import * as assert from 'assert' | ||
"interface NotScope2 extends NotScope {\n f1: (x:string)=>boolean;\n }", | ||
"class NotScopeClass {\n field?: number;\n constructor(public f2: number);\n }" | ||
"class NotScopeClass {\n field?: number;\n constructor(public f2: number) {\n field = myVarUsedByClass;\n }\n }", | ||
"const myVarUsedByClass = 5;", | ||
"enum X {\n A\n }", | ||
"const severityCellTemplate = checkViewFragment(`<div class=\"ngCellText\" ng-style=\"{'background-color': getColor(row.entity)}\">\n{{ row.entity.severity }}\n</div>`);" | ||
], | ||
@@ -86,0 +90,0 @@ scopeInfo.nonExportedDeclarations); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
215867
6.28%42
2.44%2649
0.42%+ Added
- Removed
Updated