type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
ArrowFunction
() => { openExternal( 'https://chiaforkscalculator.com', ); }
silicoin-network/silicoin-blockchain-gui
src/electron/main.tsx
TypeScript
ArrowFunction
() => { openExternal( 'https://chiaforksblockchain.com', ); }
silicoin-network/silicoin-blockchain-gui
src/electron/main.tsx
TypeScript
ArrowFunction
() => { openExternal( 'https://github.com/silicoin-network/silicoin-blockchain/issues', ); }
silicoin-network/silicoin-blockchain-gui
src/electron/main.tsx
TypeScript
ArrowFunction
() => { openExternal('https://keybase.io/team/silicoin_network.public'); }
silicoin-network/silicoin-blockchain-gui
src/electron/main.tsx
TypeScript
ArrowFunction
() => { openExternal('https://twitter.com/SilicoinProject'); }
silicoin-network/silicoin-blockchain-gui
src/electron/main.tsx
TypeScript
ArrowFunction
() => { openAbout(); }
silicoin-network/silicoin-blockchain-gui
src/electron/main.tsx
TypeScript
ArrowFunction
(url) => { // console.log(`openExternal: ${url}`) shell.openExternal(url); }
silicoin-network/silicoin-blockchain-gui
src/electron/main.tsx
TypeScript
MethodDeclaration
click() { openAbout(); }
silicoin-network/silicoin-blockchain-gui
src/electron/main.tsx
TypeScript
ArrowFunction
(tab: AppBarItem): string => { let internalTabPath = tab.path; if (Array.isArray(internalTabPath)) { [internalTabPath] = tab.path; } return internalTabPath; }
Mefjus/smart-gate
packages/client/src/elements/AppBar/index.tsx
TypeScript
ArrowFunction
({ tabs = defaultTabs }: AppBarProps) => { const { isMobile } = useMediaDevice(); const [currentUser] = useCurrentUser(); const sortedItems = useMemo( () => tabs .filter((tab) => hasAccess(tab.onlyAdmin, currentUser)) .map((tab) => { const { index, indexMobile } = tab; ...
Mefjus/smart-gate
packages/client/src/elements/AppBar/index.tsx
TypeScript
ArrowFunction
() => tabs .filter((tab) => hasAccess(tab.onlyAdmin, currentUser)) .map((tab) => { const { index, indexMobile } = tab; const reindexTab = tab; if (isMobile) { reindexTab.index = indexMobile ?? index; } return reindexTab; }) ...
Mefjus/smart-gate
packages/client/src/elements/AppBar/index.tsx
TypeScript
ArrowFunction
(tab) => hasAccess(tab.onlyAdmin, currentUser)
Mefjus/smart-gate
packages/client/src/elements/AppBar/index.tsx
TypeScript
ArrowFunction
(tab) => { const { index, indexMobile } = tab; const reindexTab = tab; if (isMobile) { reindexTab.index = indexMobile ?? index; } return reindexTab; }
Mefjus/smart-gate
packages/client/src/elements/AppBar/index.tsx
TypeScript
ArrowFunction
(tabA, tabB) => tabA.index - tabB.index
Mefjus/smart-gate
packages/client/src/elements/AppBar/index.tsx
TypeScript
ArrowFunction
(tab, index) => { const reindexTab = tab; reindexTab.index = index; return reindexTab; }
Mefjus/smart-gate
packages/client/src/elements/AppBar/index.tsx
TypeScript
ArrowFunction
() => sortedItems.find((tab) => { const historyPath = history.location.pathname; const internalTabPath = getTabPath(tab); if (internalTabPath === '/') { return historyPath === internalTabPath; } return historyPath.startsWith(internalTabPath); })?.index
Mefjus/smart-gate
packages/client/src/elements/AppBar/index.tsx
TypeScript
ArrowFunction
(tab) => { const historyPath = history.location.pathname; const internalTabPath = getTabPath(tab); if (internalTabPath === '/') { return historyPath === internalTabPath; } return historyPath.startsWith(internalTabPath); }
Mefjus/smart-gate
packages/client/src/elements/AppBar/index.tsx
TypeScript
ArrowFunction
() => { setActiveTab(defaultActiveTab); }
Mefjus/smart-gate
packages/client/src/elements/AppBar/index.tsx
TypeScript
ArrowFunction
(event: MouseEvent, newValue: number) => { setActiveTab(newValue); const selectedTab = tabs.find( (tab) => newValue === (isMobile ? tab.indexMobile ?? tab.index : tab.index), ); if (selectedTab) { history.push(getTabPath(selectedTab)); } }
Mefjus/smart-gate
packages/client/src/elements/AppBar/index.tsx
TypeScript
ArrowFunction
(tab) => newValue === (isMobile ? tab.indexMobile ?? tab.index : tab.index)
Mefjus/smart-gate
packages/client/src/elements/AppBar/index.tsx
TypeScript
ArrowFunction
({ component: Component, exact, path, index, ...rest }) => ( <Route exact={exact}
Mefjus/smart-gate
packages/client/src/elements/AppBar/index.tsx
TypeScript
ArrowFunction
(tabProps) => ( <TabbedLayout.Tab {...tabProps}
Mefjus/smart-gate
packages/client/src/elements/AppBar/index.tsx
TypeScript
MethodDeclaration
getTabPath(tabProps)
Mefjus/smart-gate
packages/client/src/elements/AppBar/index.tsx
TypeScript
TypeAliasDeclaration
export type TSLintRuleSeverity = "warning" | "error" | "off";
KleeUT/tslint-to-eslint-config
src/rules/types.ts
TypeScript
TypeAliasDeclaration
export type TSLintRuleOptions = { ruleArguments: any[]; ruleName: string; ruleSeverity: TSLintRuleSeverity; };
KleeUT/tslint-to-eslint-config
src/rules/types.ts
TypeScript
TypeAliasDeclaration
export type ESLintRuleSeverity = "warn" | "error" | "off";
KleeUT/tslint-to-eslint-config
src/rules/types.ts
TypeScript
TypeAliasDeclaration
export type ESLintRuleOptions = { notices?: any[]; ruleArguments?: any[]; ruleName: string; ruleSeverity: ESLintRuleSeverity; };
KleeUT/tslint-to-eslint-config
src/rules/types.ts
TypeScript
ArrowFunction
(type) => Int
Seojun-Park/fr_community
src/market/entity/market.entity.ts
TypeScript
ArrowFunction
(user) => user.Market
Seojun-Park/fr_community
src/market/entity/market.entity.ts
TypeScript
ArrowFunction
() => Image
Seojun-Park/fr_community
src/market/entity/market.entity.ts
TypeScript
ArrowFunction
(image) => image.Market
Seojun-Park/fr_community
src/market/entity/market.entity.ts
TypeScript
ArrowFunction
() => [Image]
Seojun-Park/fr_community
src/market/entity/market.entity.ts
TypeScript
ArrowFunction
() => Like
Seojun-Park/fr_community
src/market/entity/market.entity.ts
TypeScript
ArrowFunction
(like) => like.Markets
Seojun-Park/fr_community
src/market/entity/market.entity.ts
TypeScript
ArrowFunction
() => [Like]
Seojun-Park/fr_community
src/market/entity/market.entity.ts
TypeScript
ClassDeclaration
@Entity() @ObjectType() export class Market extends BaseEntity { @PrimaryGeneratedColumn() @Field((type) => Int) id: number; @Column() @Field() title: string; @Column() @Field() content: string; @Column({ name: 'UserId' }) @Field((type) => Int) UserId: number; @Column() @Field({ descrip...
Seojun-Park/fr_community
src/market/entity/market.entity.ts
TypeScript
ArrowFunction
( state: IGatsbyState["status"] = defaultState, action: ActionsUnion ): IGatsbyState["status"] => { switch (action.type) { case `DELETE_CACHE`: return defaultState case `UPDATE_PLUGINS_HASH`: return { ...state, PLUGINS_HASH: action.payload, } case `SET_PLUGIN_STATUS`...
0xSebin/gatsby
packages/gatsby/src/redux/reducers/status.ts
TypeScript
ArrowFunction
over => { if (over) { this.tabChange(); } }
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
ArrowFunction
message => { if (message && message.state === ConfirmationState.CONFIRMED && message.source === ConfirmationTargets.SERVICE) { const serviceId = message.data; this.serviceService.deleteById(serviceId, this.app.id) .subscribe( response => { this....
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
ArrowFunction
response => { this.messageHandlerService.showSuccess('负载均衡删除成功!'); this.serviceId = null; this.initService(true); }
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
ArrowFunction
error => { this.messageHandlerService.handleError(error); }
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
ArrowFunction
key => { if (!this.showState[key].hidden) { this.showList.push(key); } }
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
ArrowFunction
key => { if (this.showList.indexOf(key) > -1) { this.showState[key] = {hidden: false}; } else { this.showState[key] = {hidden: true}; } }
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
ArrowFunction
(item, index) => { return { id: parseInt(item.id, 10), order: index }; }
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
ArrowFunction
response => { if (response.data === 'ok!') { this.initOrder(); this.messageHandlerService.showSuccess('排序成功'); } }
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
ArrowFunction
error => { this.messageHandlerService.handleError(error); }
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
ArrowFunction
item => { return { id: item.id, order: item.order }; }
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
ArrowFunction
(item, index) => { return { id: parseInt(item.id, 10), order: index }; }
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
ArrowFunction
() => { this.syncStatus(); }
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
ArrowFunction
response => { const code = response.statusCode || response.status; if (code === httpStatusCode.NoContent) { this.serviceTpls[i].status[j].state = TemplateState.NOT_FOUND; return; } if (response.data && ...
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
ArrowFunction
error => { if (this.serviceTpls && this.serviceTpls[i] && this.serviceTpls[i].status && this.serviceTpls[i].status[j]) { this.serviceTpls[i].status[j].errNum += 1; this.messageHandlerService.showError(`${status.cl...
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
ArrowFunction
response => { this.services = response[0].data.list.sort((a, b) => a.order - b.order); this.initOrder(this.services); this.serviceId = this.getServiceId(this.serviceId); this.app = response[1].data; this.clusters = response[2].data; if (refreshTpl) { this.retri...
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
ArrowFunction
(a, b) => a.order - b.order
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
ArrowFunction
response => { const status = response[1].data; this.publishStatus = status; const tplStatusMap = {}; if (status && status.length > 0) { for (const st of status) { if (!tplStatusMap[st.templateId]) { tplStatusMap[st.templateId] = Array<PublishStatus>()...
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
ArrowFunction
error => this.messageHandlerService.handleError(error)
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
ArrowFunction
(clusterObj: Cluster) => { return this.cacheService.namespace.metaDataObj.clusterMeta && this.cacheService.namespace.metaDataObj.clusterMeta[clusterObj.name]; }
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
MethodDeclaration
ngOnInit() { this.initShow(); }
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
MethodDeclaration
initShow() { this.showList = []; Object.keys(this.showState).forEach(key => { if (!this.showState[key].hidden) { this.showList.push(key); } }); }
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
MethodDeclaration
diffTpl() { this.list.diffTpl(); }
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
MethodDeclaration
confirmEvent() { Object.keys(this.showState).forEach(key => { if (this.showList.indexOf(key) > -1) { this.showState[key] = {hidden: false}; } else { this.showState[key] = {hidden: true}; } }); }
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
MethodDeclaration
cancelEvent() { this.initShow(); }
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
MethodDeclaration
tabChange() { const orderList = [].slice.call(this.el.nativeElement.querySelectorAll('.tabs-item')).map((item, index) => { return { id: parseInt(item.id, 10), order: index }; }); if (this.orderCache && JSON.stringify(this.orderCache) === JSON.stringify(orderList)) { return...
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
MethodDeclaration
initOrder(deployments?: Service[]) { if (deployments) { this.orderCache = deployments.map(item => { return { id: item.id, order: item.order }; }); } else { this.orderCache = [].slice.call(this.el.nativeElement.querySelectorAll('.tabs-item')).map((item, inde...
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
MethodDeclaration
periodSyncStatus() { this.timer = setInterval(() => { this.syncStatus(); }, syncStatusInterval); }
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
MethodDeclaration
syncStatus(): void { if (this.serviceTpls && this.serviceTpls.length > 0) { for (let i = 0; i < this.serviceTpls.length; i++) { const tpl = this.serviceTpls[i]; if (tpl.status && tpl.status.length > 0) { for (let j = 0; j < tpl.status.length; j++) { const status = tpl.st...
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
MethodDeclaration
ngAfterContentInit() { this.initService(); }
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
MethodDeclaration
initService(refreshTpl?: boolean) { this.appId = this.route.parent.snapshot.params['id']; const namespaceId = this.cacheService.namespaceId; this.serviceId = parseInt(this.route.snapshot.params['serviceId'], 10); combineLatest( this.serviceService.list(new PageState({pageSize: 50}), 'false', this...
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
MethodDeclaration
getServiceId(serviceId: number): number { if (this.services && this.services.length > 0) { if (!serviceId) { return this.services[0].id; } for (const svc of this.services) { if (serviceId === svc.id) { return serviceId; } } return this.services[0].id;...
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
MethodDeclaration
publishHistory() { this.publishHistoryService.openModal(PublishType.SERVICE, this.serviceId); }
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
MethodDeclaration
tabClick(id: number) { if (id) { this.serviceId = id; this.retrieve(); } }
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
MethodDeclaration
cloneServiceTpl(tpl: ServiceTpl) { if (tpl) { this.router.navigate( [`portal/namespace/${this.cacheService.namespaceId}/app/${this.app.id}/service/${this.serviceId}/tpl/${tpl.id}`]); } }
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
MethodDeclaration
createServiceTpl() { this.router.navigate([`portal/namespace/${this.cacheService.namespaceId}/app/${this.app.id}/service/${this.serviceId}/tpl`]); }
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
MethodDeclaration
ngOnDestroy(): void { clearInterval(this.timer); this.subscription.unsubscribe(); this.tabScription.unsubscribe(); }
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
MethodDeclaration
onlineChange() { this.retrieve(); }
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
MethodDeclaration
retrieve(state?: ClrDatagridStateInterface): void { if (!this.serviceId) { return; } if (state) { this.pageState = PageState.fromState(state, {totalPage: this.pageState.page.totalPage, totalCount: this.pageState.page.totalCount}); } this.pageState.params['deleted'] = false; this.pag...
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
MethodDeclaration
buildTplList(tpls: ServiceTpl[]): ServiceTpl[] { if (tpls && tpls.length > 0) { for (let i = 0; i < tpls.length; i++) { const service: KubeService = JSON.parse(tpls[i].template); if (service.spec.ports && service.spec.ports.length > 0) { const ports = Array<string>(); for ...
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
MethodDeclaration
deleteService() { if (this.publishStatus && this.publishStatus.length > 0) { this.messageHandlerService.warning('已上线负载均衡无法删除,请先下线负载均衡!'); } else { const deletionMessage = new ConfirmationMessage( '删除负载均衡确认', '是否确认删除负载均衡?', this.serviceId, ConfirmationTargets.SERVICE,...
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
MethodDeclaration
createService(id: number) { if (id) { this.serviceId = null; this.initService(true); } }
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
MethodDeclaration
openModal(): void { this.createEdit.newOrEditResource(this.app, this.filterCluster()); }
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
MethodDeclaration
editService() { this.createEdit.newOrEditResource(this.app, this.filterCluster(), this.serviceId); }
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
MethodDeclaration
filterCluster(): Cluster[] { return this.clusters.filter((clusterObj: Cluster) => { return this.cacheService.namespace.metaDataObj.clusterMeta && this.cacheService.namespace.metaDataObj.clusterMeta[clusterObj.name]; }); }
wilhelmguo/wayne
src/frontend/src/app/portal/service/service.component.ts
TypeScript
ArrowFunction
(): void => { console.log(cyan(figlet.textSync(ConsoleMessage.TITLE, { horizontalLayout: 'full' }))); console.info(cyan(ConsoleMessage.BANNER)); }
arunabhdas/cavabien
src/utils/logger.util.ts
TypeScript
ArrowFunction
(message: string | Error): void => { console.error(red(ConsoleMessage.ERROR) + message); }
arunabhdas/cavabien
src/utils/logger.util.ts
TypeScript
ArrowFunction
(message: string): void => { console.log(green(ConsoleMessage.SUCCESS) + message + newLine); }
arunabhdas/cavabien
src/utils/logger.util.ts
TypeScript
ArrowFunction
(message: string): void => { console.info(cyan(ConsoleMessage.INFO) + message + newLine); }
arunabhdas/cavabien
src/utils/logger.util.ts
TypeScript
ArrowFunction
(fileName: string): void => { console.log(cyan(ConsoleMessage.GENERATE) + `${fileName}...`); }
arunabhdas/cavabien
src/utils/logger.util.ts
TypeScript
ArrowFunction
(fileName: string, filePath: string): void => { filePath ? console.log(green(ConsoleMessage.CREATE) + `${fileName} in ${filePath}`) : console.log(green(ConsoleMessage.CREATE) + `${fileName}`); }
arunabhdas/cavabien
src/utils/logger.util.ts
TypeScript
ArrowFunction
(fileName: string, filePath: string): void => { filePath ? console.log(green(ConsoleMessage.UPDATE) + `${fileName} in ${filePath}`) : console.log(green(ConsoleMessage.UPDATE) + `${fileName}`); }
arunabhdas/cavabien
src/utils/logger.util.ts
TypeScript
ClassDeclaration
@NgModule({ imports: [ ArtemisSharedModule, FormDateTimePickerModule, FormsModule, FeatureToggleModule, AssessmentInstructionsModule, RouterModule.forChild([]), ArtemisResultModule, ArtemisAssessmentSharedModule, SubmissionResultStatusModule, ...
AutoscanForJavaFork/Artemis
src/main/webapp/app/exercises/programming/assess/programming-assessment-dashboard/programming-exercises-submissions.module.ts
TypeScript
ArrowFunction
(theme) => ({ form: { display: 'flex', flexDirection: 'column', alignItems: 'center', height: '800px', width: '100%', }, formGrid: { height: '100%', width: '100%', }, paper: { height: '400px', width: '100%', display: 'flex', flexDirection: 'column', alignItems:...
bf2344/team-honey-cruller
client/src/components/Payment/useStyles.ts
TypeScript
FunctionDeclaration
export default function addEmployee(employeeName: string): Employee { const newEmployee = new Employee(); newEmployee.name = employeeName; return newEmployee; }
bpbpublications/Learning-Angular-in-OOP-way
Chapter01/modules/employee-factory.ts
TypeScript
ArrowFunction
() => { const link = "https://ghbtns.com/github-btn.html?user=basarat&repo=gls&type=star&count=true" return ( <div style={{ marginTop: '20px' }}
basarat/gls
src/demos/index.tsx
TypeScript
ArrowFunction
(props) => <div style
basarat/gls
src/demos/index.tsx
TypeScript
ArrowFunction
(props) => { return <label className={labelClass} children={props.children} />; }
basarat/gls
src/demos/index.tsx
TypeScript
ArrowFunction
(_props) => { return <input className={inputClass} />; }
basarat/gls
src/demos/index.tsx
TypeScript
ArrowFunction
(props: React.HTMLProps<HTMLButtonElement>) => { const { className, ...otherProps } = props; return ( <button {...otherProps} type="button" className={typestyle.classes(buttonClass, props.className)} />
basarat/gls
src/demos/index.tsx
TypeScript
ArrowFunction
({ size }) => { return ( <img style={{ borderRadius: '50%', // Explicit size width: `${size}px`, height: `${size}px`, }}
basarat/gls
src/demos/index.tsx
TypeScript
ArrowFunction
(props) => { const processedProps = gls.component(props); return <button {...processedProps} />; }
basarat/gls
src/demos/index.tsx
TypeScript
ArrowFunction
(props) => { /** * Generates a className from component props * + returns the rest **/ const { className, error } = gls.component(props); /** Handle the error */ const errorStyle = error ? { backgroundColor: 'red' } : {}; return <button className={className} style={errorStyle} />; }
basarat/gls
src/demos/index.tsx
TypeScript
ArrowFunction
(props) => { const { className, ...otherProps } = gls.component(props, { sizing: 'stretch' }); return <input className={className} {...otherProps} /> }
basarat/gls
src/demos/index.tsx
TypeScript