/
ai_sampletext
/
DiplomWork
Обзор
Документация
Войти
/
ai_sampletext
/
DiplomWork
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
node_modules/drizzle-orm/entity.js
31 строка
867 B
boolyshareyo
Initial commit
08 июн 2026, 16:00
08 июн 2026, 16:00
6216a29
Код
Авторство
О чём код?
const entityKind = Symbol.for("drizzle:entityKind"); const hasOwnEntityKind = Symbol.for("drizzle:hasOwnEntityKind"); function is(value, type) { if (!value || typeof value !== "object") { return false; } if (value instanceof type) { return true; } if (!Object.prototype.hasOwnProperty.call(type, entityKind)) { throw new Error( `Class "${type.name ?? "<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.` ); } let cls = Object.getPrototypeOf(value).constructor; if (cls) { while (cls) { if (entityKind in cls && cls[entityKind] === type[entityKind]) { return true; } cls = Object.getPrototypeOf(cls); } } return false; } export { entityKind, hasOwnEntityKind, is }; //# sourceMappingURL=entity.js.map