- Go backend (server/)
- Frontend (web/, server/static/)
- Database and deployment files
- Scripts and docs
Co-Authored-By: 狸花猫/Claude-Qwen3.6-Plus 🐾
14 lines
458 B
JavaScript
14 lines
458 B
JavaScript
export function autobind(obj) {
|
|
let predefined = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['constructor'];
|
|
const proto = Object.getPrototypeOf(obj);
|
|
const propNames = Object.getOwnPropertyNames(proto);
|
|
|
|
for (const key of propNames) {
|
|
if (typeof obj[key] === 'function') {
|
|
if (!predefined.find(name => key === name)) {
|
|
obj[key] = obj[key].bind(obj);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//# sourceMappingURL=autobind.js.map
|