File tree 3 files changed +9
-3
lines changed
3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " cos-js-sdk-v5" ,
3
- "version" : " 1.3.9 " ,
3
+ "version" : " 1.3.10 " ,
4
4
"description" : " JavaScript SDK for [腾讯云对象存储](https://cloud.tencent.com/product/cos)" ,
5
5
"main" : " index.js" ,
6
6
"types" : " index.d.ts" ,
Original file line number Diff line number Diff line change @@ -78,6 +78,6 @@ COS.util = {
78
78
json2xml : util . json2xml ,
79
79
} ;
80
80
COS . getAuthorization = util . getAuth ;
81
- COS . version = '1.3.9 ' ;
81
+ COS . version = '1.3.10 ' ;
82
82
83
83
module . exports = COS ;
Original file line number Diff line number Diff line change @@ -710,7 +710,13 @@ var error = function (err, opt) {
710
710
}
711
711
712
712
var isNode = function ( ) {
713
- return typeof window !== 'object' && typeof process === 'object' && typeof require === 'function' ;
713
+ // 得兜底 web worker 环境中 webpack 用了 process 插件之类的情况
714
+ return typeof window !== 'object' && typeof process === 'object' && typeof require === 'function' && ! isWebWorker ( ) ;
715
+ }
716
+
717
+ var isWebWorker = function ( ) {
718
+ // 有限判断 worker 环境的 constructor name 其次用 worker 独有的 FileReaderSync 兜底 详细参考 https://developer.mozilla.org/zh-CN/docs/Web/API/Web_Workers_API/Using_web_workers
719
+ return globalThis . constructor . name === 'DedicatedWorkerGlobalScope' || globalThis . FileReaderSync ;
714
720
}
715
721
716
722
var isCIHost = function ( url ) {
You can’t perform that action at this time.
0 commit comments