Skip to content

Commit d62b944

Browse files
committed
JS: Explain difference between type and member
1 parent aec82f6 commit d62b944

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docs/codeql/codeql-language-guides/customizing-library-models-for-javascript.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,17 @@ We can recognize this using the following extension:
166166

167167
This works in this example because the **connection** parameter has a type annotation that matches what the model is looking for.
168168

169+
Note that there is a significant difference between the following two rows:
170+
171+
.. code-block:: yaml
172+
173+
data:
174+
- ["mysql.Connection", "", ...]
175+
- ["mysql", "Member[Connection]", ...]
176+
177+
The first row matches instances of **mysql.Connection** which are objects that encapsulate a MySQL connection.
178+
The second row would match something like **require('mysql').Connection**, which is not itself a connection object.
179+
169180
In the next section, we'll show how to generalize the model to handle the absence of type annotations.
170181

171182
Continued example: Dealing with untyped code

0 commit comments

Comments
 (0)