@mixd-id/web-scaffold 0.1.230406040 → 0.1.230406041
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/Countdown.vue +1 -1
- package/src/utils/helpers.js +20 -1
package/package.json
CHANGED
|
@@ -124,7 +124,7 @@ export default{
|
|
|
124
124
|
},
|
|
125
125
|
|
|
126
126
|
setInitial(){
|
|
127
|
-
if(this.$refs.day) this.$refs.day.lastElementChild.innerHTML = '
|
|
127
|
+
if(this.$refs.day) this.$refs.day.lastElementChild.innerHTML = Math.floor(this.timer / 86400).toString().padStart(2, '0')
|
|
128
128
|
if(this.$refs.hour) this.$refs.hour.lastElementChild.innerHTML = (Math.floor(this.timer / 3600) % 24).toString().padStart(2, '0')
|
|
129
129
|
if(this.$refs.minute) this.$refs.minute.lastElementChild.innerHTML = (Math.floor(this.timer / 60) % 60).toString().padStart(2, '0')
|
|
130
130
|
if(this.$refs.second) this.$refs.second.lastElementChild.innerHTML = (this.timer % 60).toString().padStart(2, '0')
|
package/src/utils/helpers.js
CHANGED
|
@@ -256,6 +256,24 @@ const unflatten = (flatObject) => {
|
|
|
256
256
|
return nestedObject;
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
+
const accessNestedObject = function(obj, path) {
|
|
260
|
+
if(!obj || typeof path !== 'string') return undefined
|
|
261
|
+
|
|
262
|
+
const keys = path.split('.');
|
|
263
|
+
let nestedObj = obj;
|
|
264
|
+
|
|
265
|
+
for (let key of keys) {
|
|
266
|
+
if (nestedObj && nestedObj.hasOwnProperty(key)) {
|
|
267
|
+
nestedObj = nestedObj[key];
|
|
268
|
+
} else {
|
|
269
|
+
// Return undefined if any key in the path is missing
|
|
270
|
+
return undefined;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
return nestedObj;
|
|
275
|
+
}
|
|
276
|
+
|
|
259
277
|
|
|
260
278
|
module.exports = {
|
|
261
279
|
ceil,
|
|
@@ -274,5 +292,6 @@ module.exports = {
|
|
|
274
292
|
bufferToStream,
|
|
275
293
|
sequelizeChunk,
|
|
276
294
|
getPresetSortWhereParams,
|
|
277
|
-
unflatten
|
|
295
|
+
unflatten,
|
|
296
|
+
accessNestedObject
|
|
278
297
|
}
|