我想获得一个可读形式的 Blob。
import {Readable} from 'stream';
const data: Blob = new Blob( );
const myReadable: Readable = (new Readable()).wrap(data.stream());
myReadable.pipe(ext);
Run Code Online (Sandbox Code Playgroud)
我收到此错误
ERROR in src/app/features/recorder/components/record-panel/record-panel.component.ts:80:38 - error TS2345: Argument of type 'ReadableStream<any>' is not assignable to parameter of type 'ReadableStream'.
Type 'ReadableStream<any>' is missing the following properties from type 'ReadableStream': readable, read, setEncoding, pause, and 22 more.
Run Code Online (Sandbox Code Playgroud)
我使用 Node 14 angular 10 和 typescript
我定义了3个与M2M关系有关的模型
class Suite(models.Model):
name = models.CharField(max_length=250)
title = models.CharField(max_length=250)
icon = models.CharField(max_length=250)
def __str__(self):
return self.title
class Role(models.Model):
name = models.CharField(max_length=250)
title = models.CharField(max_length=250)
suites = models.ManyToManyField(Suite)
services = models.ManyToManyField(Service)
Actions = models.ManyToManyField(Action)
users = models.ManyToManyField(User)
def __str__(self):
return self.title
Run Code Online (Sandbox Code Playgroud)
在我的一种观点中,我试图收集与特定用户有关的所有Suite。用户可能与可能包含许多Suite的几个Role相关。然后按名称过滤Suite。但是过滤器似乎没有作用
queryset = Suite.objects.union(*(role.suites.all() for role in
self.get_user().role_set.all()))
repr(self.queryset)
'<QuerySet [<Suite: energia>, <Suite: waste 4 thing>]>'
self.queryset = self.queryset.filter(name="energia")
repr(self.queryset)
'<QuerySet [<Suite: energia>, <Suite: waste 4 thing>]>'
Run Code Online (Sandbox Code Playgroud)
在执行过滤器之前,queryset内部的查询属性不会更改其内容:
(SELECT "navbar_suite"."id", …Run Code Online (Sandbox Code Playgroud) 我的项目表现得很奇怪,并试图刷新节点模块安装。删除节点模块目录并通过 npm install 重新安装后,我收到下一个错误。
我尝试升级到 Angular 10 并尝试使用节点 13 和节点 14,但错误似乎仍然存在。
ERROR in node_modules/zone.js/lib/common/utils.d.ts:42:101 - error TS2304: Cannot find name 'TaskData'.
42 export declare function scheduleMacroTaskWithCurrentZone(source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void, customCancel?: (task: Task) => void): MacroTask;
~~~~~~~~
node_modules/zone.js/lib/common/utils.d.ts:42:135 - error TS2304: Cannot find name 'Task'.
42 export declare function scheduleMacroTaskWithCurrentZone(source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void, customCancel?: (task: Task) => void): MacroTask;
~~~~
node_modules/zone.js/lib/common/utils.d.ts:42:172 - error TS2304: Cannot find name …Run Code Online (Sandbox Code Playgroud)