code-gauge 4.2.0 → 4.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/native/src/functions.rs +8 -1
- package/package.json +8 -8
package/native/src/functions.rs
CHANGED
|
@@ -273,8 +273,15 @@ pub fn find_function_name(node: Node<'_>, code: &Source<'_>) -> Option<String> {
|
|
|
273
273
|
};
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
+
// A JavaScript class field (`handle = () => {}`) names its property through the `property`
|
|
277
|
+
// field; TypeScript's `public_field_definition` exposes the same thing as `name`.
|
|
278
|
+
let field_name = if parent.kind() == "field_definition" {
|
|
279
|
+
"property"
|
|
280
|
+
} else {
|
|
281
|
+
"name"
|
|
282
|
+
};
|
|
276
283
|
parent
|
|
277
|
-
.child_by_field_name(
|
|
284
|
+
.child_by_field_name(field_name)
|
|
278
285
|
.map(|name| node_text(name, code).to_string())
|
|
279
286
|
}
|
|
280
287
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "code-gauge",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.1",
|
|
4
4
|
"description": "Measure code metrics with tree-sitter.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -89,12 +89,12 @@
|
|
|
89
89
|
"registry": "https://registry.npmjs.org/"
|
|
90
90
|
},
|
|
91
91
|
"optionalDependencies": {
|
|
92
|
-
"code-gauge-linux-x64-gnu": "4.2.
|
|
93
|
-
"code-gauge-linux-arm64-gnu": "4.2.
|
|
94
|
-
"code-gauge-linux-x64-musl": "4.2.
|
|
95
|
-
"code-gauge-linux-arm64-musl": "4.2.
|
|
96
|
-
"code-gauge-darwin-x64": "4.2.
|
|
97
|
-
"code-gauge-darwin-arm64": "4.2.
|
|
98
|
-
"code-gauge-win32-x64-msvc": "4.2.
|
|
92
|
+
"code-gauge-linux-x64-gnu": "4.2.1",
|
|
93
|
+
"code-gauge-linux-arm64-gnu": "4.2.1",
|
|
94
|
+
"code-gauge-linux-x64-musl": "4.2.1",
|
|
95
|
+
"code-gauge-linux-arm64-musl": "4.2.1",
|
|
96
|
+
"code-gauge-darwin-x64": "4.2.1",
|
|
97
|
+
"code-gauge-darwin-arm64": "4.2.1",
|
|
98
|
+
"code-gauge-win32-x64-msvc": "4.2.1"
|
|
99
99
|
}
|
|
100
100
|
}
|