Skip to content

Commit 413a0ae

Browse files
author
patched.codes[bot]
committed
Patched tests/cicd/generate_docstring/js_test_file.py.js
1 parent 76bf69b commit 413a0ae

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/cicd/generate_docstring/js_test_file.py.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
11

2+
/**
3+
* Adds two numbers.
4+
* @param {number} a - The first number to add.
5+
* @param {number} b - The second number to add.
6+
* @returns {number} The sum of the two numbers.
7+
*/
28
function a_plus_b(a, b) {
39
return a + b;
410
}
511

12+
/**
13+
* Compares two objects based on the values associated with a specified key.
14+
* @param {string} keymap - The key used to compare the two objects.
15+
* @param {Object} a - The first object for comparison.
16+
* @param {Object} b - The second object for comparison.
17+
* @returns {number} - Returns -1 if the value of a is less than b, 1 if greater, and 0 if they are equal.
18+
*/
619
const compare = function (keymap, a, b) {
720
if (a[keymap] < b[keymap]) {
821
return -1;
@@ -13,6 +26,14 @@ const compare = function (keymap, a, b) {
1326
}
1427
}
1528

29+
/**
30+
* Executes a query on an SQLite database and applies a callback function on each result.
31+
* @param {Object} db - The SQLite database connection object.
32+
* @param {string} query - The SQL query string to execute.
33+
* @param {Function} callback - A callback function to be executed for each row in the query result.
34+
* @returns {void} No return value.
35+
*/
36+
1637
const sqlite = (db, query, callback) => {
1738
db.serialize(function () {
1839
db.each(query, callback);

0 commit comments

Comments
 (0)