From 8161822649ccce3deea5f1a09545918fcad1c4ff Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Wed, 18 Oct 2023 18:31:06 +0100 Subject: [PATCH] chore: add missing `use strict` directives --- bench/busboy-form-bench-latin1.js | 2 ++ bench/busboy-form-bench-utf8.js | 2 ++ bench/createMultipartBufferForEncodingBench.js | 2 ++ bench/dicer/dicer-bench-multipart-parser.js | 2 ++ bench/dicer/formidable-bench-multipart-parser.js | 2 ++ bench/dicer/multipartser-bench-multipart-parser.js | 2 ++ bench/dicer/multiparty-bench-multipart-parser.js | 2 ++ bench/dicer/parted-bench-multipart-parser.js | 2 ++ bench/dicer/parted-multipart.js | 2 ++ bench/fastify-busboy-form-bench-latin1.js | 2 ++ bench/fastify-busboy-form-bench-utf8.js | 2 ++ benchmarks/busboy/contestants/busboy.js | 2 ++ benchmarks/busboy/contestants/fastify-busboy.js | 2 ++ benchmarks/busboy/data.js | 2 ++ benchmarks/busboy/executioner.js | 2 ++ benchmarks/busboy/validator.js | 2 ++ benchmarks/common/commonBuilder.js | 2 ++ benchmarks/common/contestantResolver.js | 2 ++ benchmarks/common/executionUtils.js | 2 ++ benchmarks/common/resultUtils.js | 2 ++ benchmarks/common/resultsCombinator.js | 2 ++ 21 files changed, 42 insertions(+) diff --git a/bench/busboy-form-bench-latin1.js b/bench/busboy-form-bench-latin1.js index 95d9b74..33634ad 100644 --- a/bench/busboy-form-bench-latin1.js +++ b/bench/busboy-form-bench-latin1.js @@ -1,3 +1,5 @@ +'use strict' + const Busboy = require('busboy'); const { createMultipartBufferForEncodingBench } = require("./createMultipartBufferForEncodingBench"); diff --git a/bench/busboy-form-bench-utf8.js b/bench/busboy-form-bench-utf8.js index 6921dd5..1e6e0b7 100644 --- a/bench/busboy-form-bench-utf8.js +++ b/bench/busboy-form-bench-utf8.js @@ -1,3 +1,5 @@ +'use strict' + const Busboy = require('busboy'); const { createMultipartBufferForEncodingBench } = require("./createMultipartBufferForEncodingBench"); diff --git a/bench/createMultipartBufferForEncodingBench.js b/bench/createMultipartBufferForEncodingBench.js index 2a04a0a..9d20f8f 100644 --- a/bench/createMultipartBufferForEncodingBench.js +++ b/bench/createMultipartBufferForEncodingBench.js @@ -1,3 +1,5 @@ +'use strict' + function createMultipartBufferForEncodingBench(boundary, amount, charset) { const filename = charset === 'utf-8' ? 'utf-8\'\'%c2%a3%20and%20%e2%82%ac%20rates' : `${charset}\'en\'%A3%20rates`; const head = '--' + boundary + '\r\n' diff --git a/bench/dicer/dicer-bench-multipart-parser.js b/bench/dicer/dicer-bench-multipart-parser.js index a02f4db..d24f599 100644 --- a/bench/dicer/dicer-bench-multipart-parser.js +++ b/bench/dicer/dicer-bench-multipart-parser.js @@ -1,3 +1,5 @@ +'use strict' + const Dicer = require('../../deps/dicer/lib/Dicer') function createMultipartBuffer(boundary, size) { diff --git a/bench/dicer/formidable-bench-multipart-parser.js b/bench/dicer/formidable-bench-multipart-parser.js index 8d232ef..0470771 100644 --- a/bench/dicer/formidable-bench-multipart-parser.js +++ b/bench/dicer/formidable-bench-multipart-parser.js @@ -1,3 +1,5 @@ +'use strict' + require('../node_modules/formidable/test/common'); var multipartParser = require('../node_modules/formidable/lib/multipart_parser'), MultipartParser = multipartParser.MultipartParser, diff --git a/bench/dicer/multipartser-bench-multipart-parser.js b/bench/dicer/multipartser-bench-multipart-parser.js index 0799b85..40ca00b 100644 --- a/bench/dicer/multipartser-bench-multipart-parser.js +++ b/bench/dicer/multipartser-bench-multipart-parser.js @@ -1,3 +1,5 @@ +'use strict' + var multipartser = require('multipartser'), boundary = '-----------------------------168072824752491622650073', parser = multipartser(), diff --git a/bench/dicer/multiparty-bench-multipart-parser.js b/bench/dicer/multiparty-bench-multipart-parser.js index 08e4a76..ab79ec0 100644 --- a/bench/dicer/multiparty-bench-multipart-parser.js +++ b/bench/dicer/multiparty-bench-multipart-parser.js @@ -1,3 +1,5 @@ +'use strict' + var assert = require('node:assert'), Form = require('multiparty').Form, boundary = '-----------------------------168072824752491622650073', diff --git a/bench/dicer/parted-bench-multipart-parser.js b/bench/dicer/parted-bench-multipart-parser.js index 66762d4..e0a4670 100644 --- a/bench/dicer/parted-bench-multipart-parser.js +++ b/bench/dicer/parted-bench-multipart-parser.js @@ -1,3 +1,5 @@ +'use strict' + // A special, edited version of the multipart parser from parted is needed here // because otherwise it attempts to do some things above and beyond just parsing // -- like saving to disk and whatnot diff --git a/bench/dicer/parted-multipart.js b/bench/dicer/parted-multipart.js index 312a099..5436207 100644 --- a/bench/dicer/parted-multipart.js +++ b/bench/dicer/parted-multipart.js @@ -1,3 +1,5 @@ +'use strict' + /** * Parted (https://github.com/chjj/parted) * A streaming multipart state parser. diff --git a/bench/fastify-busboy-form-bench-latin1.js b/bench/fastify-busboy-form-bench-latin1.js index f759f9d..7ca5f44 100644 --- a/bench/fastify-busboy-form-bench-latin1.js +++ b/bench/fastify-busboy-form-bench-latin1.js @@ -1,3 +1,5 @@ +'use strict' + const Busboy = require('../lib/main'); const { createMultipartBufferForEncodingBench } = require("./createMultipartBufferForEncodingBench"); diff --git a/bench/fastify-busboy-form-bench-utf8.js b/bench/fastify-busboy-form-bench-utf8.js index aa87416..6c35071 100644 --- a/bench/fastify-busboy-form-bench-utf8.js +++ b/bench/fastify-busboy-form-bench-utf8.js @@ -1,3 +1,5 @@ +'use strict' + const Busboy = require('../lib/main'); const { createMultipartBufferForEncodingBench } = require("./createMultipartBufferForEncodingBench"); diff --git a/benchmarks/busboy/contestants/busboy.js b/benchmarks/busboy/contestants/busboy.js index c48e3ad..6cb3414 100644 --- a/benchmarks/busboy/contestants/busboy.js +++ b/benchmarks/busboy/contestants/busboy.js @@ -1,3 +1,5 @@ +'use strict' + const Busboy = require('busboy') const { buffer, boundary } = require('../data') diff --git a/benchmarks/busboy/contestants/fastify-busboy.js b/benchmarks/busboy/contestants/fastify-busboy.js index 90787de..6750f77 100644 --- a/benchmarks/busboy/contestants/fastify-busboy.js +++ b/benchmarks/busboy/contestants/fastify-busboy.js @@ -1,3 +1,5 @@ +'use strict' + const Busboy = require('../../../lib/main') const { buffer, boundary } = require('../data') diff --git a/benchmarks/busboy/data.js b/benchmarks/busboy/data.js index 5dd9b0e..4fdefae 100644 --- a/benchmarks/busboy/data.js +++ b/benchmarks/busboy/data.js @@ -1,3 +1,5 @@ +'use strict' + const boundary = '-----------------------------paZqsnEHRufoShdX6fh0lUhXBP4k' const randomContent = Buffer.from(makeString(1024 * 500), 'utf8') const buffer = createMultipartBuffer(boundary) diff --git a/benchmarks/busboy/executioner.js b/benchmarks/busboy/executioner.js index a91e1de..524912c 100644 --- a/benchmarks/busboy/executioner.js +++ b/benchmarks/busboy/executioner.js @@ -1,3 +1,5 @@ +'use strict' + const { process: processBusboy } = require('./contestants/busboy') const { process: processFastify } = require('./contestants/fastify-busboy') const { getCommonBuilder } = require('../common/commonBuilder') diff --git a/benchmarks/busboy/validator.js b/benchmarks/busboy/validator.js index 31cbde9..a86cc33 100644 --- a/benchmarks/busboy/validator.js +++ b/benchmarks/busboy/validator.js @@ -1,3 +1,5 @@ +'use strict' + const { validateEqual } = require('validation-utils') const { randomContent } = require('./data') diff --git a/benchmarks/common/commonBuilder.js b/benchmarks/common/commonBuilder.js index c43a6ec..b5707aa 100644 --- a/benchmarks/common/commonBuilder.js +++ b/benchmarks/common/commonBuilder.js @@ -1,3 +1,5 @@ +'use strict' + const { validateNotNil } = require('validation-utils') const { BenchmarkBuilder } = require('photofinish') const getopts = require('getopts') diff --git a/benchmarks/common/contestantResolver.js b/benchmarks/common/contestantResolver.js index 4a4b965..7cfc90e 100644 --- a/benchmarks/common/contestantResolver.js +++ b/benchmarks/common/contestantResolver.js @@ -1,3 +1,5 @@ +'use strict' + const getopts = require('getopts') const options = getopts(process.argv.slice(1), { diff --git a/benchmarks/common/executionUtils.js b/benchmarks/common/executionUtils.js index 45d8194..8c52ec8 100644 --- a/benchmarks/common/executionUtils.js +++ b/benchmarks/common/executionUtils.js @@ -1,3 +1,5 @@ +'use strict' + const { getCommonBuilder } = require('./commonBuilder') const { outputResults } = require('./resultUtils') diff --git a/benchmarks/common/resultUtils.js b/benchmarks/common/resultUtils.js index a413ece..ec7bce7 100644 --- a/benchmarks/common/resultUtils.js +++ b/benchmarks/common/resultUtils.js @@ -1,3 +1,5 @@ +'use strict' + const { exportResults } = require('photofinish') function outputResults (benchmark, benchmarkResults) { diff --git a/benchmarks/common/resultsCombinator.js b/benchmarks/common/resultsCombinator.js index ac0a55a..253211b 100644 --- a/benchmarks/common/resultsCombinator.js +++ b/benchmarks/common/resultsCombinator.js @@ -1,3 +1,5 @@ +'use strict' + const fs = require('node:fs') const path = require('node:path') const getopts = require('getopts')