refactor(struct): type plugin system rewrok v2

This commit is contained in:
Simon Chan 2021-01-06 18:16:26 +08:00
parent f9502f0e6f
commit c37e3dd953
32 changed files with 865 additions and 729 deletions

View file

@ -22,8 +22,9 @@ const AdbReverseStringResponse =
.string('content', { lengthField: 'length' });
const AdbReverseErrorResponse =
AdbReverseStringResponse
.afterParsed((value) => {
new Struct({ littleEndian: true })
.fields(AdbReverseStringResponse)
.postDeserialize((value) => {
throw new Error(value.content);
});