@tb-dev/utils 3.0.1 → 3.0.3

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.
package/dist/index.cjs CHANGED
@@ -7,6 +7,10 @@ const float = /^\d+(?:\.(\d+))?$/;
7
7
  const regex = {
8
8
  float
9
9
  };
10
+ function isNil(value) {
11
+ return value === void 0 || value === null;
12
+ }
13
+ const isNullish = isNil;
10
14
  function upsert(array, item, predicate) {
11
15
  const index = array.findIndex(predicate ?? ((it) => it === item));
12
16
  if (index === -1) {
@@ -81,9 +85,6 @@ function isEmpty(value) {
81
85
  }
82
86
  return false;
83
87
  }
84
- function isNullish(value) {
85
- return value === void 0 || value === null;
86
- }
87
88
  const noop = () => {
88
89
  };
89
90
  function toPixel(value) {
@@ -92,9 +93,10 @@ function toPixel(value) {
92
93
  }
93
94
  return value;
94
95
  }
95
- exports.PromiseChain = PromiseSet;
96
+ exports.PromiseSet = PromiseSet;
96
97
  exports.flushPromises = flushPromises;
97
98
  exports.isEmpty = isEmpty;
99
+ exports.isNil = isNil;
98
100
  exports.isNullish = isNullish;
99
101
  exports.noop = noop;
100
102
  exports.panic = panic;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './nil';
1
2
  export * from './array';
2
3
  export * from './panic';
3
4
  export * from './regex';
@@ -14,7 +15,6 @@ export * from './promise';
14
15
  * Any other value is considered empty only if it is nullish.
15
16
  */
16
17
  export declare function isEmpty(value?: unknown): boolean;
17
- export declare function isNullish(value: unknown): value is null | undefined;
18
18
  export declare const noop: () => void;
19
19
  /** Adds the pixel unit to a value. */
20
20
  export declare function toPixel(value: string | number): string;
package/dist/index.js CHANGED
@@ -5,6 +5,10 @@ const float = /^\d+(?:\.(\d+))?$/;
5
5
  const regex = {
6
6
  float
7
7
  };
8
+ function isNil(value) {
9
+ return value === void 0 || value === null;
10
+ }
11
+ const isNullish = isNil;
8
12
  function upsert(array, item, predicate) {
9
13
  const index = array.findIndex(predicate ?? ((it) => it === item));
10
14
  if (index === -1) {
@@ -79,9 +83,6 @@ function isEmpty(value) {
79
83
  }
80
84
  return false;
81
85
  }
82
- function isNullish(value) {
83
- return value === void 0 || value === null;
84
- }
85
86
  const noop = () => {
86
87
  };
87
88
  function toPixel(value) {
@@ -91,9 +92,10 @@ function toPixel(value) {
91
92
  return value;
92
93
  }
93
94
  export {
94
- PromiseSet as PromiseChain,
95
+ PromiseSet,
95
96
  flushPromises,
96
97
  isEmpty,
98
+ isNil,
97
99
  isNullish,
98
100
  noop,
99
101
  panic,
@@ -0,0 +1 @@
1
+ export { isNil, isNullish } from './is-nil';
@@ -0,0 +1,2 @@
1
+ export declare function isNil(value: unknown): value is null | undefined;
2
+ export declare const isNullish: typeof isNil;
@@ -1,3 +1,3 @@
1
1
  export { sleep } from './sleep';
2
- export { PromiseSet as PromiseChain } from './promise-set';
2
+ export { PromiseSet } from './promise-set';
3
3
  export { flushPromises } from './flush-promises';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tb-dev/utils",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
4
4
  "description": "TypeScript utils",
5
5
  "license": "MIT",
6
6
  "type": "module",