@modern-js/utils 1.7.7 → 1.7.8

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @modern-js/utils
2
2
 
3
+ ## 1.7.8
4
+
5
+ ### Patch Changes
6
+
7
+ - 63c354ad5: fix normalizeToPosixPath utils function args would be null
8
+ - 073e9ad78: feat(webpack): improve utils of tools.webpack
9
+ - f4a7d49e1: fix: applyOptionsChain argument type
10
+
3
11
  ## 1.7.7
4
12
 
5
13
  ### Patch Changes
@@ -0,0 +1 @@
1
+ export declare const ensureArray: <T>(params: T | T[]) => T[];
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ensureArray = void 0;
4
+ const ensureArray = (params) => {
5
+ if (Array.isArray(params)) {
6
+ return params;
7
+ }
8
+ return [params];
9
+ };
10
+ exports.ensureArray = ensureArray;
package/dist/index.d.ts CHANGED
@@ -8,6 +8,7 @@ export * from './is';
8
8
  export * from './compatRequire';
9
9
  export * from './logger';
10
10
  export * from './constants';
11
+ export * from './ensureArray';
11
12
  export * from './ensureAbsolutePath';
12
13
  export * from './clearConsole';
13
14
  export * from './applyOptionsChain';
package/dist/index.js CHANGED
@@ -20,6 +20,7 @@ __exportStar(require("./is"), exports);
20
20
  __exportStar(require("./compatRequire"), exports);
21
21
  __exportStar(require("./logger"), exports);
22
22
  __exportStar(require("./constants"), exports);
23
+ __exportStar(require("./ensureArray"), exports);
23
24
  __exportStar(require("./ensureAbsolutePath"), exports);
24
25
  __exportStar(require("./clearConsole"), exports);
25
26
  __exportStar(require("./applyOptionsChain"), exports);
package/dist/path.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export declare const isRelativePath: (test: string) => boolean;
2
2
  export declare const normalizeOutputPath: (s: string) => string;
3
- export declare const normalizeToPosixPath: (p: string) => string;
3
+ export declare const normalizeToPosixPath: (p: string | undefined) => string;
package/dist/path.js CHANGED
@@ -10,5 +10,5 @@ const isRelativePath = (test) => /^\.\.?($|[\\/])/.test(test);
10
10
  exports.isRelativePath = isRelativePath;
11
11
  const normalizeOutputPath = (s) => s.replace(/\\/g, '\\\\');
12
12
  exports.normalizeOutputPath = normalizeOutputPath;
13
- const normalizeToPosixPath = (p) => compiled_1.upath.normalizeSafe(path_1.default.normalize(p));
13
+ const normalizeToPosixPath = (p) => compiled_1.upath.normalizeSafe(path_1.default.normalize(p || ''));
14
14
  exports.normalizeToPosixPath = normalizeToPosixPath;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.7.7",
14
+ "version": "1.7.8",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/index.d.ts",
17
17
  "main": "./dist/index.js",