type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
FunctionDeclaration |
export function constructWorkloadMetadata(workload: IWorkload): IWorkloadMetadataPayload {
if (!workload) {
throw new Error('can\'t build workload metadata payload for undefined workload');
}
const workloadLocator: IWorkloadLocator = {
userLocator: config.INTEGRATION_ID,
cluster: workload.cluster,
... | mariasnyk/kubernetes-monitor | src/transmitter/payload.ts | TypeScript |
FunctionDeclaration |
export function constructDeleteWorkload(
localWorkloadLocator: ILocalWorkloadLocator,
): IDeleteWorkloadPayload {
return {
workloadLocator: {
...localWorkloadLocator,
userLocator: config.INTEGRATION_ID,
cluster: currentClusterName,
},
agentId: config.AGENT_ID,
};
} | mariasnyk/kubernetes-monitor | src/transmitter/payload.ts | TypeScript |
ArrowFunction |
(scannedImage): IDependencyGraphPayload => {
// We know that .find() won't return undefined
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const kubeWorkload: IWorkload = workloadMetadata.find((meta) => meta.imageName === scannedImage.imageWithTag)!;
const { cluster, namespace, t... | mariasnyk/kubernetes-monitor | src/transmitter/payload.ts | TypeScript |
ArrowFunction |
(meta) => meta.imageName === scannedImage.imageWithTag | mariasnyk/kubernetes-monitor | src/transmitter/payload.ts | TypeScript |
InterfaceDeclaration | /*
* JSnoX requires an object with a createElement method.
* This will normally be the React object but could be something else
*/
interface ReactLikeObject {
createElement<P>(type: React.ComponentClass<P> | string, props: P, children: React.ReactNode): React.ReactElement<P>;
} | Danlock/DefinitelyTyped | types/jsnox/index.d.ts | TypeScript |
InterfaceDeclaration |
interface CreateElement {
/**
* Renders an HTML element from the given spec string, with children but without
* extra props.
* @param specString A string that defines a component in a way that resembles
* CSS selectors. Eg. "input:email#foo.bar.baz[name=email][required]"
* @param children ... | Danlock/DefinitelyTyped | types/jsnox/index.d.ts | TypeScript |
TypeAliasDeclaration |
type Module = (reactObj: ReactLikeObject) => CreateElement; | Danlock/DefinitelyTyped | types/jsnox/index.d.ts | TypeScript |
ArrowFunction |
(bannerState: BannerState) => {
window.localStorage.setItem("bannerState", JSON.stringify(bannerState));
} | naomike/neurotechjp | src/components/Banner.tsx | TypeScript |
ArrowFunction |
() => {
const rawData = window.localStorage.getItem("bannerState");
if (rawData === null) return;
return JSON.parse(rawData) as BannerState;
} | naomike/neurotechjp | src/components/Banner.tsx | TypeScript |
ArrowFunction |
props => {
const { children } = props;
const [bannerState, setBannerState] = useState<BannerState>("Close");
useEffect(() => {
const currentBannerState = getBannerStateFromLocalStorage() ?? "Open";
setBannerState(currentBannerState);
}, []);
const onClickCloseButton = () => {
setBannerState("Cl... | naomike/neurotechjp | src/components/Banner.tsx | TypeScript |
ArrowFunction |
() => {
const currentBannerState = getBannerStateFromLocalStorage() ?? "Open";
setBannerState(currentBannerState);
} | naomike/neurotechjp | src/components/Banner.tsx | TypeScript |
ArrowFunction |
() => {
setBannerState("Close");
storeBannerStateToLocalStorate("Close");
} | naomike/neurotechjp | src/components/Banner.tsx | TypeScript |
TypeAliasDeclaration |
type BannerProps = {
children: React.ReactNode;
}; | naomike/neurotechjp | src/components/Banner.tsx | TypeScript |
TypeAliasDeclaration |
type BannerState = "Close" | "Open"; | naomike/neurotechjp | src/components/Banner.tsx | TypeScript |
ArrowFunction |
({
children,
isHovered,
isPressed,
isDisabled,
isFocused,
isLoading,
dashed,
bordered,
transparent,
...otherProps
}, forwardedRef) => (
<BlankState
{...otherProps} | Sanshit-sagar/shiny-computing-machine | components/BlankState/styles.tsx | TypeScript |
FunctionDeclaration |
export declare function str2ab(str: any): ArrayBuffer; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
FunctionDeclaration |
export declare function ab2str(buf: any): any; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
FunctionDeclaration |
export declare function bytesToHex(bytes: any): string; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
FunctionDeclaration |
export declare function hexToBytes(hex: any): Uint8Array; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
FunctionDeclaration |
export declare function generateRandomString(): any; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
FunctionDeclaration |
export declare function decrypt(data: any, password: any): Promise<any>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
FunctionDeclaration |
export declare function encrypt(data: any, password: any): Promise<any>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
FunctionDeclaration |
export declare function encryptHex(data: any, password: any): Promise<string>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
FunctionDeclaration |
export declare function decryptFile(file: any, password: any, type?: any): Promise<unknown>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
FunctionDeclaration |
export declare function encryptFile(file: any, password: any): Promise<any[]>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
FunctionDeclaration |
export declare function encryptFileStream(file: any, password: any): Promise<any>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
FunctionDeclaration |
export declare function decryptFileStream(file: any, password: any): Promise<any>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
FunctionDeclaration |
export declare function generateEncryptedKey(password: any): Promise<{
encryptedKey: any;
key: any;
}>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
FunctionDeclaration |
export declare function hmacSign(msg: any, key: any): Promise<any>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
FunctionDeclaration |
export declare function exportJwk(key: any): Promise<any>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
FunctionDeclaration |
export declare function importJwk(jwk: any): Promise<any>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
FunctionDeclaration |
export declare function jwkToPem(jwk: any, opts?: any): string; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
FunctionDeclaration |
export declare function pemToJwk(pem: any): any; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
FunctionDeclaration |
export declare function getPublicJwk(jwk: any): any; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
ClassDeclaration |
export declare class AESKey {
_password: any;
_key: any;
constructor(options?: any);
encrypted(password: string): Promise<{
encryptedKey: any;
key: any;
}>;
importSecretKey(password?: string): Promise<any>;
deriveEncryptionSecretKey(salt: any, secretKey?: crypto.webcrypto.Cr... | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
ClassDeclaration |
declare class ExportedKey {
key: crypto.KeyObject;
type: any;
_bytes: Uint8Array;
constructor(key: crypto.KeyObject, type?: string);
bytes(): Promise<Uint8Array>;
base64(): string;
pem(): string;
toString(): any;
toHex(): string;
encrypt(password: string): Promise<any>;
} | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
ClassDeclaration |
export declare class ECDHKeyPair {
_pair: any;
_raw: any;
constructor(raw?: any);
static generate(): Promise<ECDHKeyPair>;
get privateKey(): any;
get publicKey(): any;
deriveKey(publicKey: any): Promise<any>;
exportPrivateKey(): Promise<ExportedKey>;
exportPublicKey(): Promise<Expor... | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
ClassDeclaration |
export declare class HMAC {
_password: string;
_secretKey: string;
_salt: string;
_raw: any;
_key: any;
useSalt: boolean;
constructor(raw?: any, useSalt?: boolean);
importKey(): Promise<any>;
key(): Promise<any>;
verify(message: any, signature: any): Promise<any>;
sign(messa... | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
MethodDeclaration |
encrypted(password: string): Promise<{
encryptedKey: any;
key: any;
}>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
MethodDeclaration |
importSecretKey(password?: string): Promise<any>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
MethodDeclaration |
deriveEncryptionSecretKey(salt: any, secretKey?: crypto.webcrypto.CryptoKey): Promise<any>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
MethodDeclaration |
deriveDecryptionSecretKey(salt: any, secretKey?: crypto.webcrypto.CryptoKey): Promise<any>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
MethodDeclaration |
encrypt(bytes: any): Promise<any>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
MethodDeclaration |
_encrypt(bytes: any, salt: any, derivedKey: any): Promise<any>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
MethodDeclaration |
decrypt(bytes: any): Promise<any>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
MethodDeclaration |
encryptFileStream(filePath: string): Promise<unknown>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
MethodDeclaration |
decryptFileStream(filePath: string): Promise<unknown>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
MethodDeclaration |
encryptFile(file: any): Promise<unknown>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
MethodDeclaration |
decryptFile(file: any, type?: any): Promise<unknown>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
MethodDeclaration |
export(): Promise<ExportedKey>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
MethodDeclaration |
bytes(): Promise<Uint8Array>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
MethodDeclaration |
base64(): string; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
MethodDeclaration |
pem(): string; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
MethodDeclaration |
toString(): any; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
MethodDeclaration |
encrypt(password: string): Promise<any>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
MethodDeclaration |
static generate(): Promise<ECDHKeyPair>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
MethodDeclaration |
deriveKey(publicKey: any): Promise<any>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
MethodDeclaration |
exportPrivateKey(): Promise<ExportedKey>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
MethodDeclaration |
exportPublicKey(): Promise<ExportedKey>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
MethodDeclaration |
exportDerivedAESKey(publicKey: any): Promise<ExportedKey>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
MethodDeclaration |
importPrivateKey(raw: any): Promise<any>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
MethodDeclaration |
importPublicKey(raw: any): Promise<any>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
MethodDeclaration |
importKey(): Promise<any>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
MethodDeclaration |
key(): Promise<any>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
MethodDeclaration |
verify(message: any, signature: any): Promise<any>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
MethodDeclaration |
sign(message: any): Promise<string>; | Grapheene/grapheene-node | dist/lib/encryption/Crypto/index.d.ts | TypeScript |
FunctionDeclaration |
function __setMockFile(newMockFile: object) {
mockFile = newMockFile;
} | Bubbit/simple-versioner | src/__mocks__/fs.ts | TypeScript |
FunctionDeclaration |
function readFileSync(filePath: string | number) {
return mockFile;
} | Bubbit/simple-versioner | src/__mocks__/fs.ts | TypeScript |
FunctionDeclaration |
function writeFileSync(path: string | number, data: any, options?: object): void{
} | Bubbit/simple-versioner | src/__mocks__/fs.ts | TypeScript |
FunctionDeclaration | /**
* Prompts the user for a boolean question
* @param title
* @param subtitle
*/
//% group="Gameplay"
//% weight=89 help=game/ask
//% blockId=gameask block="ask %title||%subtitle"
//% group="Prompt"
export function ask(title: string, subtitle?: string): boolean {
game.eventContext(); // ini... | DalavanCloud/pxt-common-packages | libs/game/ask.ts | TypeScript |
ArrowFunction |
() => answer = true | DalavanCloud/pxt-common-packages | libs/game/ask.ts | TypeScript |
ArrowFunction |
() => answer = false | DalavanCloud/pxt-common-packages | libs/game/ask.ts | TypeScript |
ArrowFunction |
() => answer !== null | DalavanCloud/pxt-common-packages | libs/game/ask.ts | TypeScript |
FunctionDeclaration |
export function memoizeProto<TSource>(
this: AsyncIterableX<TSource>,
readerCount?: number
): AsyncIterableX<TSource>; | 0xflotus/IxJS | src/add/asynciterable-operators/memoize.ts | TypeScript |
FunctionDeclaration |
export function memoizeProto<TSource, TResult>(
this: AsyncIterableX<TSource>,
readerCount?: number,
selector?: (value: AsyncIterable<TSource>) => AsyncIterable<TResult>
): AsyncIterableX<TResult>; | 0xflotus/IxJS | src/add/asynciterable-operators/memoize.ts | TypeScript |
FunctionDeclaration | /**
* @ignore
*/
export function memoizeProto<TSource, TResult = TSource>(
this: AsyncIterableX<TSource>,
readerCount: number = -1,
selector?: (value: AsyncIterable<TSource>) => AsyncIterable<TResult>
): AsyncIterableX<TSource | TResult> {
return memoize(this, readerCount, selector);
} | 0xflotus/IxJS | src/add/asynciterable-operators/memoize.ts | TypeScript |
InterfaceDeclaration |
interface AsyncIterableX<T> {
memoize: typeof memoizeProto;
} | 0xflotus/IxJS | src/add/asynciterable-operators/memoize.ts | TypeScript |
TypeAliasDeclaration |
export type ItemRO = { readonly id: string } | chantelle-lingerie/sales | src/readonlyInterfaces.ts | TypeScript |
TypeAliasDeclaration |
export type PriceRO = { readonly price: number } | chantelle-lingerie/sales | src/readonlyInterfaces.ts | TypeScript |
TypeAliasDeclaration |
export type QtyRO = { readonly qty: number } | chantelle-lingerie/sales | src/readonlyInterfaces.ts | TypeScript |
TypeAliasDeclaration |
export type ShippingRO = { readonly shipping: number } | chantelle-lingerie/sales | src/readonlyInterfaces.ts | TypeScript |
TypeAliasDeclaration |
export type TotalRO = { readonly total: number } | chantelle-lingerie/sales | src/readonlyInterfaces.ts | TypeScript |
TypeAliasDeclaration |
export type ItemsRO<T extends ItemRO> = { items: readonly T[] } | chantelle-lingerie/sales | src/readonlyInterfaces.ts | TypeScript |
TypeAliasDeclaration |
export type OrderRO<T extends TotalRO | ShippingRO | ItemsRO<ItemRO>> = T & {
invoiced: readonly T[],
refunded: readonly T[],
canceled: readonly T[],
} | chantelle-lingerie/sales | src/readonlyInterfaces.ts | TypeScript |
TypeAliasDeclaration |
export type ItemQtyRO = ItemRO & QtyRO | chantelle-lingerie/sales | src/readonlyInterfaces.ts | TypeScript |
TypeAliasDeclaration |
export type ItemTotalRO = ItemRO & TotalRO | chantelle-lingerie/sales | src/readonlyInterfaces.ts | TypeScript |
TypeAliasDeclaration |
export type CartItemRO = ItemQtyRO & PriceRO & Partial<TotalRO> | chantelle-lingerie/sales | src/readonlyInterfaces.ts | TypeScript |
TypeAliasDeclaration |
export type CartRO<T extends CartItemRO> = ItemsRO<T> & ShippingRO | chantelle-lingerie/sales | src/readonlyInterfaces.ts | TypeScript |
TypeAliasDeclaration |
export type CartTotalsRO<T extends CartItemRO & TotalRO> = CartRO<T> & TotalRO | chantelle-lingerie/sales | src/readonlyInterfaces.ts | TypeScript |
FunctionDeclaration | /**
* List all files in directory except those ignored by .nniignore.
* @param source
* @param destination
*/
export function* listDirWithIgnoredFiles(root: string, relDir: string, ignoreFiles: string[]): Iterable<string> {
let ignoreFile = undefined;
const source = path.join(root, relDir);
if (fs.exist... | 418sec/nni | ts/nni_manager/training_service/common/util.ts | TypeScript |
FunctionDeclaration | /**
* Validate codeDir, calculate file count recursively under codeDir, and throw error if any rule is broken
*
* @param codeDir codeDir in nni config file
* @returns file number under codeDir
*/
export async function validateCodeDir(codeDir: string): Promise<number> {
let fileCount: number = 0;
let fileTo... | 418sec/nni | ts/nni_manager/training_service/common/util.ts | TypeScript |
FunctionDeclaration | /**
* crete a new directory
* @param directory
*/
export async function execMkdir(directory: string, share: boolean = false): Promise<void> {
if (process.platform === 'win32') {
await cpp.exec(`powershell.exe New-Item -Path "${directory}" -ItemType "directory" -Force`);
} else if (share) {
aw... | 418sec/nni | ts/nni_manager/training_service/common/util.ts | TypeScript |
FunctionDeclaration | /**
* copy files to the directory
* @param source
* @param destination
*/
export async function execCopydir(source: string, destination: string): Promise<void> {
if (!fs.existsSync(destination))
await fs.promises.mkdir(destination);
for (const relPath of listDirWithIgnoredFiles(source, '', [])) {
... | 418sec/nni | ts/nni_manager/training_service/common/util.ts | TypeScript |
FunctionDeclaration | /**
* crete a new file
* @param filename
*/
export async function execNewFile(filename: string): Promise<void> {
if (process.platform === 'win32') {
await cpp.exec(`powershell.exe New-Item -Path "${filename}" -ItemType "file" -Force`);
} else {
await cpp.exec(`touch '${filename}'`);
}
... | 418sec/nni | ts/nni_manager/training_service/common/util.ts | TypeScript |
FunctionDeclaration | /**
* run script using powershell or bash
* @param filePath
*/
export function runScript(filePath: string): cp.ChildProcess {
if (process.platform === 'win32') {
return cp.exec(`powershell.exe -ExecutionPolicy Bypass -file "${filePath}"`);
} else {
return cp.exec(`bash '${filePath}'`);
}
... | 418sec/nni | ts/nni_manager/training_service/common/util.ts | TypeScript |
FunctionDeclaration | /**
* output the last line of a file
* @param filePath
*/
export async function execTail(filePath: string): Promise<cpp.childProcessPromise.Result> {
let cmdresult: cpp.childProcessPromise.Result;
if (process.platform === 'win32') {
cmdresult = await cpp.exec(`powershell.exe Get-Content "${filePath}"... | 418sec/nni | ts/nni_manager/training_service/common/util.ts | TypeScript |
FunctionDeclaration | /**
* delete a directory
* @param directory
*/
export async function execRemove(directory: string): Promise<void> {
if (process.platform === 'win32') {
await cpp.exec(`powershell.exe Remove-Item "${directory}" -Recurse -Force`);
} else {
await cpp.exec(`rm -rf '${directory}'`);
}
ret... | 418sec/nni | ts/nni_manager/training_service/common/util.ts | TypeScript |
FunctionDeclaration | /**
* kill a process
* @param directory
*/
export async function execKill(pid: string): Promise<void> {
if (process.platform === 'win32') {
await cpp.exec(`cmd.exe /c taskkill /PID ${pid} /T /F`);
} else {
await cpp.exec(`pkill -P ${pid}`);
}
return Promise.resolve();
} | 418sec/nni | ts/nni_manager/training_service/common/util.ts | TypeScript |
FunctionDeclaration | /**
* get command of setting environment variable
* @param variable
* @returns command string
*/
export function setEnvironmentVariable(variable: { key: string; value: string }): string {
if (process.platform === 'win32') {
return `$env:${variable.key}="${variable.value}"`;
} else {
return ... | 418sec/nni | ts/nni_manager/training_service/common/util.ts | TypeScript |
FunctionDeclaration | /**
* Compress files in directory to tar file
* @param sourcePath
* @param tarPath
*/
export async function tarAdd(tarPath: string, sourcePath: string): Promise<void> {
const fileList = [];
for (const d of listDirWithIgnoredFiles(sourcePath, '', [])) {
fileList.push(d);
}
tar.create(
... | 418sec/nni | ts/nni_manager/training_service/common/util.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.