@mixd-id/web-scaffold 0.1.230406266 → 0.1.230406267

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mixd-id/web-scaffold",
3
3
  "private": false,
4
- "version": "0.1.230406266",
4
+ "version": "0.1.230406267",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
@@ -200,7 +200,7 @@ export default{
200
200
  }
201
201
 
202
202
  .tag2{
203
- @apply bg-text-50 p-1 rounded-lg px-2 cursor-pointer;
203
+ @apply bg-text-50 p-1 rounded-lg px-2 cursor-pointer whitespace-nowrap;
204
204
  @apply hover:bg-text-100 hover:text-white;
205
205
  }
206
206
 
package/src/index.js CHANGED
@@ -221,6 +221,8 @@ const util = {
221
221
  },
222
222
 
223
223
  unshift: (arr, item, opt = {}) => {
224
+ if(!Array.isArray(arr)) return
225
+
224
226
  opt = Object.assign({ key:"id", highlight:false }, opt)
225
227
 
226
228
  const index = arr.findIndex((_) => _[opt.key] === item[opt.key])
@@ -247,6 +249,8 @@ const util = {
247
249
  },
248
250
 
249
251
  removeEmpty(array, emptyValues = [ '', '{}', '[]' ]){
252
+ if(!Array.isArray(array)) return
253
+
250
254
  for (let i = array.length - 1; i >= 0; i--) {
251
255
  if (!array[i] || emptyValues.includes(JSON.stringify(array[i])) || Object.values(array[i]).join('').length <= 0){
252
256
  array.splice(i, 1);