type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
MethodDeclaration
trial(display_element: HTMLElement, trial: TrialType<Info>) { // circle params var diam = trial.circle_diameter; // pixels var radi = diam / 2; var paper_size = diam + trial.target_size[0]; // stimuli width, height var stimh = trial.target_size[0]; var stimw = trial.target_size[1]; var...
JAQuent/jsPsych
packages/plugin-visual-search-circle/src/index.ts
TypeScript
ArrowFunction
async () => { return { hello: 'world' } }
cataline4learning/facebook-api
start/routes/index.ts
TypeScript
FunctionDeclaration
async function sleep(ms: number = 0) { return new Promise(resolve => { setTimeout(resolve, ms); }); }
SVemulapalli/salesforcedx-vscode
packages/salesforcedx-vscode-soql/test/vscode-integration/client/client.test.ts
TypeScript
FunctionDeclaration
function waitUntil(predicate: () => boolean) { return new Promise<void>(async resolve => { let notFound = true; let tries = 5; while (notFound || tries-- > 0) { await sleep(50); notFound = !predicate(); } resolve(); }); }
SVemulapalli/salesforcedx-vscode
packages/salesforcedx-vscode-soql/test/vscode-integration/client/client.test.ts
TypeScript
ArrowFunction
resolve => { setTimeout(resolve, ms); }
SVemulapalli/salesforcedx-vscode
packages/salesforcedx-vscode-soql/test/vscode-integration/client/client.test.ts
TypeScript
ArrowFunction
async resolve => { let notFound = true; let tries = 5; while (notFound || tries-- > 0) { await sleep(50); notFound = !predicate(); } resolve(); }
SVemulapalli/salesforcedx-vscode
packages/salesforcedx-vscode-soql/test/vscode-integration/client/client.test.ts
TypeScript
ArrowFunction
() => { let sandbox: sinon.SinonSandbox; let workspacePath: string; let soqlFileUri: Uri; const encoder = new TextEncoder(); let mockConnection: MockConnection; beforeEach(async () => { sandbox = sinon.createSandbox(); mockConnection = stubMockConnection(sandbox); workspacePath = workspace.wor...
SVemulapalli/salesforcedx-vscode
packages/salesforcedx-vscode-soql/test/vscode-integration/client/client.test.ts
TypeScript
ArrowFunction
async () => { sandbox = sinon.createSandbox(); mockConnection = stubMockConnection(sandbox); workspacePath = workspace.workspaceFolders![0].uri.fsPath; soqlFileUri = Uri.file(path.join(workspacePath, 'test.soql')); const ext = extensions.getExtension('salesforce.salesforcedx-vscode-soql')!; awa...
SVemulapalli/salesforcedx-vscode
packages/salesforcedx-vscode-soql/test/vscode-integration/client/client.test.ts
TypeScript
ArrowFunction
async () => { sandbox.restore(); await workspace.fs.delete(soqlFileUri); }
SVemulapalli/salesforcedx-vscode
packages/salesforcedx-vscode-soql/test/vscode-integration/client/client.test.ts
TypeScript
ArrowFunction
async () => { await workspace.fs.writeFile( soqlFileUri, encoder.encode(` SELECT Id FRM Account `) ); await window.showTextDocument(soqlFileUri); const diagnostics = languages.getDiagnostics(soqlFileUri); expect(diagnostics) .to.be.an('array') .to.have.lengt...
SVemulapalli/salesforcedx-vscode
packages/salesforcedx-vscode-soql/test/vscode-integration/client/client.test.ts
TypeScript
ArrowFunction
async () => { const expectedError = `SELECT Ids FROM ACCOUNT\nERROR at Row:1:Column:8\nSome error at 'Ids'`; await workspace.fs.writeFile( soqlFileUri, encoder.encode(` SELECT Ids FROM Account `) ); sandbox.stub(mockConnection, 'query').throws({ name: 'INVALID_FIELD',...
SVemulapalli/salesforcedx-vscode
packages/salesforcedx-vscode-soql/test/vscode-integration/client/client.test.ts
TypeScript
ArrowFunction
() => { return languages.getDiagnostics(soqlFileUri).length > 0; }
SVemulapalli/salesforcedx-vscode
packages/salesforcedx-vscode-soql/test/vscode-integration/client/client.test.ts
TypeScript
FunctionDeclaration
export declare function outputLayer(boxPredictions: tf.Tensor4D, classPredictions: tf.Tensor4D, params: OutputLayerParams): { boxes: tf.Tensor2D[]; scores: tf.Tensor1D[]; };
davy-blavette/datatrainX
packages/datatrainx/build/es6/ssdMobilenetv1/outputLayer.d.ts
TypeScript
ArrowFunction
() => { const mockConventionalRecommendedBump = conventionalRecommendedBump as jest.MockedFunction< typeof conventionalRecommendedBump >; const mockGetLastVersion = getLastVersion as jest.MockedFunction< typeof getLastVersion >; const mockGetCommits = getCommits as jest.MockedFunction<typeof ...
jscutlery/semver
packages/semver/src/executors/version/utils/try-bump.spec.ts
TypeScript
ArrowFunction
() => { mockGetLastVersion.mockReturnValue(of('2.1.0')); loggerSpy = jest.spyOn(logger, 'warn'); }
jscutlery/semver
packages/semver/src/executors/version/utils/try-bump.spec.ts
TypeScript
ArrowFunction
async () => { mockGetCommits.mockReturnValue(of(['feat: A', 'feat: B'])); /* Mock bump to return "minor". */ mockConventionalRecommendedBump.mockImplementation( callbackify( jest.fn().mockResolvedValue({ releaseType: 'minor', }) ) as () => void ); const newVer...
jscutlery/semver
packages/semver/src/executors/version/utils/try-bump.spec.ts
TypeScript
ArrowFunction
async () => { mockGetCommits.mockReturnValue(of(['feat: A', 'feat: B'])); const newVersion = await lastValueFrom(tryBump({ preset: 'angular', projectRoot: '/libs/demo', tagPrefix: 'v', releaseType: 'premajor', preid: 'alpha', })); expect(newVersion).toEqual('3.0.0-alpha....
jscutlery/semver
packages/semver/src/executors/version/utils/try-bump.spec.ts
TypeScript
ArrowFunction
async () => { mockGetCommits.mockReturnValue(of([])); const newVersion = await lastValueFrom( tryBump({ preset: 'angular', projectRoot: '/libs/demo', tagPrefix: 'v', releaseType: 'patch', }) ); expect(newVersion).toEqual('2.1.1'); expect(mockConvention...
jscutlery/semver
packages/semver/src/executors/version/utils/try-bump.spec.ts
TypeScript
ArrowFunction
async () => { mockGetLastVersion.mockReturnValue(throwError(() => 'No version found')); mockGetCommits.mockReturnValue(of([])); mockGetFirstCommitRef.mockReturnValue(of('sha1')); await lastValueFrom( tryBump({ preset: 'angular', projectRoot: '/libs/demo', tagPrefix: 'v' ...
jscutlery/semver
packages/semver/src/executors/version/utils/try-bump.spec.ts
TypeScript
ArrowFunction
() => 'No version found'
jscutlery/semver
packages/semver/src/executors/version/utils/try-bump.spec.ts
TypeScript
ArrowFunction
async () => { mockGetCommits.mockReturnValue(of([])); const newVersion = await lastValueFrom( tryBump({ preset: 'angular', projectRoot: '/libs/demo', tagPrefix: 'v', }) ); expect(newVersion).toBeUndefined(); expect(mockGetCommits).toBeCalledWith({ projec...
jscutlery/semver
packages/semver/src/executors/version/utils/try-bump.spec.ts
TypeScript
ArrowFunction
(blog: HttpResponse<Blog>) => { if (blog.body) { return of(blog.body); } else { this.router.navigate(['404']); return EMPTY; } }
Tonterias/SpingularJhipsterV7
src/main/webapp/app/entities/blog/route/blog-routing-resolve.service.ts
TypeScript
ClassDeclaration
@Injectable({ providedIn: 'root' }) export class BlogRoutingResolveService implements Resolve<IBlog> { constructor(protected service: BlogService, protected router: Router) {} resolve(route: ActivatedRouteSnapshot): Observable<IBlog> | Observable<never> { const id = route.params['id']; if (id) { ret...
Tonterias/SpingularJhipsterV7
src/main/webapp/app/entities/blog/route/blog-routing-resolve.service.ts
TypeScript
MethodDeclaration
resolve(route: ActivatedRouteSnapshot): Observable<IBlog> | Observable<never> { const id = route.params['id']; if (id) { return this.service.find(id).pipe( mergeMap((blog: HttpResponse<Blog>) => { if (blog.body) { return of(blog.body); } else { this.rou...
Tonterias/SpingularJhipsterV7
src/main/webapp/app/entities/blog/route/blog-routing-resolve.service.ts
TypeScript
InterfaceDeclaration
export interface CallOptions {}
dizys/orpc
src/library/shared/call.ts
TypeScript
InterfaceDeclaration
export interface CallData { callUUID: string; method: string; params?: any[]; options?: CallOptions; }
dizys/orpc
src/library/shared/call.ts
TypeScript
InterfaceDeclaration
export interface IUserState { email: string; admin: boolean; token: string; }
ragnar-pals/nx-ng-starter
libs/client-store/src/lib/user/user.interface.ts
TypeScript
InterfaceDeclaration
export interface IUserStatePayload { email?: string; admin?: boolean; token?: string; }
ragnar-pals/nx-ng-starter
libs/client-store/src/lib/user/user.interface.ts
TypeScript
InterfaceDeclaration
export interface IUserObservableOutput { model$: Observable<IUserState>; email$: Observable<string>; token$: Observable<string>; admin$: Observable<boolean>; isLoggedInSubscription$: Observable<boolean>; }
ragnar-pals/nx-ng-starter
libs/client-store/src/lib/user/user.interface.ts
TypeScript
InterfaceDeclaration
export interface IUserHandlers { setState(payload: IUserStatePayload): void; }
ragnar-pals/nx-ng-starter
libs/client-store/src/lib/user/user.interface.ts
TypeScript
TypeAliasDeclaration
export type TUserPayload = IActionPayload<IUserStatePayload>;
ragnar-pals/nx-ng-starter
libs/client-store/src/lib/user/user.interface.ts
TypeScript
ArrowFunction
(props) => { const q = props.state.auth.questions.find((data) => { return data.id === props.id; }) || { question: '', answer: '', public: false, createdAt: '' }; const question = q.question; const [answer, setAnswer] = useState(q.answer); const [questionPublic, setPublic] = useState(q.public); const [s...
KKOO727/miyulab-officialsite
src/app/components/organisms/questions/QuestionEdit.tsx
TypeScript
ArrowFunction
(data) => { return data.id === props.id; }
KKOO727/miyulab-officialsite
src/app/components/organisms/questions/QuestionEdit.tsx
TypeScript
ArrowFunction
(e: { target: { checked: boolean } }) => { setPublic(e.target.checked); }
KKOO727/miyulab-officialsite
src/app/components/organisms/questions/QuestionEdit.tsx
TypeScript
ArrowFunction
(e: { target: { value: string } }) => { setAnswer(e.target.value); }
KKOO727/miyulab-officialsite
src/app/components/organisms/questions/QuestionEdit.tsx
TypeScript
ArrowFunction
() => { setSubmited(true); props.actions.updateQuestion({ answer, id: props.id, public: questionPublic, }); Router.push('/mypage', undefined, { shallow: true }); }
KKOO727/miyulab-officialsite
src/app/components/organisms/questions/QuestionEdit.tsx
TypeScript
ArrowFunction
(state) => { return { state }; }
KKOO727/miyulab-officialsite
src/app/components/organisms/questions/QuestionEdit.tsx
TypeScript
ArrowFunction
(dispatch) => { return { actions: bindActionCreators(Actions, dispatch), }; }
KKOO727/miyulab-officialsite
src/app/components/organisms/questions/QuestionEdit.tsx
TypeScript
InterfaceDeclaration
interface Props { id: string | string[]; actions: any; state: any; }
KKOO727/miyulab-officialsite
src/app/components/organisms/questions/QuestionEdit.tsx
TypeScript
ArrowFunction
(): JSX.Element => { return ( <div> <Navbar name="Update Password"></Navbar> <UpdatePasswordForm></UpdatePasswordForm> </div>
PSU-CapstoneBrownHope/OldCapstoneProject
front/src/components/UpdatePassword/UpdatePassword.tsx
TypeScript
ClassDeclaration
export class PropertyComponent extends LitElement { render() { return html` <div> Hello, home page </div> `; } }
oleksandr-voronkov/homester-vntu
src/app/views/property.component.ts
TypeScript
MethodDeclaration
render() { return html` <div> Hello, home page </div> `; }
oleksandr-voronkov/homester-vntu
src/app/views/property.component.ts
TypeScript
ClassDeclaration
// [§ 4.5.17 The samp element](https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-samp-element) export class Sample extends InlineAnnotation<GlobalAttributes> { static vendorPrefix = "html"; static type = "samp"; }
CondeNast-Copilot/atjson
packages/@atjson/source-html/src/annotations/samp.ts
TypeScript
FunctionDeclaration
function expectConfigurationOption(configurationList: Stanza, configurationKey: string, expected: any) { const value = extractConfigurationValue(configurationList, configurationKey); expect(value).toEqual(expected); }
DevRichter/ngx-chat
projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/multi-user-chat.plugin.spec.ts
TypeScript
FunctionDeclaration
function extractConfigurationValue(configurationList: Stanza, configurationKey: string) { const fieldNodes = configurationList.getChildrenByAttr('var', configurationKey); expect(fieldNodes.length).toEqual(1); const fieldNode = fieldNodes[0]; const values = fieldNode.getChildren('value').map(node => nod...
DevRichter/ngx-chat
projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/multi-user-chat.plugin.spec.ts
TypeScript
ArrowFunction
() => { const mockClientFactory = new MockClientFactory(); xmppClientMock = mockClientFactory.clientInstance; TestBed.configureTestingModule({ providers: [ XmppChatConnectionService, {provide: XmppClientFactoryService, useValue: mockClientFactory}, ...
DevRichter/ngx-chat
projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/multi-user-chat.plugin.spec.ts
TypeScript
ArrowFunction
() => conferenceService
DevRichter/ngx-chat
projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/multi-user-chat.plugin.spec.ts
TypeScript
ArrowFunction
() => { it('should throw if user is not allowed to create rooms', async () => { xmppClientMock.send.and.callFake((content: Stanza) => { chatConnectionService.onStanzaReceived( xml('presence', {from: content.attrs.to, to: content.attrs.from}, ...
DevRichter/ngx-chat
projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/multi-user-chat.plugin.spec.ts
TypeScript
ArrowFunction
async () => { xmppClientMock.send.and.callFake((content: Stanza) => { chatConnectionService.onStanzaReceived( xml('presence', {from: content.attrs.to, to: content.attrs.from}, xml('x', {xmlns: 'http://jabber.org/protocol/muc#user', type: 'error'}...
DevRichter/ngx-chat
projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/multi-user-chat.plugin.spec.ts
TypeScript
ArrowFunction
(content: Stanza) => { chatConnectionService.onStanzaReceived( xml('presence', {from: content.attrs.to, to: content.attrs.from}, xml('x', {xmlns: 'http://jabber.org/protocol/muc#user', type: 'error'}), xml('error', {by: 'me@example.com...
DevRichter/ngx-chat
projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/multi-user-chat.plugin.spec.ts
TypeScript
ArrowFunction
async () => { xmppClientMock.send.and.callFake((content: Stanza) => { chatConnectionService.onStanzaReceived( xml('presence', {from: content.attrs.to, to: content.attrs.from}, xml('x', {xmlns: 'http://jabber.org/protocol/muc#user'}, ...
DevRichter/ngx-chat
projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/multi-user-chat.plugin.spec.ts
TypeScript
ArrowFunction
(content: Stanza) => { chatConnectionService.onStanzaReceived( xml('presence', {from: content.attrs.to, to: content.attrs.from}, xml('x', {xmlns: 'http://jabber.org/protocol/muc#user'}, xml('item', {affiliation: 'visitor', role: 'v...
DevRichter/ngx-chat
projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/multi-user-chat.plugin.spec.ts
TypeScript
ArrowFunction
async () => { xmppClientMock.send.and.callFake((content: Stanza) => { if (content.name === 'presence') { chatConnectionService.onStanzaReceived( xml('presence', {from: content.attrs.to, to: content.attrs.from}, xml('x...
DevRichter/ngx-chat
projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/multi-user-chat.plugin.spec.ts
TypeScript
ArrowFunction
(content: Stanza) => { if (content.name === 'presence') { chatConnectionService.onStanzaReceived( xml('presence', {from: content.attrs.to, to: content.attrs.from}, xml('x', {xmlns: 'http://jabber.org/protocol/muc#user'}, ...
DevRichter/ngx-chat
projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/multi-user-chat.plugin.spec.ts
TypeScript
ArrowFunction
async () => { xmppClientMock.send.and.callFake((content: Stanza) => { if (content.name === 'presence') { chatConnectionService.onStanzaReceived( xml('presence', {from: content.attrs.to, to: content.attrs.from}, xml('x',...
DevRichter/ngx-chat
projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/multi-user-chat.plugin.spec.ts
TypeScript
ArrowFunction
(content: Stanza) => { if (content.name === 'presence') { chatConnectionService.onStanzaReceived( xml('presence', {from: content.attrs.to, to: content.attrs.from}, xml('x', {xmlns: 'http://jabber.org/protocol/muc#user'}, ...
DevRichter/ngx-chat
projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/multi-user-chat.plugin.spec.ts
TypeScript
ArrowFunction
async () => { xmppClientMock.send.and.callFake((content: Stanza) => { if (content.name === 'presence') { chatConnectionService.onStanzaReceived( xml('presence', {from: content.attrs.to, to: content.attrs.from}, xml('x'...
DevRichter/ngx-chat
projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/multi-user-chat.plugin.spec.ts
TypeScript
ArrowFunction
(content: Stanza) => { if (content.name === 'presence') { chatConnectionService.onStanzaReceived( xml('presence', {from: content.attrs.to, to: content.attrs.from}, xml('x', {xmlns: 'http://jabber.org/protocol/muc#user'}, ...
DevRichter/ngx-chat
projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/multi-user-chat.plugin.spec.ts
TypeScript
ArrowFunction
() => { it('should be able to receive messages in rooms', async (resolve) => { xmppClientMock.send.and.callFake((content: Stanza) => { chatConnectionService.onStanzaReceived( xml('presence', {from: content.attrs.to, to: content.attrs.from}, ...
DevRichter/ngx-chat
projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/multi-user-chat.plugin.spec.ts
TypeScript
ArrowFunction
async (resolve) => { xmppClientMock.send.and.callFake((content: Stanza) => { chatConnectionService.onStanzaReceived( xml('presence', {from: content.attrs.to, to: content.attrs.from}, xml('x', {xmlns: 'http://jabber.org/protocol/muc#user', type: '...
DevRichter/ngx-chat
projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/multi-user-chat.plugin.spec.ts
TypeScript
ArrowFunction
(content: Stanza) => { chatConnectionService.onStanzaReceived( xml('presence', {from: content.attrs.to, to: content.attrs.from}, xml('x', {xmlns: 'http://jabber.org/protocol/muc#user', type: 'error'}, xml('item', {affiliation: 'mem...
DevRichter/ngx-chat
projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/multi-user-chat.plugin.spec.ts
TypeScript
ArrowFunction
(message) => { expect(message.body).toEqual('message content here'); resolve(); }
DevRichter/ngx-chat
projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/multi-user-chat.plugin.spec.ts
TypeScript
ArrowFunction
async () => { xmppClientMock.send.and.callFake((stanza: Stanza) => { if (stanza.name === 'message') { expect(stanza.name).toEqual('message'); expect(stanza.attrs.from).toEqual('me@example.com/something'); expect(stanza.attrs.to)....
DevRichter/ngx-chat
projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/multi-user-chat.plugin.spec.ts
TypeScript
ArrowFunction
(stanza: Stanza) => { if (stanza.name === 'message') { expect(stanza.name).toEqual('message'); expect(stanza.attrs.from).toEqual('me@example.com/something'); expect(stanza.attrs.to).toEqual('chatroom@conference.example.com'); ...
DevRichter/ngx-chat
projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/multi-user-chat.plugin.spec.ts
TypeScript
ArrowFunction
node => node.getText()
DevRichter/ngx-chat
projects/pazznetwork/ngx-chat/src/lib/services/adapters/xmpp/plugins/multi-user-chat.plugin.spec.ts
TypeScript
ArrowFunction
c => ({ __typename: "CountryDisplay", code: c.code, country: c.name })
23andMe/saleor-dashboard
src/warehouses/components/WarehouseCreatePage/WarehouseCreatePage.stories.tsx
TypeScript
ArrowFunction
() => <WarehouseCreatePage {...props} />
23andMe/saleor-dashboard
src/warehouses/components/WarehouseCreatePage/WarehouseCreatePage.stories.tsx
TypeScript
ArrowFunction
() => <WarehouseCreatePage {...props}
23andMe/saleor-dashboard
src/warehouses/components/WarehouseCreatePage/WarehouseCreatePage.stories.tsx
TypeScript
ArrowFunction
() => ( <WarehouseCreatePage {...props}
23andMe/saleor-dashboard
src/warehouses/components/WarehouseCreatePage/WarehouseCreatePage.stories.tsx
TypeScript
ArrowFunction
field => ({ __typename: "WarehouseError", code: WarehouseErrorCode.INVALID, field, message: "Warehouse invalid" })
23andMe/saleor-dashboard
src/warehouses/components/WarehouseCreatePage/WarehouseCreatePage.stories.tsx
TypeScript
ClassDeclaration
@Component({ styleUrls: ['./careerbook.component.scss'], templateUrl: './careerbook.component.html', }) export class CareerbookComponent { }
riyasuchdev/career-book
src/app/careerbook/careerbook.component.ts
TypeScript
FunctionDeclaration
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ export default function () { return `export default '';`; }
10088/angular-cli
packages/angular_devkit/build_angular/src/builders/extract-i18n/empty-loader.ts
TypeScript
ArrowFunction
() => { let component: AspectMetricsComponent; let fixture: ComponentFixture<AspectMetricsComponent>; beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [ AspectMetricsComponent ], imports: [ SharedMocksModule, FormsModule, ReactiveForms...
Emerald-Newbee/OpenSpeedMonitor
frontend/src/app/modules/aspect-configuration/components/aspect-metrics/aspect-metrics.component.spec.ts
TypeScript
ArrowFunction
() => { TestBed.configureTestingModule({ declarations: [ AspectMetricsComponent ], imports: [ SharedMocksModule, FormsModule, ReactiveFormsModule ], providers: [ AspectMetricsComponent ] }) .compileComponents(); }
Emerald-Newbee/OpenSpeedMonitor
frontend/src/app/modules/aspect-configuration/components/aspect-metrics/aspect-metrics.component.spec.ts
TypeScript
ArrowFunction
() => { fixture = TestBed.createComponent(AspectMetricsComponent); component = fixture.componentInstance; component.aspects = []; component.aspectType = {name: '', icon: ''}; fixture.detectChanges(); }
Emerald-Newbee/OpenSpeedMonitor
frontend/src/app/modules/aspect-configuration/components/aspect-metrics/aspect-metrics.component.spec.ts
TypeScript
ArrowFunction
(component: AspectMetricsComponent) => { const type1: PerformanceAspectType = {name: 'PAGE_CONSTRUCTION_STARTED', icon: 'hourglass'}; const type2: PerformanceAspectType = {name: 'PAGE_SHOWS_USEFUL_CONTENT', icon: 'hourglass'}; const aspectsOfTwoDifferentTypes = [ { id: 1, ...
Emerald-Newbee/OpenSpeedMonitor
frontend/src/app/modules/aspect-configuration/components/aspect-metrics/aspect-metrics.component.spec.ts
TypeScript
ArrowFunction
(aspects: ExtendedPerformanceAspect[]) => { expect(aspects.length).toBe(1); expect(aspects[0].performanceAspectType).toBe(type1); }
Emerald-Newbee/OpenSpeedMonitor
frontend/src/app/modules/aspect-configuration/components/aspect-metrics/aspect-metrics.component.spec.ts
TypeScript
FunctionDeclaration
export declare function startServer(commandOptions: CommandOptions, { isDev: _isDev, isWatch: _isWatch, preparePackages: _preparePackages, }?: { isDev?: boolean; isWatch?: boolean; preparePackages?: boolean; }): Promise<SnowpackDevServer>;
Robscha11/vis_exc1
node_modules/snowpack/lib/commands/dev.d.ts
TypeScript
FunctionDeclaration
export declare function command(commandOptions: CommandOptions): Promise<unknown>;
Robscha11/vis_exc1
node_modules/snowpack/lib/commands/dev.d.ts
TypeScript
ClassDeclaration
export declare class OneToManyMap { readonly keyToValue: Map<string, string[]>; readonly valueToKey: Map<string, string>; add(key: string, _value: string | string[]): void; delete(key: string): void; key(value: string): string | undefined; value(key: string): string[] | undefined; }
Robscha11/vis_exc1
node_modules/snowpack/lib/commands/dev.d.ts
TypeScript
MethodDeclaration
add(key: string, _value: string | string[]): void;
Robscha11/vis_exc1
node_modules/snowpack/lib/commands/dev.d.ts
TypeScript
MethodDeclaration
delete(key: string): void;
Robscha11/vis_exc1
node_modules/snowpack/lib/commands/dev.d.ts
TypeScript
MethodDeclaration
key(value: string): string | undefined;
Robscha11/vis_exc1
node_modules/snowpack/lib/commands/dev.d.ts
TypeScript
MethodDeclaration
value(key: string): string[] | undefined;
Robscha11/vis_exc1
node_modules/snowpack/lib/commands/dev.d.ts
TypeScript
ArrowFunction
async (id: String) => { const deleted = await Favorite.deleteOne({ _id: id }); return deleted; }
Rafael-Cesario/Study
09_my_favorites/API/src/database/methods/deleteFavorite.ts
TypeScript
TypeAliasDeclaration
type BaseOptions = { key?: string uri?: string }
peritpatrio/appsignal-javascript
packages/javascript/src/types/options.ts
TypeScript
TypeAliasDeclaration
export type AppsignalOptions = BaseOptions & { namespace?: string revision?: string ignoreErrors?: RegExp[] }
peritpatrio/appsignal-javascript
packages/javascript/src/types/options.ts
TypeScript
TypeAliasDeclaration
export type PushApiOptions = BaseOptions & { key: string version: string }
peritpatrio/appsignal-javascript
packages/javascript/src/types/options.ts
TypeScript
ArrowFunction
(event) => { let toast = this.toastCtrl.create({ message: 'Event created', duration: 3000, position: 'bottom', showCloseButton: true, closeButtonText: 'UNDO' }); toast.onDidDismiss((data, role) => { if (role == "close")...
javieraviles/tri-together
src/pages/event-form/event-form.ts
TypeScript
ArrowFunction
(data, role) => { if (role == "close") { this.eventService.deleteEvent(event.id); } }
javieraviles/tri-together
src/pages/event-form/event-form.ts
TypeScript
ArrowFunction
() => { let toast = this.toastCtrl.create({ message: 'Event modified', duration: 3000, position: 'bottom', showCloseButton: true, closeButtonText: 'UNDO' }); toast.onDidDismiss((data, role) => { if (role == "close") { ...
javieraviles/tri-together
src/pages/event-form/event-form.ts
TypeScript
ArrowFunction
(data, role) => { if (role == "close") { this.eventService.updateEvent(this.eventId, this.originalEvent).then( () => { Object.assign(this.event, this.originalEvent); }); } }
javieraviles/tri-together
src/pages/event-form/event-form.ts
TypeScript
ArrowFunction
() => { Object.assign(this.event, this.originalEvent); }
javieraviles/tri-together
src/pages/event-form/event-form.ts
TypeScript
ClassDeclaration
@Component({ selector: 'page-event-form', templateUrl: 'event-form.html', }) export class EventFormPage { event: Event = new Event(); eventId: string; originalEvent: Event = new Event(); editMode: Boolean = false; title: string = "Create event"; eventModified: boolean = false; userId: string; disc...
javieraviles/tri-together
src/pages/event-form/event-form.ts
TypeScript
MethodDeclaration
ionViewWillLeave() { if(!this.eventModified && this.editMode) { Object.assign(this.event, this.originalEvent); } }
javieraviles/tri-together
src/pages/event-form/event-form.ts
TypeScript
MethodDeclaration
saveEvent() { if(!this.editMode) { this.event.owner = this.userId; this.eventService.createEvent(this.event).then( (event) => { let toast = this.toastCtrl.create({ message: 'Event created', duration: 3000, position: 'bottom', showCloseButton...
javieraviles/tri-together
src/pages/event-form/event-form.ts
TypeScript
ClassDeclaration
export class DefaultHasManyEntityCrudRepository< TargetEntity extends Entity, TargetID, TargetRepository extends EntityCrudRepository<TargetEntity, TargetID> > implements HasManyRepository<TargetEntity> { /** * Constructor of DefaultHasManyEntityCrudRepository * @param targetRepository the related target...
sybarite/loopback-next
packages/repository/src/repositories/relation.repository.ts
TypeScript
InterfaceDeclaration
/** * CRUD operations for a target repository of a HasMany relation */ export interface HasManyRepository<Target extends Entity> { /** * Create a target model instance * @param targetModelData The target model data * @param options Options for the operation * @returns A promise which resolves to the new...
sybarite/loopback-next
packages/repository/src/repositories/relation.repository.ts
TypeScript
MethodDeclaration
async create( targetModelData: Partial<TargetEntity>, options?: Options, ): Promise<TargetEntity> { return await this.targetRepository.create( constrainDataObject(targetModelData, this.constraint), options, ); }
sybarite/loopback-next
packages/repository/src/repositories/relation.repository.ts
TypeScript
MethodDeclaration
async find(filter?: Filter, options?: Options): Promise<TargetEntity[]> { return await this.targetRepository.find( constrainFilter(filter, this.constraint), options, ); }
sybarite/loopback-next
packages/repository/src/repositories/relation.repository.ts
TypeScript