MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / buildProjection

Function buildProjection

packages/hydrooj/src/utils.ts:4–8  ·  view source on GitHub ↗
(fields: readonly T[])

Source from the content-addressed store, hash-verified

2import { Service } from './context';
3
4export function buildProjection<T extends string | number = string>(fields: readonly T[]): Record<T, true> {
5 const o: Record<T, true> = Object.create(null);
6 for (const k of fields) o[k] = true;
7 return o;
8}
9
10export const log2 = (val: bigint | number) => {
11 if (typeof val === 'bigint') {

Callers 11

getFunction · 0.90
getMultiFunction · 0.90
getMultiFunction · 0.90
getHistoryFunction · 0.90
getMethod · 0.90
getListMethod · 0.90
getMultiMethod · 0.90
getListForRenderMethod · 0.90
getListMethod · 0.90
getMethod · 0.90
messageMethod · 0.90

Calls 1

createMethod · 0.80

Tested by

no test coverage detected