Skip to content

Commit

Permalink
Decaffeinate from CoffeeScript to regular JavaScript
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenyeargin committed Dec 21, 2023
1 parent 32bfb6c commit 18736e1
Show file tree
Hide file tree
Showing 11 changed files with 5,678 additions and 1,824 deletions.
16 changes: 16 additions & 0 deletions .eslintrc.js
@@ -0,0 +1,16 @@
module.exports = {
env: {
browser: true,
commonjs: true,
es2021: true,
},
extends: 'airbnb-base',
overrides: [
],
parserOptions: {
ecmaVersion: 'latest',
},
rules: {
'no-param-reassign': ['error', { props: false }],
},
};
12 changes: 0 additions & 12 deletions index.coffee

This file was deleted.

21 changes: 21 additions & 0 deletions index.js
@@ -0,0 +1,21 @@
const fs = require('fs');
const path = require('path');

module.exports = function (robot, scripts) {
const scriptsPath = path.resolve(__dirname, 'src');
if (fs.existsSync(scriptsPath)) {
return (() => {
const result = [];
for (const script of Array.from(fs.readdirSync(scriptsPath).sort())) {
if ((scripts != null) && !Array.from(scripts).includes('*')) {
if (Array.from(scripts).includes(script)) { result.push(robot.loadFile(scriptsPath, script)); } else {
result.push(undefined);
}
} else {
result.push(robot.loadFile(scriptsPath, script));
}
}
return result;
})();
}
};

0 comments on commit 18736e1

Please sign in to comment.