pp-is 1.2.6 → 1.2.7

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/README.md CHANGED
@@ -46,6 +46,11 @@ Checks if value is a Function.
46
46
 
47
47
  Checks if value is a Null.
48
48
 
49
+ ---
50
+ #### `isNil`
51
+
52
+ Checks if value is a Null or Undefined
53
+
49
54
  ---
50
55
  #### `isNumber`
51
56
 
package/README_es.md CHANGED
@@ -46,6 +46,11 @@ Verifica si el valor es una función
46
46
 
47
47
  Verifica si el valor es un nulo.
48
48
 
49
+ ---
50
+ #### `isNil`
51
+
52
+ Verifica si el valor es un nulo o no definido.
53
+
49
54
  ---
50
55
  #### `isNumber`
51
56
 
@@ -0,0 +1,11 @@
1
+ import isUndefined from "./isUndefined.js"
2
+ import isNull from "./isNull.js"
3
+ /**
4
+ * @function isNil
5
+ * @description - Check that a value is undefined or null
6
+ * @param { Any } value - Any Value
7
+ * @return {boolean}
8
+ */
9
+
10
+ const isNil = (value)=>isUndefined(value)||isNull(value)
11
+ export { isNil as default }
package/dist/pp-is.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!!
2
2
  * Power Panel pp-is <https://github.com/carlos-sweb/pp-is>
3
3
  * @author Carlos Illesca
4
- * @version 1.2.6 (2025/06/02 21:43 PM)
4
+ * @version 1.2.7 (2025/06/11 21:30 PM)
5
5
  * Released under the MIT License
6
6
  */
7
7
  import isPromise from "./main/isPromise.js"
@@ -15,6 +15,7 @@ import isDate from "./main/isDate.js"
15
15
  import isFunction from "./main/isFunction.js"
16
16
  import isUndefined from "./main/isUndefined.js"
17
17
  import isNull from "./main/isNull.js"
18
+ import isNil from "./main/isNil.js"
18
19
  import isNaN from "./main/isNaN.js"
19
20
  import isNumber from "./main/isNumber.js"
20
21
  import isEmail from "./main/isEmail.js"
@@ -61,6 +62,7 @@ import base from "./helper/base.js"
61
62
  'isObject':base(isObject),
62
63
  'isString':base(isString),
63
64
  'isUndefined':base(isUndefined),
65
+ 'isNil':base(isNil),
64
66
  'isEmail':base(isEmail),
65
67
  'isNaN':base(isNaN),
66
68
  'isRegExp':base(isRegExp),
package/dist/pp-is.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).ppIs=t()}(this,(function(){"use strict";const e=(e,t)=>(e=>Object.prototype.toString.call(e))(e)==="[object "+t+"]",t=t=>e(t,"String"),i=t=>e(t,"Array"),o=t=>e(t,"Object"),n=t=>!0===t||!1===t||e(t,"Boolean"),s=t=>e(t,"Function"),d=e=>Number.isNaN(Number.parseInt(e)),r=(e,t,i)=>{const o=e(t);return n(o)?o:i},l=e=>(t,i,o)=>((e,t,i,o)=>{const n=e(t);return n?!s(i)||r(i,t,n):!!s(o)&&r(o,t,n)})(e,t,i,o);return{isArray:l(i),isBoolean:l(n),isDate:l((t=>e(t,"Date"))),isElement:l((e=>!(!e||1!==e.nodeType))),isEmpty:l((e=>t(e)?""===e:i(e)?0==e.length:!o(e)||0===Object.keys(e).length)),isBlank:l((e=>!!t(e)&&(""===e||""===e.trim()))),isFunction:l(s),isNull:l((t=>e(t,"Null"))),isNumber:l((t=>e(t,"Number")&&!d(t))),isObject:l(o),isString:l(t),isUndefined:l((t=>e(t,"Undefined"))),isEmail:l((e=>/^([a-z1-9\._-]+)@([a-z0-9-]+\.[a-z]{2,11}|[a-z0-9]+\.[a-z]{2,24}\.[a-z]{2,24})$/i.test(e))),isNaN:l(d),isRegExp:l((t=>e(t,"RegExp"))),isUrl:l((e=>/^(https?:\/\/)?([w]{3}\.|[w]{3}2\.)?([a-z\d]+\.)?([a-z\d]+\.[a-z]{2,}|localhost|[\d]+\.[\d]+\.[\d]+\.[\d]+)(\:[\d]+)?([\??\/?]+[\/;&a-z\d%_.~+=-]*)?(\#[\/;&a-z\d%_.~+=-]*)?$/gi.test(e))),isNodeList:l((e=>"undefined"!=typeof NodeList&&NodeList.prototype.isPrototypeOf(e))),isHTMLCollection:l((e=>"undefined"!=typeof HTMLCollection&&HTMLCollection.prototype.isPrototypeOf(e))),isPromise:l((t=>e(t,"Promise")))}}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).ppIs=t()}(this,(function(){"use strict";const e=(e,t)=>(e=>Object.prototype.toString.call(e))(e)==="[object "+t+"]",t=t=>e(t,"String"),i=t=>e(t,"Array"),o=t=>e(t,"Object"),s=t=>!0===t||!1===t||e(t,"Boolean"),n=t=>e(t,"Function"),d=t=>e(t,"Undefined"),l=t=>e(t,"Null"),r=e=>Number.isNaN(Number.parseInt(e)),a=(e,t,i)=>{const o=e(t);return s(o)?o:i},p=e=>(t,i,o)=>((e,t,i,o)=>{const s=e(t);return s?!n(i)||a(i,t,s):!!n(o)&&a(o,t,s)})(e,t,i,o);return{isArray:p(i),isBoolean:p(s),isDate:p((t=>e(t,"Date"))),isElement:p((e=>!(!e||1!==e.nodeType))),isEmpty:p((e=>t(e)?""===e:i(e)?0==e.length:!o(e)||0===Object.keys(e).length)),isBlank:p((e=>!!t(e)&&(""===e||""===e.trim()))),isFunction:p(n),isNull:p(l),isNumber:p((t=>e(t,"Number")&&!r(t))),isObject:p(o),isString:p(t),isUndefined:p(d),isNil:p((e=>d(e)||l(e))),isEmail:p((e=>/^([a-z1-9\._-]+)@([a-z0-9-]+\.[a-z]{2,11}|[a-z0-9]+\.[a-z]{2,24}\.[a-z]{2,24})$/i.test(e))),isNaN:p(r),isRegExp:p((t=>e(t,"RegExp"))),isUrl:p((e=>/^(https?:\/\/)?([w]{3}\.|[w]{3}2\.)?([a-z\d]+\.)?([a-z\d]+\.[a-z]{2,}|localhost|[\d]+\.[\d]+\.[\d]+\.[\d]+)(\:[\d]+)?([\??\/?]+[\/;&a-z\d%_.~+=-]*)?(\#[\/;&a-z\d%_.~+=-]*)?$/gi.test(e))),isNodeList:p((e=>"undefined"!=typeof NodeList&&NodeList.prototype.isPrototypeOf(e))),isHTMLCollection:p((e=>"undefined"!=typeof HTMLCollection&&HTMLCollection.prototype.isPrototypeOf(e))),isPromise:p((t=>e(t,"Promise")))}}));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pp-is",
3
3
  "description": "Collection of methods for check",
4
- "version": "1.2.6",
4
+ "version": "1.2.7",
5
5
  "main": "dist/pp-is.min.js",
6
6
  "scripts": {
7
7
  "build": "rollup -c && terser -o ./dist/pp-is.min.js --compress --mangle --comments false -- ./dist/pp-is.rollup.js && rm -rf ./dist/pp-is.rollup.js",
@@ -33,7 +33,8 @@
33
33
  "isHTMLCollection",
34
34
  "isNodeList",
35
35
  "isBlank",
36
- "isPromise"
36
+ "isPromise",
37
+ "isNil"
37
38
  ],
38
39
  "author": "Carlos Illesca",
39
40
  "license": "MIT",