1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | 'use strict';
|
12 |
|
13 | var path = require('path');
|
14 | require('babel-register')({
|
15 | plugins: [
|
16 | path.join(__dirname, 'require.js')
|
17 | ]
|
18 | });
|
19 | require('babel-polyfill');
|
20 |
|
21 |
|
22 | if (typeof String.prototype.toProperCase !== 'function') {
|
23 | String.prototype.toProperCase = function () {
|
24 | return this.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
|
25 | };
|
26 | }
|
27 |
|
28 |
|
29 | if (typeof String.prototype.contains !== 'function') {
|
30 | String.prototype.contains = function(str) {
|
31 | return this.indexOf(str) !== -1;
|
32 | };
|
33 | }
|
34 |
|
35 |
|
36 | if (typeof String.prototype.capitiliseFirst !== 'function') {
|
37 | String.prototype.capitiliseFirst = function () {
|
38 | if (this.length >= 2) {
|
39 | return this[0].toUpperCase() + this.substring(1);
|
40 | }
|
41 | return this;
|
42 | };
|
43 | }
|