Skip to content

Commit

Permalink
Merge pull request #29 from Geloosa/extra-libs-filepath
Browse files Browse the repository at this point in the history
more safe extra lib filePath generation
  • Loading branch information
alexdima authored Mar 4, 2019
2 parents 505232c + 6d8ff4c commit e9381f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/monaco.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class LanguageServiceDefaultsImpl implements monaco.languages.typescript.

addExtraLib(content: string, filePath?: string): IDisposable {
if (typeof filePath === 'undefined') {
filePath = `ts:extralib-${Date.now()}`;
filePath = `ts:extralib-${Math.random().toString(36).substring(2, 15)}`;
}

if (this._extraLibs[filePath]) {
Expand Down

0 comments on commit e9381f6

Please sign in to comment.