Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gzupanda
code-server
提交
a06854a9
C
code-server
项目概览
gzupanda
/
code-server
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
code-server
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
a06854a9
编写于
1月 11, 2019
作者:
A
Asher
提交者:
Kyle Carberry
2月 05, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update Node fills due to updated types package
上级
d128ca6d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
12 deletion
+18
-12
packages/node-browser/src/child_process.ts
packages/node-browser/src/child_process.ts
+1
-1
packages/node-browser/src/fs.ts
packages/node-browser/src/fs.ts
+15
-11
packages/node-browser/src/util.ts
packages/node-browser/src/util.ts
+2
-0
未找到文件。
packages/node-browser/src/child_process.ts
浏览文件 @
a06854a9
...
...
@@ -161,7 +161,7 @@ function fork(modulePath: string): cp.ChildProcess {
}));
}
function
spawn
(
_command
:
string
,
_args
?:
ReadonlyArray
<
string
>
,
_options
?:
cp
.
SpawnOptions
):
cp
.
ChildProcess
{
function
spawn
(
_command
:
string
,
_args
?:
ReadonlyArray
<
string
>
|
cp
.
SpawnOptions
,
_options
?:
cp
.
SpawnOptions
):
cp
.
ChildProcess
{
throw
new
Error
(
"
not implemented
"
);
}
// tslint:enable only-arrow-functions
...
...
packages/node-browser/src/fs.ts
浏览文件 @
a06854a9
...
...
@@ -30,7 +30,7 @@ class ReaddirQueue extends Queue<ReaddirCallback> {
const
stdio
=
await
promisify
(
exec
)(
`bash -c '
${
keys
.
map
((
key
)
=>
`cd
${
escapePath
(
key
)}
&& ls -1a; echo;`
).
join
(
"
"
)}
'`
);
stdio
.
stdout
.
trim
().
split
(
"
\n\n
"
).
forEach
((
split
,
index
)
=>
{
const
path
=
keys
[
index
];
const
cbs
=
items
.
get
(
path
);
const
cbs
=
items
.
get
(
path
)
!
;
if
(
split
.
indexOf
(
"
does not exist
"
)
!==
-
1
)
{
cbs
.
forEach
((
cb
)
=>
{
cb
({
...
...
@@ -262,7 +262,7 @@ function appendFile(
// @ts-ignore not sure how to make this work.
return
callback
(
new
Error
(
"
not open
"
),
undefined
as
any
);
// tslint:disable-line no-any
}
path
=
openFiles
.
get
(
path
).
path
;
path
=
openFiles
.
get
(
path
)
!
.
path
;
}
const
process
=
exec
(
`
${
data
?
"
cat >>
"
:
"
touch
"
}
${
escapePath
(
path
.
toString
())}
`
,
(
error
)
=>
{
...
...
@@ -310,7 +310,7 @@ function fstat(fd: number, callback: (err: NodeJS.ErrnoException, stats: fs.Stat
if
(
!
openFiles
.
has
(
fd
))
{
return
callback
(
new
Error
(
"
not open
"
),
null
as
any
);
// tslint:disable-line no-any
}
stat
(
openFiles
.
get
(
fd
).
path
,
callback
);
stat
(
openFiles
.
get
(
fd
)
!
.
path
,
callback
);
}
function
futimes
(
...
...
@@ -323,7 +323,7 @@ function futimes(
return
callback
(
new
Error
(
"
not opened
"
));
}
const
openFile
=
openFiles
.
get
(
fd
);
const
openFile
=
openFiles
.
get
(
fd
)
!
;
const
command
=
[
{
flag
:
"
a
"
,
time
:
atime
},
{
flag
:
"
m
"
,
time
:
mtime
},
...
...
@@ -344,7 +344,7 @@ function lstat(path: fs.PathLike, callback: (err: NodeJS.ErrnoException, stats:
}
function
mkdir
(
path
:
fs
.
PathLike
,
mode
:
number
|
string
|
undefined
|
null
|
((
err
:
NodeJS
.
ErrnoException
)
=>
void
),
path
:
fs
.
PathLike
,
mode
:
number
|
string
|
fs
.
MakeDirectoryOptions
|
undefined
|
null
|
((
err
:
NodeJS
.
ErrnoException
)
=>
void
),
callback
?:
(
err
:
NodeJS
.
ErrnoException
)
=>
void
,
):
void
{
execAndCallback
(
...
...
@@ -391,7 +391,7 @@ function open(
});
}
function
read
<
TBuffer
extends
Buffer
|
Uint8Array
>
(
function
read
<
TBuffer
extends
fs
.
BinaryData
>
(
fd
:
number
,
buffer
:
TBuffer
,
offset
:
number
,
...
...
@@ -409,7 +409,7 @@ function read<TBuffer extends Buffer | Uint8Array>(
}
const
hasPosition
=
typeof
position
===
"
number
"
;
const
openFile
=
openFiles
.
get
(
fd
);
const
openFile
=
openFiles
.
get
(
fd
)
!
;
if
(
!
hasPosition
)
{
position
=
openFile
.
position
||
0
;
...
...
@@ -427,6 +427,7 @@ function read<TBuffer extends Buffer | Uint8Array>(
const
output
=
data
.
slice
(
position
!
,
position
!
+
length
);
if
(
output
.
length
!==
0
)
{
// TODO: seems to be no more set with v10, but need to decide if we'll be running v10.
buffer
.
set
(
output
,
offset
);
}
...
...
@@ -459,7 +460,7 @@ function readFile(
// @ts-ignore not sure how to make this work.
return
callback
(
new
Error
(
"
not open
"
),
undefined
as
any
);
// tslint:disable-line no-any
}
path
=
openFiles
.
get
(
path
).
path
;
path
=
openFiles
.
get
(
path
)
!
.
path
;
}
readFileQueue
.
add
(
path
.
toString
(),
(
error
,
result
)
=>
{
...
...
@@ -473,8 +474,8 @@ function readFile(
function
readdir
(
path
:
fs
.
PathLike
,
options
:
{
encoding
?:
string
|
null
}
|
string
|
undefined
|
null
|
((
err
:
NodeJS
.
ErrnoException
,
files
:
string
[])
=>
void
),
callback
?:
((
err
:
NodeJS
.
ErrnoException
,
files
:
string
[])
=>
void
)
|
((
err
:
NodeJS
.
ErrnoException
,
files
:
Buffer
[])
=>
void
)
|
((
err
:
NodeJS
.
ErrnoException
,
files
:
Array
<
string
|
Buffer
>
)
=>
void
),
options
:
{
encoding
?:
string
|
null
,
withFileTypes
?:
boolean
}
|
string
|
undefined
|
null
|
((
err
:
NodeJS
.
ErrnoException
,
files
:
string
[])
=>
void
),
callback
?:
((
err
:
NodeJS
.
ErrnoException
,
files
:
string
[])
=>
void
)
|
((
err
:
NodeJS
.
ErrnoException
,
files
:
Buffer
[])
=>
void
)
|
((
err
:
NodeJS
.
ErrnoException
,
files
:
fs
.
Dirent
[])
=>
void
)
):
void
{
if
(
typeof
options
===
"
function
"
)
{
callback
=
options
;
...
...
@@ -596,7 +597,7 @@ function writeFile(
// @ts-ignore not sure how to make this work.
return
callback
(
new
Error
(
"
not open
"
),
undefined
as
any
);
// tslint:disable-line no-any
}
path
=
openFiles
.
get
(
path
).
path
;
path
=
openFiles
.
get
(
path
)
!
.
path
;
}
const
process
=
exec
(
`
${
data
?
"
cat >
"
:
"
touch
"
}
${
escapePath
(
path
.
toString
())}
`
,
(
error
)
=>
{
...
...
@@ -627,6 +628,7 @@ rmdir.__promisify__ = undefined as any;
stat
.
__promisify__
=
undefined
as
any
;
unlink
.
__promisify__
=
undefined
as
any
;
writeFile
.
__promisify__
=
undefined
as
any
;
realpath
.
native
=
undefined
as
any
;
// tslint:enable no-any
const
exp
:
typeof
fs
=
{
...
...
@@ -634,6 +636,8 @@ const exp: typeof fs = {
Stats
:
fs
.
Stats
,
ReadStream
:
fs
.
ReadStream
,
WriteStream
:
fs
.
WriteStream
,
Dirent
:
fs
.
Dirent
,
promises
:
fs
.
promises
,
access
:
throwUnimplementedError
,
accessSync
:
throwSyncError
,
...
...
packages/node-browser/src/util.ts
浏览文件 @
a06854a9
...
...
@@ -10,6 +10,8 @@ throwUnimplementedError.link = undefined as any;
export
const
throwSyncError
=
():
any
=>
{
throw
new
Error
(
"
sync is not supported
"
);
};
// realpath & realpathSync.
throwSyncError
.
native
=
undefined
as
any
;
// tslint:enable no-any
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录