本文整理汇总了TypeScript中cerialize.Deserialize函数的典型用法代码示例。如果您正苦于以下问题:TypeScript Deserialize函数的具体用法?TypeScript Deserialize怎么用?TypeScript Deserialize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Deserialize函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: callback
this.cryptoService.decrypt(password, encryptedInfo, (err, decrypted) => {
if (err){
return callback(err,null,null);
}
try {
var json = JSON.parse(decrypted);
var walletInfo:PrivateWalletInfo = Deserialize(json, PrivateWalletInfo);
}
catch(err){
return callback('cannot open wallet, make sure your password is correct',null,null)
}
if(walletInfo.seed == null){
return callback('SEED_MISSING', walletInfo, null);
}
else {
var wallet = new PrivateWalletService(walletInfo, password);
return callback(null, walletInfo, wallet);
}
});
示例2: callback
this.cryptoService.decrypt(password, encryptedInfo, (err, decrypted) => {
if (err){
return callback(err,null,null);
}
else if (decrypted.startsWith('xpub')){
let error = 'This version of Icewallet is not compatable with your wallet\n';
error += 'Please create a new wallet with your public key\n';
error += decrypted + '\n';
error += 'Then use the "Next Unused Address Indexes" option to update your private wallet';
return callback(error,null,null);
}
try {
var json = JSON.parse(decrypted);
var walletInfo:PublicWalletInfo = Deserialize(json, PublicWalletInfo)
var wallet = new PublicWalletService(walletInfo, password);
}
catch(err){
return callback('Could not create wallet, check your xpub or password',decrypted,null);
}
return callback(null, decrypted, wallet);
});
示例3: Deserialize
.map((res: Response) => {
const updated = Deserialize(res.json(), User);
return updated;
});
示例4:
public static deserializeArray<T>(ctor: NoParamConstructor<T>, json): Array<T> {
return cerialize.Deserialize(json, ctor);
}
示例5: Deserialize
.map((res: Response) => {
const json = res.json();
const locations: Location[] = Deserialize(json, Location);
return locations;
});
示例6: Deserialize
.map((res: Response) => {
const json = res.json();
const users = Deserialize(json, User);
return users;
});