Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
Swap in lodash for string manipulation and sanitization
Browse files Browse the repository at this point in the history
  • Loading branch information
sknep committed Jun 3, 2021
1 parent e2e7286 commit 135ca67
Show file tree
Hide file tree
Showing 6 changed files with 25,462 additions and 48 deletions.
6 changes: 3 additions & 3 deletions components/Breadcrumb.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

<script>
import { toTitleCase, deSlugify } from "@/utilities/formatting.js"
const _ = require('lodash');
export default {
props: {
Expand All @@ -48,15 +48,15 @@ export default {
},
computed: {
crumbs () {
const fullPath = this.$route.fullPath;
const fullPath = _.escapeRegExp(this.$route.fullPath);
const segments = fullPath.substring(1).split('/');
const crumbs = [];
let path = '';
segments.forEach((segment, index) => {
path = `${path}/${segment}`;
const match = this.$router.match(path);
crumbs.push({
title: toTitleCase(deSlugify(segment)),
title: _.startCase(segment),
...match,
});
});
Expand Down
1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ module.exports = {
collectCoverageFrom: [
'<rootDir>/components/**/*.vue',
'<rootDir>/pages/**/*.vue',
'<rootDir>/utilities/**/*.js'
],
coverageThreshold: {
global: {
Expand Down
Loading

0 comments on commit 135ca67

Please sign in to comment.