type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
ArrowFunction
(code: string, rates: RateListing) => { let rate = getRate(code, rates); if (rate === undefined) { const denomination = getDenominationByCode(code); if (denomination === undefined) { this.logger.error( `Could not get rate or denomination listing for ${code}.` ); re...
cryptotronxyz/bitcore
packages/insight/src/app/shared/currency-value/currency-value.component.ts
TypeScript
ArrowFunction
unit => unit.rate === 1
cryptotronxyz/bitcore
packages/insight/src/app/shared/currency-value/currency-value.component.ts
TypeScript
ArrowFunction
( amount: number, code: string, displayAs: string, rates: RateListing ) => { return { unit: displayAs, value: convertAmount( amount, this.getOrGenerateRate(code, rates), this.getOrGenerateRate(displayAs, rates) ), approximation: true }; }
cryptotronxyz/bitcore
packages/insight/src/app/shared/currency-value/currency-value.component.ts
TypeScript
ClassDeclaration
@Component({ selector: 'app-currency-value', templateUrl: './currency-value.component.html', styleUrls: ['./currency-value.component.scss'] }) export class CurrencyValueComponent implements OnChanges { constructor(private apiService: ApiService, private logger: NGXLogger) {} /** * Note: because JavaScript...
cryptotronxyz/bitcore
packages/insight/src/app/shared/currency-value/currency-value.component.ts
TypeScript
InterfaceDeclaration
interface Settings { amount: number; code: string; displayAs: string; }
cryptotronxyz/bitcore
packages/insight/src/app/shared/currency-value/currency-value.component.ts
TypeScript
EnumDeclaration
/** * The only currencies for which symbols are displayed in Insight. * * We intentionally avoid using the Angular currency pipe to display currency * symbols. There are potential visual edge cases with strangely-rendered, * uncommon currency symbols, and they simply add unnecessary visual complexity. * * We dis...
cryptotronxyz/bitcore
packages/insight/src/app/shared/currency-value/currency-value.component.ts
TypeScript
MethodDeclaration
ngOnChanges() { this.settings.next({ amount: this.amount, code: this.code, displayAs: this.displayAs }); }
cryptotronxyz/bitcore
packages/insight/src/app/shared/currency-value/currency-value.component.ts
TypeScript
FunctionDeclaration
/* .dP"Y8 888888 888888 88 88 88""Yb 8888b. 88""Yb dP""b8 db dP""b8 88 88 888888 `Ybo." 88__ 88 88 88 88__dP 8I Yb 88__dP dP `" dPYb dP `" 88 88 88__ o.`Y8b 88"" 88 Y8 8P 88""" 8I dY 88""Yb Yb dP__Yb Yb 888888 88"" 8bodP' 888888 88 ...
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
FunctionDeclaration
async function setupDBConnection(connectionOptions: IDBConnection, uri: string): Promise<void> { if (connectionOptions) { // dbConnection = await Database.createConnection(conn); if (connectionOptions.certPath && fs.existsSync(connectionOptions.certPath)) { connectionOptions.ssl = { ca: fs.read...
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
FunctionDeclaration
async function loadCompletionCache(connectionOptions: IDBConnection) { if (!connectionOptions || !dbConnection) return; // setup database caches for schemas, functions, tables, and fields let vQueries = SqlQueryManager.getVersionQueries(dbConnection.pg_version); try { if (connectionOptions.database) { ...
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
FunctionDeclaration
async function validateTextDocument(textDocument: TextDocument): Promise<void> { let diagnostics: Diagnostic[] = []; // parse and find issues if (dbConnection) { let sqlText = textDocument.getText(); if (!sqlText) { connection.sendDiagnostics({uri: textDocument.uri, diagnostics}); return; ...
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
FunctionDeclaration
function fixQuotedIdent(str: string): string { return str.replace(/^\"/, '').replace(/\"$/, '').replace(/\"\"/, '"'); }
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
FunctionDeclaration
function readIdents(iterator: BackwardIterator, maxlvl: number): Ident[] { return iterator.readIdents(maxlvl).map<Ident>(name => { let isQuoted = false; if (name.match(/^\".*?\"$/)) { isQuoted = true; name = fixQuotedIdent(name); } return { isQuoted: isQuoted, name: name }; }); }
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
(_params) : InitializeResult => { shouldSendDiagnosticRelatedInformation = _params.capabilities && _params.capabilities.textDocument && _params.capabilities.textDocument.publishDiagnostics && _params.capabilities.textDocument.publishDiagnostics.relatedInformation; return { capabilities: { textDocumentSyn...
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
(fn:DBFunctionsRaw) => { // return new ColumnNode(this.connection, this.table, column); let existing = functionCache.find(f => f.name === fn.name); if (!existing) { existing = { name: fn.name, schema: fn.schema, result_type: fn.result_type, type: fn.typ...
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
f => f.name === fn.name
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
a => a
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
a => a.trim()
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
rw => rw.word.toLocaleUpperCase()
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
rw => rw.datname
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
err => { console.log(err.message) }
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
(change) => { validateTextDocument(change.document); }
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
(e: any): CompletionItem[] => { let items: FieldCompletionItem[] = []; let scenarioFound = false; let document = documents.get(e.textDocument.uri); if (!document) return items; let iterator = new BackwardIterator(document, e.position.character - 1, e.position.line); // // look back and grab the text i...
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
tbl => { return (isQuotedIdent && tbl.tablename === ident) || (!isQuotedIdent && tbl.tablename.toLocaleLowerCase() == ident.toLocaleLowerCase()); }
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
field => { items.push({ label: field.attname, kind: CompletionItemKind.Property, detail: field.data_type }); }
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
table => { items.push({ label: table.tablename, kind: CompletionItemKind.Class }); }
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
sch => { return (idents[pos].isQuoted && sch.name === idents[pos].name) || (!idents[pos].isQuoted && sch.name.toLocaleLowerCase() == idents[pos].name.toLocaleLowerCase()); }
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
sch => { return sch.name == "public" }
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
tbl => { if (tbl.schemaname != schema.name) { return; } items.push({ label: tbl.tablename, kind: CompletionItemKind.Class, detail: tbl.schemaname !== "public" ? tbl.schemaname : null }); }
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
tbl => { return tbl.schemaname == schema.name && (idents[pos].isQuoted && tbl.tablename === idents[pos].name) || (!idents[pos].isQuoted && tbl.tablename.toLocaleLowerCase() == idents[pos].name.toLocaleLowerCase()); }
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
schema => { items.push({ label: schema.name, kind: CompletionItemKind.Module }); }
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
table => { items.push({ label: table.tablename, detail: table.schemaname !== "public" ? table.schemaname : null, kind: table.is_table ? CompletionItemKind.Class : CompletionItemKind.Interface, insertText: table.schemaname == "public" ? table.tablename : table.schemaname + "." + ta...
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
field => { let foundItem = items.find(i => i.label === field.attname && i.kind === CompletionItemKind.Field && i.detail === field.data_type); if (foundItem) { foundItem.tables.push(table.tablename); foundItem.tables.sort(); foundItem.documentation = foundItem.tables.join('...
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
i => i.label === field.attname && i.kind === CompletionItemKind.Field && i.detail === field.data_type
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
fn => { items.push({ label: fn.name, kind: CompletionItemKind.Function, detail: fn.result_type, documentation: fn.overloads[0].description }); }
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
keyword => { items.push({ label: keyword, kind: CompletionItemKind.Keyword }); }
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
database => { items.push({ label: database, kind: CompletionItemKind.Module }); }
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
(positionParams): SignatureHelp => { let document = documents.get(positionParams.textDocument.uri); let activeSignature = null, activeParameter = null, signatures: SignatureInformation[] = []; if (document) { let iterator = new BackwardIterator(document, positionParams.position.character - 1, positionParams....
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
f => f.name.toLocaleLowerCase() === ident.toLocaleLowerCase()
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
o => o.args.length >= paramCount
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
overload => { signatures.push({ label: `${fn.name}( ${overload.args.join(' , ')} )`, documentation: overload.description, parameters: overload.args.map<ParameterInformation>(v => { return {label: v}}) }); }
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
v => { return {label: v}}
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
name => { let isQuoted = false; if (name.match(/^\".*?\"$/)) { isQuoted = true; name = fixQuotedIdent(name); } return { isQuoted: isQuoted, name: name }; }
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
InterfaceDeclaration
export interface ISetConnection { connection: IDBConnection documentUri?: string; }
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
InterfaceDeclaration
export interface ExplainResults { rowCount: number; command: string; rows?: any[]; fields?: any[]; }
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
InterfaceDeclaration
export interface DBSchema { name: string }
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
InterfaceDeclaration
export interface DBField { attisdropped: boolean, attname: string, attnum: number, attrelid: string, data_type: string }
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
InterfaceDeclaration
export interface DBTable { schemaname: string, tablename: string, is_table: boolean, columns: DBField[] }
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
InterfaceDeclaration
export interface DBFunctionsRaw { schema: string name: string result_type: string argument_types: string type: string, description: string }
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
InterfaceDeclaration
export interface DBFunctionArgList { args: string[], description: string }
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
InterfaceDeclaration
export interface DBFunction { schema: string name: string result_type: string overloads: DBFunctionArgList[], type: string }
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
InterfaceDeclaration
export interface Ident { isQuoted: boolean, name: string }
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
InterfaceDeclaration
/* dP""b8 dP"Yb 8888b. 888888 dP""b8 dP"Yb 8b d8 88""Yb 88 888888 888888 88 dP"Yb 88b 88 dP `" dP Yb 8I Yb 88__ dP `" dP Yb 88b d88 88__dP 88 88__ 88 88 dP Yb 88Yb88 Yb Yb dP 8I dY 88"" Yb Yb dP 88YbdP88 88""" 88 .o 88"" 88 88 Yb dP 88 Y...
anibalmorales/vscode-postgres
src/language/server.ts
TypeScript
ArrowFunction
( validationStatus: ComponentStatus ): ComponentStatus => { if ( this.state.bucket.name === this.props.startBucket.name || validationStatus === ComponentStatus.Error ) { return ComponentStatus.Disabled } return validationStatus }
AlenBadel/influxdb
ui/src/buckets/components/RenameBucketForm.tsx
TypeScript
ArrowFunction
(bucketName: string): string | null => { if (!bucketName) { return 'Name is required' } if (this.props.buckets.find(b => b.name === bucketName)) { return 'This bucket name is taken' } }
AlenBadel/influxdb
ui/src/buckets/components/RenameBucketForm.tsx
TypeScript
ArrowFunction
b => b.name === bucketName
AlenBadel/influxdb
ui/src/buckets/components/RenameBucketForm.tsx
TypeScript
ArrowFunction
(): void => { const {startBucket, onRenameBucket} = this.props const {bucket} = this.state onRenameBucket(startBucket.name, bucket) this.handleClose() }
AlenBadel/influxdb
ui/src/buckets/components/RenameBucketForm.tsx
TypeScript
ArrowFunction
(e: ChangeEvent<HTMLInputElement>) => { const name = e.target.value const bucket = {...this.state.bucket, name} this.setState({bucket}) }
AlenBadel/influxdb
ui/src/buckets/components/RenameBucketForm.tsx
TypeScript
ArrowFunction
() => { const { router, params: {orgID}, } = this.props router.push(`/orgs/${orgID}/load-data/buckets`) }
AlenBadel/influxdb
ui/src/buckets/components/RenameBucketForm.tsx
TypeScript
ArrowFunction
(state: AppState, props: Props): StateProps => { const { params: {bucketID}, } = props const startBucket = getByID<OwnBucket>(state, ResourceType.Buckets, bucketID) const buckets = getAll<Bucket>(state, ResourceType.Buckets).filter( b => b.id !== bucketID ) return { startBucket, buckets, ...
AlenBadel/influxdb
ui/src/buckets/components/RenameBucketForm.tsx
TypeScript
ArrowFunction
b => b.id !== bucketID
AlenBadel/influxdb
ui/src/buckets/components/RenameBucketForm.tsx
TypeScript
ClassDeclaration
class RenameBucketForm extends PureComponent<Props, State> { public state = {bucket: this.props.startBucket} public render() { const {bucket} = this.state return ( <Form onSubmit={this.handleSubmit}> <Form.ValidationElement label="Name" validationFunc={this.handleValidat...
AlenBadel/influxdb
ui/src/buckets/components/RenameBucketForm.tsx
TypeScript
InterfaceDeclaration
interface State { bucket: OwnBucket }
AlenBadel/influxdb
ui/src/buckets/components/RenameBucketForm.tsx
TypeScript
InterfaceDeclaration
interface StateProps { startBucket: OwnBucket buckets: Bucket[] }
AlenBadel/influxdb
ui/src/buckets/components/RenameBucketForm.tsx
TypeScript
InterfaceDeclaration
interface DispatchProps { onRenameBucket: typeof renameBucket }
AlenBadel/influxdb
ui/src/buckets/components/RenameBucketForm.tsx
TypeScript
TypeAliasDeclaration
type Props = StateProps & DispatchProps & WithRouterProps
AlenBadel/influxdb
ui/src/buckets/components/RenameBucketForm.tsx
TypeScript
MethodDeclaration
public render() { const {bucket} = this.state return ( <Form onSubmit={this.handleSubmit}> <Form.ValidationElement label="Name" validationFunc={this.handleValidation} value={bucket.name} > {status => ( <> <FlexBox ...
AlenBadel/influxdb
ui/src/buckets/components/RenameBucketForm.tsx
TypeScript
ArrowFunction
() => { const bluehawk = new Bluehawk({ tags: [EmphasizeTag], }); bluehawk.addLanguage("js", { languageId: "javascript", blockComments: [[/\/\*/, /\*\//]], lineComments: [/\/\/ ?/], }); it("works as a one line tag", async (done) => { const source = new Document({ text: `a b // :emp...
mongodben/Bluehawk
src/bluehawk/tags/emphasizeTag.test.ts
TypeScript
ArrowFunction
async (done) => { const source = new Document({ text: `a b // :emphasize: c `, path: "test.js", }); const parseResult = bluehawk.parse(source); const files = await bluehawk.process(parseResult); expect(files["test.js"].document.text.toString()).toBe( `a b c ` ); expect( ...
mongodben/Bluehawk
src/bluehawk/tags/emphasizeTag.test.ts
TypeScript
ArrowFunction
async (done) => { const singleInput = `const bar = "foo" // :emphasize-start: describe("some stuff", () => { it("foos the bar", () => { expect(true).toBeTruthy(); }); }); // :emphasize-end: console.log(bar); `; const source = new Document({ text: singleInput, path: "test.js", }); ...
mongodben/Bluehawk
src/bluehawk/tags/emphasizeTag.test.ts
TypeScript
ArrowFunction
async (done) => { const singleInput = `const bar = "foo" // :emphasize-start: describe("some stuff", () => { // :emphasize-end: it("foos the bar", () => { expect(true).toBeTruthy(); }); // :emphasize-start: }); // :emphasize-end: console.log(bar); `; const source = new Document({ text: sing...
mongodben/Bluehawk
src/bluehawk/tags/emphasizeTag.test.ts
TypeScript
ArrowFunction
async (done) => { const singleInput = `line 1 line 2 // :emphasize-start: line 3 // :emphasize-end: line 4 line 5 // :emphasize: line 6 // :emphasize-start: line 7 line 8 // :emphasize-end: line 9`; const source = new Document({ text: singleInput, path: "test.js", }); const parseResult = ...
mongodben/Bluehawk
src/bluehawk/tags/emphasizeTag.test.ts
TypeScript
FunctionDeclaration
export function npmNameFromPackageName(name: string): ModuleNpmName { if (name.indexOf("/") > 0) { let [ org, pkg ] = name.split("/"); if (org.startsWith("@")) { org = org.slice(1); } return { scope: org, pkg, name: `@${ org }/${ pkg }` }; } else { return { scope: undefined, pkg: name, na...
zenwarr/rollman
src/local-module.ts
TypeScript
ClassDeclaration
export class LocalModule { public get name() { return this._config.name; } public get checkedName() { if (!this._config.name) { throw new Error(`Module at "${ this.path }" has no name defined`); } return this._config.name; } public get formattedName() { return this._config.name...
zenwarr/rollman
src/local-module.ts
TypeScript
InterfaceDeclaration
export interface ModuleNpmName { scope: string | undefined; pkg: string; name: string; }
zenwarr/rollman
src/local-module.ts
TypeScript
InterfaceDeclaration
export interface LocalModuleConfig { path: string; name: ModuleNpmName | undefined; useNpm: boolean; publishIfSourceNotChanged?: boolean; }
zenwarr/rollman
src/local-module.ts
TypeScript
MethodDeclaration
public static createFromPackage(packagePath: string): LocalModule { let manifest = getManifestManager().readPackageManifest(packagePath); if (!manifest) { return new LocalModule({ path: packagePath, name: undefined, useNpm: false }); } else { const publishIfSourceN...
zenwarr/rollman
src/local-module.ts
TypeScript
ArrowFunction
() => ( <UserContext.Consumer> {({ user })
Art9Studio/JumbleSweets-Backend
saleor/static/dashboard-next/configuration/index.tsx
TypeScript
ArrowFunction
({ native }: ChartEvent, [firstElement]: ActiveElement[]) => { if (!native?.target) { return; } const canvas = native.target as HTMLCanvasElement; canvas.style.cursor = firstElement ? 'pointer' : 'default'; }
acelaya/shlink-web-client-react
src/utils/helpers/charts.ts
TypeScript
ArrowFunction
({ dataset, raw }: TooltipItem<ChartType>) => `${dataset.label}: ${prettify(`${raw}`)}`
acelaya/shlink-web-client-react
src/utils/helpers/charts.ts
TypeScript
ArrowFunction
({ label, raw }: TooltipItem<ChartType>) => `${label}: ${prettify(`${raw}`)}`
acelaya/shlink-web-client-react
src/utils/helpers/charts.ts
TypeScript
ArrowFunction
(props: { year: number; month: number; colspan: number }) => { return ( <tr className="month-year-separator"> <td colSpan={props.colspan}> {capitalize(moment(new Date(props.year, props.month, 1)).format('MMMM YYYY'))}
CelineK/kresus
client/components/reports/month-year-separator.tsx
TypeScript
MethodDeclaration
capitalize(moment
CelineK/kresus
client/components/reports/month-year-separator.tsx
TypeScript
ArrowFunction
args => { const [selected, setSelected] = useState<string | number>(''); return ( <> <Menu.Trigger {...args}> <Button variant="menu" size="small"> Choose Menu </Button> <Menu onSelect={setSelected}> <Menu.Item key="burger">🍔 Burger</Menu.Item> <Menu....
reservix-ui/marigold
packages/components/src/Menu/Menu.stories.tsx
TypeScript
ArrowFunction
() => ( <Menu aria-label="Only a Menu"> <Menu.Item key
reservix-ui/marigold
packages/components/src/Menu/Menu.stories.tsx
TypeScript
ArrowFunction
(tenant: any) => { //console.log(tenant); if (tenant !== null || tenant !== '') { // Clone the request to add the new header clonedRequest = req.clone({ headers: req.headers.append('X-Tenant-Id', `${tenant}`) }); } }
indice-co/Indice.Angular
projects/ng-auth/src/lib/tenant/tenant-header.interceptor.ts
TypeScript
ClassDeclaration
@Injectable({providedIn: 'root'}) export class TenantHeaderInterceptor implements HttpInterceptor { constructor(@Inject(TENANT_PREFIX_URL) private tenantPrefixUrl: string, @Inject(TenantService) private tenantStore: TenantService) { } intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEve...
indice-co/Indice.Angular
projects/ng-auth/src/lib/tenant/tenant-header.interceptor.ts
TypeScript
MethodDeclaration
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { let clonedRequest = req; // First check if request is going to our api or an external if (req.urlWithParams.toLowerCase().startsWith(this.tenantPrefixUrl.toLowerCase())) { this.tenantStore.getTenant()....
indice-co/Indice.Angular
projects/ng-auth/src/lib/tenant/tenant-header.interceptor.ts
TypeScript
ClassDeclaration
export class FriendList { public id: number; public friendId: number; public requestedFriendId: number; public toUsername: string; public fromUsername: string; public status: string; public friendListLink: number = 1000; constructor(f: number, t:number) { this.friendId = f...
12142020-dotnet-uta/P2_RepeatCommitters
FrontEnd/src/app/friendRequest.ts
TypeScript
ArrowFunction
(users: User[]) => { const AUTH_FAILED_MESSAGE = 'User Name / Password not matching'; /** * Passport-local strategy fails authentication with the third argument, * the first argument assumes an error in the authenticating process. */ if (!users || !users.length) { ...
aslamj/loopback4-example-passport-login
src/authentication-strategies/local.ts
TypeScript
ArrowFunction
err => { /** * Error occurred in authenticating process. * Does not necessarily mean an unauthorized user. */ done(err); }
aslamj/loopback4-example-passport-login
src/authentication-strategies/local.ts
TypeScript
ClassDeclaration
@bind(asAuthStrategy) export class LocalAuthStrategy implements AuthenticationStrategy { name = 'local'; passportstrategy: Strategy; strategy: StrategyAdapter<User>; /** * create a local passport strategy */ constructor( @repository(UserRepository) public userRepository: UserRepository, ) { ...
aslamj/loopback4-example-passport-login
src/authentication-strategies/local.ts
TypeScript
MethodDeclaration
/** * authenticate a request * @param request */ async authenticate(request: Request): Promise<UserProfile | RedirectRoute> { return this.strategy.authenticate(request); }
aslamj/loopback4-example-passport-login
src/authentication-strategies/local.ts
TypeScript
MethodDeclaration
/** * authenticate user with provided username and password * * @param username * @param password * @param done * * @returns User model */ verify( username: string, password: string, // eslint-disable-next-line @typescript-eslint/no-explicit-any done: (error: any, user?: any, opt...
aslamj/loopback4-example-passport-login
src/authentication-strategies/local.ts
TypeScript
MethodDeclaration
/** * maps returned User model from verify function to UserProfile * * @param user */ mapProfile(user: User): UserProfile { const userProfile: UserProfile = { [securityId]: '' + user.id, profile: { ...user, }, }; return userProfile; }
aslamj/loopback4-example-passport-login
src/authentication-strategies/local.ts
TypeScript
ArrowFunction
items => { this.items = items; this.loading = false; }
TheJLifeX/ngx-back-forward-cache
projects/demo-app/src/app/page-c/page-c.component.ts
TypeScript
ClassDeclaration
@Component({ selector: 'app-page-c', templateUrl: './page-c.component.html', styleUrls: ['./page-c.component.scss'] }) export class PageCComponent implements OnInit { loading!: boolean; items!: string[]; private componentDestroyed$ = new Subject<void>(); constructor(private demoApiService: DemoApiServ...
TheJLifeX/ngx-back-forward-cache
projects/demo-app/src/app/page-c/page-c.component.ts
TypeScript
MethodDeclaration
ngOnInit(): void { this.loading = true; this.demoApiService.getData('Page C').pipe( takeUntil(this.componentDestroyed$) ).subscribe(items => { this.items = items; this.loading = false; }); }
TheJLifeX/ngx-back-forward-cache
projects/demo-app/src/app/page-c/page-c.component.ts
TypeScript
MethodDeclaration
ngOnDestroy(): void { this.componentDestroyed$.next(); this.componentDestroyed$.complete(); }
TheJLifeX/ngx-back-forward-cache
projects/demo-app/src/app/page-c/page-c.component.ts
TypeScript
FunctionDeclaration
function isExpectedId(actualId: string, messageId: string): boolean { return actualId.startsWith(`task_${messageId}_`); }
JGibson2019/accessibility-insights-service
packages/azure-services/src/azure-batch/batch.spec.ts
TypeScript