Files
lan-manager/web/node_modules/@probe.gl/log/dist/esm/utils/autobind.js
openclaw 0a5f6a8047 Initial commit: Lan-manager project code
- Go backend (server/)
- Frontend (web/, server/static/)
- Database and deployment files
- Scripts and docs

Co-Authored-By: 狸花猫/Claude-Qwen3.6-Plus 🐾
2026-04-20 00:52:58 +08:00

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