decord/source/utils/BasicPermissionUtils.tsx

32 lines
924 B
TypeScript
Raw Normal View History

2026-09-01 10:26:29 +00:00
// Module ID: 4129
// Function ID: 4130
2026-07-29 08:29:29 +00:00
// Name: has
2026-09-02 09:53:35 +00:00
// Dependencies: [503, 2]
2026-07-20 16:05:17 +00:00
2026-09-01 10:26:29 +00:00
// Module 4129 (has)
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
2026-09-02 09:53:35 +00:00
import fromStringAll from "fromString" /* 503 */;
2026-08-24 06:08:38 +00:00
const result = set.fileFinishedImporting("utils/BasicPermissionUtils.tsx");
2026-07-29 08:29:29 +00:00
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-24 06:08:38 +00:00
return fromStringAll.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)) {
2026-08-24 06:08:38 +00:00
self.cache[VIEW_CHANNEL] = fromStringAll.deserialize(VIEW_CHANNEL);
const obj = fromStringAll;
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;