sebastienrousseau / crypto-service

Require template literals instead of string concatenation JS-0246
Anti-pattern
Minor
7 months agoa year old
Unexpected string concatenation
44  const app = fastify.fastify(fastifyOptions);
45
46  // Logger middleware for fastify instance (logs to console)
47  logger.info("\n\nEnvironment details: " + consoleOutput);48
49  // Register API routes.
50  routes(app);
Unexpected string concatenation
109    certificate.write(Buffer.from(revocationCertificate).toString("base64"));
110    certificate.on("finish", () => {
111      console.log(
112        "🔏 The revocation certificate data was written to `" +113          data.type +114          ".cert`",115      );
116    });
117    certificate.end();
Unexpected string concatenation
103    prkey.end();
104
105    const certificate = fs.createWriteStream(
106      path.resolve(__dirname, "../key/" + data.type + ".cert"),107      { encoding: "utf8" },
108    );
109    certificate.write(Buffer.from(revocationCertificate).toString("base64"));
Unexpected string concatenation
 97    prkey.write(Buffer.from(privateKey).toString("base64"));
 98    prkey.on("finish", () => {
 99      console.log(
100        "🔒 The private key data was written to `" + data.type + ".key`",101      );
102    });
103    prkey.end();
Unexpected string concatenation
 91    pbkey.end();
 92
 93    const prkey = fs.createWriteStream(
 94      path.resolve(__dirname, "../key/" + data.type + ".key"), 95      { encoding: "utf8" },
 96    );
 97    prkey.write(Buffer.from(privateKey).toString("base64"));