type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
ArrowFunction |
(resource) =>
resource.status?.conditions?.find(
(c) => c.type === 'Upgradeable' && c.status === K8sResourceConditionStatus.False,
) | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(c) => c.type === 'Upgradeable' && c.status === K8sResourceConditionStatus.False | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(resources) =>
resources.filter((resource) => getConditionUpgradeableFalse(resource)) | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(resource) => getConditionUpgradeableFalse(resource) | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
EnumDeclaration |
export enum ClusterUpdateStatus {
UpToDate = 'Up to Date',
UpdatesAvailable = 'Updates Available',
Updating = 'Updating',
Failing = 'Failing',
UpdatingAndFailing = 'Updating and Failing',
ErrorRetrieving = 'Error Retrieving',
Invalid = 'Invalid Cluster Version',
} | DaoDaoNoCode/console | frontend/public/module/k8s/cluster-settings.ts | TypeScript |
ArrowFunction |
(date?: Date | null, format = DefaultFormat) => {
if (date) {
return dayjs(date).format(format);
}
return date;
} | doly-dev/mobile-more | src/components/BizForm/demos/components/ItemSpecialDatePicker/SpecialDatePicker.tsx | TypeScript |
ArrowFunction |
(type: string, data: number) => {
switch (type) {
case 'year':
return data + '年';
case 'month':
return data + '月';
case 'day':
return data + '日';
default:
return data;
}
} | doly-dev/mobile-more | src/components/BizForm/demos/components/ItemSpecialDatePicker/SpecialDatePicker.tsx | TypeScript |
ArrowFunction |
({
value,
format = DefaultFormat,
readOnly = false,
placeholder = '请选择',
specialValue = safeDate('9999-12-31'),
specialLabel = '长期',
onConfirm,
onClose,
...restProps
}) => {
const fmtValue = value ? formatDate(value, format) : value;
const isSpecial = React.useMemo(
() => fmtValue === formatD... | doly-dev/mobile-more | src/components/BizForm/demos/components/ItemSpecialDatePicker/SpecialDatePicker.tsx | TypeScript |
ArrowFunction |
() => fmtValue === formatDate(specialValue, format) | doly-dev/mobile-more | src/components/BizForm/demos/components/ItemSpecialDatePicker/SpecialDatePicker.tsx | TypeScript |
ArrowFunction |
(checked: boolean) => {
onClose?.();
if (!readOnly) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
onConfirm?.(checked ? specialValue : undefined);
}
} | doly-dev/mobile-more | src/components/BizForm/demos/components/ItemSpecialDatePicker/SpecialDatePicker.tsx | TypeScript |
InterfaceDeclaration |
export interface SpecialDatePickerProps extends DatePickerProps {
format?: string;
readOnly?: boolean;
specialValue?: Date;
specialLabel?: React.ReactNode;
placeholder?: string;
} | doly-dev/mobile-more | src/components/BizForm/demos/components/ItemSpecialDatePicker/SpecialDatePicker.tsx | TypeScript |
ArrowFunction |
({ erOverstyrt, utbetaling, style }: UtbetalingCellProps) => (
<Cell erOverstyrt={erOverstyrt} | navikt/helse-speil | src/client/routes/saksbilde/utbetaling/utbetalingstabell/UtbetalingCell.tsx | TypeScript |
InterfaceDeclaration |
interface UtbetalingCellProps extends React.HTMLAttributes<HTMLTableDataCellElement> {
erOverstyrt?: boolean;
utbetaling?: number;
} | navikt/helse-speil | src/client/routes/saksbilde/utbetaling/utbetalingstabell/UtbetalingCell.tsx | TypeScript |
MethodDeclaration |
somPenger(utbetaling) | navikt/helse-speil | src/client/routes/saksbilde/utbetaling/utbetalingstabell/UtbetalingCell.tsx | TypeScript |
FunctionDeclaration | /**
* Recursively process the handlebars templates for the given project.
* @param {string} currentPath
* @param {string} fullFolderPath
*/
function processFolder(currentPath, fullFolderPath) {
fs.readdirSync(fullFolderPath).forEach(function(fileName) {
let f = parseFileName(fileName, projectParameters)... | bmustiata/ars | src/main.ts | TypeScript |
FunctionDeclaration | /**
* parseFileName - Parse the file name
* @param {string} fileName
* @param {any} projectParameters
* @return {Object}
*/
function parseFileName(fileName, projectParameters) {
const result = {
name: null,
originalName: fileName,
keepExisting: false,
hbsTemplate: false
};
... | bmustiata/ars | src/main.ts | TypeScript |
FunctionDeclaration | /**
* isDirectory - Checks if the given file path is a directory.
* @param {string} name
* @return {boolean}
*/
function isDirectory(name) {
try {
return fs.statSync(name).isDirectory();
} catch (e) {
return false;
}
} | bmustiata/ars | src/main.ts | TypeScript |
FunctionDeclaration | /**
* isFile - Checks if the given file path is an existing file
* @param {string} name
* @return {boolean}
*/
function isFile(name) {
try {
return fs.statSync(name).isFile();
} catch (e) {
return false;
}
} | bmustiata/ars | src/main.ts | TypeScript |
FunctionDeclaration | /**
* executeDiff - Execute the given diff process.
* @param {string} diff program name
* @param {string} file1 first file to diff
* @param {string} file2 second file do diff
* @return {void}
*/
function executeDiff(processName, file1, file2) {
childProcess.execSync(
`${processName} "${file1}" "${file... | bmustiata/ars | src/main.ts | TypeScript |
ArrowFunction |
(it) => {
console.log(` * ${it}`)
} | bmustiata/ars | src/main.ts | TypeScript |
FunctionDeclaration | /**
* Get specific province data with IDataProvince object structure
*
* Return object data based on provided province key
*
* @param {string} provinceKey - Array key of the province
* @return {IDataProvince} IDataProvince object
**/
export function getDataProvince(provinceKey: string): IDataProvince {
return... | agraris/nusantara-valid | src/ts/functions/extended/_province.extended.ts | TypeScript |
FunctionDeclaration | /**
* Get all province data with IDataProvince object structure
*
* Return all IDataProvince object in Array<IDataProvince>
*
* @return {IDataProvince[]} Array of IDataProvince object
**/
export function getDataProvinces(): IDataProvince[]{
return prov.getData() as IDataProvince[]
} | agraris/nusantara-valid | src/ts/functions/extended/_province.extended.ts | TypeScript |
FunctionDeclaration | /**
* Get all regencies in a Province
*
* Return an array of regencies in a Province
*
* @param {string} provinceKey - Key of the province
* @return {IDataRegency[]} Array of IDataRegency object
**/
export function getDataRegenciesInProvince(provinceKey: string): IDataRegency[] {
return prov.getDataRegenciesI... | agraris/nusantara-valid | src/ts/functions/extended/_province.extended.ts | TypeScript |
FunctionDeclaration | /**
* Get all districts in a Regency
*
* Return an array of districts in a Regency
*
* @param {string} regencyKey - Key of the regency
* @return {IDataDistrict[]} Array of IDataDistrict object
**/
export function getDataDistrictsInRegency(regencyKey: string): IDataDistrict[] {
return prov.getDataDistrictsInRe... | agraris/nusantara-valid | src/ts/functions/extended/_province.extended.ts | TypeScript |
ArrowFunction |
({ bpsCode, name }) => ({ bpsCode, name }) | agraris/nusantara-valid | src/ts/functions/extended/_province.extended.ts | TypeScript |
ClassDeclaration | /**
* Nusantara Valid: _province.extended.ts
*
* Licensed under MIT (https://github.com/agraris/nusantara-valid/blob/master/LICENSE)
*
* @class The ProvinceExtended class
**/
class ProvinceExtended extends Province {
getDataRegenciesInProvince(provinceKey: string): IDataRegency[] {
const REGENCIES = PR... | agraris/nusantara-valid | src/ts/functions/extended/_province.extended.ts | TypeScript |
MethodDeclaration |
getDataRegenciesInProvince(provinceKey: string): IDataRegency[] {
const REGENCIES = PROVINCE_DATA_EXTENSION[provinceKey].regencies as []
const regencies = REGENCIES.map(({ bpsCode, name }) => ({ bpsCode, name }))
return regencies
} | agraris/nusantara-valid | src/ts/functions/extended/_province.extended.ts | TypeScript |
MethodDeclaration |
getDataDistrictsInRegency(regencyKey: string): IDataDistrict[] {
const provinceKey = regencyKey.split('.')[0]
const REGENCIES = PROVINCE_DATA_EXTENSION[provinceKey].regencies
let DISTRICTS = []
for (const element of REGENCIES) {
if (element.bpsCode == regencyKey) {
... | agraris/nusantara-valid | src/ts/functions/extended/_province.extended.ts | TypeScript |
ArrowFunction |
({
messages,
}: {
messages: MessageUI[]
}): ReactElement => {
const message = messages[0]
return (
<View
style={{
alignItems: 'flex-start',
justifyContent: 'flex-start',
}} | terra-money/station-mobile | src/components/history/HistoryItem.tsx | TypeScript |
ArrowFunction |
(item, index) => {
return (
<Text
key={`message.summary-${index}`} | terra-money/station-mobile | src/components/history/HistoryItem.tsx | TypeScript |
ArrowFunction |
({ item }: { item: TxUI }): ReactElement => {
return (
<ExtLink
url={item.link}
title={
<View>
{_.some(item.messages) && (
<Message messages={item.messages} /> | terra-money/station-mobile | src/components/history/HistoryItem.tsx | TypeScript |
ArrowFunction |
async () => {
const container = await createContainer();
process.on("uncaughtException", (err) => {
container.resolve<Logger>("logger").error(`Uncaught: ${err.toString()}`, err);
process.exit(1);
});
process.on("unhandledRejection", (err) => {
if (err) {
container.resolve<Logger>("logger").e... | low-cpu/express-boilerplate | src/index.ts | TypeScript |
ArrowFunction |
(err) => {
container.resolve<Logger>("logger").error(`Uncaught: ${err.toString()}`, err);
process.exit(1);
} | low-cpu/express-boilerplate | src/index.ts | TypeScript |
ArrowFunction |
(err) => {
if (err) {
container.resolve<Logger>("logger").error(`Unhandled: ${err.toString()}`, err);
}
process.exit(1);
} | low-cpu/express-boilerplate | src/index.ts | TypeScript |
ArrowFunction |
item => item.id !== categoryId | felagos/store-app | src/product/services/product/product.service.ts | TypeScript |
ClassDeclaration |
@Injectable()
export class ProductService {
constructor(
@InjectRepository(ProductRepository) private productRepository: ProductRepository,
@InjectRepository(BrandRepository) private brandRepository: BrandRepository,
@InjectRepository(CategoryRepository) private categoryRepository: Categor... | felagos/store-app | src/product/services/product/product.service.ts | TypeScript |
MethodDeclaration |
findAllPagination(filter?: FilterProductsDto): Promise<PaginationResponseDto<Product[]>> {
return this.productRepository.findAllPagination(filter);
} | felagos/store-app | src/product/services/product/product.service.ts | TypeScript |
MethodDeclaration |
async findOne(id: number): Promise<Product> {
const product = await this.productRepository.findOne(id);
if (!product) throw new NotFoundException('Product not found');
return product;
} | felagos/store-app | src/product/services/product/product.service.ts | TypeScript |
MethodDeclaration |
async create(payload: CreateProductDTO): Promise<Product> {
const newProduct = this.productRepository.create(payload);
if (payload.brandId) {
const brand = await this.brandRepository.findOne(payload.brandId);
newProduct.brand = brand;
}
if (payload.categoriesIds)... | felagos/store-app | src/product/services/product/product.service.ts | TypeScript |
MethodDeclaration |
async update(id: number, changes: UpdateProductDTO): Promise<Product> {
const product = await this.productRepository.findOne(id);
if (changes.brandId) {
const brand = await this.brandRepository.findOne(changes.brandId);
product.brand = brand;
}
if (changes.catego... | felagos/store-app | src/product/services/product/product.service.ts | TypeScript |
MethodDeclaration |
async remove(id: number) {
const result = await this.productRepository.delete(id);
if (result.affected === 0) throw new NotFoundException('Product not found');
} | felagos/store-app | src/product/services/product/product.service.ts | TypeScript |
MethodDeclaration |
async removeCategoryByProduct(productId: number, categoryId: number) {
const product = await this.productRepository.findOne(productId, {
relations: ['categories'],
});
product.categories = product.categories.filter(item => item.id !== categoryId);
return this.productReposito... | felagos/store-app | src/product/services/product/product.service.ts | TypeScript |
MethodDeclaration |
async addCategoryToProduct(productId: number, categoryId: number) {
const product = await this.productRepository.findOne(productId, {
relations: ['categories']
});
const category = await this.categoryRepository.findOne(categoryId);
product.categories.push(category);
... | felagos/store-app | src/product/services/product/product.service.ts | TypeScript |
ClassDeclaration |
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule],
})
export class AppRoutingRoutingModule { } | stefanwalther/angular-markdown-editor | src/app/app-routing.module.ts | TypeScript |
ArrowFunction |
(user) => user.profileId | gemma-Kim/study-nest | src/module/user/entity/user.entity.ts | TypeScript |
ClassDeclaration | // @Entity('user')
// export class User {
// @PrimaryGeneratedColumn()
// id: number;
// @Column()
// email: string;
// @Column()
// nickname: string;
// @Column()
// password: string;
// @CreateDateColumn()
// createAt: string;
// @UpdateDateColumn()
// updateAt: string;
// @OneToMany(() => U... | gemma-Kim/study-nest | src/module/user/entity/user.entity.ts | TypeScript |
ClassDeclaration |
@Injectable()
export class TodoService {
constructor(
@InjectRepository(ToDo) private todoRepository: Repository<ToDo>,
) {}
async findAll(): Promise<ToDo[]> {
return await this.todoRepository.find();
}
async findById(id_todo: number): Promise<ToDo[]> {
return await this.todoRepository.find({ i... | Inushin/pruebaNestJS | src/todo/todo.service.ts | TypeScript |
MethodDeclaration |
async findAll(): Promise<ToDo[]> {
return await this.todoRepository.find();
} | Inushin/pruebaNestJS | src/todo/todo.service.ts | TypeScript |
MethodDeclaration |
async findById(id_todo: number): Promise<ToDo[]> {
return await this.todoRepository.find({ id_todo });
} | Inushin/pruebaNestJS | src/todo/todo.service.ts | TypeScript |
MethodDeclaration |
async findToDosByUserId(userId: number): Promise<ToDo[]> {
return await this.todoRepository.find({ where: { user: userId } });
} | Inushin/pruebaNestJS | src/todo/todo.service.ts | TypeScript |
MethodDeclaration |
async create(todo: CrearToDo): Promise<ToDo> {
let actividad = this.todoRepository.create(todo);
return await this.todoRepository.save(actividad);
} | Inushin/pruebaNestJS | src/todo/todo.service.ts | TypeScript |
MethodDeclaration |
async update(todo: ModificarToDo): Promise<ToDo> {
let modificado = await this.findById(todo.id_todo);
modificado[0].actividad = todo.actividad;
modificado[0].finalizada = todo.finalizada;
return await this.todoRepository.save(modificado[0]);
} | Inushin/pruebaNestJS | src/todo/todo.service.ts | TypeScript |
MethodDeclaration |
async remove(id_todo: number) {
await this.todoRepository.delete(id_todo);
} | Inushin/pruebaNestJS | src/todo/todo.service.ts | TypeScript |
MethodDeclaration | /**
* 检查指定的组是否正在加载中
* @method RES.ResourceLoader#isGroupInLoading
* @param groupName {string}
* @returns {boolean}
*/
public isGroupInLoading(groupName:string):boolean{
return this.itemListDic[groupName]!==undefined;
} | 000D/egret-core | src/extension/resource/core/ResourceLoader.ts | TypeScript |
MethodDeclaration | /**
* 开始加载一组文件
* @method RES.ResourceLoader#loadGroup
* @param list {egret.Array<ResourceItem>} 加载项列表
* @param groupName {string} 组名
* @param priority {number} 加载优先级
*/
public loadGroup(list:Array<ResourceItem>,groupName:string,priority:number=0):void{
if(this.itemListDic[groupName]||!groupName)
... | 000D/egret-core | src/extension/resource/core/ResourceLoader.ts | TypeScript |
MethodDeclaration | /**
* 加载一个文件
* @method RES.ResourceLoader#loadItem
* @param resItem {egret.ResourceItem} 要加载的项
*/
public loadItem(resItem:ResourceItem):void{
this.lazyLoadList.push(resItem);
resItem.groupName = "";
this.next();
} | 000D/egret-core | src/extension/resource/core/ResourceLoader.ts | TypeScript |
MethodDeclaration | /**
* 加载下一项
*/
private next():void{
while(this.loadingCount<this.thread) {
let resItem:ResourceItem = this.getOneResourceItem();
if(!resItem)
break;
this.loadingCount++;
if(resItem.loaded){
this.onI... | 000D/egret-core | src/extension/resource/core/ResourceLoader.ts | TypeScript |
MethodDeclaration | /**
* 获取下一个待加载项
*/
private getOneResourceItem():ResourceItem{
if (this.failedList.length > 0)
return this.failedList.shift();
let maxPriority:number = Number.NEGATIVE_INFINITY;
for(let p in this.priorityQueue){
maxPriority = Math.max(maxPriority,<number><any> p);
}
let ... | 000D/egret-core | src/extension/resource/core/ResourceLoader.ts | TypeScript |
MethodDeclaration | /**
* 加载结束
*/
private onItemComplete(resItem:ResourceItem):void{
this.loadingCount--;
let groupName:string = resItem.groupName;
if(!resItem.loaded){//加载失败
let times = this.retryTimesDic[resItem.name] || 1;
if (times > this.maxRetryTimes) {
dele... | 000D/egret-core | src/extension/resource/core/ResourceLoader.ts | TypeScript |
MethodDeclaration | /**
* 从优先级队列中移除指定的组名
*/
private removeGroupName(groupName:string):void{
for(let p in this.priorityQueue){
let queue:any[] = this.priorityQueue[p];
let index:number = 0;
let found:boolean = false;
let length:number = queue.length;
for(let i:number=0;i<length;i++){
... | 000D/egret-core | src/extension/resource/core/ResourceLoader.ts | TypeScript |
FunctionDeclaration |
export declare function getPermissionTypes({ includeRestrictedPermissions }: {
includeRestrictedPermissions?: boolean | undefined;
}): Readonly<{
access_activity: {
name: string;
description: string;
};
access_user_profile: {
name: string;
description: string;
};
... | Judge24601/Lumohacks | FitBit/node_modules/@fitbit/sdk/lib/ProjectConfiguration.d.ts | TypeScript |
FunctionDeclaration |
export declare function normalizeProjectConfig(config: any, defaults?: Partial<AppProjectConfiguration & ClockProjectConfiguration>): ProjectConfiguration; | Judge24601/Lumohacks | FitBit/node_modules/@fitbit/sdk/lib/ProjectConfiguration.d.ts | TypeScript |
FunctionDeclaration |
export declare function validateAppType(config: ProjectConfiguration): DiagnosticList; | Judge24601/Lumohacks | FitBit/node_modules/@fitbit/sdk/lib/ProjectConfiguration.d.ts | TypeScript |
FunctionDeclaration |
export declare function validateDisplayName(name: string): string | true; | Judge24601/Lumohacks | FitBit/node_modules/@fitbit/sdk/lib/ProjectConfiguration.d.ts | TypeScript |
FunctionDeclaration |
export declare function validateProjectDisplayName(config: ProjectConfiguration): DiagnosticList; | Judge24601/Lumohacks | FitBit/node_modules/@fitbit/sdk/lib/ProjectConfiguration.d.ts | TypeScript |
FunctionDeclaration |
export declare function validateWipeColor(config: ProjectConfiguration): DiagnosticList; | Judge24601/Lumohacks | FitBit/node_modules/@fitbit/sdk/lib/ProjectConfiguration.d.ts | TypeScript |
FunctionDeclaration |
export declare function validateRequestedPermissions({ requestedPermissions }: ProjectConfiguration): DiagnosticList; | Judge24601/Lumohacks | FitBit/node_modules/@fitbit/sdk/lib/ProjectConfiguration.d.ts | TypeScript |
FunctionDeclaration |
export declare function validateBuildTarget({ buildTargets }: ProjectConfiguration): DiagnosticList; | Judge24601/Lumohacks | FitBit/node_modules/@fitbit/sdk/lib/ProjectConfiguration.d.ts | TypeScript |
FunctionDeclaration |
export declare function validateLocaleDisplayName({ i18n }: ProjectConfiguration, localeKey: keyof typeof LOCALES): DiagnosticList; | Judge24601/Lumohacks | FitBit/node_modules/@fitbit/sdk/lib/ProjectConfiguration.d.ts | TypeScript |
FunctionDeclaration |
export declare function validateLocaleDisplayNames(config: ProjectConfiguration): DiagnosticList; | Judge24601/Lumohacks | FitBit/node_modules/@fitbit/sdk/lib/ProjectConfiguration.d.ts | TypeScript |
FunctionDeclaration |
export declare function validateSupportedLocales({ i18n }: ProjectConfiguration): DiagnosticList; | Judge24601/Lumohacks | FitBit/node_modules/@fitbit/sdk/lib/ProjectConfiguration.d.ts | TypeScript |
FunctionDeclaration |
export declare function validateAppUUID({ appUUID }: ProjectConfiguration): DiagnosticList; | Judge24601/Lumohacks | FitBit/node_modules/@fitbit/sdk/lib/ProjectConfiguration.d.ts | TypeScript |
FunctionDeclaration |
export declare function validate(config: ProjectConfiguration): DiagnosticList; | Judge24601/Lumohacks | FitBit/node_modules/@fitbit/sdk/lib/ProjectConfiguration.d.ts | TypeScript |
InterfaceDeclaration |
export interface BaseProjectConfiguration {
appType: AppType;
appDisplayName: string;
appUUID: string;
requestedPermissions: string[];
i18n: LocalesConfig;
buildTargets: BuildTarget[];
enableProposedAPI?: true;
} | Judge24601/Lumohacks | FitBit/node_modules/@fitbit/sdk/lib/ProjectConfiguration.d.ts | TypeScript |
InterfaceDeclaration |
export interface AppProjectConfiguration extends BaseProjectConfiguration {
appType: AppType.APP;
wipeColor: string;
iconFile: string;
} | Judge24601/Lumohacks | FitBit/node_modules/@fitbit/sdk/lib/ProjectConfiguration.d.ts | TypeScript |
InterfaceDeclaration |
export interface ClockProjectConfiguration extends BaseProjectConfiguration {
appType: AppType.CLOCKFACE;
} | Judge24601/Lumohacks | FitBit/node_modules/@fitbit/sdk/lib/ProjectConfiguration.d.ts | TypeScript |
EnumDeclaration |
export declare enum AppType {
APP = "app",
CLOCKFACE = "clockface"
} | Judge24601/Lumohacks | FitBit/node_modules/@fitbit/sdk/lib/ProjectConfiguration.d.ts | TypeScript |
EnumDeclaration |
export declare enum BuildTarget {
HIGGS = "higgs",
MESON = "meson"
} | Judge24601/Lumohacks | FitBit/node_modules/@fitbit/sdk/lib/ProjectConfiguration.d.ts | TypeScript |
TypeAliasDeclaration |
export declare type LocalesConfig = {
[locale: string]: {
name: string;
};
}; | Judge24601/Lumohacks | FitBit/node_modules/@fitbit/sdk/lib/ProjectConfiguration.d.ts | TypeScript |
TypeAliasDeclaration |
declare type ProjectConfiguration = AppProjectConfiguration | ClockProjectConfiguration; | Judge24601/Lumohacks | FitBit/node_modules/@fitbit/sdk/lib/ProjectConfiguration.d.ts | TypeScript |
ArrowFunction |
w => w.name === name | RetrogradeAmnesia/Bot | src/api/modules/logging/webhook-logger.ts | TypeScript |
ClassDeclaration |
export class WebhookLogger {
constructor(
private bot = Deps.get<Client>(Client)
) {}
public async get(channelId: string, name: string) {
const channel = this.bot.channels.cache.get(channelId) as TextChannel;
if (!channel) return;
const webhooks = await channel.fetchWebhooks();
return webho... | RetrogradeAmnesia/Bot | src/api/modules/logging/webhook-logger.ts | TypeScript |
MethodDeclaration |
public async get(channelId: string, name: string) {
const channel = this.bot.channels.cache.get(channelId) as TextChannel;
if (!channel) return;
const webhooks = await channel.fetchWebhooks();
return webhooks.find(w => w.name === name)
?? await channel.createWebhook(name, {
avatar: this.... | RetrogradeAmnesia/Bot | src/api/modules/logging/webhook-logger.ts | TypeScript |
MethodDeclaration |
public async feedback(message: string) {
const webhook = await this.get(process.env.FEEDBACK_CHANNEL_ID, `${process.env.BOT_NAME} - Feedback`);
if (!webhook) return;
await webhook.send(new MessageEmbed({
title: 'Feedback',
description: message
}));
} | RetrogradeAmnesia/Bot | src/api/modules/logging/webhook-logger.ts | TypeScript |
MethodDeclaration |
public async vote(userId: string, votes: number) {
const webhook = await this.get(process.env.VOTE_CHANNEL_ID, `${process.env.BOT_NAME} - Vote`);
if (!webhook) return;
await webhook.send(new MessageEmbed({
title: 'Vote',
description: `✅ <@!${userId}> has entered, and now has \`${votes}\` entri... | RetrogradeAmnesia/Bot | src/api/modules/logging/webhook-logger.ts | TypeScript |
ClassDeclaration |
export declare class Abbr extends Root {
constructor(id: string);
} | mariousm/TestingAWE | dist/libraryWIO/class/Abbr.d.ts | TypeScript |
FunctionDeclaration |
function definePowerCreepGetter<T extends keyof PowerCreep>(
property: T,
handler: (self: PowerCreep) => PowerCreep[T],
) {
defineGetter<PowerCreep, PowerCreepConstructor, T>(
PowerCreep,
property,
handler,
)
} | stachu3478/screeps-bot | src/overloads/powerCreep/PowerCreep.ts | TypeScript |
FunctionDeclaration |
function memoizeByPowerCreep<T>(fn: (c: PowerCreep) => T) {
return _.memoize(fn, (c: PowerCreep) => c.id)
} | stachu3478/screeps-bot | src/overloads/powerCreep/PowerCreep.ts | TypeScript |
ArrowFunction |
(c: PowerCreep) => c.id | stachu3478/screeps-bot | src/overloads/powerCreep/PowerCreep.ts | TypeScript |
ArrowFunction |
(c) => new PowerCreepCorpus(c) | stachu3478/screeps-bot | src/overloads/powerCreep/PowerCreep.ts | TypeScript |
ArrowFunction |
(self) => powerCreepCorpus(self) | stachu3478/screeps-bot | src/overloads/powerCreep/PowerCreep.ts | TypeScript |
ArrowFunction |
(self) => 0 | stachu3478/screeps-bot | src/overloads/powerCreep/PowerCreep.ts | TypeScript |
ArrowFunction |
params => {
// this.serviceMaintenanceId = params['id'];
} | https-github-com-blackshot/auto-frontend | src/app/features/service-maintenance/components/service-maintenance-control/service-maintenance-control.component.ts | TypeScript |
ArrowFunction |
(res) => {
this.openSnackBar('Данные успешно сохранены!');
this.serviceMaintenance = new ServiceMaintenance();
console.log('res', res);
} | https-github-com-blackshot/auto-frontend | src/app/features/service-maintenance/components/service-maintenance-control/service-maintenance-control.component.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'app-service-maintenance-control',
templateUrl: './service-maintenance-control.component.html',
styleUrls: ['./service-maintenance-control.component.scss']
})
export class ServiceMaintenanceControlComponent implements OnInit, OnDestroy {
@Output() public myOutput = new EventEmitter();... | https-github-com-blackshot/auto-frontend | src/app/features/service-maintenance/components/service-maintenance-control/service-maintenance-control.component.ts | TypeScript |
MethodDeclaration |
ngOnInit(): void {
this.serviceMaintenance = new ServiceMaintenance();
// this.loadServiceMaintenance();
this._route.params.subscribe(params => {
// this.serviceMaintenanceId = params['id'];
});
} | https-github-com-blackshot/auto-frontend | src/app/features/service-maintenance/components/service-maintenance-control/service-maintenance-control.component.ts | TypeScript |
MethodDeclaration |
ngOnDestroy(): void {
this._unsubscribeAll.next();
this._unsubscribeAll.complete();
} | https-github-com-blackshot/auto-frontend | src/app/features/service-maintenance/components/service-maintenance-control/service-maintenance-control.component.ts | TypeScript |
MethodDeclaration |
public buttonClick(): void {
this.myOutput.emit(true);
} | https-github-com-blackshot/auto-frontend | src/app/features/service-maintenance/components/service-maintenance-control/service-maintenance-control.component.ts | TypeScript |
MethodDeclaration | // loadServiceMaintenance(): void {
// this._serviceMaintenanceService.getServiceMaintenance(this.serviceMaintenanceId)
// .pipe(takeUntil(this._unsubscribeAll)).subscribe((res) => {
// this.serviceMaintenance = res;
// console.log(this.serviceMaintenance);
// });
// }
create(): void {
... | https-github-com-blackshot/auto-frontend | src/app/features/service-maintenance/components/service-maintenance-control/service-maintenance-control.component.ts | TypeScript |
MethodDeclaration |
openSnackBar(message: string) {
this._snackBar.open(message, '', {
duration: 2000,
horizontalPosition: this.horizontalPosition,
verticalPosition: this.verticalPosition,
});
} | https-github-com-blackshot/auto-frontend | src/app/features/service-maintenance/components/service-maintenance-control/service-maintenance-control.component.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.