@ls-stack/utils 3.1.0 → 3.2.0

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.
@@ -34,15 +34,15 @@ __export(assertions_exports, {
34
34
  module.exports = __toCommonJS(assertions_exports);
35
35
  var undefErrMsg = "not undefined assertion failed";
36
36
  var nullishErrMsg = "not nullish assertion failed";
37
- function notUndefined(value, message = undefErrMsg) {
37
+ function notUndefined(value, errorMsg = undefErrMsg) {
38
38
  if (value === void 0) {
39
- throw new Error(message);
39
+ throw new Error(errorMsg);
40
40
  }
41
41
  return value;
42
42
  }
43
- function notNullish(value, message = nullishErrMsg) {
43
+ function notNullish(value, errorMsg = nullishErrMsg) {
44
44
  if (value === void 0 || value === null) {
45
- throw new Error(message);
45
+ throw new Error(errorMsg);
46
46
  }
47
47
  return value;
48
48
  }
@@ -1,8 +1,8 @@
1
1
  type NotUndefined<T> = T extends undefined ? never : T;
2
2
  type StrictNonUndefined<T, N = unknown> = undefined extends T ? NotUndefined<T> : N;
3
- declare function notUndefined<T>(value: T, message?: string): StrictNonUndefined<T>;
3
+ declare function notUndefined<T>(value: T, errorMsg?: string): StrictNonUndefined<T>;
4
4
  type StrictNonNullable<T, N = unknown> = undefined extends T ? NonNullable<T> : null extends T ? NonNullable<T> : N;
5
- declare function notNullish<T>(value: T, message?: string): StrictNonNullable<T>;
5
+ declare function notNullish<T>(value: T, errorMsg?: string): StrictNonNullable<T>;
6
6
  declare function assertIsNotNullish<T>(value: T, errorMsg?: string): asserts value is StrictNonNullable<T, never>;
7
7
  declare function assertIsNotUndefined<T>(value: T, errorMsg?: string): asserts value is StrictNonUndefined<T, never>;
8
8
  /** Use this function to assert that a certain condition is always true. */
@@ -1,8 +1,8 @@
1
1
  type NotUndefined<T> = T extends undefined ? never : T;
2
2
  type StrictNonUndefined<T, N = unknown> = undefined extends T ? NotUndefined<T> : N;
3
- declare function notUndefined<T>(value: T, message?: string): StrictNonUndefined<T>;
3
+ declare function notUndefined<T>(value: T, errorMsg?: string): StrictNonUndefined<T>;
4
4
  type StrictNonNullable<T, N = unknown> = undefined extends T ? NonNullable<T> : null extends T ? NonNullable<T> : N;
5
- declare function notNullish<T>(value: T, message?: string): StrictNonNullable<T>;
5
+ declare function notNullish<T>(value: T, errorMsg?: string): StrictNonNullable<T>;
6
6
  declare function assertIsNotNullish<T>(value: T, errorMsg?: string): asserts value is StrictNonNullable<T, never>;
7
7
  declare function assertIsNotUndefined<T>(value: T, errorMsg?: string): asserts value is StrictNonUndefined<T, never>;
8
8
  /** Use this function to assert that a certain condition is always true. */
@@ -9,7 +9,7 @@ import {
9
9
  isPromise,
10
10
  notNullish,
11
11
  notUndefined
12
- } from "./chunk-2TIVYE43.js";
12
+ } from "./chunk-3XCS7FVO.js";
13
13
  export {
14
14
  assertIsNotNullish,
15
15
  assertIsNotUndefined,
package/dist/cache.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  import "./chunk-HTCYUMDR.js";
5
5
  import {
6
6
  isPromise
7
- } from "./chunk-2TIVYE43.js";
7
+ } from "./chunk-3XCS7FVO.js";
8
8
  import "./chunk-II4R3VVX.js";
9
9
 
10
10
  // src/cache.ts
@@ -1,15 +1,15 @@
1
1
  // src/assertions.ts
2
2
  var undefErrMsg = "not undefined assertion failed";
3
3
  var nullishErrMsg = "not nullish assertion failed";
4
- function notUndefined(value, message = undefErrMsg) {
4
+ function notUndefined(value, errorMsg = undefErrMsg) {
5
5
  if (value === void 0) {
6
- throw new Error(message);
6
+ throw new Error(errorMsg);
7
7
  }
8
8
  return value;
9
9
  }
10
- function notNullish(value, message = nullishErrMsg) {
10
+ function notNullish(value, errorMsg = nullishErrMsg) {
11
11
  if (value === void 0 || value === null) {
12
- throw new Error(message);
12
+ throw new Error(errorMsg);
13
13
  }
14
14
  return value;
15
15
  }
@@ -5,7 +5,7 @@ import {
5
5
  isFunction,
6
6
  isObject,
7
7
  isPromise
8
- } from "./chunk-2TIVYE43.js";
8
+ } from "./chunk-3XCS7FVO.js";
9
9
 
10
10
  // src/tsResult.ts
11
11
  function okUnwrapOr() {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isFunction
3
- } from "./chunk-2TIVYE43.js";
3
+ } from "./chunk-3XCS7FVO.js";
4
4
 
5
5
  // src/enhancedMap.ts
6
6
  var enhancedMapReject = Symbol();
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  EnhancedMap
3
- } from "./chunk-4DCLNY64.js";
3
+ } from "./chunk-OHHF4CJZ.js";
4
4
  import {
5
5
  durationObjToMs
6
6
  } from "./chunk-5MNYPLZI.js";
7
7
  import "./chunk-HTCYUMDR.js";
8
- import "./chunk-2TIVYE43.js";
8
+ import "./chunk-3XCS7FVO.js";
9
9
  import "./chunk-II4R3VVX.js";
10
10
 
11
11
  // src/createThrottleController.ts
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  EnhancedMap,
3
3
  enhancedMapReject
4
- } from "./chunk-4DCLNY64.js";
5
- import "./chunk-2TIVYE43.js";
4
+ } from "./chunk-OHHF4CJZ.js";
5
+ import "./chunk-3XCS7FVO.js";
6
6
  export {
7
7
  EnhancedMap,
8
8
  enhancedMapReject
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isObject
3
- } from "./chunk-2TIVYE43.js";
3
+ } from "./chunk-3XCS7FVO.js";
4
4
 
5
5
  // src/getValueStableKey.ts
6
6
  function getValueStableKey(input, maxSortingDepth = 3) {
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-HTCYUMDR.js";
6
6
  import {
7
7
  invariant
8
- } from "./chunk-2TIVYE43.js";
8
+ } from "./chunk-3XCS7FVO.js";
9
9
 
10
10
  // src/interpolate.ts
11
11
  function mod(n, m) {
package/dist/main.d.ts CHANGED
@@ -11,10 +11,8 @@
11
11
  ///<reference path="enhancedMap.d.ts" />
12
12
  ///<reference path="exhaustiveMatch.d.ts" />
13
13
  ///<reference path="getValueStableKey.d.ts" />
14
- ///<reference path="internalUtils.d.ts" />
15
14
  ///<reference path="interpolate.d.ts" />
16
15
  ///<reference path="levenshtein.d.ts" />
17
- ///<reference path="main.d.ts" />
18
16
  ///<reference path="mathUtils.d.ts" />
19
17
  ///<reference path="objUtils.d.ts" />
20
18
  ///<reference path="parallelAsyncCalls.d.ts" />
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Result,
3
3
  unknownToError
4
- } from "./chunk-55DQGPY3.js";
4
+ } from "./chunk-J73KJABC.js";
5
5
  import {
6
6
  sleep
7
7
  } from "./chunk-5DZT3Z5Z.js";
@@ -9,7 +9,7 @@ import "./chunk-VAAMRG4K.js";
9
9
  import {
10
10
  invariant,
11
11
  isObject
12
- } from "./chunk-2TIVYE43.js";
12
+ } from "./chunk-3XCS7FVO.js";
13
13
 
14
14
  // src/parallelAsyncCalls.ts
15
15
  var ParallelAsyncResultCalls = class {
package/dist/testUtils.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-HTCYUMDR.js";
15
15
  import {
16
16
  isObject
17
- } from "./chunk-2TIVYE43.js";
17
+ } from "./chunk-3XCS7FVO.js";
18
18
 
19
19
  // src/testUtils.ts
20
20
  function createLoggerStore({
package/dist/tsResult.js CHANGED
@@ -4,9 +4,9 @@ import {
4
4
  ok,
5
5
  resultify,
6
6
  unknownToError
7
- } from "./chunk-55DQGPY3.js";
7
+ } from "./chunk-J73KJABC.js";
8
8
  import "./chunk-VAAMRG4K.js";
9
- import "./chunk-2TIVYE43.js";
9
+ import "./chunk-3XCS7FVO.js";
10
10
  export {
11
11
  Result,
12
12
  err,
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  isObject,
9
9
  isPlainObject
10
- } from "./chunk-2TIVYE43.js";
10
+ } from "./chunk-3XCS7FVO.js";
11
11
 
12
12
  // src/yamlStringify.ts
13
13
  function yamlStringify(obj, {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ls-stack/utils",
3
3
  "description": "Typescript utils",
4
- "version": "3.1.0",
4
+ "version": "3.2.0",
5
5
  "license": "MIT",
6
6
  "files": [
7
7
  "dist"
@@ -84,11 +84,6 @@
84
84
  "types": "./dist/getValueStableKey.d.ts",
85
85
  "require": "./dist/getValueStableKey.cjs"
86
86
  },
87
- "./internalUtils": {
88
- "import": "./dist/internalUtils.js",
89
- "types": "./dist/internalUtils.d.ts",
90
- "require": "./dist/internalUtils.cjs"
91
- },
92
87
  "./interpolate": {
93
88
  "import": "./dist/interpolate.js",
94
89
  "types": "./dist/interpolate.d.ts",
@@ -99,11 +94,6 @@
99
94
  "types": "./dist/levenshtein.d.ts",
100
95
  "require": "./dist/levenshtein.cjs"
101
96
  },
102
- "./main": {
103
- "import": "./dist/main.js",
104
- "types": "./dist/main.d.ts",
105
- "require": "./dist/main.cjs"
106
- },
107
97
  "./mathUtils": {
108
98
  "import": "./dist/mathUtils.js",
109
99
  "types": "./dist/mathUtils.d.ts",
@@ -256,18 +246,12 @@
256
246
  "getValueStableKey": [
257
247
  "./dist/getValueStableKey.d.ts"
258
248
  ],
259
- "internalUtils": [
260
- "./dist/internalUtils.d.ts"
261
- ],
262
249
  "interpolate": [
263
250
  "./dist/interpolate.d.ts"
264
251
  ],
265
252
  "levenshtein": [
266
253
  "./dist/levenshtein.d.ts"
267
254
  ],
268
- "main": [
269
- "./dist/main.d.ts"
270
- ],
271
255
  "mathUtils": [
272
256
  "./dist/mathUtils.d.ts"
273
257
  ],