type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
ArrowFunction
(state) => state.config.echo.forceUpdateMessage
artsy/eigen
src/lib/AndroidApp.tsx
TypeScript
ArrowFunction
() => { createAllChannels() }
artsy/eigen
src/lib/AndroidApp.tsx
TypeScript
ArrowFunction
() => { if (isHydrated) { // We wait a bit until the UI finishes drawing behind the splash screen setTimeout(() => { RNBootSplash.hide().then(() => { requestAnimationFrame(() => { ArtsyNativeModule.lockActivityScreenOrientation() }) }) ArtsyNative...
artsy/eigen
src/lib/AndroidApp.tsx
TypeScript
ArrowFunction
() => { RNBootSplash.hide().then(() => { requestAnimationFrame(() => { ArtsyNativeModule.lockActivityScreenOrientation() }) }) ArtsyNativeModule.setAppStyling() if (isLoggedIn) { ArtsyNativeModule.setNavigationBarColor("#FFFFFF") Artsy...
artsy/eigen
src/lib/AndroidApp.tsx
TypeScript
ArrowFunction
() => { requestAnimationFrame(() => { ArtsyNativeModule.lockActivityScreenOrientation() }) }
artsy/eigen
src/lib/AndroidApp.tsx
TypeScript
ArrowFunction
() => { ArtsyNativeModule.lockActivityScreenOrientation() }
artsy/eigen
src/lib/AndroidApp.tsx
TypeScript
ArrowFunction
() => { if (isLoggedIn) { savePendingToken() } }
artsy/eigen
src/lib/AndroidApp.tsx
TypeScript
ArrowFunction
() => ( <AppProviders> <AdminMenuWrapper> <Main /> </AdminMenuWrapper> </AppProviders> )
artsy/eigen
src/lib/AndroidApp.tsx
TypeScript
ClassDeclaration
export default class doubleIncrementCounterControl extends React.Component<Props,{}>{ constructor(){ super(); } render() { return <input type="button" style={{backgroundColor: Colors.BLUE}} /*className={this.props.counterPositive ? 'default' : '...
pinchuque/reduxlearn
src/React/doubleIncrementCounterControl.tsx
TypeScript
InterfaceDeclaration
interface Props{ counterPositive:boolean, onClick(item): void }
pinchuque/reduxlearn
src/React/doubleIncrementCounterControl.tsx
TypeScript
MethodDeclaration
render() { return <input type="button" style={{backgroundColor: Colors.BLUE}}
pinchuque/reduxlearn
src/React/doubleIncrementCounterControl.tsx
TypeScript
ArrowFunction
(auths: string[]): string[] => { // const reg=new RegExp(Reg_Module) return auths.filter(Boolean).map((auth) => { auth.match(Reg_Module); const moduleName = RegExp.$1; // console.log(authMatch, moduleName); return moduleName; }); }
liangchaofei/vue3-ts-vite
src/utils/permission.ts
TypeScript
ArrowFunction
(auth) => { auth.match(Reg_Module); const moduleName = RegExp.$1; // console.log(authMatch, moduleName); return moduleName; }
liangchaofei/vue3-ts-vite
src/utils/permission.ts
TypeScript
ArrowFunction
(routes: RouteRecordRaw[], roles: string[]): RouteRecordRaw[] => { const res: RouteRecordRaw[] = []; routes.forEach((route) => { const { auth } = (route.meta as IAuth) || {}; if (!auth) { if (route.children) { route.children = filterAsyncRoutes(route.children, roles); } res.push(r...
liangchaofei/vue3-ts-vite
src/utils/permission.ts
TypeScript
ArrowFunction
(route) => { const { auth } = (route.meta as IAuth) || {}; if (!auth) { if (route.children) { route.children = filterAsyncRoutes(route.children, roles); } res.push(route); } else { if (intersection(roles, auth).length > 0) { if (route.children) { route.chil...
liangchaofei/vue3-ts-vite
src/utils/permission.ts
TypeScript
TypeAliasDeclaration
type IAuth = { auth?: string[] };
liangchaofei/vue3-ts-vite
src/utils/permission.ts
TypeScript
ClassDeclaration
/** * Vendors are the organizations that provide professional translation services. * To assign a Vendor to a project workflow you should invite an existing Organization to be a Vendor for you. * * Use API to get the list of the Vendors you already invited to your organization. */ export class Vendors extends Crow...
crowdin/crowdin-node-sdk-2
src/vendors/index.ts
TypeScript
InterfaceDeclaration
export interface Vendor { id: number; name: string; description: string; status: string; }
crowdin/crowdin-node-sdk-2
src/vendors/index.ts
TypeScript
MethodDeclaration
/** * @param options optional pagination parameters for the request * @see https://support.crowdin.com/enterprise/api/#operation/api.vendors.getMany */ listVendors(options?: PaginationOptions): Promise<ResponseList<VendorsModel.Vendor>>;
crowdin/crowdin-node-sdk-2
src/vendors/index.ts
TypeScript
MethodDeclaration
/** * @param limit maximum number of items to retrieve (default 25) * @param offset starting offset in the collection (default 0) * @deprecated optional parameters should be passed through an object * @see https://support.crowdin.com/enterprise/api/#operation/api.vendors.getMany */ listVendors(...
crowdin/crowdin-node-sdk-2
src/vendors/index.ts
TypeScript
MethodDeclaration
listVendors( options?: number | PaginationOptions, deprecatedOffset?: number, ): Promise<ResponseList<VendorsModel.Vendor>> { if (isOptionalNumber(options, '0' in arguments)) { options = { limit: options, offset: deprecatedOffset }; } const url = `${this.url}/ven...
crowdin/crowdin-node-sdk-2
src/vendors/index.ts
TypeScript
EnumDeclaration
export enum Subjects{ TicketCreated = 'ticket:created', OrderUpdated = 'order:updated' }
Rampo0/Advance-Microservice
nats-test/src/events/subjects.ts
TypeScript
ClassDeclaration
/** * Attaches a load balancer policy to an ELB Listener. * * * ## Example Usage for Custom Policy * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const wuTang = new aws.elb.LoadBalancer("wu-tang", { * availabilityZones: ["us-east-1a"], * l...
Dominik-K/pulumi-aws
sdk/nodejs/elasticloadbalancing/listenerPolicy.ts
TypeScript
InterfaceDeclaration
/** * Input properties used for looking up and filtering ListenerPolicy resources. */ export interface ListenerPolicyState { /** * The load balancer to attach the policy to. */ readonly loadBalancerName?: pulumi.Input<string>; /** * The load balancer listener port to apply the policy to. ...
Dominik-K/pulumi-aws
sdk/nodejs/elasticloadbalancing/listenerPolicy.ts
TypeScript
InterfaceDeclaration
/** * The set of arguments for constructing a ListenerPolicy resource. */ export interface ListenerPolicyArgs { /** * The load balancer to attach the policy to. */ readonly loadBalancerName: pulumi.Input<string>; /** * The load balancer listener port to apply the policy to. */ read...
Dominik-K/pulumi-aws
sdk/nodejs/elasticloadbalancing/listenerPolicy.ts
TypeScript
MethodDeclaration
/** * Get an existing ListenerPolicy resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra a...
Dominik-K/pulumi-aws
sdk/nodejs/elasticloadbalancing/listenerPolicy.ts
TypeScript
MethodDeclaration
/** * Returns true if the given object is an instance of ListenerPolicy. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ public static isInstance(obj: any): obj is ListenerPolicy { if (obj === undefined || obj === null) { ...
Dominik-K/pulumi-aws
sdk/nodejs/elasticloadbalancing/listenerPolicy.ts
TypeScript
ClassDeclaration
@Component({ selector: 'wlodzimierz-top-menu', templateUrl: './top-menu.component.html', styleUrls: ['./top-menu.component.scss'] }) export class TopMenuComponent implements OnInit { public isExpanded = true; public currentUser$: Observable<UserModel>; public constructor(private usersFacade: UsersFacade) ...
liannoi/wlodzimierz
src/Clients/web-spa/apps/wlodzimierz/src/app/layout/top-menu/top-menu.component.ts
TypeScript
MethodDeclaration
public ngOnInit(): void { this.currentUser$ = this.usersFacade.currentUser$; this.usersFacade.verify(); }
liannoi/wlodzimierz
src/Clients/web-spa/apps/wlodzimierz/src/app/layout/top-menu/top-menu.component.ts
TypeScript
MethodDeclaration
public onCollapse(): void { this.isExpanded = true; }
liannoi/wlodzimierz
src/Clients/web-spa/apps/wlodzimierz/src/app/layout/top-menu/top-menu.component.ts
TypeScript
InterfaceDeclaration
export interface Config { baseDir?: string baseName?: string type?: string serverJs: ServerJs | string, layout: ServerJs | string env?: string useCDN?: string isRax?: boolean useReactToString?: boolean routes: RouteItem[] injectScript: string[] injectCss: string[] }
bailinx/egg-react-ssr
packages/ykfe-utils/src/interface/config.ts
TypeScript
InterfaceDeclaration
export interface ServerJs { (ctx: Context): Promise<React.ReactElement> }
bailinx/egg-react-ssr
packages/ykfe-utils/src/interface/config.ts
TypeScript
FunctionDeclaration
/*** * Copyright (c) 2017 [Arthur Xie] * <https://github.com/kite-js/kite> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights...
kite-js/kite
dist/core/callsite.d.ts
TypeScript
FunctionDeclaration
function mapStateToProps(appState: APPState): StoreProps { const routeParams: RouteParams = appState.route.params; return {subView: routeParams.account?.subView, curUser: appState.stage.curUser!}; }
hiisea/elux-demo-web
projects/vue-vuex-mmf/user-team/src/modules/account/views/Main.tsx
TypeScript
ArrowFunction
() => mapStateToProps(appState)
hiisea/elux-demo-web
projects/vue-vuex-mmf/user-team/src/modules/account/views/Main.tsx
TypeScript
InterfaceDeclaration
export interface StoreProps { curUser: CurUser; subView?: SubView; }
hiisea/elux-demo-web
projects/vue-vuex-mmf/user-team/src/modules/account/views/Main.tsx
TypeScript
MethodDeclaration
setup() { const store = useStore(); const appState = store.getState(); const storeProps = computed(() => mapStateToProps(appState)); return {store, storeProps}; }
hiisea/elux-demo-web
projects/vue-vuex-mmf/user-team/src/modules/account/views/Main.tsx
TypeScript
MethodDeclaration
render() { const {curUser, subView} = this.storeProps; return curUser.hasLogin ? ( <Logout /> ) : ( <> {subView === 'login' && <LoginForm />} {subView === 'register' && <RegisterForm />} </>
hiisea/elux-demo-web
projects/vue-vuex-mmf/user-team/src/modules/account/views/Main.tsx
TypeScript
FunctionDeclaration
export async function getIssues(): Promise<IssueResult[]> { const promises = new Array<Promise<IssueResult>>(); repos.forEach(repo => { promises.push(getRepoIssues(repo)); }); return Promise.all(promises); }
jadekler/sloth
src/issue.ts
TypeScript
FunctionDeclaration
async function getRepoIssues(repo: Repo): Promise<IssueResult> { const [owner, name] = repo.repo.split('/'); const result = {issues: new Array<Issue>(), repo}; let res: Octokit.AnyResponse; let i = 1; do { try { res = await octo.issues.getForRepo( {owner, repo: name, state: 'open', per_pa...
jadekler/sloth
src/issue.ts
TypeScript
FunctionDeclaration
export async function tagIssues() { const promises = new Array<Promise<void|Octokit.AnyResponse>>(); const repos = await getIssues(); repos.forEach(r => { r.issues.forEach(i => { const [owner, name] = r.repo.repo.split('/'); i.isTriaged = isTriaged(i); i.isOutOfSLO = isOutOfSLO(i); i....
jadekler/sloth
src/issue.ts
TypeScript
FunctionDeclaration
function tagIssue(i: Issue, label: string): Promise<void|Octokit.AnyResponse> { return octo.issues .addLabels({ labels: [label], number: i.number, owner: i.owner, repo: i.repo // tslint:disable-next-line no-any } as any) .catch(e => { console.error(`E...
jadekler/sloth
src/issue.ts
TypeScript
FunctionDeclaration
function untagIssue( i: Issue, label: string): Promise<void|Octokit.AnyResponse> { return octo.issues .removeLabel( {name: label, number: i.number, owner: i.owner, repo: i.repo}) .catch(e => { console.error(`Error un-tagging ${i.repo}#${i.number} with '${label}'`); console.e...
jadekler/sloth
src/issue.ts
TypeScript
FunctionDeclaration
export async function showIssues(flags: Flags) { const options = { csv: flags.csv, language: flags.language, outOfSLO: flags.outOfSlo, untriaged: flags.untriaged, repo: flags.repo, api: flags.api, pr: flags.pr }; const repos = await getIssues(); const issues = new Array<Issue>(); ...
jadekler/sloth
src/issue.ts
TypeScript
ArrowFunction
repo => { promises.push(getRepoIssues(repo)); }
jadekler/sloth
src/issue.ts
TypeScript
ArrowFunction
r => { r.issues.forEach(i => { const [owner, name] = r.repo.repo.split('/'); i.isTriaged = isTriaged(i); i.isOutOfSLO = isOutOfSLO(i); i.repo = name; i.owner = owner; if (!i.isTriaged && !hasLabel(i, 'triage me') && hoursOld(i.created_at) > 16) { console.log(`T...
jadekler/sloth
src/issue.ts
TypeScript
ArrowFunction
i => { const [owner, name] = r.repo.repo.split('/'); i.isTriaged = isTriaged(i); i.isOutOfSLO = isOutOfSLO(i); i.repo = name; i.owner = owner; if (!i.isTriaged && !hasLabel(i, 'triage me') && hoursOld(i.created_at) > 16) { console.log(`Tagging ${i.repo}#${i.number}...
jadekler/sloth
src/issue.ts
TypeScript
ArrowFunction
e => { console.error(`Error tagging ${i.repo}#${i.number} with '${label}'`); console.error(e); }
jadekler/sloth
src/issue.ts
TypeScript
ArrowFunction
e => { console.error(`Error un-tagging ${i.repo}#${i.number} with '${label}'`); console.error(e); }
jadekler/sloth
src/issue.ts
TypeScript
ArrowFunction
r => { if (options.language && options.language.toLowerCase() !== r.repo.language.toLowerCase()) { return; } if (options.repo && options.repo.toLowerCase() !== r.repo.repo.toLowerCase()) { return; } r.issues.forEach(i => { if (options.pr) { if (!isPullReque...
jadekler/sloth
src/issue.ts
TypeScript
ArrowFunction
i => { if (options.pr) { if (!isPullRequest(i)) { return; } } else { if (isPullRequest(i)) { return; } } i.api = getApi(i); if (options.api && !isApi(i, options.api)) { return; } i.isTriaged = isTriaged(i); if (...
jadekler/sloth
src/issue.ts
TypeScript
ArrowFunction
issue => { const values = [ issue.html_url, options.csv ? issue.isTriaged : (issue.isTriaged ? '🦖' : '🚨'), options.csv ? !issue.isOutOfSLO : (!issue.isOutOfSLO ? '🦖' : '🚨'), truncate(issue.title, 75), issue.language, issue.api || '', issue.pri || '' ]; if (options.csv) { ...
jadekler/sloth
src/issue.ts
TypeScript
ArrowFunction
l => console.log(l)
jadekler/sloth
src/issue.ts
TypeScript
InterfaceDeclaration
export interface IssueOptions { csv?: boolean; untriaged?: boolean; outOfSLO?: boolean; repository?: string; language?: string; api?: string; pr?: boolean; }
jadekler/sloth
src/issue.ts
TypeScript
ArrowFunction
(account) => ({ name: account.name, address: Address.createFromRawAddress(account.address).pretty(), publicKey: account.publicKey, privateKey: Crypto.decrypt(account.encryptedPrivateKey, payload.password.value), ...
Acetane/wallet
src/views/modals/ModalBackupProfile/ModalBackupProfileTs.ts
TypeScript
ArrowFunction
async () => { await this.generateAndDownloadPaperWallet(); Vue.set(this, 'downloadInProgress', false); }
Acetane/wallet
src/views/modals/ModalBackupProfile/ModalBackupProfileTs.ts
TypeScript
ClassDeclaration
@Component({ components: { FormProfileUnlock }, computed: { ...mapGetters({ currentProfile: 'profile/currentProfile', networkType: 'network/networkType', generationHash: 'network/generationHash', knownAccounts: 'account/knownAccounts', }), }, ...
Acetane/wallet
src/views/modals/ModalBackupProfile/ModalBackupProfileTs.ts
TypeScript
MethodDeclaration
/** * Hook called when the account has been unlocked * @param {Account} account */ public onAccountUnlocked(payload: { account: Account; password: Password }) { // decrypt seed const encSeed = this.currentProfile.seed; this.plainMnemonic = Crypto.decrypt(encSeed, payload.password....
Acetane/wallet
src/views/modals/ModalBackupProfile/ModalBackupProfileTs.ts
TypeScript
MethodDeclaration
/** * Hook called when child component FormProfileUnlock or * HardwareConfirmationButton emit the 'error' event. * @param {string} message * @return {void} */ public onError(error: string) { this.$emit('error', error); }
Acetane/wallet
src/views/modals/ModalBackupProfile/ModalBackupProfileTs.ts
TypeScript
MethodDeclaration
/** * Life cycle hook */ public created() { this.accountService = new AccountService(); }
Acetane/wallet
src/views/modals/ModalBackupProfile/ModalBackupProfileTs.ts
TypeScript
MethodDeclaration
/** * Hook called when the download button is clicked * @return {void} */ public async onDownload() { if (!this.plainMnemonic) { this.$store.dispatch('notification/ADD_ERROR', this.$t('mnemonic_not_found')); return; } Vue.set(this, 'downloadInProgress', tru...
Acetane/wallet
src/views/modals/ModalBackupProfile/ModalBackupProfileTs.ts
TypeScript
MethodDeclaration
/** * Generates and downloads paper-wallet for the root account and the profile(known) accounts */ protected async generateAndDownloadPaperWallet(): Promise<boolean> { const rootAccount: Account = this.accountService.getAccountByPath( new MnemonicPassPhrase(this.plainMnemonic), ...
Acetane/wallet
src/views/modals/ModalBackupProfile/ModalBackupProfileTs.ts
TypeScript
FunctionDeclaration
export default function confirm({ title, message, onAnswer }: { title: string; message: string; onAnswer: (answer) => void; }) { openConfirmDialogExternal({ title, message, onAnswer }); }
bladexr8/my-sass
app/lib/confirm.ts
TypeScript
ClassDeclaration
class HeaderLogo extends React.PureComponent<IProps> { public render() { const { classes, linkTo } = this.props; return ( <Link className={classes.root} to={linkTo}> <Logo className={classes.logo} /> <div className={classes.title}>akropolis</div> </Link> ); } }
akropolisio/akropolisclient
src/modules/shared/Logo/Logo.tsx
TypeScript
InterfaceDeclaration
interface IOwnProps { linkTo: string; viewType: 'row' | 'column'; onlyIcon?: boolean; }
akropolisio/akropolisclient
src/modules/shared/Logo/Logo.tsx
TypeScript
TypeAliasDeclaration
type IProps = IOwnProps & StylesProps;
akropolisio/akropolisclient
src/modules/shared/Logo/Logo.tsx
TypeScript
MethodDeclaration
public render() { const { classes, linkTo } = this.props; return ( <Link className={classes.root} to={linkTo}> <Logo className={classes.logo} /> <div className={classes.title}>akropolis</div> </Link> ); }
akropolisio/akropolisclient
src/modules/shared/Logo/Logo.tsx
TypeScript
ArrowFunction
header => { if (header.range.start.line != 0 && !document.lineAt(header.range.start.line - 1).isEmptyOrWhitespace) { editBuilder.insert(new Position(header.range.start.line, 0), config.lineEnding); } editBuilder.replace(header.range,...
rkubik/markdown-toc
src/AutoMarkdownToc.ts
TypeScript
ArrowFunction
element => { editBuilder.replace(element.range, element.fullHeaderWithoutOrder); }
rkubik/markdown-toc
src/AutoMarkdownToc.ts
TypeScript
ArrowFunction
header => { let anchorMatches = header.hash.match(this.configManager.regexStrings.REGEXP_ANCHOR); if (anchorMatches != null) { let name = anchorMatches[1]; let text = [ this.configManager.lineEnding, '<a id="markdown-', ...
rkubik/markdown-toc
src/AutoMarkdownToc.ts
TypeScript
ArrowFunction
header => { minimumRenderedDepth = Math.min(minimumRenderedDepth, header.depth); }
rkubik/markdown-toc
src/AutoMarkdownToc.ts
TypeScript
ArrowFunction
header => { if (header.depth >= this.configManager.options.DEPTH_FROM.value) { let row = this.generateTocRow(header, minimumRenderedDepth); tocRows.push(row); } }
rkubik/markdown-toc
src/AutoMarkdownToc.ts
TypeScript
ArrowFunction
optionKey => { if (this.configManager.options.optionsFlag.indexOf(optionKey) != -1) { tocStartIndicator.push(optionKey + ':' + this.configManager.options.getOptionValueByKey(optionKey) + ' '); } }
rkubik/markdown-toc
src/AutoMarkdownToc.ts
TypeScript
MethodDeclaration
// Public function public updateMarkdownToc(isBySave: boolean = false) { let autoMarkdownToc = this; let editor = window.activeTextEditor; if (editor == undefined) { return false; } let insertPosition = editor.selection.active; editor.edit(function (editBui...
rkubik/markdown-toc
src/AutoMarkdownToc.ts
TypeScript
MethodDeclaration
public deleteMarkdownToc() { let autoMarkdownToc = this; let editor = window.activeTextEditor; if (editor == undefined) { return false; } editor.edit(function (editBuilder) { let tocRange = autoMarkdownToc.getTocRange(); if (tocRange == null) ...
rkubik/markdown-toc
src/AutoMarkdownToc.ts
TypeScript
MethodDeclaration
public updateMarkdownSections() { let tocRange = this.getTocRange(); this.updateOptions(tocRange); let headerList = this.headerManager.getHeaderList(); let editor = window.activeTextEditor; let config = this.configManager; if (editor != undefined) { let docum...
rkubik/markdown-toc
src/AutoMarkdownToc.ts
TypeScript
MethodDeclaration
public deleteMarkdownSections() { let tocRange = this.getTocRange(); this.updateOptions(tocRange); let headerList = this.headerManager.getHeaderList(); let editor = window.activeTextEditor; if (editor != undefined && headerList != undefined) { editor.edit(function (e...
rkubik/markdown-toc
src/AutoMarkdownToc.ts
TypeScript
MethodDeclaration
public notifyDocumentSave() { // Prevent save again if (this.configManager.options.saveBySelf) { this.configManager.options.saveBySelf = false; return; } let editor = window.activeTextEditor; if (editor != undefined) { let doc = editor.documen...
rkubik/markdown-toc
src/AutoMarkdownToc.ts
TypeScript
MethodDeclaration
// Private function private getTocRange() { let editor = window.activeTextEditor; if (editor == undefined) { return null; } let doc = editor.document; let start, stop: Position | undefined; for (let index = 0; index < doc.lineCount; index++) { let ...
rkubik/markdown-toc
src/AutoMarkdownToc.ts
TypeScript
MethodDeclaration
private updateOptions(tocRange: Range | null) { this.configManager.loadConfigurations(); this.configManager.loadCustomOptions(tocRange); }
rkubik/markdown-toc
src/AutoMarkdownToc.ts
TypeScript
MethodDeclaration
private insertAnchor(editBuilder: TextEditorEdit, headerList: Header[]) { if (!this.configManager.options.INSERT_ANCHOR.value) { return; } headerList.forEach(header => { let anchorMatches = header.hash.match(this.configManager.regexStrings.REGEXP_ANCHOR); if...
rkubik/markdown-toc
src/AutoMarkdownToc.ts
TypeScript
MethodDeclaration
private deleteAnchor(editBuilder: TextEditorEdit) { let editor = window.activeTextEditor; if (editor != undefined) { let doc = editor.document; for (let index = 0; index < doc.lineCount; index++) { let lineText = doc.lineAt(index).text; if (lineTe...
rkubik/markdown-toc
src/AutoMarkdownToc.ts
TypeScript
MethodDeclaration
private createToc(editBuilder: TextEditorEdit, headerList: Header[], insertPosition: Position) { let text: string[] = []; //// TOC STAT: the custom option IS inside the toc start. text = text.concat(this.generateTocStartIndicator()); //// HEADERS let minimumRenderedDepth = he...
rkubik/markdown-toc
src/AutoMarkdownToc.ts
TypeScript
MethodDeclaration
private generateTocRow(header: Header, minimumRenderedDepth: number) { let row: string[] = []; // Indentation let indentRepeatTime = header.depth - Math.max(this.configManager.options.DEPTH_FROM.value, minimumRenderedDepth); row.push(this.configManager.tab.repeat(indentRepeatTime)); ...
rkubik/markdown-toc
src/AutoMarkdownToc.ts
TypeScript
MethodDeclaration
private generateTocStartIndicator() { let tocStartIndicator: string[] = []; tocStartIndicator.push('<!-- TOC '); this.generateCustomOptionsInTocStart(tocStartIndicator); tocStartIndicator.push('-->' + this.configManager.lineEnding); return tocStartIndicator.join(''); }
rkubik/markdown-toc
src/AutoMarkdownToc.ts
TypeScript
MethodDeclaration
private generateCustomOptionsInTocStart(tocStartIndicator: string[]) { // custom options this.configManager.options.optionsFlag.forEach(optionKey => { if (this.configManager.options.optionsFlag.indexOf(optionKey) != -1) { tocStartIndicator.push(optionKey + ':' + this.configM...
rkubik/markdown-toc
src/AutoMarkdownToc.ts
TypeScript
ArrowFunction
() => { const { theme, toggleTheme } = useTheme() return ( <button className={style.themeToggler} onClick={toggleTheme} aria-label="Toggle dark mode" > {theme === 'light' ? '🌘' : '☀️'}
anuphunt/rolling-realms
src/components/togglers/ThemeToggler/index.tsx
TypeScript
ClassDeclaration
@Component({ selector: 'angular-emojis', template: ` <span [ngStyle]="{'font-size': size + 'px'}" > {{emojiIcon}} </span> `, styles: [ ] }) export class AngularEmojisComponent implements OnInit { @Input() name: string = 'smile'; @Input() size: string ='30'; emojiIcon: string; constr...
c-goldschmidt/angular-packages
projects/angular-emojis/src/lib/angular-emojis.component.ts
TypeScript
MethodDeclaration
ngOnInit(): void { this.emojiIcon = emojiData[this.name]; }
c-goldschmidt/angular-packages
projects/angular-emojis/src/lib/angular-emojis.component.ts
TypeScript
FunctionDeclaration
/** * Formats a path to be a display path. */ export function formatPath(path: string, rootDir?: string | boolean) { path = fs.resolve(path); rootDir = rootDir === true ? fs.resolve('.') : rootDir; let dir = fs.dirname(path); dir = typeof rootDir === 'string' ? dir.substr(rootDir.length) : dir; const file =...
uiharness/-uiharness
code/libs/dev/src/common/logging.ts
TypeScript
FunctionDeclaration
/** * Logs file stats for the given directory */ export async function fileStatsTable(args: { dir: string; showHeader?: boolean }) { const { showHeader = false } = args; const dir = fs.resolve(args.dir); const toSize = (bytes: number) => fs.size.toString(bytes, { round: 0, spacer: '' }); const getPaths = (d...
uiharness/-uiharness
code/libs/dev/src/common/logging.ts
TypeScript
ArrowFunction
(bytes: number) => fs.size.toString(bytes, { round: 0, spacer: '' })
uiharness/-uiharness
code/libs/dev/src/common/logging.ts
TypeScript
ArrowFunction
(dir: string) => { return fs.pathExistsSync(dir) ? fs.readdirSync(dir).map(path => fs.join(dir, path)) : []; }
uiharness/-uiharness
code/libs/dev/src/common/logging.ts
TypeScript
ArrowFunction
path => fs.join(dir, path)
uiharness/-uiharness
code/libs/dev/src/common/logging.ts
TypeScript
ArrowFunction
path => !path.endsWith('.map')
uiharness/-uiharness
code/libs/dev/src/common/logging.ts
TypeScript
ArrowFunction
path => !path.endsWith('.html')
uiharness/-uiharness
code/libs/dev/src/common/logging.ts
TypeScript
ArrowFunction
path => { const stats = fs.statSync(path); const bytes = stats.size; const size = toSize(bytes); return { path, bytes, size }; }
uiharness/-uiharness
code/libs/dev/src/common/logging.ts
TypeScript
ArrowFunction
label => log.gray(label)
uiharness/-uiharness
code/libs/dev/src/common/logging.ts
TypeScript
ArrowFunction
e => { let file = fs.basename(e.path); if (file.endsWith('.js')) { file = log.yellow(file); } else if (file.endsWith('.css')) { file = log.cyan(file); } else { file = log.magenta(file); } table.add([file, e.size]); }
uiharness/-uiharness
code/libs/dev/src/common/logging.ts
TypeScript
ArrowFunction
(acc, next) => acc + next.bytes
uiharness/-uiharness
code/libs/dev/src/common/logging.ts
TypeScript