// using a typecast:
def results = new File(someDirectory).listFiles((FileFilter) { it.name.startsWith 'foo'})
// using as keyword:
def results = new File(someDirectory).listFiles({ it.name.startsWith 'foo'} as FileFilter)
// using SAM-type coercion:
FileFilter ff = { it.name.startsWith 'foo'}
def results = new File(someDirectory).listFiles(ff)
答案 0 :(得分:0)
{{1}}
如果不起作用,请尝试:
1-删除'node_modules'文件夹
2- npm缓存清理
3- npm更新