@fluffy-spoon/csharp-parser
Advanced tools
Comparing version 1.0.126 to 1.0.128
{ | ||
"name": "@fluffy-spoon/csharp-parser", | ||
"version": "1.0.126", | ||
"version": "1.0.128", | ||
"description": "Parses C# code as well as possible into TypeScript objects.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/src/Index", |
@@ -132,3 +132,3 @@ import { FileParser } from '../src/FileParser'; | ||
expect(file.namespaces[0].classes[0].attributes.length).toBe(2, "namespace class attributes length"); | ||
expect(file.namespaces[0].classes[0].fields.length).toBe(1, "namespace class fields length"); | ||
expect(file.namespaces[0].classes[0].fields.length).toBe(2, "namespace class fields length"); | ||
expect(file.namespaces[0].classes[0].methods.length).toBe(0, "namespace class methods length"); | ||
@@ -151,4 +151,8 @@ expect(file.namespaces[0].classes[0].constructors.length).toBe(1, "namespace class constructors length"); | ||
expect(file.namespaces[0].classes[0].fields[1].type.genericParameters[0].name).toBe("string", "namespace class field generic parameter name"); | ||
expect(file.namespaces[0].classes[0].fields[1].initialValue).toBe("new List<string>()", "namespace class field initial value"); | ||
expect(file.namespaces[0].classes[0].constructors[0].name).toBe("MyPoco", "namespace class constructor name"); | ||
expect(file.namespaces[0].classes[0].constructors[0].isConstructor).toBe(true, "namespace class constructor is constructor"); | ||
expect(file.namespaces[0].classes[0].constructors[0].isPublic).toBe(true, "namespace class constructor is public"); | ||
@@ -388,2 +392,19 @@ expect(file.namespaces[0].classes[0].attributes[1].name).toBe("SomeAttributeWithParameters", "namespace class attribute name"); | ||
describe("statics:", function () { | ||
it("should be able to detect statics", useCSharp('Static.cs', (parser) => { | ||
var file = parser.parseFile(); | ||
expect(file.classes[0].isPublic).toBe(true); | ||
expect(file.classes[0].isStatic).toBe(true); | ||
expect(file.classes[0].properties[0].isStatic).toBe(true); | ||
expect(file.classes[0].fields[0].isPublic).toBe(false); | ||
expect(file.classes[0].fields[0].isStatic).toBe(true); | ||
expect(file.classes[0].fields[0].isPublic).toBe(true); | ||
expect(file.classes[0].fields[0].isStatic).toBe(false); | ||
expect(file.classes[0].methods[0].isStatic).toBe(true); | ||
})); | ||
}); | ||
}); |
@@ -142,2 +142,3 @@ export class CSharpType implements CSharpGenericParameterContainer { | ||
isConstructor: boolean; | ||
isStatic: boolean; | ||
isVirtual: boolean; | ||
@@ -311,2 +312,4 @@ isBodyless: boolean; | ||
isStatic: boolean; | ||
innerScopeText: string; | ||
@@ -418,5 +421,7 @@ name: string; | ||
isPublic: boolean; | ||
isStatic: boolean; | ||
isReadOnly: boolean; | ||
attributes: CSharpAttribute[]; | ||
initialValue?: string; | ||
@@ -443,2 +448,3 @@ constructor(name: string) { | ||
isStatic: boolean; | ||
isVirtual: boolean; | ||
@@ -445,0 +451,0 @@ |
Sorry, the diff of this file is not supported yet
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
0
102298
39
2249