type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
InterfaceDeclaration |
export interface UntagResourceCommandOutput extends UntagResourceResponse, __MetadataBearer {} | Acium-Global/aws-sdk-js-v3 | clients/client-customer-profiles/commands/UntagResourceCommand.ts | TypeScript |
MethodDeclaration | /**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: CustomerProfilesClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<UntagResourceCommandInput, UntagResourceCommandOutput> {
this.middlewareStack.use(getSerdePlug... | Acium-Global/aws-sdk-js-v3 | clients/client-customer-profiles/commands/UntagResourceCommand.ts | TypeScript |
MethodDeclaration |
private serialize(input: UntagResourceCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return serializeAws_restJson1UntagResourceCommand(input, context);
} | Acium-Global/aws-sdk-js-v3 | clients/client-customer-profiles/commands/UntagResourceCommand.ts | TypeScript |
MethodDeclaration |
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<UntagResourceCommandOutput> {
return deserializeAws_restJson1UntagResourceCommand(output, context);
} | Acium-Global/aws-sdk-js-v3 | clients/client-customer-profiles/commands/UntagResourceCommand.ts | TypeScript |
ArrowFunction |
( error ) => {
if ( error ) {
console.log( error );
}
} | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
ArrowFunction |
( resolve, reject ) => {
Promise.all( [this.readFile(), file.readFile()] )
.then( ( contents ) => {
const isDiff = contents[0] !== contents[1];
resolve( isDiff );
}, ( err ) => {
reject( err );
} );
... | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
ArrowFunction |
( contents ) => {
const isDiff = contents[0] !== contents[1];
resolve( isDiff );
} | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
ArrowFunction |
( err ) => {
reject( err );
} | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
ArrowFunction |
data => new FileManager( destinationFile, data ).writeFile() | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
ArrowFunction |
error => console.log( error ) | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
ArrowFunction |
( err ) => {
if ( err ) {
console.error( `Error occured while creating ${ destinationFile } file.` );
}
console.log( `${ destinationFile } file has been created.` );
} | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
ArrowFunction |
( resolve, reject ) => {
if ( !this.isLocalFile() ) {
this.fetchFile()
.then( data => resolve( data ) )
.catch( error => reject( error ) );
} else {
fs.readFile( this.getFormatedPath(), 'utf8', ( err, data ) => {
... | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
ArrowFunction |
data => resolve( data ) | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
ArrowFunction |
error => reject( error ) | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
ArrowFunction |
( err, data ) => {
if ( err ) {
reject( err );
} else {
resolve( data.toString() );
}
} | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
ArrowFunction |
( resolve, reject ) => {
https.get( this.pathToFile, ( res ) => {
const { statusCode } = res;
if ( statusCode !== 200 ) {
const error = new Error( 'Request Failed.\n' +
`Status Code: ${ statusCode }` );
console... | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
ArrowFunction |
( res ) => {
const { statusCode } = res;
if ( statusCode !== 200 ) {
const error = new Error( 'Request Failed.\n' +
`Status Code: ${ statusCode }` );
console.error( error.message );
// Consume response ... | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
ArrowFunction |
( chunk ) => { rawData += chunk; } | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
ArrowFunction |
() => {
resolve( rawData );
} | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
ArrowFunction |
( e ) => {
console.error( `Got error: ${ e.message }` );
reject( e );
} | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
ClassDeclaration |
export class FileManager {
/**@private path to file*/
private pathToFile: string;
/**@private parsed path object */
private pathObject: path.ParsedPath;
/**@private file content */
private data: any;
constructor( pathToFile: string, data?: any ) {
this.pathToFile = pathToFile;
... | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
MethodDeclaration | /**
* Write new file to filesystem
* @param filePath specify path to new file
* @param data content of new file
*/
writeFile(): void {
mkdirp.sync( path.dirname( this.pathToFile ) );
fs.writeFile( this.pathToFile, this.data, ( error ) => {
if ( error ) {
... | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
MethodDeclaration | /**
* Check if file exist
*/
fileExists(): boolean {
return fs.existsSync( this.pathToFile );
} | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
MethodDeclaration | /**
* Check if file is different from file specified as parameter
* @param file to compare with
*/
isDiff( file: FileManager ): Promise<boolean> {
return new Promise( ( resolve, reject ) => {
Promise.all( [this.readFile(), file.readFile()] )
.then( ( contents ) => {
... | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
MethodDeclaration | /**
* @returns name of lock file based on filename
*/
getSpecLockFileName(): string {
let specLockFile: string;
if ( this.pathObject.ext === FILE_EXT.JSON
|| this.pathObject.ext === FILE_EXT.YAML
|| this.pathObject.ext === FILE_EXT.WADL ) {
specLockFile = th... | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
MethodDeclaration | /**
* Create copy of file
* @param destinationFile specify path to new file
*/
createCopy( destinationFile: string ): void {
if ( !this.isLocalFile() ) {
this.fetchFile()
.then( data => new FileManager( destinationFile, data ).writeFile() )
.catch( err... | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
MethodDeclaration | /**
* Read file content
* @returns file content
*/
readFile(): Promise<string> {
return new Promise<string>( ( resolve, reject ) => {
if ( !this.isLocalFile() ) {
this.fetchFile()
.then( data => resolve( data ) )
.catch( error =>... | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
MethodDeclaration | /**
* Fetch file from remote host
* @returns file content
*/
fetchFile(): Promise<string> {
return new Promise<string>( ( resolve, reject ) => {
https.get( this.pathToFile, ( res ) => {
const { statusCode } = res;
if ( statusCode !== 200 ) {
... | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
MethodDeclaration | /**
* Check if file is in local filesystem
*/
isLocalFile(): boolean {
return !validUrl.isWebUri( this.pathToFile );
} | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
MethodDeclaration | /**
* @returns path to file
*/
getPathToFile(): string {
return this.pathToFile;
} | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
MethodDeclaration | /**
* Parse path to file into path object
*/
parsePath(): void {
this.pathObject = path.parse( this.pathToFile );
} | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
MethodDeclaration | /**
* @returns formated path object
*/
getFormatedPath(): string {
return path.format( this.pathObject );
} | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
MethodDeclaration | /**
* @returns file extension
*/
getExt(): string {
return this.pathObject.ext;
} | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
MethodDeclaration | /**
* @returns file root
*/
getRoot(): string {
return this.pathObject.root;
} | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
MethodDeclaration | /**
* @returns file directory
*/
getDir(): string {
return this.pathObject.dir;
} | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
MethodDeclaration | /**
* @returns file base
*/
getBase(): string {
return this.pathObject.base;
} | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
MethodDeclaration | /**
* @returns file name
*/
getName(): string {
return this.pathObject.name;
} | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
MethodDeclaration | /**
* Set file directory
*/
setDir( dir: string ) {
this.pathObject.dir = dir;
} | SilvesterLipjanec/angular-rest-generator | src/file-manager.ts | TypeScript |
FunctionDeclaration | // Map Redux state to component props
function mapStateToProps(state: any) {
return {
survey: state.survey
};
} | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
FunctionDeclaration | // Map Redux actions to component props
function mapDispatchToProps(dispatch: any) {
return {
updateSurveyDispatch(surveyId: string, survey: any) {
dispatch(updateSurvey(surveyId, survey));
}
};
} | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
ArrowFunction |
(docs: Array<Object>) => {
let participants: Array<Participant> = [];
docs.forEach((obj: any) => {
let participant: Participant = {
participantId: obj.registration_code,
securityQuestions: [
{
question: obj.securit... | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
ArrowFunction |
(obj: any) => {
let participant: Participant = {
participantId: obj.registration_code,
securityQuestions: [
{
question: obj.security_question_1,
answer: obj.sq_1_answer
},
... | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
ArrowFunction |
() => {
(document.getElementById(
'participant-file-upload'
) as HTMLInputElement).value = '';
} | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
ArrowFunction |
() => {
this.setState({
error: false,
emptyIdsError: false,
emptyFileError: false,
duplicateError: false,
duplicateParticipants: [],
success: false,
successParticipants: [],
warning: false,
warningPartic... | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
ArrowFunction |
(participants: Array<Participant>) => {
//check for blank file
if (isEmptyObject(participants)) {
this.setState({emptyFileError: true});
this.clearFileSelection();
return false;
}
//check for blank registration codes
let emptyIds = participant... | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
ArrowFunction |
(participant: Participant) => {
return isEmptyObject(participant.participantId);
} | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
ArrowFunction |
(participant: Participant) => {
return participant.participantId;
} | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
ArrowFunction |
(
acc: Array<string>,
participantId: string,
index: number,
participantIds: Array<string>
) => {
if (
participantIds.indexOf(participantId) !== index &&
!a... | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
ArrowFunction |
(csv: any) => {
var lines = csv.split('\n');
// strip all empty lines
lines = lines.filter((line: string) => {
return line.length > 7; //an empty line will be 6 commas in a csv file -> ",,,,,,/r"
});
var result = [];
var headers = lines[0].split(',');
... | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
ArrowFunction |
(line: string) => {
return line.length > 7; //an empty line will be 6 commas in a csv file -> ",,,,,,/r"
} | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
ArrowFunction |
(
participants: Array<Participant>,
existingIDs: Array<string>
) => {
return participants
.map((participant: Participant) => {
return participant.participantId;
})
.filter((participantId: string) => {
return existingIDs.inc... | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
ArrowFunction |
(participantId: string) => {
return existingIDs.includes(participantId);
} | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
ArrowFunction |
(
participants: Array<Participant>,
existingIDs: Array<string>
) => {
return participants.filter((participant: Participant) => {
return !existingIDs.includes(participant.participantId);
});
} | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
ArrowFunction |
(participant: Participant) => {
return !existingIDs.includes(participant.participantId);
} | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
ArrowFunction |
(files: any) => {
let parent = this;
let {survey, updateSurveyDispatch} = this.props;
let existingParticipants: Array<string> = [];
let successParticipants: Array<string> = [];
let errorParticipants: Array<string> = [];
let participantList = !isEmptyObject(survey.partici... | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
ArrowFunction |
(event) => {
let csvData = event.target.result;
let p = parent.csvToJSON(csvData);
let jsonData = JSON.parse(p);
let participants = parent.JSONtoParticipants(jsonData);
let isValid = parent.validateParticipants(participants);
if (isValid) {
... | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
ArrowFunction |
(snapshot: any) => {
snapshot.forEach((doc: any) => {
existingParticipants.push(doc.data.participantId);
});
// find and remove participants already in survey
let existsInSurvey = parent.findExis... | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
ArrowFunction |
(doc: any) => {
existingParticipants.push(doc.data.participantId);
} | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
ArrowFunction |
(participantId: string) => {
participantList.push(participantId);
successParticipants.push(participantId);
} | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
ArrowFunction |
(participant: Participant) => {
return new Promise<void>((resolve, reject) => {
createParticipant(participant)
.then(() => {
participantList.push(
... | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
ArrowFunction |
(resolve, reject) => {
createParticipant(participant)
.then(() => {
participantList.push(
participant.participantId
... | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
ArrowFunction |
() => {
participantList.push(
participant.participantId
);
successParticipants.push(
partic... | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
ArrowFunction |
(error: any) => {
console.error(
'Error adding document: ',
error
);
errorParticipants.push... | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
ArrowFunction |
() => {
parent.setState({
successParticipants: successParticipants,
success: true
});
survey.participants = participantList;
... | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
ArrowFunction |
(err) => {
parent.setState({error: true});
console.error(err);
} | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
ArrowFunction |
(err: any) => {
parent.setState({error: true});
console.error(err);
} | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
ArrowFunction |
() => {
let files = (document.getElementById(
'participant-file-upload'
) as HTMLInputElement).files;
if (files !== null && files.length > 0) {
this.processFile(files);
}
this.resetErrorState();
} | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
InterfaceDeclaration |
interface ReduxProps {
survey: Survey;
updateSurveyDispatch: Function;
} | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
InterfaceDeclaration |
interface State {
error: boolean;
emptyIdsError: boolean;
emptyFileError: boolean;
duplicateError: boolean;
duplicateParticipants: Array<string>;
success: boolean;
successParticipants: Array<string>;
warning: boolean;
warningParticipants: Array<string>;
formatError: boolean;
... | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
MethodDeclaration |
render() {
let {survey} = this.props;
let {
error,
emptyIdsError,
emptyFileError,
duplicateError,
duplicateParticipants,
success,
successParticipants,
warning,
warningParticipants,
fo... | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
MethodDeclaration |
updateSurveyDispatch(surveyId: string, survey: any) {
dispatch(updateSurvey(surveyId, survey));
} | FDA/SHAPE | SHAPE-ADMIN/src/pages/ParticipantImport.tsx | TypeScript |
ArrowFunction |
(
email: string,
password: string,
): RequestSigninAction => ({
type: REQUEST_SIGNIN,
email,
password,
}) | lit-automation/frontend | src/actions/authorization/signin.ts | TypeScript |
ArrowFunction |
(
jwt: string,
email: string,
): RequestSigninSuccesAction => ({
type: REQUEST_SIGNIN_SUCCES,
jwt,
email,
}) | lit-automation/frontend | src/actions/authorization/signin.ts | TypeScript |
ArrowFunction |
(
error: string,
): RequestSigninFailureAction => ({
type: REQUEST_SIGNIN_FAILURE,
error,
}) | lit-automation/frontend | src/actions/authorization/signin.ts | TypeScript |
InterfaceDeclaration | // REQUEST_SIGNIN
export interface RequestSigninAction extends Action<string> {
email: string;
password: string;
} | lit-automation/frontend | src/actions/authorization/signin.ts | TypeScript |
InterfaceDeclaration | // REQUEST_SIGNIN_SUCCES
export interface RequestSigninSuccesAction extends Action<string> {
jwt: string;
email: string;
} | lit-automation/frontend | src/actions/authorization/signin.ts | TypeScript |
InterfaceDeclaration | // REQUEST_SIGNIN_FAILURE
export interface RequestSigninFailureAction extends Action<string> {
error: string;
} | lit-automation/frontend | src/actions/authorization/signin.ts | TypeScript |
InterfaceDeclaration | // Combined action interface for reducer
export interface SigninActions extends
RequestSigninAction,
RequestSigninSuccesAction,
RequestSigninFailureAction {} | lit-automation/frontend | src/actions/authorization/signin.ts | TypeScript |
ArrowFunction |
(callback: any, wait: number, immediate?: boolean): any => {
let timeout: any = null
return function (this: any) {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const context = this
// eslint-disable-next-line prefer-rest-params
const args = arguments
const later = function () {
... | yypkg/yypkg | core/debounce.ts | TypeScript |
ClassDeclaration |
@Injectable()
export class UserService {
expiresIn = 60 * 60 * 24 * 5 * 1000;
sessionCookieName = 'accessToken';
constructor(
@InjectRepository(User)
private userRepository: UserRepository,
private configService: ConfigService,
) {
this.initializeFirebase();
}
initializeFirebase() {
fi... | ignocide/oasis-quota-service | src/user/user.service.ts | TypeScript |
MethodDeclaration |
initializeFirebase() {
firebase.initializeApp({
credential: firebase.credential.cert(this.configService.get('firebase')),
});
} | ignocide/oasis-quota-service | src/user/user.service.ts | TypeScript |
MethodDeclaration |
async signUpIfNotExist(uid: string): Promise<User> {
const user = await this.readByFirebaseUid(uid);
if (user) {
return user;
}
const createdUser = this.userRepository.save({
firebaseUid: uid,
});
return createdUser;
} | ignocide/oasis-quota-service | src/user/user.service.ts | TypeScript |
MethodDeclaration |
async readByFirebaseUid(firebaseUid: string): Promise<User | null> {
const user = await this.userRepository.findOne({
firebaseUid,
});
return user || null;
} | ignocide/oasis-quota-service | src/user/user.service.ts | TypeScript |
MethodDeclaration |
async authFirebase(token: string) {
return await firebase.auth().verifyIdToken(token);
} | ignocide/oasis-quota-service | src/user/user.service.ts | TypeScript |
MethodDeclaration |
async createSessionCookie(idToken: string): Promise<string> {
return firebase
.auth()
.createSessionCookie(idToken, { expiresIn: this.expiresIn });
} | ignocide/oasis-quota-service | src/user/user.service.ts | TypeScript |
MethodDeclaration |
async getUidBySessionCookie(sessionCookie: string) {
try {
const { uid } = await firebase
.auth()
.verifySessionCookie(sessionCookie, true /** checkRevoked */);
return uid;
} catch (e) {
return null;
}
} | ignocide/oasis-quota-service | src/user/user.service.ts | TypeScript |
ClassDeclaration |
export class Initial1603926831459 implements MigrationInterface {
name = 'Initial1603926831459'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`CREATE TABLE "story" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "mediaId" text NOT NULL, "numLikes" integer NOT NULL ... | Bukii/vscode-stories-api | src/migrations/1603926831459-Initial.ts | TypeScript |
MethodDeclaration |
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`CREATE TABLE "story" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "mediaId" text NOT NULL, "numLikes" integer NOT NULL DEFAULT 0, "creatorUsername" text NOT NULL, "creatorAvatarUrl" text NOT NULL, "flair" text NOT NULL, "cre... | Bukii/vscode-stories-api | src/migrations/1603926831459-Initial.ts | TypeScript |
MethodDeclaration |
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`DROP TABLE "story"`);
} | Bukii/vscode-stories-api | src/migrations/1603926831459-Initial.ts | TypeScript |
ArrowFunction |
data => data[0] | fairmutex/Movie-App | src/app/movies/movie.service.ts | TypeScript |
ClassDeclaration |
@Injectable({
providedIn: 'root',
})
export class MovieService {
private moviesUrl = environment.MOVIES_API;
constructor(private http: HttpClient) { }
getMovies(query:any): Observable<Movie[]> {
let url = this.moviesUrl;
if(query)
if(query.action == "genre"){
url = `${url + '?genres='}${que... | fairmutex/Movie-App | src/app/movies/movie.service.ts | TypeScript |
MethodDeclaration |
getMovies(query:any): Observable<Movie[]> {
let url = this.moviesUrl;
if(query)
if(query.action == "genre"){
url = `${url + '?genres='}${query.value}`
}
else if(query.action == "search"){
url = `${url + '?name='}${query.value}`
}
return this.http.get<Movie[]>(url)
.pipe(
... | fairmutex/Movie-App | src/app/movies/movie.service.ts | TypeScript |
MethodDeclaration | // If data was retreived only once Search and filtering was handled at client side
// getMovies(): Observable<Movie[]> {
// return this.http.get<Movie[]>(this.moviesUrl)
// .pipe(
// tap(data => console.log(JSON.stringify(data))),
// // tap(data => this.movies = data),
// catchError(this.handle... | fairmutex/Movie-App | src/app/movies/movie.service.ts | TypeScript |
MethodDeclaration |
private handleError(err) {
// in a real world app, we may send the server to some remote logging infrastructure
// instead of just logging it to the console
let errorMessage: string;
if (err.error instanceof ErrorEvent) {
// A client-side or network error occurred. Handle it accordingly.
er... | fairmutex/Movie-App | src/app/movies/movie.service.ts | TypeScript |
ClassDeclaration |
@Module({
imports: [
TypeOrmModule.forRoot({
type: 'mysql',
host: 'localhost',
port: 3306,
username: 'nest',
password: 'app',
database: 'sendmeapp',
entities: [__dirname + '/**/*.entity{.ts,.js}'],
synchronize: true,
}),
MensajesModule,
],
controllers: ... | vakanal/nestjs-udemy | src/app.module.ts | TypeScript |
ArrowFunction |
() => {
beforeEach(() => {
TestBed.configureTestingModule({
providers: [Service495Service]
});
});
it('should ...', inject([Service495Service], (service: Service495Service) => {
expect(service).toBeTruthy();
}));
} | angular/angular-cli-stress-test | src/app/services/service-495.service.spec.ts | TypeScript |
ArrowFunction |
() => {
TestBed.configureTestingModule({
providers: [Service495Service]
});
} | angular/angular-cli-stress-test | src/app/services/service-495.service.spec.ts | TypeScript |
ArrowFunction |
(service: Service495Service) => {
expect(service).toBeTruthy();
} | angular/angular-cli-stress-test | src/app/services/service-495.service.spec.ts | TypeScript |
ClassDeclaration |
export declare class BillCreationException implements BillException {
readonly message: string;
readonly name: string;
readonly code: number;
readonly stack: string;
/**
* Construct the BillCreationException.
*
* @param message string [optional] The Exception message to throw.
*... | lootably/DefinitelyTyped | types/bitpay-sdk/Exceptions/BillCreationException.d.ts | TypeScript |
ArrowFunction |
(pi: PeerInfo) => [pi.endpoint, pi] | hyperhyperspace/hhs-lib-ts | src/mesh/agents/peer/sources/ConstantPeerSource.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.