PageSourceSearch

https://www.gapvax.com/assets/js/helpers.js

js gapvax.com collected 2026-10-08 18:09:57 UTC 1,353 bytes, 54 lines download raw bytes

1function phonePattern(number){
2	var pattern = /(.*\d.*){10,}/;
3	return pattern.test(number);
4} 
5
6function TwoDigits(n){
7    return n > 9 ? "" + n: "0" + n;
8}
9
10function numberWithCommas(x) {
11    x = x.toString();
12    var pattern = /(-?\d+)(\d{3})/;
13    while (pattern.test(x))
14        x = x.replace(pattern, "$1,$2");
15    return x;
16}
17
18function validateEmail(email) {
19    var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
20    return re.test(String(email).toLowerCase());
21}
22
23function hasLocalStorage(){
24	var test = 'test';
25    try {
26        localStorage.setItem(test, test);
27        localStorage.removeItem(test);
28        return true;
29    } catch(e) {
30        return false;
31    }
32}
33
34function round(value, precision) {
35    var multiplier = Math.pow(10, precision || 0);
36    return Math.round(value * multiplier) / multiplier;
37}
38
39function capitalize(string) {
40    return string.charAt(0).toUpperCase() + string.slice(1);
41}
42
43if(typeof String.prototype.trim !== 'function') {
44  String.prototype.trim = function() {
45    return this.replace(/^\s+|\s+$/g, ''); 
46  }
47}
48
49if (!String.prototype.includes) {
50    String.prototype.includes = function() {
51        'use strict';
52        return String.prototype.indexOf.apply(this, arguments) !== -1;
53    };
54}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.