feat(Vector)

This commit is contained in:
2025-07-23 10:36:50 +03:00
parent 83c491ff6f
commit aca4539ce4
21 changed files with 1103 additions and 1533 deletions

View File

@ -1,28 +1,31 @@
export function satisfiesConcept(obj, pure_virtual, virtual, debug) {
if (typeof obj !== 'object' || obj === null) {
return false;
}
}
const desc = Object.getOwnPropertyDescriptors(obj.constructor.prototype)
if (debug) {
const missingMethods = []
pure_virtual.forEach((method) => {
if (typeof obj[method] !== 'function') {
if (method in desc == false) {
missingMethods.push(method)
}
})
virtual.forEach((method) => {
if (!(method in obj)) {
if (method in obj == false) {
missingMethods.push(method)
}
})
if (missingMethods.length !== 0) {
console.debug(obj.constructor.name, missingMethods)
console.debug('this class doesn\'t have methods', obj.constructor.name, missingMethods)
return false
}
} else {
if (!pure_virtual.every((method) => typeof obj[method] === 'function')) {
if (!pure_virtual.every((method) => method in desc)) {
return false;
}