cec-nuxt-lib 0.7.6 → 0.7.8
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/dist/module.json
CHANGED
|
@@ -29,10 +29,12 @@ const toTitleCase = (str) => {
|
|
|
29
29
|
.join(' ');
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
const toSentenceCase = (str) => {
|
|
32
|
+
const toSentenceCase = (str, notLast) => {
|
|
33
33
|
return !str.length
|
|
34
34
|
? ''
|
|
35
|
-
:
|
|
35
|
+
: notLast
|
|
36
|
+
? `${str[0].toUpperCase()}${str.slice(1).replace(/[-_]/g, ' ')}`
|
|
37
|
+
: `${str[0].toUpperCase()}${str.slice(1).replace(/_/g, ' ')}`;
|
|
36
38
|
};
|
|
37
39
|
|
|
38
40
|
// Make arrays of the items in the paths
|
|
@@ -54,7 +56,13 @@ let hrefs =
|
|
|
54
56
|
}, []);
|
|
55
57
|
|
|
56
58
|
// Sentence case for the breadcrumb display
|
|
57
|
-
const links = hrefs.map((e, i) =>
|
|
59
|
+
const links = hrefs.map((e, i) =>
|
|
60
|
+
!i
|
|
61
|
+
? 'Home'
|
|
62
|
+
: routeTrim.includes('digital-contact-card')
|
|
63
|
+
? toSentenceCase(e, hrefs.length - 1 - i)
|
|
64
|
+
: toSentenceCase(e, 1)
|
|
65
|
+
);
|
|
58
66
|
</script>
|
|
59
67
|
<template>
|
|
60
68
|
<div class="cec-breadcrumb-bg">
|
package/package.json
CHANGED