diff --git a/docs/search-index/build.js b/docs/search-index/build.js index 28299016..aae5abc8 100644 --- a/docs/search-index/build.js +++ b/docs/search-index/build.js @@ -1,12 +1,13 @@ 'use strict'; const fs = require('fs'); +const path = require('path'); const { extractDescription, extractKeywords } = require('./extract'); const searchIndex = []; // Install -const contents = fs.readFileSync(`${__dirname}/../install.md`, 'utf8'); +const contents = fs.readFileSync(path.join(__dirname, '..', 'install.md'), 'utf8'); const matches = contents.matchAll( /## (?[A-Za-z ]+)\n\n(?<body>[^#]+)/gs ); @@ -34,7 +35,7 @@ for (const match of matches) { 'colour', 'utility' ].forEach((section) => { - const contents = fs.readFileSync(`${__dirname}/../api-${section}.md`, 'utf8'); + const contents = fs.readFileSync(path.join(__dirname, '..', `api-${section}.md`), 'utf8'); const matches = contents.matchAll( /\n## (?<title>[A-Za-z]+)\n\n(?<firstparagraph>.+?)\n\n/gs ); @@ -54,6 +55,6 @@ for (const match of matches) { }); fs.writeFileSync( - `${__dirname}/../search-index.json`, + path.join(__dirname, '..', 'search-index.json'), JSON.stringify(searchIndex) ); diff --git a/package.json b/package.json index 03bdf614..6804a400 100644 --- a/package.json +++ b/package.json @@ -121,23 +121,23 @@ "prebuild-install": "^6.0.0", "semver": "^7.3.2", "simple-get": "^4.0.0", - "tar-fs": "^2.1.0", + "tar-fs": "^2.1.1", "tunnel-agent": "^0.6.0" }, "devDependencies": { "async": "^3.2.0", "cc": "^2.0.1", "decompress-zip": "^0.3.2", - "documentation": "^13.0.2", + "documentation": "^13.1.0", "exif-reader": "^1.0.3", "icc": "^2.0.0", "license-checker": "^25.0.1", - "mocha": "^8.1.1", + "mocha": "^8.2.1", "mock-fs": "^4.13.0", "nyc": "^15.1.0", "prebuild": "^10.0.1", "rimraf": "^3.0.2", - "semistandard": "^14.2.3" + "semistandard": "^16.0.0" }, "license": "Apache-2.0", "config": { diff --git a/test/unit/stats.js b/test/unit/stats.js index 6b1d8ee5..0b828e6c 100644 --- a/test/unit/stats.js +++ b/test/unit/stats.js @@ -7,7 +7,7 @@ const sharp = require('../../'); const fixtures = require('../fixtures'); // Test Helpers -var threshold = 0.001; +const threshold = 0.001; function isInAcceptableRange (actual, expected) { return actual >= ((1 - threshold) * expected) && actual <= ((1 + threshold) * expected); }