1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

chalk and source maps

This commit is contained in:
Kyle Spearrin
2018-05-15 10:50:06 -04:00
parent d79cf6d9f8
commit eb83569f2f
7 changed files with 24 additions and 26 deletions

View File

@@ -12,8 +12,14 @@ export class CreateCommand {
constructor(private cipherService: CipherService, private folderService: FolderService) { }
async run(object: string, requestData: string, cmd: program.Command): Promise<Response> {
const reqJson = new Buffer(requestData, 'base64').toString();
const req = JSON.parse(reqJson);
let req: any = null;
try {
const reqJson = new Buffer(requestData, 'base64').toString();
req = JSON.parse(reqJson);
} catch (e) {
return Response.badRequest('Error parsing the encoded request data.');
}
switch (object.toLowerCase()) {
case 'item':
return await this.createCipher(req);