decord/source/utils/BasicPermissionUtils.tsx

29 lines
856 B
TypeScript
Raw Normal View History

2026-08-15 05:55:55 +00:00
// Module ID: 4029
// Function ID: 4030
2026-07-29 08:29:29 +00:00
// Name: has
// Dependencies: [506, 2]
2026-07-20 16:05:17 +00:00
2026-08-15 05:55:55 +00:00
// Module 4029 (has)
2026-07-29 08:29:29 +00:00
const result = require("set").fileFinishedImporting("utils/BasicPermissionUtils.tsx");
const prototype = function BasicPermissionUtils() {
return Object.create(new.target.prototype);
}.prototype;
prototype["has"] = function has(arg0, arg1) {
2026-08-12 06:57:52 +00:00
return (arg0 & arg1) === arg1;
2026-07-29 08:29:29 +00:00
};
prototype["asBasicFlag"] = function asBasicFlag(permissions) {
2026-08-12 06:57:52 +00:00
return importAll(506).asUintN(24, permissions);
2026-07-29 08:29:29 +00:00
};
prototype["asBigFlag"] = function asBigFlag(VIEW_CHANNEL) {
const self = this;
if (!Object.hasOwn(this.cache, VIEW_CHANNEL)) {
self.cache[VIEW_CHANNEL] = importAll(506).deserialize(VIEW_CHANNEL);
const obj = importAll(506);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return self.cache[VIEW_CHANNEL];
};
prototype.cache = {};
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default prototype;
2026-08-12 06:57:52 +00:00
export const MAXIMUM_BITS = 24;