Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
authenticate(): Observable {
if (!this.login$) {
this.login$ = Observable.fromPromise(new Promise(resolve => firebase.auth().onAuthStateChanged(resolve))
.then(user => user ? user : firebase.auth()
.signInWithEmailAndPassword(
Config.getEnv(Config.ENV_USERNAME),
Config.getEnv(Config.ENV_PASSWORD)
))
)
.publishLast()
.refCount();
}
return this.login$;
}
}
textDocumentRename(params: RenameParams, span = new Span()): Observable {
const uri = normalizeUri(params.textDocument.uri);
const editUris = new Set();
return Observable.fromPromise(this.projectManager.ensureOwnFiles(span))
.mergeMap(() => {
const filePath = uri2path(uri);
const configuration = this.projectManager.getParentConfiguration(params.textDocument.uri);
if (!configuration) {
throw new Error(`tsconfig.json not found for ${filePath}`);
}
configuration.ensureAllFiles(span);
const sourceFile = this._getSourceFile(configuration, filePath, span);
if (!sourceFile) {
throw new Error(`Expected source file ${filePath} to exist in configuration`);
}
const position = ts.getPositionOfLineAndCharacter(sourceFile, params.position.line, params.position.character);
public get milestones(): Observable {
const options = this._assignOwnerRepo({
state: 'closed'
});
return Observable.fromPromise(this.github.issues.getMilestones(options))
.map((resp: any) => resp.data);
}
/**
public getIssuesByMileStone(milestone): Observable<{milestone:IMilestones.RootObject, issue?: IIssue.RootObject, error?: any }> {
const options: Github.IssuesGetForRepoParams = this._assignOwnerRepo({
milestone: milestone.number,
direction: 'asc',
state: 'closed'
});
return Observable.fromPromise(this.github.issues.getForRepo(options).catch((e) => Promise.reject({milestone: milestone, error: e})))
.map((resp: any) => {
return {milestone: milestone, issues: resp.data}
});
}
}
public getMilestone(id): Observable {
const options = this._assignOwnerRepo({
number: id
});
return Observable.fromPromise(this.github.issues.getMilestone(options))
.map((resp: any) => resp.data);
}
/**