weboptimizer 2.0.1480 → 2.0.1482

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,8 @@
1
+ /**
2
+ * Checks if given path points to a valid file.
3
+ * @param filePath - Path to directory.
4
+ * @returns A promise holding a boolean which indicates directory existence.
5
+ */
6
+ export declare const isFile: (filePath: string) => Promise<boolean>;
1
7
  declare const _default: any[];
2
8
  export default _default;
package/eslint.config.mjs CHANGED
@@ -1,7 +1,6 @@
1
- import clientnode from 'clientnode';
2
1
  import google from 'eslint-config-google';
3
2
  import jsdoc from 'eslint-plugin-jsdoc';
4
- import { readFile } from 'fs/promises';
3
+ import { readFile, stat } from 'fs/promises';
5
4
  import globals from 'globals';
6
5
  import { resolve } from 'path';
7
6
  import { cwd } from 'process';
@@ -10,8 +9,19 @@ import js from '@eslint/js';
10
9
  import typescriptPlugin from '@typescript-eslint/eslint-plugin';
11
10
  import typescriptParser from '@typescript-eslint/parser';
12
11
 
13
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
- const isFile = clientnode.isFile;
12
+ /**
13
+ * Checks if given path points to a valid file.
14
+ * @param filePath - Path to directory.
15
+ * @returns A promise holding a boolean which indicates directory existence.
16
+ */
17
+ export const isFile = async filePath => {
18
+ try {
19
+ return (await stat(filePath)).isFile();
20
+ } catch (error) {
21
+ if (Object.prototype.hasOwnProperty.call(error, 'code') && ['ENOENT', 'ENOTDIR'].includes(error.code)) return false;
22
+ throw error;
23
+ }
24
+ };
15
25
 
16
26
  // Remove unsupported rules.
17
27
  const unsuportedRules = ['require-jsdoc', 'valid-jsdoc'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weboptimizer",
3
- "version": "2.0.1480",
3
+ "version": "2.0.1482",
4
4
  "description": "A generic web optimizer, (module) bundler and development environment.",
5
5
  "keywords": [
6
6
  "webpack",
@@ -100,7 +100,7 @@
100
100
  "babel-loader": "^9.1.3",
101
101
  "babel-plugin-transform-modern-regexp": "^0.0.6",
102
102
  "babel-preset-minify": "^0.5.2",
103
- "clientnode": "3.0.1149",
103
+ "clientnode": "3.0.1153",
104
104
  "ejs": "^3.1.10",
105
105
  "exports-loader": "^5.0.0",
106
106
  "extract-loader": "^5.1.0",
@@ -125,7 +125,7 @@
125
125
  "@types/html-minifier": "^4.0.5",
126
126
  "@types/html-minifier-terser": "^7.0.2",
127
127
  "@types/imagemin": "^9.0.0",
128
- "@types/node": "^20.14.7",
128
+ "@types/node": "^20.14.8",
129
129
  "@types/postcss-import": "^14.0.3",
130
130
  "@types/postcss-url": "^10.0.4",
131
131
  "@types/webpack-env": "^1.18.5",
@@ -137,7 +137,7 @@
137
137
  "documentation-website": "^1.0.326",
138
138
  "eslint": "^9.5.0",
139
139
  "eslint-config-google": "^0.14.0",
140
- "eslint-plugin-jsdoc": "^48.2.12",
140
+ "eslint-plugin-jsdoc": "^48.4.0",
141
141
  "favicons": "^7.2.0",
142
142
  "favicons-webpack-plugin": "^6.0.1",
143
143
  "globals": "^15.6.0",
@@ -295,6 +295,9 @@
295
295
  "stylelint-config-standard-scss": {
296
296
  "optional": true
297
297
  },
298
+ "typescript-eslint": {
299
+ "optional": true
300
+ },
298
301
  "typescript-plugin-css-modules": {
299
302
  "optional": true
300
303
  },