Skip to content

Commit

Permalink
Patched /private/var/folders/19/08z9_xys69v3f1xfqtyn9jyw0000gn/T/tmp6…
Browse files Browse the repository at this point in the history
…xh36d7v/tests/cicd/generate_docstring/js_test_file.py.js
  • Loading branch information
patched.codes[bot] committed Sep 2, 2024
1 parent c3b1137 commit 0a5147e
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions tests/cicd/generate_docstring/js_test_file.py.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,37 @@

function a_plus_b(a, b) {
/**
* Adds two numbers together.
* @param {number} a - The first number
* @param {number} b - The second number
* @returns {number} The sum of a and b
*/function a_plus_b(a, b) {
return a + b;
}

/**
* Executes a SQL query against a SQLite database.
* @param {Object} db - The SQLite database object.
* @param {string} query - The SQL query to execute.
* @param {function} callback - A callback function to be executed for each row returned by the query.
*/
const sqlite = (db, query, callback) => {
db.serialize(function () {
/**
* Executes a query on the database and iterates over the result set, calling the callback function for each row.
* @param {string} query - The SQL query to execute.
* @param {function} callback - The callback function to be called for each row in the result set. The callback function takes three arguments: the error object, the row object, and the row id.
* @returns {undefined}
*/ db.serialize(function () {
db.each(query, callback);
});
}

/**
* Compares two objects based on a specified key.
* @param {string} keymap - The key to compare.
* @param {object} a - The first object to compare.
* @param {object} b - The second object to compare.
* @returns {number} - Returns -1 if a is less than b, 1 if a is greater than b, and 0 if a is equal to b.
*/
const compare= function (keymap, a, b) {
if (a[keymap] < b[keymap]) {
return -1;
Expand Down

0 comments on commit 0a5147e

Please sign in to comment.