Skip to content

Commit

Permalink
Add a method to the String prototype to trim internal white space
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-white committed Sep 4, 2018
1 parent 301aaf2 commit e26cd49
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ import { router } from '../lib/router';
import { setHttp } from './http';
import './assertions';

// "iTrim" for "internally trim"
// eslint-disable-next-line no-extend-native
String.prototype.iTrim = function iTrim() {
return this.replace(/\s+/g, ' ');
};

Vue.prototype.$alert = function $alert() {
const component = closestComponentWithAlert(this);
return component != null
Expand Down

0 comments on commit e26cd49

Please sign in to comment.