sebastienrousseau / crypto-service

Use shorthand property syntax for object literals JS-0240
Anti-pattern
Minor
7 months agoa year old
31
32  app.get("/", async () => {
33    return {
34      id: id,35      title: "👋 Welcome to Crypto Server!",
36      description: "Crypto Server is a Fastify web server that exposes easy consumable REST APIs to perform low-level cryptographic operations.",
37      details: "It supports the following cryptographic operations:\n- Digital Signing,\n- Encryption and Decryption,\n- Key Generation,\n- Key Management,\n- Pseudorandom Number Generation,\n- Signature Verification.\n- Development of this server is hosted by GitHub at the following page. Source code is available to everyone under the standard MIT license.",
Expected property shorthand
52  const revokeKey = await openpgp.revokeKey({
53    date: new Date(), // revocation date
54    key: privateKeyRead, // private key object
55    reasonForRevocation: { flag: flag, string: reason }, // optional, default: 056  });
57
58  console.log(revokeKey);
Expected property shorthand.
59  });
60
61  const signOptions: openpgp.SignOptions = {
62    detached: detached,63    message: unsignedMessage,
64    signingKeys: privateKeyRead,
65  };
Expected property shorthand.
 56  const reformatKeys = await openpgp.reformatKey({
 57    privateKey: privateKey,
 58    userIDs: [{ name: data.name, email: data.email }],
 59    passphrase: passphrase, 60    keyExpirationTime: expiration,
 61    date: new Date(),
 62    format: "armored",
Expected property shorthand.
 54  });
 55
 56  const reformatKeys = await openpgp.reformatKey({
 57    privateKey: privateKey, 58    userIDs: [{ name: data.name, email: data.email }],
 59    passphrase: passphrase,
 60    keyExpirationTime: expiration,