Skip to content

Instantly share code, notes, and snippets.

var app=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function o(t){t.forEach(e)}function r(t){return"function"==typeof t}function c(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function s(t,e){t.appendChild(e)}function i(t,e,n){t.insertBefore(e,n||null)}function u(t){t.parentNode&&t.parentNode.removeChild(t)}function a(t){return document.createElement(t)}function l(t){return document.createTextNode(t)}function d(){return l(" ")}function f(t){const e={};for(const n of t)e[n.name]=n.value;return e}let p;function h(t){p=t}const $=[],m=[];let g=[];const b=[],y=Promise.resolve();let _=!1;function x(t){g.push(t)}const v=new Set;let E=0;function k(){if(0!==E)return;const t=p;do{try{for(;E<$.length;){const t=$[E];E++,h(t),C(t.$$)}}catch(t){throw $.length=0,E=0,t}for(h(null),$.length=0,E=0;m.length;)m.pop()();for(let t=0;t<g.length;t+=1){const e=g[t];v.has(e)||(v.add(e),e())}g.length=0}while($.length);for(;b.length;)b.pop()();_=!1,v.
@re2005
re2005 / validators.js
Last active February 6, 2024 10:45
Regular expression for common validators | alpha, date, kvk number, iban, zicode (NL)
const regexps = {
alpha: '[a-zA-Z .-]+',
alphaNumeric: '[a-zA-Z0-9À-ü ,.\'-]+',
sameChars: /^(?!.*(.)\1\1+)/i,
date: /^(?:(?:(?:[0]?[1-9]|1[0-9]|2[0-8])-(?:(0)?[1-9]|1[0-2])|(?:29|30)-(?:(0)?[13-9]|1[0-2])|31-(?:(0)?[13578]|1[02]))-[1-9]\d{3}|29-(0)?2-(?:[1-9]\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00))$/,
kvkNumber: /^[0-9]{8}$/,
btwNumber: /^[A-Za-z]{2}[0-9]{9}[A-Za-z][0-9]{2}$/,
phoneMobile: /(^(\(?(0031|0|\+31)\)?){1})( ?-?(6){1}\)?)(( ?|-)?[1-9]( ?|-)?){1}(( ?|-)?[0-9]( ?|-)?){7}$/,
phoneFixedThreeDigits: /(^(\(?(0031|0|\+31)\)?){1})( ?-?([0-9]){3}\)?)(( ?|-)?[0-9]( ?|-)?){6}$/,
phoneFixedFourDigits: /(^(\(?(0031|0|\+31)\)?){1})( ?-?([0-9]){2}\)?)(( ?|-)?[0-9]( ?|-)?){7}$/,
@re2005
re2005 / jest.config.js
Last active February 23, 2020 19:42
Buefy component test
module.exports = {
setupFilesAfterEnv: ['<rootDir>/tests/unit/vueBuefy.js']
};
@re2005
re2005 / LanguageSelector.spec.ts
Last active February 23, 2020 19:36
Jest unit text for Vue typescript component using vue-i18n
import {shallowMount} from '@vue/test-utils';
import LanguageSelector from '@/components/LanguageSelector/LanguageSelector.vue';
import {LanguageService} from '@/services/language-service';
let wrapper: any;
const $i18n = {
locale: 'en'
};