type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
ClassDeclaration
export default class MyDocument extends Document { static async getInitialProps(ctx) { const initialProps = await Document.getInitialProps(ctx); return { ...initialProps }; } render() { return ( <Html lang="en"> <Head> {isProduction && ( <> <script ...
PedroBoni/nirmalyaghosh.com
pages/_document.tsx
TypeScript
MethodDeclaration
static async getInitialProps(ctx) { const initialProps = await Document.getInitialProps(ctx); return { ...initialProps }; }
PedroBoni/nirmalyaghosh.com
pages/_document.tsx
TypeScript
MethodDeclaration
render() { return ( <Html lang="en"> <Head> {isProduction && ( <> <script async src={`https://www.googletagmanager.com/gtag/js?id=${process.env.GA_TRACKING_ID}`}
PedroBoni/nirmalyaghosh.com
pages/_document.tsx
TypeScript
ArrowFunction
params => params.has('tabLink')
gaoyuan1223m/E-Business-Pin-DuoDuo
src/app/home/components/home-container/home-container.component.ts
TypeScript
ArrowFunction
params => params.get('tabLink')
gaoyuan1223m/E-Business-Pin-DuoDuo
src/app/home/components/home-container/home-container.component.ts
TypeScript
ClassDeclaration
@Component({ selector: 'app-home-container', templateUrl: './home-container.component.html', styleUrls: ['./home-container.component.css'], changeDetection: ChangeDetectionStrategy.OnPush }) export class HomeContainerComponent implements OnInit { topMenus$: Observable<TopMenu[]>; selectedTabLink$: Obse...
gaoyuan1223m/E-Business-Pin-DuoDuo
src/app/home/components/home-container/home-container.component.ts
TypeScript
MethodDeclaration
ngOnInit(): void { this.topMenus$ = this.service.getTabs(); this.selectedTabLink$ = this.activatedRoute.firstChild.paramMap.pipe( filter(params => params.has('tabLink')), map(params => params.get('tabLink')) ); }
gaoyuan1223m/E-Business-Pin-DuoDuo
src/app/home/components/home-container/home-container.component.ts
TypeScript
MethodDeclaration
handleTabSelected(topMenu: TopMenu) { this.router.navigate(['home', topMenu.link]); }
gaoyuan1223m/E-Business-Pin-DuoDuo
src/app/home/components/home-container/home-container.component.ts
TypeScript
ArrowFunction
() => { beforeEach(() => cy.visit('/')); it('should display welcome message', () => { // Custom command example, see `../support/commands.ts` file cy.login('my-email@something.com', 'myPassword'); // Function helper example, see `../support/app.po.ts` file getGreeting().contains('Welcome four-fou...
seadonk/kablamo
apps/four-fours-e2e/src/integration/app.spec.ts
TypeScript
ArrowFunction
() => cy.visit('/')
seadonk/kablamo
apps/four-fours-e2e/src/integration/app.spec.ts
TypeScript
ArrowFunction
() => { // Custom command example, see `../support/commands.ts` file cy.login('my-email@something.com', 'myPassword'); // Function helper example, see `../support/app.po.ts` file getGreeting().contains('Welcome four-fours'); }
seadonk/kablamo
apps/four-fours-e2e/src/integration/app.spec.ts
TypeScript
ClassDeclaration
@Component({ computed: {...mapState({activeAccount: 'account', app: 'app'})}, components: { LineChart, TransactionList, }, }) export class MonitorDashBoardTs extends Vue { app: AppInfo activeAccount: StoreAccount updateAnimation = '' networkStatusList = networkStatusConfig page = 1 formatNumb...
Coordinate-Cat/nem2-desktop-wallet
src/views/monitor/monitor-dashboard/MonitorDashBoardTs.ts
TypeScript
ArrowFunction
<T>( promises: Iterable<Promise<T>> ): Subscription<T[], T> => fromPromise(Promise.all(promises)).transform(mapcat((x: T[]) => x))
Bnaya/umbrella
packages/rstream/src/from/promises.ts
TypeScript
ArrowFunction
(x: T[]) => x
Bnaya/umbrella
packages/rstream/src/from/promises.ts
TypeScript
ArrowFunction
() => { let component: TestPage; let fixture: ComponentFixture<TestPage>; beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [TestPage], imports: [IonicModule.forRoot()] }).compileComponents(); fixture = TestBed.createComponent(TestPage); component = fixture.com...
dehesselle/mycoradar
app/src/app/corona-profile/corona_test/test-page.component.spec.ts
TypeScript
ArrowFunction
() => { TestBed.configureTestingModule({ declarations: [TestPage], imports: [IonicModule.forRoot()] }).compileComponents(); fixture = TestBed.createComponent(TestPage); component = fixture.componentInstance; fixture.detectChanges(); }
dehesselle/mycoradar
app/src/app/corona-profile/corona_test/test-page.component.spec.ts
TypeScript
FunctionDeclaration
/* ---------------------------------------------------------------------------- * Helper functions * ------------------------------------------------------------------------- */ /** * Compute whether the header is hidden * * If the user scrolls past a certain threshold, the header can be hidden when * scrolling d...
109383670/mkdocs-material
src/assets/javascripts/components/header/_/index.ts
TypeScript
FunctionDeclaration
/* ---------------------------------------------------------------------------- * Functions * ------------------------------------------------------------------------- */ /** * Watch header * * @param el - Header element * @param options - Options * * @returns Header observable */ export function watchHeader( ...
109383670/mkdocs-material
src/assets/javascripts/components/header/_/index.ts
TypeScript
FunctionDeclaration
/** * Mount header * * This function manages the different states of the header, i.e. whether it's * hidden or rendered with a shadow. This depends heavily on the main area. * * @param el - Header element * @param options - Options * * @returns Header component observable */ export function mountHeader( el:...
109383670/mkdocs-material
src/assets/javascripts/components/header/_/index.ts
TypeScript
ArrowFunction
({ offset: { y } }) => y
109383670/mkdocs-material
src/assets/javascripts/components/header/_/index.ts
TypeScript
ArrowFunction
([a, b]) => [a < b, b] as const
109383670/mkdocs-material
src/assets/javascripts/components/header/_/index.ts
TypeScript
ArrowFunction
([{ offset }, [, y]]) => Math.abs(y - offset.y) > 100
109383670/mkdocs-material
src/assets/javascripts/components/header/_/index.ts
TypeScript
ArrowFunction
([, [direction]]) => direction
109383670/mkdocs-material
src/assets/javascripts/components/header/_/index.ts
TypeScript
ArrowFunction
([{ offset }, search]) => offset.y > 400 && !search
109383670/mkdocs-material
src/assets/javascripts/components/header/_/index.ts
TypeScript
ArrowFunction
active => active ? hidden$ : of(false)
109383670/mkdocs-material
src/assets/javascripts/components/header/_/index.ts
TypeScript
ArrowFunction
() => { const styles = getComputedStyle(el) return of( styles.position === "sticky" || styles.position === "-webkit-sticky" ) }
109383670/mkdocs-material
src/assets/javascripts/components/header/_/index.ts
TypeScript
ArrowFunction
([sticky, { height }, hidden]) => ({ height: sticky ? height : 0, sticky, hidden })
109383670/mkdocs-material
src/assets/javascripts/components/header/_/index.ts
TypeScript
ArrowFunction
(a, b) => ( a.sticky === b.sticky && a.height === b.height && a.hidden === b.hidden )
109383670/mkdocs-material
src/assets/javascripts/components/header/_/index.ts
TypeScript
ArrowFunction
() => { const push$ = new Subject<Main>() push$ .pipe( distinctUntilKeyChanged("active"), combineLatestWith(header$) ) .subscribe(([{ active }, { hidden }]) => { if (active) el.setAttribute("data-md-state", hidden ? "hidden" : "shadow") else ...
109383670/mkdocs-material
src/assets/javascripts/components/header/_/index.ts
TypeScript
ArrowFunction
([{ active }, { hidden }]) => { if (active) el.setAttribute("data-md-state", hidden ? "hidden" : "shadow") else el.removeAttribute("data-md-state") }
109383670/mkdocs-material
src/assets/javascripts/components/header/_/index.ts
TypeScript
ArrowFunction
state => ({ ref: el, ...state })
109383670/mkdocs-material
src/assets/javascripts/components/header/_/index.ts
TypeScript
InterfaceDeclaration
/* ---------------------------------------------------------------------------- * Types * ------------------------------------------------------------------------- */ /** * Header */ export interface Header { height: number /* Header visible height */ sticky: boolean /...
109383670/mkdocs-material
src/assets/javascripts/components/header/_/index.ts
TypeScript
InterfaceDeclaration
/* ---------------------------------------------------------------------------- * Helper types * ------------------------------------------------------------------------- */ /** * Watch options */ interface WatchOptions { viewport$: Observable<Viewport> /* Viewport observable */ }
109383670/mkdocs-material
src/assets/javascripts/components/header/_/index.ts
TypeScript
InterfaceDeclaration
/** * Mount options */ interface MountOptions { viewport$: Observable<Viewport> /* Viewport observable */ header$: Observable<Header> /* Header observable */ main$: Observable<Main> /* Main area observable */ }
109383670/mkdocs-material
src/assets/javascripts/components/header/_/index.ts
TypeScript
MethodDeclaration
async fn() { const res = createMockResponse(); res.body = "hello"; const expected = { status: 200, message: "OK", headers: new Headers({ "cache-control": "max-age=0", "content-type": "text/plain; charset=utf-8", "content-length": "5", }), body: "hello",...
JohannLai/doa
test/response/inspect_test.ts
TypeScript
ArrowFunction
highScores => highScores.map(e => HighscoreDto.fromEntity(e))
alvalabs/hack-day-team-nice
backend/src/db/repositories/highscores.repository.ts
TypeScript
ArrowFunction
e => HighscoreDto.fromEntity(e)
alvalabs/hack-day-team-nice
backend/src/db/repositories/highscores.repository.ts
TypeScript
ClassDeclaration
@Injectable() export class HighscoresRepository { private entity: string = "high_scores"; constructor( @InjectRepository(HighScoreEntity) private readonly repo: Repository<HighScoreEntity>, ) {} public async allBySeasonIdRaw( seasonId: string, currentSeasonId: string, limit: number = 0, ...
alvalabs/hack-day-team-nice
backend/src/db/repositories/highscores.repository.ts
TypeScript
MethodDeclaration
public async allBySeasonIdRaw( seasonId: string, currentSeasonId: string, limit: number = 0, ) { const take = limit ? limit : seasonId === currentSeasonId ? 50 : 20; // Using joins to fetch logotypeUrl that related to the bots team. const highScores = await this.repo .createQueryBuilder...
alvalabs/hack-day-team-nice
backend/src/db/repositories/highscores.repository.ts
TypeScript
MethodDeclaration
public getBotScore(botName: string) { return this.repo .find({ where: [{ botName }], }) .then(highScores => highScores.map(e => HighscoreDto.fromEntity(e))); }
alvalabs/hack-day-team-nice
backend/src/db/repositories/highscores.repository.ts
TypeScript
MethodDeclaration
public async getBestBotScore(botName: string, seasonId: string) { return await this.repo .createQueryBuilder(this.entity) .select(this.entity) .where( "high_scores.botName = :botName AND high_scores.seasonId = :seasonId", { botName, seasonId, }, )...
alvalabs/hack-day-team-nice
backend/src/db/repositories/highscores.repository.ts
TypeScript
MethodDeclaration
public async updateBestBotScore( botName: string, seasonId: string, score: number, ) { await this.repo .createQueryBuilder() .update(this.entity) .set({ score }) .where("botName = :botName AND seasonId = :seasonId", { botName, seasonId, }) .execute(...
alvalabs/hack-day-team-nice
backend/src/db/repositories/highscores.repository.ts
TypeScript
MethodDeclaration
public async create(dto: HighscoreDto): Promise<HighscoreDto> { return this.repo.save(dto); }
alvalabs/hack-day-team-nice
backend/src/db/repositories/highscores.repository.ts
TypeScript
MethodDeclaration
public async delete(botName: string) { return await this.repo .createQueryBuilder() .delete() .from(this.entity) .where("botName = :botName", { botName }) .execute(); }
alvalabs/hack-day-team-nice
backend/src/db/repositories/highscores.repository.ts
TypeScript
ArrowFunction
filter => ({ type: SET_PREVIOUS_QUERIES_FILTER, payload: { filter } })
hardforkio/conquery
frontend/src/js/previous-queries/filter/actions.ts
TypeScript
ArrowFunction
(value: any) => isUndefined(value) || isUndefined(value.isValid) ? { isValid: !isUndefined(value), value } : value
darwinia-network/web-wallet
packages/ui-params/src/Param/Vector.tsx
TypeScript
ArrowFunction
(value, index) => ( <Component defaultValue={value}
darwinia-network/web-wallet
packages/ui-params/src/Param/Vector.tsx
TypeScript
ArrowFunction
(index: number) => { return (value: RawParam): void => { this.setState( ({ values }: State) => ({ values: values.map((svalue, sindex) => (sindex === index) ? value : svalue )}), () => { const { values } = this.state; ...
darwinia-network/web-wallet
packages/ui-params/src/Param/Vector.tsx
TypeScript
ArrowFunction
(value: RawParam): void => { this.setState( ({ values }: State) => ({ values: values.map((svalue, sindex) => (sindex === index) ? value : svalue )}), () => { const { values } = this.state; const { onChange } = this.prop...
darwinia-network/web-wallet
packages/ui-params/src/Param/Vector.tsx
TypeScript
ArrowFunction
({ values }: State) => ({ values: values.map((svalue, sindex) => (sindex === index) ? value : svalue )})
darwinia-network/web-wallet
packages/ui-params/src/Param/Vector.tsx
TypeScript
ArrowFunction
(svalue, sindex) => (sindex === index) ? value : svalue
darwinia-network/web-wallet
packages/ui-params/src/Param/Vector.tsx
TypeScript
ArrowFunction
() => { const { values } = this.state; const { onChange } = this.props; onChange && onChange({ isValid: values.reduce((result: boolean, { isValid }) => result && isValid, true), value: values.map(({ value }) => value) }); }
darwinia-network/web-wallet
packages/ui-params/src/Param/Vector.tsx
TypeScript
ArrowFunction
(): void => { this.setState(({ values }: State, { type: { sub } }: Props) => { const value = getInitValue(sub as TypeDef); return { values: values.concat({ isValid: !isUndefined(value), value }) }; }); }
darwinia-network/web-wallet
packages/ui-params/src/Param/Vector.tsx
TypeScript
ArrowFunction
({ values }: State, { type: { sub } }: Props) => { const value = getInitValue(sub as TypeDef); return { values: values.concat({ isValid: !isUndefined(value), value }) }; }
darwinia-network/web-wallet
packages/ui-params/src/Param/Vector.tsx
TypeScript
ArrowFunction
(): void => { this.setState(({ values }: State) => ({ values: values.slice(0, values.length - 1) })); }
darwinia-network/web-wallet
packages/ui-params/src/Param/Vector.tsx
TypeScript
ArrowFunction
({ values }: State) => ({ values: values.slice(0, values.length - 1) })
darwinia-network/web-wallet
packages/ui-params/src/Param/Vector.tsx
TypeScript
ClassDeclaration
class Vector extends React.PureComponent<Props, State> { state: State = { Component: null, values: [] }; static getDerivedStateFromProps ({ defaultValue: { value = [] }, isDisabled, type: { sub, type } }: Props, prevState: State): Partial<State> | null { if (type === prevState.type) { return n...
darwinia-network/web-wallet
packages/ui-params/src/Param/Vector.tsx
TypeScript
TypeAliasDeclaration
type Props = BareProps & WithTranslation;
darwinia-network/web-wallet
packages/ui-params/src/Param/Vector.tsx
TypeScript
TypeAliasDeclaration
type State = { Component: React.ComponentType<BareProps> | null, type?: string, values: Array<RawParam> };
darwinia-network/web-wallet
packages/ui-params/src/Param/Vector.tsx
TypeScript
MethodDeclaration
static getDerivedStateFromProps ({ defaultValue: { value = [] }, isDisabled, type: { sub, type } }: Props, prevState: State): Partial<State> | null { if (type === prevState.type) { return null; } const values: Array<RawParam> = isDisabled || prevState.values.length === 0 ? value.map((value: an...
darwinia-network/web-wallet
packages/ui-params/src/Param/Vector.tsx
TypeScript
MethodDeclaration
render () { const { className, isDisabled, onEnter, style, type, withLabel } = this.props; const { Component, values } = this.state; const subType = type.sub as TypeDef; if (!Component) { return null; } return ( <Bare className={className} style={style} > ...
darwinia-network/web-wallet
packages/ui-params/src/Param/Vector.tsx
TypeScript
MethodDeclaration
t('Add item')
darwinia-network/web-wallet
packages/ui-params/src/Param/Vector.tsx
TypeScript
MethodDeclaration
t('Remove item')
darwinia-network/web-wallet
packages/ui-params/src/Param/Vector.tsx
TypeScript
ClassDeclaration
export declare class HttpRequest { private httpClient; constructor(baseURL: string); get(path: string, params?: any, opts?: AxiosRequestConfig): Promise<{ result: any; status: number; }>; post(path: string, body?: any, opts?: AxiosRequestConfig): Promise<{ result: any; ...
AllanMangeni/Tatum-crypto-exchange
node_modules/@binance-chain/javascript-sdk/lib/utils/request.d.ts
TypeScript
MethodDeclaration
get(path: string, params?: any, opts?: AxiosRequestConfig): Promise<{ result: any; status: number; }>;
AllanMangeni/Tatum-crypto-exchange
node_modules/@binance-chain/javascript-sdk/lib/utils/request.d.ts
TypeScript
MethodDeclaration
post(path: string, body?: any, opts?: AxiosRequestConfig): Promise<{ result: any; status: number; }>;
AllanMangeni/Tatum-crypto-exchange
node_modules/@binance-chain/javascript-sdk/lib/utils/request.d.ts
TypeScript
MethodDeclaration
request(method: Method, path: string, params?: any, opts?: AxiosRequestConfig): Promise<{ result: any; status: number; }>;
AllanMangeni/Tatum-crypto-exchange
node_modules/@binance-chain/javascript-sdk/lib/utils/request.d.ts
TypeScript
FunctionDeclaration
function sortNoop (): number { return 0; }
AndreasGassmann/apps
packages/apps-config/src/endpoints/util.ts
TypeScript
FunctionDeclaration
function sortLinks (a: SortOption, b: SortOption): number { return !!a.isUnreachable !== !!b.isUnreachable ? a.isUnreachable ? 1 : -1 : 0; }
AndreasGassmann/apps
packages/apps-config/src/endpoints/util.ts
TypeScript
FunctionDeclaration
function expandLinked (input: LinkOption[]): LinkOption[] { const valueRelay = input.map(({ value }) => value); return input.reduce((result: LinkOption[], entry): LinkOption[] => { result.push(entry); return entry.linked ? result.concat( expandLinked(entry.linked).map((child): LinkOption =>...
AndreasGassmann/apps
packages/apps-config/src/endpoints/util.ts
TypeScript
FunctionDeclaration
function expandEndpoint (t: TFunction, { dnslink, genesisHash, homepage, info, isChild, isDisabled, isUnreachable, linked, paraId, providers, teleport, text }: EndpointOption, firstOnly: boolean, withSort: boolean): LinkOption[] { const base = { genesisHash, homepage, info, isChild, isDisabled, ...
AndreasGassmann/apps
packages/apps-config/src/endpoints/util.ts
TypeScript
FunctionDeclaration
export function expandEndpoints (t: TFunction, input: EndpointOption[], firstOnly: boolean, withSort: boolean): LinkOption[] { return input .sort(withSort ? sortLinks : sortNoop) .reduce((all: LinkOption[], e) => all.concat(expandEndpoint(t, e, firstOnly, withSort)), []); }
AndreasGassmann/apps
packages/apps-config/src/endpoints/util.ts
TypeScript
ArrowFunction
(result: LinkOption[], entry): LinkOption[] => { result.push(entry); return entry.linked ? result.concat( expandLinked(entry.linked).map((child): LinkOption => { child.genesisHashRelay = entry.genesisHash; child.isChild = true; child.valueRelay = valueRelay; ...
AndreasGassmann/apps
packages/apps-config/src/endpoints/util.ts
TypeScript
ArrowFunction
(child): LinkOption => { child.genesisHashRelay = entry.genesisHash; child.isChild = true; child.valueRelay = valueRelay; return child; }
AndreasGassmann/apps
packages/apps-config/src/endpoints/util.ts
TypeScript
ArrowFunction
(_, index) => !firstOnly || index === 0
AndreasGassmann/apps
packages/apps-config/src/endpoints/util.ts
TypeScript
ArrowFunction
([host, value], index): LinkOption => ({ ...base, dnslink: index === 0 ? dnslink : undefined, isLightClient: value.startsWith('light://'), isRelay: false, textBy: value.startsWith('light://') ? t('lightclient.experimental', 'light client (experimental)', { ns: 'apps-config' }) ...
AndreasGassmann/apps
packages/apps-config/src/endpoints/util.ts
TypeScript
ArrowFunction
({ paraId }) => paraId
AndreasGassmann/apps
packages/apps-config/src/endpoints/util.ts
TypeScript
ArrowFunction
(o) => options.push(...expandEndpoint(t, o, firstOnly, withSort))
AndreasGassmann/apps
packages/apps-config/src/endpoints/util.ts
TypeScript
ArrowFunction
(all: LinkOption[], e) => all.concat(expandEndpoint(t, e, firstOnly, withSort))
AndreasGassmann/apps
packages/apps-config/src/endpoints/util.ts
TypeScript
InterfaceDeclaration
interface SortOption { isUnreachable?: boolean; }
AndreasGassmann/apps
packages/apps-config/src/endpoints/util.ts
TypeScript
ArrowFunction
(t) => { if (t.name === 'rlpx') { t.options.bootnodes = t.options.bootnodes || this.common.bootstrapNodes() return new RlpxServer({ config: this, ...t.options }) } else { return new Libp2pServer({ config: this, ...t.options }) } }
alexfmpe/ethereumjs-vm
packages/client/lib/config.ts
TypeScript
ClassDeclaration
export class Config { // Initialize Common with an explicit 'chainstart' HF set until // hardfork awareness is implemented within the library // Also a fix for https://github.com/ethereumjs/ethereumjs-vm/issues/757 public static readonly COMMON_DEFAULT = new Common({ chain: 'mainnet', hardfork: 'chainstart' })...
alexfmpe/ethereumjs-vm
packages/client/lib/config.ts
TypeScript
InterfaceDeclaration
export interface ConfigOptions { /** * Specify the chain and hardfork by passing a Common instance. * * Default: chain 'mainnet' and hardfork 'chainstart' */ common?: Common /** * Synchronization mode ('full' or 'light') * * Default: 'full' */ syncmode?: string /** * Provide a cu...
alexfmpe/ethereumjs-vm
packages/client/lib/config.ts
TypeScript
MethodDeclaration
/** * Returns the directory for storing the client chain data * based on syncmode and selected chain (subdirectory of 'datadir') */ getChainDataDirectory(): string { const networkDirName = this.common.chainName() const chainDataDirName = this.syncmode === 'light' ? 'lightchain' : 'chain' const dat...
alexfmpe/ethereumjs-vm
packages/client/lib/config.ts
TypeScript
MethodDeclaration
/** * Returns the directory for storing the client state data * based selected chain (subdirectory of 'datadir') */ getStateDataDirectory(): string { const networkDirName = this.common.chainName() const dataDir = `${this.datadir}/${networkDirName}/state` return dataDir }
alexfmpe/ethereumjs-vm
packages/client/lib/config.ts
TypeScript
ClassDeclaration
@Component({ selector: 'ng-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { title = 'angular'; }
StarApps03/AppsStars
angular/src/app/app.component.ts
TypeScript
FunctionDeclaration
// 时间复杂度:O(n) // 空间复杂度:O(1) export function climbStairs(n: number): number { console.time('爬楼梯'); if(n <= 2) return n; let step0 = 1; let step1 = 1; for(let i = 2; i <= n; i++) { const temp = step0; step0 = step1; step1 = step0 + temp; } console.timeEnd('爬楼梯'); return step1; }
lotosv2010/Learning-algorithm
src/leetcode/70/index.ts
TypeScript
ClassDeclaration
export class Setup { @ApiProperty() game_id: number; @ApiPropertyOptional() variant_id: number; @ApiProperty() selector_value: number; @ApiProperty() name: string; }
GlukKazan/DagazServer
src/interfaces/setup.interface.ts
TypeScript
ArrowFunction
_ => Promise.resolve({ data: {} })
moattarwork/Action.Teams.SendMessage
__mocks__/request-promise.ts
TypeScript
ArrowFunction
t => { const obj: any = {}; const found: any = 1; const wanted: any = 1; const notWanted: any = 1; const fn: (stuff: any) => void = () => {}; const expectedError: Error = new Error(); const eventEmitter: EventEmitter = new EventEmitter(); const pattern: RegExp | string | { [key: string]...
AISS-2021-L9-G02/DefinitelyTyped
types/tap/tap-tests.ts
TypeScript
ArrowFunction
async t => { const wanted: any = 1; const expectedError: Error = new Error(); const message = 'message'; const extra = { todo: false, skip: 'skip', diagnostic: true, extra_stuff: false, }; const promise: Promise<any> = Promise.resolve(1); const promiseProvid...
AISS-2021-L9-G02/DefinitelyTyped
types/tap/tap-tests.ts
TypeScript
ArrowFunction
t => { t.pass(); }
AISS-2021-L9-G02/DefinitelyTyped
types/tap/tap-tests.ts
TypeScript
ArrowFunction
t => { const cwd = t.testdir({ 'demo.jpg': Buffer.from('a jpg'), 'package.json': JSON.stringify({ name: 'pj', }), src: { 'index.js': 'yay', hardlinked: t.fixture('link', '../target'), softlinked: t.fixture('symlink', '../target'), ...
AISS-2021-L9-G02/DefinitelyTyped
types/tap/tap-tests.ts
TypeScript
ArrowFunction
t => { // fairly infrequent vs testdir() sugar t.fixture('dir', {}); t.fixture('file', 'content'); t.fixture('file', Buffer.from('content')); // much more common, as sugar does not exist t.fixture('link', 'target'); t.fixture('symlink', 'target'); }
AISS-2021-L9-G02/DefinitelyTyped
types/tap/tap-tests.ts
TypeScript
ArrowFunction
() => { this.emit(Events.ADBREAK_STATE_PLAYING); }
JamoDevNich/indigo-player
src/extensions/FreeWheelExtension/FreeWheelExtension.ts
TypeScript
ArrowFunction
() => { if (this.currentAdBreak) { this.emit(Events.ADBREAK_STATE_TIMEUPDATE, { currentTime: this.currentAdBreak.freewheelSlot.getPlayheadTime(), } as IAdBreakTimeUpdateEventData); } }
JamoDevNich/indigo-player
src/extensions/FreeWheelExtension/FreeWheelExtension.ts
TypeScript
ArrowFunction
() => { this.emit(Events.ADBREAK_STATE_BUFFERING); }
JamoDevNich/indigo-player
src/extensions/FreeWheelExtension/FreeWheelExtension.ts
TypeScript
ArrowFunction
cuepoint => { if (cuepoint === AdBreakType.PREROLL) { this.adContext.addTemporalSlot('preroll', this.sdk.ADUNIT_PREROLL, 0); } else if (cuepoint === AdBreakType.POSTROLL) { this.adContext.addTemporalSlot( 'postroll', this.sdk.ADUNIT_POSTROLL, freewheel.duration...
JamoDevNich/indigo-player
src/extensions/FreeWheelExtension/FreeWheelExtension.ts
TypeScript
ArrowFunction
(slot, index) => ({ sequenceIndex: index, id: slot.getCustomId(), type: slot.getAdUnit(), startsAt: slot.getTimePosition(), duration: slot.getTotalDuration(), hasBeenWatched: false, maxAds: slot.getAdCount(), free...
JamoDevNich/indigo-player
src/extensions/FreeWheelExtension/FreeWheelExtension.ts
TypeScript
ArrowFunction
adBreak => adBreak.type === AdBreakType.MIDROLL && adBreak.startsAt <= currentTime && adBreak.startsAt > this.prevCurrentTime && !adBreak.hasBeenWatched
JamoDevNich/indigo-player
src/extensions/FreeWheelExtension/FreeWheelExtension.ts
TypeScript