type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
MethodDeclaration
// print option and its current value on screen // applies special styling whener or not the option is selected private printOption (id: GameOption, name: string, value: number | string): void { term.styleReset() if (this.curGameOption === id) { term('\n ').bgBrightBlue(name).styleReset(': ') } else { term('\n ' + name + ': ') } term.styleReset().red(value) }
TheEmrio/nim-game
src/Interface.ts
TypeScript
MethodDeclaration
// changes a numeric option like stack count or max sticks per turn // left arrow to increment by one // right arrow to decrement by one private updateNumericOption (action: Symbol): void { const delta = action === GameInput.MORE ? 1 : -1 if (this.curGameOption === GameOption.STACKS_COUNT) { const newValue = this.stacksCount + delta if (OPTION_BOUNDARIES.stacksCount.max >= newValue && newValue >= OPTION_BOUNDARIES.stacksCount.min) { this.stacksCount = newValue } } else if (this.curGameOption === GameOption.MAX_STICKS_PER_TURN) { const newValue = this.maxSticksPerTurn + delta if (OPTION_BOUNDARIES.maxSticksPerTurn.max >= newValue && newValue >= OPTION_BOUNDARIES.maxSticksPerTurn.min) { this.maxSticksPerTurn = newValue } } }
TheEmrio/nim-game
src/Interface.ts
TypeScript
MethodDeclaration
// draws the options UI to let users set player names and other options for the game private async drawOptionsScreen (): Promise<void> { this.reset() term.bold(' * Game Options *') term.styleReset('\n Use UP and DOWN to move between options, RIGHT and LEFT to change numeric values, and regular keyboard (A-Z, a-z, spaces, and -_+=) for player names') this.printOption(GameOption.PLAYER_1_NAME, 'Player #1', this.players[0]) this.printOption(GameOption.PLAYER_2_NAME, 'Player #2', this.players[1]) this.printOption(GameOption.STACKS_COUNT, 'Stacks', this.stacksCount) this.printOption(GameOption.MAX_STICKS_PER_TURN, 'Max Sticks per Turn', this.maxSticksPerTurn) term.styleReset('\n\n') if (this.curGameOption === GameOption.SUBMIT) { term(' ').bgGreen('[Submit]') } else { term(' [ Submit ]') } const input = await this.getGameInput() switch (input) { case GameInput.UP: // move up in the options list this.curGameOption = Math.max(0, this.curGameOption - 1) break case GameInput.DOWN: // move down this.curGameOption = Math.min(GameOption.SUBMIT, this.curGameOption + 1) break case GameInput.MORE: // increment/decrement numeric values case GameInput.LESS: this.updateNumericOption(input) break case GameInput.BACKSPACE: if (this.curGameOption === GameOption.PLAYER_1_NAME) { this.players[0] = this.players[0].slice(0, -1) } else if (this.curGameOption === GameOption.PLAYER_2_NAME) { this.players[1] = this.players[1].slice(0, -1) } break case GameInput.SUBMIT: // start game! if (!GameOption.SUBMIT) { break } // player names may not have been set if (this.players[0].length < OPTION_BOUNDARIES.players.min || this.players[1].length < OPTION_BOUNDARIES.players.min) { break } this.game = new Game({ players: this.players, maxTakesByTurn: this.maxSticksPerTurn, boardProperties: { stacks: this.stacksCount } }) this.step = UIStep.IN_GAME break case GameInput.UNKNOWN: // non-allowed character, just ignore break default: // dealing with characters (player names) if (this.curGameOption === GameOption.PLAYER_1_NAME && this.players[0].length < OPTION_BOUNDARIES.players.max) { this.players[0] += input } else if (this.curGameOption === GameOption.PLAYER_2_NAME && this.players[1].length < OPTION_BOUNDARIES.players.max) { this.players[1] += input } } }
TheEmrio/nim-game
src/Interface.ts
TypeScript
MethodDeclaration
// print UI during game private async gameTurn (): Promise<void> { this.reset() const { board, waitingFor: player } = this.game.getGameState() this.selectedStickCount = Math.min(board[this.selectedStack], this.selectedStickCount) term(' Select the stack with UP/DOWN and select the number of sticks to take with RIGHT/LEFT. Press ENTER to submit\n\n') term(' Current player: ').red(player).styleReset('\n\n') // drawing board, applying special styling to selected stack and sticks for (let i = 0; i < board.length; i++) { if (this.selectedStack === i) { term.yellow(' ' + (i + 1).toString().padStart(2, ' ')).cyan(' | ') term.yellow('I '.repeat(this.selectedStickCount)) term.magenta('I '.repeat(board[i] - this.selectedStickCount)) } else { term.magenta(' ' + (i + 1).toString().padStart(2, ' ')).cyan(' | ') term.magenta('I '.repeat(board[i])) } term('\n') } const input = await this.getGameInput() switch (input) { case GameInput.UP: // move up in stacks list this.selectedStack = Math.max(0, this.selectedStack - 1) // also update stick count this.selectedStickCount = Math.min(board[this.selectedStack], this.selectedStickCount) break case GameInput.DOWN: // move down this.selectedStack = Math.min(board.length - 1, this.selectedStack + 1) this.selectedStickCount = Math.min(board[this.selectedStack], this.selectedStickCount) break case GameInput.MORE: // add one to the number of selected sticks this.selectedStickCount = Math.min(board[this.selectedStack], this.maxSticksPerTurn, this.selectedStickCount + 1) break case GameInput.LESS: // remove one this.selectedStickCount = Math.max(1, this.selectedStickCount - 1) break case GameInput.SUBMIT: // confirm move if (!this.game.isMoveValid(this.selectedStack, this.selectedStickCount)) { break } const nextPlayer = this.game.play(this.selectedStack, this.selectedStickCount) // the game ended if (nextPlayer === null) { this.step = UIStep.GAME_SUMMARY } break } }
TheEmrio/nim-game
src/Interface.ts
TypeScript
MethodDeclaration
// prints the summary UI private async summary (): Promise<void> { this.reset() const winner = this.game.getWinner() term(' Winner: ').bold.yellow(winner) term('\n\n Press Ctrl+C to exit or any other key to play again') await this.getGameInput() this.step = UIStep.OPTIONS }
TheEmrio/nim-game
src/Interface.ts
TypeScript
MethodDeclaration
// main draw routine, called at most every `this.clockSpeed` ms private async draw (): Promise<void> { try { switch (this.step) { case UIStep.TITLE_SCREEN: await this.printTitleScreen() break case UIStep.OPTIONS: await this.drawOptionsScreen() break case UIStep.IN_GAME: await this.gameTurn() break case UIStep.GAME_SUMMARY: await this.summary() break default: throw new Error('Unknown state: ' + this.step) } setTimeout(() => this.draw(), this.clockSpeed) } catch (e) { console.error('Game failed') console.error(e) } }
TheEmrio/nim-game
src/Interface.ts
TypeScript
MethodDeclaration
start (): void { this.draw() }
TheEmrio/nim-game
src/Interface.ts
TypeScript
ArrowFunction
async (request, config) => { const validator = new Validator(request, customParams) if (validator.error) throw validator.error const jobRunID = validator.validated.id const eventId = validator.validated.data.eventId const url = `/events/${eventId}` const reqConfig = { ...config.api, headers: { ...config.api.headers, 'x-rapidapi-key': config.apiKey, }, params: { include: 'scores', }, url, } const response = await Requester.request(reqConfig) response.data.result = response.data return Requester.success(jobRunID, response, config.verbose) }
vnavascues/external-adapters-js
packages/sources/therundown/src/endpoint/event.ts
TypeScript
ArrowFunction
() => { const dispatch = useDispatch(); const [confirmClearDialogOpen, setConfirmClearDialogOpen] = useState(false); const ideas = useSelector( (state: RootState) => state.games.startStopContinue.ideas ); const exportIdeas = () => { const fileName = "startstopcontinue.txt"; const text = getCategories() .map( (category) => `* ${category}\n` + ideasByCategory(ideas, category) .map((idea) => ` * ${idea.payload.message}\n`) .join("") ) .join(""); const fileToSave = new Blob([text], { type: "plain/text", }); saveAs(fileToSave, fileName); }; return ( <> <ListItem> <Button onClick={()
random82/DigitalIcebreakers
DigitalIcebreakers/ClientApp/src/games/StartStopContinue/Menu.tsx
TypeScript
ArrowFunction
(state: RootState) => state.games.startStopContinue.ideas
random82/DigitalIcebreakers
DigitalIcebreakers/ClientApp/src/games/StartStopContinue/Menu.tsx
TypeScript
ArrowFunction
() => { const fileName = "startstopcontinue.txt"; const text = getCategories() .map( (category) => `* ${category}\n` + ideasByCategory(ideas, category) .map((idea) => ` * ${idea.payload.message}\n`) .join("") ) .join(""); const fileToSave = new Blob([text], { type: "plain/text", }); saveAs(fileToSave, fileName); }
random82/DigitalIcebreakers
DigitalIcebreakers/ClientApp/src/games/StartStopContinue/Menu.tsx
TypeScript
ArrowFunction
(category) => `* ${category}\n` + ideasByCategory(ideas, category) .map((idea) => ` * ${idea.payload.message}\n`) .join("")
random82/DigitalIcebreakers
DigitalIcebreakers/ClientApp/src/games/StartStopContinue/Menu.tsx
TypeScript
ArrowFunction
(idea) => ` * ${idea.payload.message}\n`
random82/DigitalIcebreakers
DigitalIcebreakers/ClientApp/src/games/StartStopContinue/Menu.tsx
TypeScript
ArrowFunction
() => setConfirmClearDialogOpen(true)
random82/DigitalIcebreakers
DigitalIcebreakers/ClientApp/src/games/StartStopContinue/Menu.tsx
TypeScript
ArrowFunction
(jsonValue) => V1QueueFromJSON(jsonValue)
deeplearning2012/polyaxon
sdks/ts/http_client/v1/src/apis/QueuesV1Api.ts
TypeScript
ArrowFunction
(jsonValue) => V1ListQueuesResponseFromJSON(jsonValue)
deeplearning2012/polyaxon
sdks/ts/http_client/v1/src/apis/QueuesV1Api.ts
TypeScript
InterfaceDeclaration
export interface CreateQueueRequest { owner: string; agent: string; body: V1Queue; }
deeplearning2012/polyaxon
sdks/ts/http_client/v1/src/apis/QueuesV1Api.ts
TypeScript
InterfaceDeclaration
export interface DeleteQueueRequest { owner: string; agent: string; uuid: string; }
deeplearning2012/polyaxon
sdks/ts/http_client/v1/src/apis/QueuesV1Api.ts
TypeScript
InterfaceDeclaration
export interface GetQueueRequest { owner: string; agent: string; uuid: string; }
deeplearning2012/polyaxon
sdks/ts/http_client/v1/src/apis/QueuesV1Api.ts
TypeScript
InterfaceDeclaration
export interface ListOrganizationQueueNamesRequest { owner: string; offset?: number; limit?: number; sort?: string; query?: string; }
deeplearning2012/polyaxon
sdks/ts/http_client/v1/src/apis/QueuesV1Api.ts
TypeScript
InterfaceDeclaration
export interface ListOrganizationQueuesRequest { owner: string; offset?: number; limit?: number; sort?: string; query?: string; }
deeplearning2012/polyaxon
sdks/ts/http_client/v1/src/apis/QueuesV1Api.ts
TypeScript
InterfaceDeclaration
export interface ListQueueNamesRequest { owner: string; agent: string; offset?: number; limit?: number; sort?: string; query?: string; }
deeplearning2012/polyaxon
sdks/ts/http_client/v1/src/apis/QueuesV1Api.ts
TypeScript
InterfaceDeclaration
export interface ListQueuesRequest { owner: string; agent: string; offset?: number; limit?: number; sort?: string; query?: string; }
deeplearning2012/polyaxon
sdks/ts/http_client/v1/src/apis/QueuesV1Api.ts
TypeScript
InterfaceDeclaration
export interface PatchQueueRequest { owner: string; queueAgent: string; queueUuid: string; body: V1Queue; }
deeplearning2012/polyaxon
sdks/ts/http_client/v1/src/apis/QueuesV1Api.ts
TypeScript
InterfaceDeclaration
export interface UpdateQueueRequest { owner: string; queueAgent: string; queueUuid: string; body: V1Queue; }
deeplearning2012/polyaxon
sdks/ts/http_client/v1/src/apis/QueuesV1Api.ts
TypeScript
MethodDeclaration
/** * Create queue */ async createQueueRaw(requestParameters: CreateQueueRequest): Promise<runtime.ApiResponse<V1Queue>> { if (requestParameters.owner === null || requestParameters.owner === undefined) { throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling createQueue.'); } if (requestParameters.agent === null || requestParameters.agent === undefined) { throw new runtime.RequiredError('agent','Required parameter requestParameters.agent was null or undefined when calling createQueue.'); } if (requestParameters.body === null || requestParameters.body === undefined) { throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling createQueue.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = await this.request({ path: `/api/v1/orgs/{owner}/agents/{agent}/queues`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"agent"}}`, encodeURIComponent(String(requestParameters.agent))), method: 'POST', headers: headerParameters, query: queryParameters, body: V1QueueToJSON(requestParameters.body), }); return new runtime.JSONApiResponse(response, (jsonValue) => V1QueueFromJSON(jsonValue)); }
deeplearning2012/polyaxon
sdks/ts/http_client/v1/src/apis/QueuesV1Api.ts
TypeScript
MethodDeclaration
/** * Create queue */ async createQueue(requestParameters: CreateQueueRequest): Promise<V1Queue> { const response = await this.createQueueRaw(requestParameters); return await response.value(); }
deeplearning2012/polyaxon
sdks/ts/http_client/v1/src/apis/QueuesV1Api.ts
TypeScript
MethodDeclaration
/** * Delete queue */ async deleteQueueRaw(requestParameters: DeleteQueueRequest): Promise<runtime.ApiResponse<void>> { if (requestParameters.owner === null || requestParameters.owner === undefined) { throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling deleteQueue.'); } if (requestParameters.agent === null || requestParameters.agent === undefined) { throw new runtime.RequiredError('agent','Required parameter requestParameters.agent was null or undefined when calling deleteQueue.'); } if (requestParameters.uuid === null || requestParameters.uuid === undefined) { throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling deleteQueue.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = await this.request({ path: `/api/v1/orgs/{owner}/agents/{agent}/queues/{uuid}`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"agent"}}`, encodeURIComponent(String(requestParameters.agent))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))), method: 'DELETE', headers: headerParameters, query: queryParameters, }); return new runtime.VoidApiResponse(response); }
deeplearning2012/polyaxon
sdks/ts/http_client/v1/src/apis/QueuesV1Api.ts
TypeScript
MethodDeclaration
/** * Delete queue */ async deleteQueue(requestParameters: DeleteQueueRequest): Promise<void> { await this.deleteQueueRaw(requestParameters); }
deeplearning2012/polyaxon
sdks/ts/http_client/v1/src/apis/QueuesV1Api.ts
TypeScript
MethodDeclaration
/** * Get queue */ async getQueueRaw(requestParameters: GetQueueRequest): Promise<runtime.ApiResponse<V1Queue>> { if (requestParameters.owner === null || requestParameters.owner === undefined) { throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling getQueue.'); } if (requestParameters.agent === null || requestParameters.agent === undefined) { throw new runtime.RequiredError('agent','Required parameter requestParameters.agent was null or undefined when calling getQueue.'); } if (requestParameters.uuid === null || requestParameters.uuid === undefined) { throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling getQueue.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = await this.request({ path: `/api/v1/orgs/{owner}/agents/{agent}/queues/{uuid}`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"agent"}}`, encodeURIComponent(String(requestParameters.agent))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))), method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response, (jsonValue) => V1QueueFromJSON(jsonValue)); }
deeplearning2012/polyaxon
sdks/ts/http_client/v1/src/apis/QueuesV1Api.ts
TypeScript
MethodDeclaration
/** * Get queue */ async getQueue(requestParameters: GetQueueRequest): Promise<V1Queue> { const response = await this.getQueueRaw(requestParameters); return await response.value(); }
deeplearning2012/polyaxon
sdks/ts/http_client/v1/src/apis/QueuesV1Api.ts
TypeScript
MethodDeclaration
/** * List organization level queues names */ async listOrganizationQueueNamesRaw(requestParameters: ListOrganizationQueueNamesRequest): Promise<runtime.ApiResponse<V1ListQueuesResponse>> { if (requestParameters.owner === null || requestParameters.owner === undefined) { throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling listOrganizationQueueNames.'); } const queryParameters: runtime.HTTPQuery = {}; if (requestParameters.offset !== undefined) { queryParameters['offset'] = requestParameters.offset; } if (requestParameters.limit !== undefined) { queryParameters['limit'] = requestParameters.limit; } if (requestParameters.sort !== undefined) { queryParameters['sort'] = requestParameters.sort; } if (requestParameters.query !== undefined) { queryParameters['query'] = requestParameters.query; } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = await this.request({ path: `/api/v1/orgs/{owner}/queues/names`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))), method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response, (jsonValue) => V1ListQueuesResponseFromJSON(jsonValue)); }
deeplearning2012/polyaxon
sdks/ts/http_client/v1/src/apis/QueuesV1Api.ts
TypeScript
MethodDeclaration
/** * List organization level queues names */ async listOrganizationQueueNames(requestParameters: ListOrganizationQueueNamesRequest): Promise<V1ListQueuesResponse> { const response = await this.listOrganizationQueueNamesRaw(requestParameters); return await response.value(); }
deeplearning2012/polyaxon
sdks/ts/http_client/v1/src/apis/QueuesV1Api.ts
TypeScript
MethodDeclaration
/** * List organization level queues */ async listOrganizationQueuesRaw(requestParameters: ListOrganizationQueuesRequest): Promise<runtime.ApiResponse<V1ListQueuesResponse>> { if (requestParameters.owner === null || requestParameters.owner === undefined) { throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling listOrganizationQueues.'); } const queryParameters: runtime.HTTPQuery = {}; if (requestParameters.offset !== undefined) { queryParameters['offset'] = requestParameters.offset; } if (requestParameters.limit !== undefined) { queryParameters['limit'] = requestParameters.limit; } if (requestParameters.sort !== undefined) { queryParameters['sort'] = requestParameters.sort; } if (requestParameters.query !== undefined) { queryParameters['query'] = requestParameters.query; } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = await this.request({ path: `/api/v1/orgs/{owner}/queues`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))), method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response, (jsonValue) => V1ListQueuesResponseFromJSON(jsonValue)); }
deeplearning2012/polyaxon
sdks/ts/http_client/v1/src/apis/QueuesV1Api.ts
TypeScript
MethodDeclaration
/** * List organization level queues */ async listOrganizationQueues(requestParameters: ListOrganizationQueuesRequest): Promise<V1ListQueuesResponse> { const response = await this.listOrganizationQueuesRaw(requestParameters); return await response.value(); }
deeplearning2012/polyaxon
sdks/ts/http_client/v1/src/apis/QueuesV1Api.ts
TypeScript
MethodDeclaration
/** * List queues names */ async listQueueNamesRaw(requestParameters: ListQueueNamesRequest): Promise<runtime.ApiResponse<V1ListQueuesResponse>> { if (requestParameters.owner === null || requestParameters.owner === undefined) { throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling listQueueNames.'); } if (requestParameters.agent === null || requestParameters.agent === undefined) { throw new runtime.RequiredError('agent','Required parameter requestParameters.agent was null or undefined when calling listQueueNames.'); } const queryParameters: runtime.HTTPQuery = {}; if (requestParameters.offset !== undefined) { queryParameters['offset'] = requestParameters.offset; } if (requestParameters.limit !== undefined) { queryParameters['limit'] = requestParameters.limit; } if (requestParameters.sort !== undefined) { queryParameters['sort'] = requestParameters.sort; } if (requestParameters.query !== undefined) { queryParameters['query'] = requestParameters.query; } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = await this.request({ path: `/api/v1/orgs/{owner}/agents/{agent}/queues/names`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"agent"}}`, encodeURIComponent(String(requestParameters.agent))), method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response, (jsonValue) => V1ListQueuesResponseFromJSON(jsonValue)); }
deeplearning2012/polyaxon
sdks/ts/http_client/v1/src/apis/QueuesV1Api.ts
TypeScript
MethodDeclaration
/** * List queues names */ async listQueueNames(requestParameters: ListQueueNamesRequest): Promise<V1ListQueuesResponse> { const response = await this.listQueueNamesRaw(requestParameters); return await response.value(); }
deeplearning2012/polyaxon
sdks/ts/http_client/v1/src/apis/QueuesV1Api.ts
TypeScript
MethodDeclaration
/** * List queues */ async listQueuesRaw(requestParameters: ListQueuesRequest): Promise<runtime.ApiResponse<V1ListQueuesResponse>> { if (requestParameters.owner === null || requestParameters.owner === undefined) { throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling listQueues.'); } if (requestParameters.agent === null || requestParameters.agent === undefined) { throw new runtime.RequiredError('agent','Required parameter requestParameters.agent was null or undefined when calling listQueues.'); } const queryParameters: runtime.HTTPQuery = {}; if (requestParameters.offset !== undefined) { queryParameters['offset'] = requestParameters.offset; } if (requestParameters.limit !== undefined) { queryParameters['limit'] = requestParameters.limit; } if (requestParameters.sort !== undefined) { queryParameters['sort'] = requestParameters.sort; } if (requestParameters.query !== undefined) { queryParameters['query'] = requestParameters.query; } const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = await this.request({ path: `/api/v1/orgs/{owner}/agents/{agent}/queues`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"agent"}}`, encodeURIComponent(String(requestParameters.agent))), method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response, (jsonValue) => V1ListQueuesResponseFromJSON(jsonValue)); }
deeplearning2012/polyaxon
sdks/ts/http_client/v1/src/apis/QueuesV1Api.ts
TypeScript
MethodDeclaration
/** * List queues */ async listQueues(requestParameters: ListQueuesRequest): Promise<V1ListQueuesResponse> { const response = await this.listQueuesRaw(requestParameters); return await response.value(); }
deeplearning2012/polyaxon
sdks/ts/http_client/v1/src/apis/QueuesV1Api.ts
TypeScript
MethodDeclaration
/** * Patch queue */ async patchQueueRaw(requestParameters: PatchQueueRequest): Promise<runtime.ApiResponse<V1Queue>> { if (requestParameters.owner === null || requestParameters.owner === undefined) { throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling patchQueue.'); } if (requestParameters.queueAgent === null || requestParameters.queueAgent === undefined) { throw new runtime.RequiredError('queueAgent','Required parameter requestParameters.queueAgent was null or undefined when calling patchQueue.'); } if (requestParameters.queueUuid === null || requestParameters.queueUuid === undefined) { throw new runtime.RequiredError('queueUuid','Required parameter requestParameters.queueUuid was null or undefined when calling patchQueue.'); } if (requestParameters.body === null || requestParameters.body === undefined) { throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling patchQueue.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = await this.request({ path: `/api/v1/orgs/{owner}/agents/{queue.agent}/queues/{queue.uuid}`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"queue.agent"}}`, encodeURIComponent(String(requestParameters.queueAgent))).replace(`{${"queue.uuid"}}`, encodeURIComponent(String(requestParameters.queueUuid))), method: 'PATCH', headers: headerParameters, query: queryParameters, body: V1QueueToJSON(requestParameters.body), }); return new runtime.JSONApiResponse(response, (jsonValue) => V1QueueFromJSON(jsonValue)); }
deeplearning2012/polyaxon
sdks/ts/http_client/v1/src/apis/QueuesV1Api.ts
TypeScript
MethodDeclaration
/** * Patch queue */ async patchQueue(requestParameters: PatchQueueRequest): Promise<V1Queue> { const response = await this.patchQueueRaw(requestParameters); return await response.value(); }
deeplearning2012/polyaxon
sdks/ts/http_client/v1/src/apis/QueuesV1Api.ts
TypeScript
MethodDeclaration
/** * Update queue */ async updateQueueRaw(requestParameters: UpdateQueueRequest): Promise<runtime.ApiResponse<V1Queue>> { if (requestParameters.owner === null || requestParameters.owner === undefined) { throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling updateQueue.'); } if (requestParameters.queueAgent === null || requestParameters.queueAgent === undefined) { throw new runtime.RequiredError('queueAgent','Required parameter requestParameters.queueAgent was null or undefined when calling updateQueue.'); } if (requestParameters.queueUuid === null || requestParameters.queueUuid === undefined) { throw new runtime.RequiredError('queueUuid','Required parameter requestParameters.queueUuid was null or undefined when calling updateQueue.'); } if (requestParameters.body === null || requestParameters.body === undefined) { throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling updateQueue.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication } const response = await this.request({ path: `/api/v1/orgs/{owner}/agents/{queue.agent}/queues/{queue.uuid}`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"queue.agent"}}`, encodeURIComponent(String(requestParameters.queueAgent))).replace(`{${"queue.uuid"}}`, encodeURIComponent(String(requestParameters.queueUuid))), method: 'PUT', headers: headerParameters, query: queryParameters, body: V1QueueToJSON(requestParameters.body), }); return new runtime.JSONApiResponse(response, (jsonValue) => V1QueueFromJSON(jsonValue)); }
deeplearning2012/polyaxon
sdks/ts/http_client/v1/src/apis/QueuesV1Api.ts
TypeScript
MethodDeclaration
/** * Update queue */ async updateQueue(requestParameters: UpdateQueueRequest): Promise<V1Queue> { const response = await this.updateQueueRaw(requestParameters); return await response.value(); }
deeplearning2012/polyaxon
sdks/ts/http_client/v1/src/apis/QueuesV1Api.ts
TypeScript
FunctionDeclaration
async function testPromisify() { const rd = util.promisify(fs.readdir); let listS: string[]; listS = await rd('path'); listS = await rd('path', 'utf8'); listS = await rd('path', null); listS = await rd('path', undefined); listS = await rd('path', { encoding: 'utf8' }); listS = await rd('path', { encoding: null }); listS = await rd('path', { encoding: null, withFileTypes: false }); listS = await rd('path', { encoding: 'utf8', withFileTypes: false }); const listDir: fs.Dirent[] = await rd('path', { withFileTypes: true }); const listDir2: Buffer[] = await rd('path', { withFileTypes: false, encoding: 'buffer' }); const listDir3: fs.Dirent[] = await rd('path', { encoding: 'utf8', withFileTypes: true }); const ln = util.promisify(fs.link); // $ExpectType Promise<void> ln("abc", "def"); }
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
() => { }
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
(err, data) => content = data
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
(err, data) => stringOrBuffer = data
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
(err, data) => buffer = data
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
(err: NodeJS.ErrnoException | null, bytesRead: number, buffer: DataView) => { }
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
(err, data) => { if (err && err.errno) { errno = err.errno; } }
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
(err: NodeJS.ErrnoException | null, files: fs.Dirent[]) => { }
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
(err, folder) => { console.log(folder); // Prints: /tmp/foo-itXde2 }
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
(event, filename) => { console.log(event, filename); }
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
(current, previous) => { console.log(current, previous); }
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
(err) => { }
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
(error?: Error | null) => { }
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
(err, linkString) => s = linkString
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
(err, linkString) => b = linkString
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
(err, resolvedPath) => s = resolvedPath
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
(err, resolvedPath) => b = resolvedPath
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
(err) => console.error(err)
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
(err, path) => { err; // $ExpectType ErrnoException | null path; // $ExpectType string | undefined }
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
(err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => { }
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
async () => { try { await fs.promises.rmdir('some/test/path'); await fs.promises.rmdir('some/test/path', { maxRetries: 123, retryDelay: 123, recursive: true }); } catch (e) { } try { await fs.promises.rmdir('some/test/file'); await fs.promises.rmdir('some/test/file', { maxRetries: 123, retryDelay: 123 }); } catch (e) { } }
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
async (err, dir) => { const dirEnt: fs.Dirent | null = await dir.read(); }
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
async () => { // tslint:disable-next-line: await-promise for await (const thing of dir) { } // tslint:disable-next-line: await-promise for await (const thing of dirBuffer) { } // tslint:disable-next-line: await-promise for await (const thing of dirUrl) { } }
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
async () => { const handle: FileHandle = await openAsync('test', 'r'); const writeStream = fs.createWriteStream('./index.d.ts', { fd: handle, }); const _wom = writeStream.writableObjectMode; // $ExpectType boolean const readStream = fs.createReadStream('./index.d.ts', { fd: handle, }); const _rom = readStream.readableObjectMode; // $ExpectType boolean (await handle.read()).buffer; // $ExpectType Buffer (await handle.read({ buffer: new Uint32Array(), offset: 1, position: 2, length: 3, })).buffer; // $ExpectType Uint32Array await handle.write('hurr', 0, 'utf-8'); await handle.write(Buffer.from('hurr'), 0, 42, 10); }
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
async () => { await writeFileAsync('test', 'test'); await writeFileAsync('test', Buffer.from('test')); await writeFileAsync('test', ['test', 'test2']); await writeFileAsync('test', async function *() { yield 'yeet'; }()); await writeFileAsync('test', process.stdin); }
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
(err?: NodeJS.ErrnoException | null) => {}
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
(err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => { }
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
(err, st: fs.Stats) => { }
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
(err, st: fs.BigIntStats) => { }
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
(err, st) => { st; // $ExpectType Stats | BigIntStats }
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
(err: Error | null) => {}
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
(fd) => { // Create a stream from some character device. const stream = fd.createReadStream(); // $ExpectType ReadStream stream.close(); stream.push(null); stream.read(0); }
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
(fd) => { // Create a stream from some character device. const stream = fd.createWriteStream(); // $ExpectType WriteStream stream.close(); }
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
MethodDeclaration
filter(src, dst) { return src !== 'node_modules' && dst !== 'something'; }
0-Captain/DefinitelyTyped
types/node/test/fs.ts
TypeScript
ArrowFunction
async (id : number) => { const patient = await Patient.db .select(selectList) .where('patients.id', id) .join('users', 'users.id', '=', 'patients.userId'); if (!patient || !patient[0]) { throw new AppError('Patient with the given id is not found', status.NOT_FOUND); } return patient[0]; }
fuboki10/Ketofan-Back-End
src/services/patient.service.ts
TypeScript
ArrowFunction
async (limit : number, offset : number, searchProps: PatientSearchProps) => { const query = Patient.db .select(selectList) .join('users', 'users.id', '=', 'patients.userId'); // handle name search if (searchProps.name) { query.where('name', 'like', `${searchProps.name}%`); } // handle area search if (searchProps.area) { query .join('patient_areas', 'patient_areas.patientId', '=', 'patients.id') .where('patient_areas.areaId', '=', searchProps.area); } // handle insurance search if (searchProps.insurance) { query .join('patient_insurances', 'patient_insurances.patientId', '=', 'patients.id') .where('patient_insurances.insuranceId', '=', searchProps.insurance); } // handle specialization search if (searchProps.specialization) { query .join('patient_specializations', 'patient_specializations.patientId', '=', 'patients.id') .where('patient_specializations.specializationId', '=', searchProps.specialization); } const [patients, total] : any = await Promise.all([ query.offset(offset).limit(limit), Patient.db.count(), ]); return { patients, total: parseInt(total[0].count, 10) }; }
fuboki10/Ketofan-Back-End
src/services/patient.service.ts
TypeScript
ArrowFunction
async (userId : number) : Promise<PatientInterface> => { const patient = await Patient.db .select(selectList) .where('patients.userId', userId) .join('users', 'users.id', '=', 'patients.userId'); if (!patient || !patient[0]) { throw new AppError('Patient with the given id is not found', status.NOT_FOUND); } return patient[0]; }
fuboki10/Ketofan-Back-End
src/services/patient.service.ts
TypeScript
InterfaceDeclaration
interface PatientSearchProps { name?: string; area?: number; insurance?: number; specialization?: number; }
fuboki10/Ketofan-Back-End
src/services/patient.service.ts
TypeScript
InterfaceDeclaration
/** * Form Context * Set top form style and pass to Form Item usage. */ export interface FormContextProps extends Callbacks { name?: string; vertical?: boolean; preserve?: boolean; form?: FormInstance; }
MonadsTech/react-native-form
dist/context.d.ts
TypeScript
ClassDeclaration
/** * @author [email protected] (Brian Brown) */ export default class BitMatrixParser { private mappingBitMatrix; private readMappingMatrix; private version; /** * @param bitMatrix {@link BitMatrix} to parse * @throws FormatException if dimension is < 8 or > 144 or not 0 mod 2 */ constructor(bitMatrix: BitMatrix); getVersion(): Version; /** * <p>Creates the version object based on the dimension of the original bit matrix from * the datamatrix code.</p> * * <p>See ISO 16022:2006 Table 7 - ECC 200 symbol attributes</p> * * @param bitMatrix Original {@link BitMatrix} including alignment patterns * @return {@link Version} encapsulating the Data Matrix Code's "version" * @throws FormatException if the dimensions of the mapping matrix are not valid * Data Matrix dimensions. */ static readVersion(bitMatrix: BitMatrix): Version; /** * <p>Reads the bits in the {@link BitMatrix} representing the mapping matrix (No alignment patterns) * in the correct order in order to reconstitute the codewords bytes contained within the * Data Matrix Code.</p> * * @return bytes encoded within the Data Matrix Code * @throws FormatException if the exact number of bytes expected is not read */ readCodewords(): Int8Array; /** * <p>Reads a bit of the mapping matrix accounting for boundary wrapping.</p> * * @param row Row to read in the mapping matrix * @param column Column to read in the mapping matrix * @param numRows Number of rows in the mapping matrix * @param numColumns Number of columns in the mapping matrix * @return value of the given bit in the mapping matrix */ private readModule; /** * <p>Reads the 8 bits of the standard Utah-shaped pattern.</p> * * <p>See ISO 16022:2006, 5.8.1 Figure 6</p> * * @param row Current row in the mapping matrix, anchored at the 8th bit (LSB) of the pattern * @param column Current column in the mapping matrix, anchored at the 8th bit (LSB) of the pattern * @param numRows Number of rows in the mapping matrix * @param numColumns Number of columns in the mapping matrix * @return byte from the utah shape */ private readUtah; /** * <p>Reads the 8 bits of the special corner condition 1.</p> * * <p>See ISO 16022:2006, Figure F.3</p> * * @param numRows Number of rows in the mapping matrix * @param numColumns Number of columns in the mapping matrix * @return byte from the Corner condition 1 */ private readCorner1; /** * <p>Reads the 8 bits of the special corner condition 2.</p> * * <p>See ISO 16022:2006, Figure F.4</p> * * @param numRows Number of rows in the mapping matrix * @param numColumns Number of columns in the mapping matrix * @return byte from the Corner condition 2 */ private readCorner2; /** * <p>Reads the 8 bits of the special corner condition 3.</p> * * <p>See ISO 16022:2006, Figure F.5</p> * * @param numRows Number of rows in the mapping matrix * @param numColumns Number of columns in the mapping matrix * @return byte from the Corner condition 3 */ private readCorner3; /** * <p>Reads the 8 bits of the special corner condition 4.</p> * * <p>See ISO 16022:2006, Figure F.6</p> * * @param numRows Number of rows in the mapping matrix * @param numColumns Number of columns in the mapping matrix * @return byte from the Corner condition 4 */ private readCorner4; /** * <p>Extracts the data region from a {@link BitMatrix} that contains * alignment patterns.</p> * * @param bitMatrix Original {@link BitMatrix} with alignment patterns * @return BitMatrix that has the alignment patterns removed */ private extractDataRegion; }
AliAyub007/ScannerRepo
node_modules/@zxing/library/esm5/core/datamatrix/decoder/BitMatrixParser.d.ts
TypeScript
MethodDeclaration
getVersion(): Version;
AliAyub007/ScannerRepo
node_modules/@zxing/library/esm5/core/datamatrix/decoder/BitMatrixParser.d.ts
TypeScript
MethodDeclaration
/** * <p>Creates the version object based on the dimension of the original bit matrix from * the datamatrix code.</p> * * <p>See ISO 16022:2006 Table 7 - ECC 200 symbol attributes</p> * * @param bitMatrix Original {@link BitMatrix} including alignment patterns * @return {@link Version} encapsulating the Data Matrix Code's "version" * @throws FormatException if the dimensions of the mapping matrix are not valid * Data Matrix dimensions. */ static readVersion(bitMatrix: BitMatrix): Version;
AliAyub007/ScannerRepo
node_modules/@zxing/library/esm5/core/datamatrix/decoder/BitMatrixParser.d.ts
TypeScript
MethodDeclaration
/** * <p>Reads the bits in the {@link BitMatrix} representing the mapping matrix (No alignment patterns) * in the correct order in order to reconstitute the codewords bytes contained within the * Data Matrix Code.</p> * * @return bytes encoded within the Data Matrix Code * @throws FormatException if the exact number of bytes expected is not read */ readCodewords(): Int8Array;
AliAyub007/ScannerRepo
node_modules/@zxing/library/esm5/core/datamatrix/decoder/BitMatrixParser.d.ts
TypeScript
FunctionDeclaration
/** * Get artifacts for single project build * * @see https://circleci.com/docs/api/v1-reference/#build-artifacts * @example /project/:vcs-type/:username/:project/:build_num/artifacts * * @param token - CircleCI API token * @param vcs - Project's git information * @param buildNumber - Target build number * @returns Promise of an array of build artifacs */ export function getBuildArtifacts( token: string, vcs: GitInfo, buildNumber: number ): Promise<ArtifactResponse> { const url = `${createVcsUrl(vcs)}/${buildNumber}/artifacts`; return client(token).get<ArtifactResponse>(url); }
davidwallacejackson/circleci-api
src/api/artifacts.ts
TypeScript
FunctionDeclaration
/** * Get the latest build artifacts for a project * * @example branch - The branch you would like to look in for the latest build. Returns artifacts for latest build in entire project if omitted. * @example filter - Restricts which builds are returned. Set to "completed", "successful", "failed", "running" * * @see https://circleci.com/docs/api/v1-reference/#build-artifacts-latest * @example GET - /project/:vcs-type/:username/:project/latest/artifacts?branch=:branch&filter=:filter * @param token - CircleCI API token * @param vcs - Project's git information * @param options - Query parameters */ export function getLatestArtifacts( token: string, { vcs, options = {} }: GitRequiredRequest ): Promise<ArtifactResponse> { const { branch, filter } = options; const url = `${createVcsUrl(vcs)}/latest/artifacts${queryParams({ branch, filter })}`; return client(token).get<ArtifactResponse>(url); }
davidwallacejackson/circleci-api
src/api/artifacts.ts
TypeScript
ArrowFunction
(subjectName: string): string | undefined => subjectName.match(/CN=(.+?)(?:,|$)/)?.[1]
AlexeyWapo/crypto-pro
src/helpers/_extractCommonName.ts
TypeScript
ArrowFunction
async ({ callES, dynamicSettings, }) => { const callAsCurrentUser: APICaller = async ( endpoint: string, clientParams: Record<string, any> = {}, options?: CallAPIOptions ) => callES(endpoint, clientParams, options); const indexPatternsFetcher = new IndexPatternsFetcher(callAsCurrentUser); // Since `getDynamicIndexPattern` is called in setup_request (and thus by every endpoint) // and since `getFieldsForWildcard` will throw if the specified indices don't exist, // we have to catch errors here to avoid all endpoints returning 500 for users without APM data // (would be a bad first time experience) try { const fields = await indexPatternsFetcher.getFieldsForWildcard({ pattern: dynamicSettings.heartbeatIndices, }); const indexPattern: IIndexPattern = { fields, title: dynamicSettings.heartbeatIndices, }; return indexPattern; } catch (e) { const notExists = e.output?.statusCode === 404; if (notExists) { // eslint-disable-next-line no-console console.error( `Could not get dynamic index pattern because indices "${dynamicSettings.heartbeatIndices}" don't exist` ); return; } // re-throw throw e; } }
AlexCornigeanu/kibana
x-pack/plugins/uptime/server/lib/requests/get_index_pattern.ts
TypeScript
ArrowFunction
async ( endpoint: string, clientParams: Record<string, any> = {}, options?: CallAPIOptions ) => callES(endpoint, clientParams, options)
AlexCornigeanu/kibana
x-pack/plugins/uptime/server/lib/requests/get_index_pattern.ts
TypeScript
ClassDeclaration
export class ItemProperty { constructor( public id: string, public name: Text[] = [], // value bir dil icin birden fazla deger olabilir. Yani su sekilde olacak (ornegin name = [ color , renk ]): // value = [ tr:kirmizi, tr:mavi, en:red, en: blue ] public value: Text[] = [], public valueDecimal: number[], public valueQuantity: Quantity[], public valueBinary: BinaryObject[], public valueQualifier: PropertyValueQualifier, public itemClassificationCode: Code, public uri: string, public associatedCatalogueLineID: number[], // hjids of catalogue lines public required:boolean = false, // whether this property is required or not (does not exist in the backend data model and used only in the UI) public options:Text[] = [] // available options to be selected as a value for the item property (does not exist in the backend data model and used only in the UI) ) { } }
hrabhijith/frontend-service
src/app/catalogue/model/publish/item-property.ts
TypeScript
ArrowFunction
async (req: NextApiRequest, res: NextApiResponse) => { const credential = await useCredential() if ( credential.accessToken == null || credential.refreshToken == null || credential.accessToken.length <= 0 || credential.refreshToken.length <= 0 ) return res.status(401) const fitbit = useFitbit() fetch(credential, fitbit).then((activity) => { res.json(JSON.stringify(activity)) }) }
iamtakagi/fitbit-insights
src/pages/api/fitbit.ts
TypeScript
ArrowFunction
(activity) => { res.json(JSON.stringify(activity)) }
iamtakagi/fitbit-insights
src/pages/api/fitbit.ts
TypeScript
FunctionDeclaration
async function addStatusLogEntry(): Promise<void> { await connect(); await Status.logStatus(); await disconnect(); }
simbo/home-internet-connection
src/server/cron-tasks/log-status.task.ts
TypeScript
ArrowFunction
(søknad: ISøknad) => { const fraOmDeg = [ søknad.søker.oppholdsland.svar, søknad.søker.arbeidsland.svar, søknad.søker.pensjonsland.svar, ]; const fraOmBarnet = søknad.barnInkludertISøknaden.flatMap((barn: IBarnMedISøknad) => [ barn.oppholdsland.svar, barn.barnetrygdFraEøslandHvilketLand.svar, barn.andreForelderArbeidUtlandetHvilketLand.svar, barn.andreForelderPensjonHvilketLand.svar, ]); return fraOmDeg.concat(fraOmBarnet); }
navikt/familie-ba-soknad
src/frontend/utils/eøs.ts
TypeScript
ArrowFunction
(barn: IBarnMedISøknad) => [ barn.oppholdsland.svar, barn.barnetrygdFraEøslandHvilketLand.svar, barn.andreForelderArbeidUtlandetHvilketLand.svar, barn.andreForelderPensjonHvilketLand.svar, ]
navikt/familie-ba-soknad
src/frontend/utils/eøs.ts
TypeScript
ArrowFunction
(søknad: ISøknad) => søknad.mottarBarnetrygdForBarnFraAnnetEøsland.svar === ESvar.JA
navikt/familie-ba-soknad
src/frontend/utils/eøs.ts
TypeScript
FunctionDeclaration
async function loadArtistsByGroupIds(ids: GroupId[]) { const rows = await ArtistModel.find({ groupId: { $in: ids } }); return ids.map((id) => ( rows.filter((x) => ( x.groupId.toString() === id.toString() )) )); }
Musly/musly-api
app/artist/ArtistLoader.ts
TypeScript
FunctionDeclaration
async function loadArtistByIds(ids: ArtistId[]) { const rows = await ArtistModel.find({ _id: { $in: ids } }); return ids.map((id) => ( rows.filter((x) => ( x._id.toString() === id.toString() )) )); }
Musly/musly-api
app/artist/ArtistLoader.ts
TypeScript