소스 검색

Merge pull request #29 from Geloosa/extra-libs-filepath

more safe extra lib filePath generation
Alexandru Dima 6 년 전
부모
커밋
e9381f692d
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/monaco.contribution.ts

+ 1 - 1
src/monaco.contribution.ts

@@ -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]) {