@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 +1 -1
- package/src/components/TextWithTag.vue +1 -1
- package/src/index.js +4 -0
package/package.json
CHANGED
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);
|