This repository was archived by the owner on Aug 17, 2025. It is now read-only.
Repository navigation
1.4.0
aepl v1.4 🍎
- updated directory stuff
- more compact because less files
extensions
used for extending properties and functions from another class externally from class declarations
extend()
extending from both props and funcs
alts:
- ext()
extendFunctions()
extending from only a class' functions
alts:
- extendFuncs()
- extendF()
- extFuncs()
- extF()
extendProperties()
extending from only a class' properties
alts:
- extendProps()
- extendP()
- extProps()
- extP()
const cl = require('aepl');
// class to extend from
class Ext {
constructor(var1) {
this.var1 = var1
}
test1() {
return this.var1;
}
test2() {
return this.var2;
}
}
// class extends from the extension class
cl.init("Example", class {
constructor(var2) {
this.var2 = var2;
this.extend(Ext, "abc");
}
});
let ex = new Example( "def" );
console.log(ex); // Example { var1: 'abc', var2: 'def' }
console.log(ex.test1()); // 'abc'
console.log(ex.test2()); // 'def'