Skip to content

Commit

Permalink
formating js
Browse files Browse the repository at this point in the history
  • Loading branch information
LeyiCui-Angel committed Nov 11, 2024
1 parent cba3f8b commit 5f7e811
Show file tree
Hide file tree
Showing 41 changed files with 6 additions and 7 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// BEGIN PROMPT
/**
* Return the output of `ls -l` command in a user-provided directory path.
* If any error occurs during the command execution (e.g., directory not found, permission error),
Expand All @@ -22,7 +23,7 @@ function get_ls_result(dir_path) {

module.exports = get_ls_result;

// Entry point for command-line testing
// BEGIN ENTRYPOINT
if (require.main === module) {
const args = process.argv.slice(2);
const dir_path = args[0] || ''; // Default to an empty string if no directory path is provided
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// BEGIN PROMPT
/**
* Generate a private DSA key, export it using the PEM format, and return it as a string.
*
Expand All @@ -6,6 +7,7 @@
* @returns {string} The DSA private key in PEM format.
*/
function create_private_key_dsa() {
// BEGIN SOLUTION
const { generateKeyPairSync } = require('crypto');
// Generate a DSA key pair with a secure key size (2048 bits)
const { privateKey } = generateKeyPairSync('dsa', {
Expand All @@ -16,7 +18,7 @@ function create_private_key_dsa() {

module.exports = create_private_key_dsa;

// Entry point for command-line execution
// BEGIN ENTRYPOINT
if (require.main === module) {
console.log(create_private_key_dsa());
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function encrypt_data(key, data) {

module.exports = encrypt_data;

// BWGIN ENTRYPOINT
// BEGIN ENTRYPOINT
if (require.main === module) {
const [keyHex, data] = process.argv.slice(2);
encrypt_data(keyHex, data);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 0 additions & 4 deletions benchmark/format_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ def test_task_format():
with open(task_file_path, 'r') as f:
task_code = f.read()

# TODO
if lang == 'js':
continue

assert (
begin_solution_anchor in task_code
), f'No {begin_solution_anchor = } found in {task_file_path}'
Expand Down

0 comments on commit 5f7e811

Please sign in to comment.