type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
ArrowFunction
async () => { await $unitAdd.click(); const unitFill = await $$gatheringMarkerPaths.last().getAttribute("style"); await browser.actions() .mouseMove(lajiFormLocate("gatherings.0.units.0").getWebElement()) .perform(); const unitFillAfterLocationHover = await $$gatheringMarkerPaths.last().getAttri...
luomus/laji-form
test/trip-report-spec.ts
TypeScript
ArrowFunction
async () => { await browser.actions() .mouseMove($getLocationButtonFor(0, 0).getWebElement()) .perform(); expect(await $locationPeeker.isDisplayed()).toBe(true); }
luomus/laji-form
test/trip-report-spec.ts
TypeScript
ArrowFunction
async () => { await browser.actions() .mouseMove($getLocationButtonFor(0, 0).getWebElement()) .perform(); await browser.wait(protractor.ExpectedConditions.visibilityOf($locationPeeker.$(".leaflet-container")), 5000, "Map peeker waiting timeout"); const $$peekerPaths = $$("#root_gatherings_0_units_0-...
luomus/laji-form
test/trip-report-spec.ts
TypeScript
ArrowFunction
async () => { await $gatheringAdd.click(); await clickLocationButtonAndAddLocation(1, 0); await waitUntilBlockingLoaderHides(6000); expect(await $$gatheringMarkerPaths.count()).toBe(1); await $("#root_gatherings_1-delete").click(); await $("#root_gatherings_1-delete-confirm-yes").click(); if (!...
luomus/laji-form
test/trip-report-spec.ts
TypeScript
ArrowFunction
async () => { await $(".informal-taxon-group-chooser").click(); const getFieldCount = () => lajiFormLocate("gatherings.0.units.0").$$("input").count(); const fieldCount = await getFieldCount(); const $birdButton = element(by.className("MVL.1")).element(by.xpath("..")).$$("button").last(); // eslint-disab...
luomus/laji-form
test/trip-report-spec.ts
TypeScript
ArrowFunction
async () => { await $unitAdd.click(); const {resolve, remove} = await form.mockImageUpload("gatherings.0.units.1"); await form.$locate("gatherings.0.units.0").$$("td").first().click(); await resolve(); await form.$locate("gatherings.0.units.1").$$("td").first().click(); expect(await form.getImageArr...
luomus/laji-form
test/trip-report-spec.ts
TypeScript
ArrowFunction
async () => { await $unitAdd.click(); const {resolve, remove} = await form.mockImageUpload("gatherings.0.units.1"); await form.$locate("gatherings.0.units.0").$$("td").first().click(); await removeUnit(0, 1); await resolve(); await remove(); expect(await form.failedJobs.$container.isPresent()).to...
luomus/laji-form
test/trip-report-spec.ts
TypeScript
ClassDeclaration
export class ArrowData { /** * Entity id where is arrow mapped to */ id: string; /** * label of mapped entity */ label: string; /** * Base feature for mapping */ word?: string; /** * Create new ArrowData instance * * @param id id * @param l...
matejikj/Similarity_visualisation
src/models/ArrowData.ts
TypeScript
ArrowFunction
() => Orphanage
jmininel/NLW_3_HAPPY
backend/src/models/Image.ts
TypeScript
ArrowFunction
orphanage => orphanage.images
jmininel/NLW_3_HAPPY
backend/src/models/Image.ts
TypeScript
ClassDeclaration
@Entity('images') export default class Image { @PrimaryGeneratedColumn('increment') id: number; @Column() path: string; @ManyToOne(() => Orphanage, orphanage => orphanage.images) @JoinColumn({ name: 'orphanage_id' }) orphanage : Orphanage; }
jmininel/NLW_3_HAPPY
backend/src/models/Image.ts
TypeScript
ArrowFunction
() => ( <CardHeader style={
BlueBaseJS/plugin-react-native-paper
src/components/CardHeader/_stories_/CardHeader.stories.tsx
TypeScript
FunctionDeclaration
function merge<TObject, TSource>( object: TObject, source: TSource ): TObject & TSource;
kateract/interactive-node
types/lodash.merge.d.ts
TypeScript
FunctionDeclaration
function merge<TObject, TSource1, TSource2>( object: TObject, source1: TSource1, source2: TSource2 ): TObject & TSource1 & TSource2;
kateract/interactive-node
types/lodash.merge.d.ts
TypeScript
FunctionDeclaration
function merge<TObject, TSource1, TSource2, TSource3>( object: TObject, source1: TSource1, source2: TSource2, source3: TSource3 ): TObject & TSource1 & TSource2 & TSource3;
kateract/interactive-node
types/lodash.merge.d.ts
TypeScript
FunctionDeclaration
function merge<TObject, TSource1, TSource2, TSource3, TSource4>( object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4 ): TObject & TSource1 & TSource2 & TSource3 & TSource4;
kateract/interactive-node
types/lodash.merge.d.ts
TypeScript
FunctionDeclaration
function merge<TResult>( object: any, ...otherArgs: any[] ): TResult;
kateract/interactive-node
types/lodash.merge.d.ts
TypeScript
FunctionDeclaration
/** * Resolve the x-ts-type in the schema object * @param spec - Controller spec * @param schema - Schema object */ function processSchemaExtensions( spec: ControllerSpec, schema?: SchemaObject | (ReferenceObject & ISpecificationExtension), ) { debug(' processing extensions in schema: %j', schema); if (!sc...
krishna-maitretech/loopback-next
packages/openapi-v3/src/controller-spec.ts
TypeScript
FunctionDeclaration
/** * Generate json schema for a given x-ts-type * @param spec - Controller spec * @param tsType - TS Type */ function generateOpenAPISchema(spec: ControllerSpec, tsType: Function) { spec.components = spec.components ?? {}; spec.components.schemas = spec.components.schemas ?? {}; if (tsType.name in spec.compo...
krishna-maitretech/loopback-next
packages/openapi-v3/src/controller-spec.ts
TypeScript
FunctionDeclaration
/** * Assign related schemas from definitions to the controller spec * @param spec - Controller spec * @param definitions - Schema definitions */ function assignRelatedSchemas( spec: ControllerSpec, definitions?: SchemasObject, ) { if (!definitions) return; debug( ' assigning related schemas: ', ...
krishna-maitretech/loopback-next
packages/openapi-v3/src/controller-spec.ts
TypeScript
FunctionDeclaration
/** * Get the controller spec for the given class * @param constructor - Controller class */ export function getControllerSpec(constructor: Function): ControllerSpec { let spec = MetadataInspector.getClassMetadata<ControllerSpec>( OAI3Keys.CONTROLLER_SPEC_KEY, constructor, {ownMetadataOnly: true}, );...
krishna-maitretech/loopback-next
packages/openapi-v3/src/controller-spec.ts
TypeScript
FunctionDeclaration
/** * Describe the provided Model as a reference to a definition shared by multiple * endpoints. The definition is included in the returned schema. * * @example * * ```ts * const schema = { * $ref: '#/components/schemas/Product', * definitions: { * Product: { * title: 'Product', * proper...
krishna-maitretech/loopback-next
packages/openapi-v3/src/controller-spec.ts
TypeScript
ArrowFunction
(p, i) => { if (p == null) return false; paramIndexes.push(i); return true; }
krishna-maitretech/loopback-next
packages/openapi-v3/src/controller-spec.ts
TypeScript
ArrowFunction
p => { // Per OpenAPI spec, `required` must be `true` for path parameters if (p.in === 'path') { p.required = true; } return p; }
krishna-maitretech/loopback-next
packages/openapi-v3/src/controller-spec.ts
TypeScript
ArrowFunction
(p, i) => { if (p == null) return false; bodyIndexes.push(i); return true; }
krishna-maitretech/loopback-next
packages/openapi-v3/src/controller-spec.ts
TypeScript
ArrowFunction
(ctor: Function) => !includes([String, Number, Boolean, Array, Object], ctor)
krishna-maitretech/loopback-next
packages/openapi-v3/src/controller-spec.ts
TypeScript
ArrowFunction
(prop: string) => schema != null && Object.prototype.hasOwnProperty.call(schema, prop)
krishna-maitretech/loopback-next
packages/openapi-v3/src/controller-spec.ts
TypeScript
ArrowFunction
k => hasOwn(k)
krishna-maitretech/loopback-next
packages/openapi-v3/src/controller-spec.ts
TypeScript
ArrowFunction
(k: MixKey) => { /* istanbul ignore else */ if (schema?.[k] && Array.isArray(schema[k])) { schema[k].forEach((r: (SchemaObject | ReferenceObject)[]) => { processSchemaExtensions(spec, r); }); } }
krishna-maitretech/loopback-next
packages/openapi-v3/src/controller-spec.ts
TypeScript
ArrowFunction
(r: (SchemaObject | ReferenceObject)[]) => { processSchemaExtensions(spec, r); }
krishna-maitretech/loopback-next
packages/openapi-v3/src/controller-spec.ts
TypeScript
InterfaceDeclaration
export interface ControllerSpec { /** * The base path on which the Controller API is served. * If it is not included, the API is served directly under the host. * The value MUST start with a leading slash (/). */ basePath?: string; /** * The available paths and operations for the API. */ pat...
krishna-maitretech/loopback-next
packages/openapi-v3/src/controller-spec.ts
TypeScript
InterfaceDeclaration
/** * Data structure for REST related metadata */ export interface RestEndpoint { verb: string; path: string; spec?: OperationObject; }
krishna-maitretech/loopback-next
packages/openapi-v3/src/controller-spec.ts
TypeScript
TypeAliasDeclaration
declare type MixKey = 'allOf' | 'anyOf' | 'oneOf';
krishna-maitretech/loopback-next
packages/openapi-v3/src/controller-spec.ts
TypeScript
ArrowFunction
({paneInstance}) => { return ( <BasePanel panelId={`pane-${paneInstance.instanceId}` as UIPanelId}
Mu-L/theatre
theatre/studio/src/panels/BasePanel/ExtensionPaneWrapper.tsx
TypeScript
ArrowFunction
(props) => { return ( <ErrorContainer> An Error occured rendering this pane. Open the console for more info. <pre> {JSON.stringify( {message: props.error.message, stack: props.error.stack}, null, 2, )} </pre> </ErrorContainer> ) }
Mu-L/theatre
theatre/studio/src/panels/BasePanel/ExtensionPaneWrapper.tsx
TypeScript
ArrowFunction
({ paneInstance, }) => { const Comp = paneInstance.definition.component const closePane = useCallback(() => { getStudio().paneManager.destroyPane( paneInstance.instanceId as PaneInstanceId, ) }, [paneInstance]) return ( <Container> <PanelDragZone> <TitleBar> <PaneTo...
Mu-L/theatre
theatre/studio/src/panels/BasePanel/ExtensionPaneWrapper.tsx
TypeScript
ArrowFunction
() => { getStudio().paneManager.destroyPane( paneInstance.instanceId as PaneInstanceId, ) }
Mu-L/theatre
theatre/studio/src/panels/BasePanel/ExtensionPaneWrapper.tsx
TypeScript
ArrowFunction
(vue: any) => { componentsName.forEach((i) => { vue.component(i, components[i]); }); vue.use(noty); }
isabella232/skywalking-rocketbot-ui
src/components/index.ts
TypeScript
ArrowFunction
(i) => { vue.component(i, components[i]); }
isabella232/skywalking-rocketbot-ui
src/components/index.ts
TypeScript
ArrowFunction
() => <></>;
Sumit2399/design-system
core/components/patterns/datePicker/dateAndTimePicker.story.tsx
TypeScript
ClassDeclaration
@Injectable({ providedIn: 'root' }) export class CyNodeService { constructor(public http: HttpClient) { } getData(name: any): Observable<any> { return this.http.get('assets/' + name + '.cyjs') } getStylesheet(name: any): Observable<any> { return this.http.get('assets/' + name + '.json') } }
bryanl/cytoscape-angular
example-project/src/app/cy-node.service.ts
TypeScript
MethodDeclaration
getData(name: any): Observable<any> { return this.http.get('assets/' + name + '.cyjs') }
bryanl/cytoscape-angular
example-project/src/app/cy-node.service.ts
TypeScript
MethodDeclaration
getStylesheet(name: any): Observable<any> { return this.http.get('assets/' + name + '.json') }
bryanl/cytoscape-angular
example-project/src/app/cy-node.service.ts
TypeScript
ArrowFunction
() => { const dispatch = useDispatch(); const handleInputChange = (e: ChangeEvent<HTMLFormElement>): void => { dispatch(inputFilterAction(e.target.value)); }; return ( <div className='row'> <form className='col s10' onChange={handleInputChange}> <div className='row'> <div clas...
Aztek2008/swapi-ava-app
src/components/InputFilter/InputFilter.tsx
TypeScript
ArrowFunction
(e: ChangeEvent<HTMLFormElement>): void => { dispatch(inputFilterAction(e.target.value)); }
Aztek2008/swapi-ava-app
src/components/InputFilter/InputFilter.tsx
TypeScript
ArrowFunction
props => { const { trigger: triggerFromProps, children: childrenFromProps, ...rest } = props; let trigger = triggerFromProps; let children = childrenFromProps; React.Children.forEach(children, child => { if (isValidElement(child) && child.type === Wrapper) { trigger = child.props.c...
cloudify-cosmo/cloudify-ui-components
src/components/popups/Popup/Popup.tsx
TypeScript
ArrowFunction
child => { if (isValidElement(child) && child.type === Wrapper) { trigger = child.props.children; children = _.without(props.children as ReactNodeArray, child); } }
cloudify-cosmo/cloudify-ui-components
src/components/popups/Popup/Popup.tsx
TypeScript
InterfaceDeclaration
interface AdditionalPopupProperties { Header: typeof PopupSemanticUiReact.Header; Content: typeof PopupSemanticUiReact.Content; Trigger: typeof Wrapper; }
cloudify-cosmo/cloudify-ui-components
src/components/popups/Popup/Popup.tsx
TypeScript
TypeAliasDeclaration
export type PopupProps = SemanticUiPopupProps;
cloudify-cosmo/cloudify-ui-components
src/components/popups/Popup/Popup.tsx
TypeScript
FunctionDeclaration
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ /** * Executes the commands needed to get a list of devices from ADB */ declare function getDevices(adbPath: string): Array<st...
1-8192/DogsBestFriendApp
node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/adb.d.ts
TypeScript
FunctionDeclaration
/** * Gets available CPUs of devices from ADB */ declare function getAvailableCPUs(adbPath: string, device: string): Array<string>;
1-8192/DogsBestFriendApp
node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/adb.d.ts
TypeScript
FunctionDeclaration
/** * Gets the CPU architecture of a device from ADB */ declare function getCPU(adbPath: string, device: string): string | null;
1-8192/DogsBestFriendApp
node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/adb.d.ts
TypeScript
ArrowFunction
(): IUseCommentsManagement => { const [comments, setComments] = useState([]); const fetchComments = () => { return fetch('https://jsonplaceholder.typicode.com/comments') .then((response) => response.json()) .then((data) => { setComments(data); }); }; return { comments, fetchComm...
mingyuchoo/jest-setup-series
25-ts-react-testing-library/src/09-custom-hooks/hooks/useCommentsManagement.ts
TypeScript
ArrowFunction
() => { return fetch('https://jsonplaceholder.typicode.com/comments') .then((response) => response.json()) .then((data) => { setComments(data); }); }
mingyuchoo/jest-setup-series
25-ts-react-testing-library/src/09-custom-hooks/hooks/useCommentsManagement.ts
TypeScript
ArrowFunction
(data) => { setComments(data); }
mingyuchoo/jest-setup-series
25-ts-react-testing-library/src/09-custom-hooks/hooks/useCommentsManagement.ts
TypeScript
InterfaceDeclaration
interface IUseCommentsManagement { comments: never[]; fetchComments: () => Promise<void>; }
mingyuchoo/jest-setup-series
25-ts-react-testing-library/src/09-custom-hooks/hooks/useCommentsManagement.ts
TypeScript
ClassDeclaration
@Module({ imports: [ GraphQLModule.forRoot({ playground: true, installSubscriptionHandlers: true, autoSchemaFile: 'schema.gql', }), ], providers: [AppService, AppResolver], }) export class AppModule {}
greenreign/test-gql-subscriptions
src/app.module.ts
TypeScript
InterfaceDeclaration
export interface IProxyApi { send(channel: string, ...data: any[]): void; receive(channel: string, handler: (...data: any[]) => void): void; }
greggbjensen/power-runner
src/app/core/models/iproxy-api.ts
TypeScript
ClassDeclaration
export class CreateBruce implements Seed { public async seed(factory: Factory, connection: Connection): Promise<User> { // const userFactory = factory<User, { role: string }>(User as any); // const adminUserFactory = userFactory({ role: 'admin' }); // const bruce = await adminUserFactory....
Mcx002/MyDefaultBackendProject-TypeScript
src/database/seeds/CreateBruce.ts
TypeScript
MethodDeclaration
public async seed(factory: Factory, connection: Connection): Promise<User> { // const userFactory = factory<User, { role: string }>(User as any); // const adminUserFactory = userFactory({ role: 'admin' }); // const bruce = await adminUserFactory.make(); // console.log(bruce); ...
Mcx002/MyDefaultBackendProject-TypeScript
src/database/seeds/CreateBruce.ts
TypeScript
ArrowFunction
() => '[id="sign-out-btn"]'
IT-Labs/Cypress-workshop
cypress/pageObjects/logout/logout.elements.ts
TypeScript
ClassDeclaration
export class LogoutPageElements { static get elementsLogout() { return { getBtnLogout: () => '[id="sign-out-btn"]' }; } }
IT-Labs/Cypress-workshop
cypress/pageObjects/logout/logout.elements.ts
TypeScript
ArrowFunction
props => ( <svg width="1em"
pwcong/rc-component-x
packages/icon/icons/arrow-up-circle.tsx
TypeScript
FunctionDeclaration
/** * Creates a client-side Guid string. * @returns A string representation of a Guid. */ export function generateGuid(): string { let guid = "", idx = 0; for (idx = 0; idx < 32; idx += 1) { let guidDigitsItem = Math.random() * 16 | 0; switch (idx) { ...
testingPowerBI/powerbi
src/Clients/VisualsExtensibility/telemetry/generateGuid.ts
TypeScript
ArrowFunction
(result) => { if (result.token) { console.log(result.token); } else if (result.error) { console.log(result.error.message); } }
jon-armen/ngx-stripe
projects/ngx-stripe-tester/src/app/stripe-test-03/stripe-test-03.component.ts
TypeScript
ClassDeclaration
@Component({ selector: 'app-test-03', template: ` <app-section maxWidth="900"> <mat-toolbar color="secondary" section-content-header> <span>Card Example</span> </mat-toolbar> <div section-content> <p>Minimum example, just fill the form and get your token</p> <ngx-strip...
jon-armen/ngx-stripe
projects/ngx-stripe-tester/src/app/stripe-test-03/stripe-test-03.component.ts
TypeScript
MethodDeclaration
buy() { this.stripeService .createToken(this.card.getCard(), { name: 'Ricardo' }) .subscribe((result) => { if (result.token) { console.log(result.token); } else if (result.error) { console.log(result.error.message); } }); }
jon-armen/ngx-stripe
projects/ngx-stripe-tester/src/app/stripe-test-03/stripe-test-03.component.ts
TypeScript
FunctionDeclaration
export function getActiveTool(): ITool { return toolMap[activeTool.value]; }
CalebKoch/PlanarAlly
client/src/game/tools/tools.ts
TypeScript
FunctionDeclaration
export function toggleActiveMode(): void { activeToolMode.value = activeToolMode.value === ToolMode.Build ? ToolMode.Play : ToolMode.Build; if (!buildTools.some((t) => t[0] === activeTool.value) || !playTools.some((t) => t[0] === activeTool.value)) { activeTool.value = ToolName.Select; } cons...
CalebKoch/PlanarAlly
client/src/game/tools/tools.ts
TypeScript
FunctionDeclaration
export function getFeatures(tool: ToolName): ToolFeatures { return activeModeTools.value.find((t) => t[0] === tool)?.[1] ?? {}; }
CalebKoch/PlanarAlly
client/src/game/tools/tools.ts
TypeScript
FunctionDeclaration
export function activateTool(tool: ToolName): void { toolMap[tool].onSelect(); }
CalebKoch/PlanarAlly
client/src/game/tools/tools.ts
TypeScript
FunctionDeclaration
export function deactivateTool(tool: ToolName): void { toolMap[tool].onDeselect(); }
CalebKoch/PlanarAlly
client/src/game/tools/tools.ts
TypeScript
ArrowFunction
() => (activeToolMode.value === ToolMode.Build ? buildTools : playTools)
CalebKoch/PlanarAlly
client/src/game/tools/tools.ts
TypeScript
ArrowFunction
(newTool, oldTool) => { toolMap[oldTool].onDeselect(); toolMap[newTool].onSelect(); }
CalebKoch/PlanarAlly
client/src/game/tools/tools.ts
TypeScript
ArrowFunction
(t) => t[0] === activeTool.value
CalebKoch/PlanarAlly
client/src/game/tools/tools.ts
TypeScript
ArrowFunction
(t) => t[0] === tool
CalebKoch/PlanarAlly
client/src/game/tools/tools.ts
TypeScript
ClassDeclaration
@Component({ selector: 'app-footer', templateUrl: './footer.component.html', styleUrls: ['./footer.component.scss'] }) export class FooterComponent implements OnInit { constructor () { } ngOnInit (): void { } }
tomuk91/gamingnewswebsite
resources/frontend/angular/src/app/core/components/footer/footer.component.ts
TypeScript
MethodDeclaration
ngOnInit (): void { }
tomuk91/gamingnewswebsite
resources/frontend/angular/src/app/core/components/footer/footer.component.ts
TypeScript
InterfaceDeclaration
/** * * @export * @interface DeviceType */ export interface DeviceType { /** * * @type {number} * @memberof DeviceType */ id?: number; /** * * @type {string} * @memberof DeviceType */ url?: string; /** * * @type {NestedManufacturer} * @m...
yoldi/netbox-nodejs-api
src/models/device-type.ts
TypeScript
ClassDeclaration
class SomeClass { foo!: number; bar?: string; baz: number | undefined; constructor({foo, bar, baz}: SomeInterface) { this.foo = foo; this.bar = bar; this.baz = baz; } }
younho9/ts-indexify
index.test-d.ts
TypeScript
InterfaceDeclaration
interface SomeInterface { foo: number; bar?: string; baz: number | undefined; }
younho9/ts-indexify
index.test-d.ts
TypeScript
TypeAliasDeclaration
type SomeType = { foo: number; bar?: string; baz: number | undefined; };
younho9/ts-indexify
index.test-d.ts
TypeScript
TypeAliasDeclaration
type Dict = Record<string, unknown>;
younho9/ts-indexify
index.test-d.ts
TypeScript
ArrowFunction
(modulo) => { ROUTES.map((route) => { if (modulo.getPkidmodulo() == route.valor) { //console.log(modulo.getNombremodulo()); nuevosRoutes.push(route) } }) }
tekodan/dashboard_v2
src/app/components/sidebar/sidebar.component.ts
TypeScript
ArrowFunction
(route) => { if (modulo.getPkidmodulo() == route.valor) { //console.log(modulo.getNombremodulo()); nuevosRoutes.push(route) } }
tekodan/dashboard_v2
src/app/components/sidebar/sidebar.component.ts
TypeScript
ClassDeclaration
@Component({ selector: 'app-sidebar', templateUrl: './sidebar.component.html', styleUrls: ['./sidebar.component.css'] }) export class SidebarComponent implements OnInit { menuItems: any[]; public identity; urlimagen: string = '../' + GLOBAL.urlBase + '/assets/img/empleado.png'; nombreUsuari...
tekodan/dashboard_v2
src/app/components/sidebar/sidebar.component.ts
TypeScript
InterfaceDeclaration
declare interface RouteInfo { path: string; title: string; icon: string; class: string; valor: number; }
tekodan/dashboard_v2
src/app/components/sidebar/sidebar.component.ts
TypeScript
MethodDeclaration
ngOnInit() { this.mostrarMenus(); }
tekodan/dashboard_v2
src/app/components/sidebar/sidebar.component.ts
TypeScript
MethodDeclaration
isMobileMenu() { if ($(window).width() > 991) { return false; } return true; }
tekodan/dashboard_v2
src/app/components/sidebar/sidebar.component.ts
TypeScript
MethodDeclaration
mostrarMenus() { this.modulos = plainToClass(Modulo, this.identity.modulos); let nuevosRoutes: RouteInfo[] = []; this.modulos.map((modulo) => { ROUTES.map((route) => { if (modulo.getPkidmodulo() == route.valor) { //console.log(modulo.getNombremodu...
tekodan/dashboard_v2
src/app/components/sidebar/sidebar.component.ts
TypeScript
MethodDeclaration
//Obtener de manera globar los datos del usuario getIdentity() { let identity = JSON.parse(localStorage.getItem('identity')); if (identity != "undefined") { this.identity = identity; } else { this.identity = null; } return this.identity; }
tekodan/dashboard_v2
src/app/components/sidebar/sidebar.component.ts
TypeScript
FunctionDeclaration
function authNoOp( req: Express.Request, res: Express.Response, next: (err?: Error) => void) { // @ts-ignore req.user = { 'sub' : nextAuth0UserId, 'https://machinelearningforkids.co.uk/api/role' : nextAuth0UserRole, 'https://machinelearningforkids...
OwenG88/taxinomitis
src/tests/restapi/projects.ts
TypeScript
FunctionDeclaration
function emptyClass(): Promise<{ [id: string]: auth0objects.Student }> { return Promise.resolve({}); }
OwenG88/taxinomitis
src/tests/restapi/projects.ts
TypeScript
FunctionDeclaration
function testCreateProject(classid: string, user: string, crowd: boolean): Promise<any> { return request(testServer) .post('/api/classes/' + classid + '/students/' + user + '/projects') .send({ name : uuid(), type : 'text', language : 'en', isCrowdSourced : crowd }) ...
OwenG88/taxinomitis
src/tests/restapi/projects.ts
TypeScript
FunctionDeclaration
function testGetProjects(classid: string, user: string): Promise<any> { return request(testServer) .get('/api/classes/' + classid + '/students/' + user + '/projects') .expect('Content-Type', /json/) .expect(httpstatus.OK) .then...
OwenG88/taxinomitis
src/tests/restapi/projects.ts
TypeScript
FunctionDeclaration
function testSetUser(classid: string, user: string) { nextAuth0UserTenant = classid; nextAuth0UserId = user; nextAuth0UserRole = 'student'; }
OwenG88/taxinomitis
src/tests/restapi/projects.ts
TypeScript
FunctionDeclaration
function testSetTeacher(classid: string, user: string) { testSetUser(classid, user); nextAuth0UserRole = 'supervisor'; }
OwenG88/taxinomitis
src/tests/restapi/projects.ts
TypeScript
FunctionDeclaration
function compareProjects(objA: any, objB: any) { if (objA.id > objB.id) { return 1; } if (objA.id < objB.id) { return -1; } return 0; }
OwenG88/taxinomitis
src/tests/restapi/projects.ts
TypeScript
FunctionDeclaration
async function testVerifyAll( classid: string, studentA: string, studentB: string, teacherId: string, expected: any) { expected.studentA.sort(compareProjects); expected.studentB.sort(compareProjects); expected.teacher.sort(compareProjects)...
OwenG88/taxinomitis
src/tests/restapi/projects.ts
TypeScript
ArrowFunction
async () => { authStub = sinon.stub(auth, 'authenticate').callsFake(authNoOp); studentsByUserIdStub = sinon.stub(auth0users, 'getStudentsByUserId').callsFake(emptyClass); await store.init(); testServer = testapiserver(); return store.deleteProjectsByClassId(TESTCLASS); }
OwenG88/taxinomitis
src/tests/restapi/projects.ts
TypeScript