refactor: move remaining language examples to fixture files

This commit is contained in:
Paul Gauthier (aider) 2024-11-27 07:05:10 -08:00
parent 44ceb8f1a0
commit 8c218e9edc
6 changed files with 89 additions and 0 deletions

View file

@ -0,0 +1,26 @@
// Class definition
class Person {
constructor(name) {
this.name = name;
}
sayHello() {
return `Hello, ${this.name}!`;
}
}
// Function declaration
function greet(person) {
return person.sayHello();
}
// Variables and constants
const DEFAULT_NAME = 'World';
let currentPerson = new Person(DEFAULT_NAME);
// Export for use in other modules
module.exports = {
Person,
greet,
DEFAULT_NAME
};