pp-is 1.2.5 → 1.2.6

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
@@ -106,6 +106,24 @@ Checks if value is a valid HTMLCollection.
106
106
 
107
107
  ---
108
108
 
109
+ #### `isEmpty`
110
+
111
+ Verify that a value is not empty, in the case of a string that is not “” , in the case of an array that is not \[\] and an object that is not {}.
112
+
113
+ ---
114
+
115
+ #### `isBlank`
116
+
117
+ Check that a value is blank, which is when a string is not empty but filled with blank spaces.
118
+
119
+ ---
120
+
121
+ #### `isPromise`
122
+
123
+ Checks if value is classified as an Promise object.
124
+
125
+ ---
126
+
109
127
  ## How to use ?
110
128
 
111
129
  ```javascript
package/README_es.md CHANGED
@@ -106,6 +106,24 @@ Verifica si el valor es un HTTMLCollection valido.
106
106
 
107
107
  ---
108
108
 
109
+ #### `isEmpty`
110
+
111
+ Verifica que un valor no este vacio , en caso de una cadena que sea distinta a "" , en caso de un arreglo que sea distinoto a [] y un objecto que sea distinto a {}
112
+
113
+ ---
114
+
115
+ #### `isBlank`
116
+
117
+ Comprueba que un valor esté en blanco, lo cual ocurre cuando una cadena no está vacía, sino que está llena de espacios en blanco.
118
+
119
+ ---
120
+
121
+ #### `isPromise`
122
+
123
+ Comprueba si el valor está clasificado como un objeto Promise.
124
+
125
+ ---
126
+
109
127
  ## ¿ Como se usa ?
110
128
 
111
129
  ```javascript
@@ -0,0 +1,10 @@
1
+ import isString from "./isString.js"
2
+ /**
3
+ * @function isBlack
4
+ * @description - Check that a value is blank, which is when a string is not empty but filled with blank spaces.
5
+ * @param { Any } value - Any Value
6
+ * @return {boolean}
7
+ */
8
+
9
+ const isBlank = (value)=>isString(value) ? ( value === "" || value.trim() === "" ) : false
10
+ export { isBlank as default }
@@ -3,7 +3,7 @@ import isArray from "./isArray.js"
3
3
  import isObject from "./isObject.js"
4
4
  /**
5
5
  * @function isEmpty
6
- * @description - Checks if value is not empty
6
+ * @description - Verify that a value is not empty, in the case of a string that is not “” , in the case of an array that is not [] and an object that is not {}.
7
7
  * @param { Any } value - Any value
8
8
  * @example
9
9
  * // this a empty string
@@ -0,0 +1,9 @@
1
+ import getTypeCompare from "./../helper/getTypeCompare.js"
2
+ /**
3
+ * @function isPromise
4
+ * @description - Checks if value is classified as an Promise object.
5
+ * @param { Any } value - Any Value
6
+ * @return {boolean}
7
+ */
8
+ const isPromise = (value)=> getTypeCompare(value,"Promise")
9
+ export { isPromise as default }
package/dist/pp-is.js CHANGED
@@ -1,10 +1,12 @@
1
1
  /*!!
2
2
  * Power Panel pp-is <https://github.com/carlos-sweb/pp-is>
3
3
  * @author Carlos Illesca
4
- * @version 1.2.5 (2025/06/01 21:58 PM)
4
+ * @version 1.2.6 (2025/06/02 21:43 PM)
5
5
  * Released under the MIT License
6
6
  */
7
+ import isPromise from "./main/isPromise.js"
7
8
  import isString from "./main/isString.js"
9
+ import isBlank from "./main/isBlank.js"
8
10
  import isArray from "./main/isArray.js"
9
11
  import isObject from "./main/isObject.js"
10
12
  import isRegExp from "./main/isRegExp.js"
@@ -46,12 +48,13 @@ import base from "./helper/base.js"
46
48
  * @property {function} isFreeModule - {@link isFreeModule}
47
49
  * @property {function} getRoot - {@link getRoot}
48
50
  */
49
- const is = {
51
+ const is = {
50
52
  'isArray':base(isArray),
51
53
  'isBoolean':base(isBoolean),
52
54
  'isDate':base(isDate),
53
55
  'isElement':base(isElement),
54
56
  'isEmpty':base(isEmpty),
57
+ 'isBlank':base(isBlank),
55
58
  'isFunction':base(isFunction),
56
59
  'isNull':base(isNull),
57
60
  'isNumber':base(isNumber),
@@ -64,6 +67,7 @@ import base from "./helper/base.js"
64
67
  'isUrl':base(isUrl),
65
68
  'isNodeList':base(isNodeList),
66
69
  'isHTMLCollection':base(isHTMLCollection),
70
+ 'isPromise':base(isPromise)
67
71
  }
68
72
 
69
73
  export { is as default }
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)),l=(e,t,i)=>{const o=e(t);return n(o)?o:i},r=e=>(t,i,o)=>((e,t,i,o)=>{const n=e(t);return n?!s(i)||l(i,t,n):!!s(o)&&l(o,t,n)})(e,t,i,o);return{isArray:r(i),isBoolean:r(n),isDate:r((t=>e(t,"Date"))),isElement:r((e=>!(!e||1!==e.nodeType))),isEmpty:r((e=>t(e)?""===e:i(e)?0==e.length:!o(e)||0===Object.keys(e).length)),isFunction:r(s),isNull:r((t=>e(t,"Null"))),isNumber:r((t=>e(t,"Number")&&!d(t))),isObject:r(o),isString:r(t),isUndefined:r((t=>e(t,"Undefined"))),isEmail:r((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:r(d),isRegExp:r((t=>e(t,"RegExp"))),isUrl:r((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:r((e=>"undefined"!=typeof NodeList&&NodeList.prototype.isPrototypeOf(e))),isHTMLCollection:r((e=>"undefined"!=typeof HTMLCollection&&HTMLCollection.prototype.isPrototypeOf(e)))}}));
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")))}}));
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.5",
4
+ "version": "1.2.6",
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",
@@ -31,7 +31,9 @@
31
31
  "isRegExp",
32
32
  "isUrl",
33
33
  "isHTMLCollection",
34
- "isNodeList"
34
+ "isNodeList",
35
+ "isBlank",
36
+ "isPromise"
35
37
  ],
36
38
  "author": "Carlos Illesca",
37
39
  "license": "MIT",