Based on urlregex.com
Validate email syntax in JavaScript
| Is valid |
|---|
| import fs from "fs"; | |
| import dotenv from "dotenv"; | |
| import { fileURLToPath } from "url"; | |
| import path from "path"; | |
| const referenceFiles = [ | |
| ".env.development", | |
| ".env.local", | |
| ".env.production", | |
| ".env", |
| // Currency | |
| function useCurrencyFormat() { | |
| const { code, currency } = useCountryContext(); | |
| const options: Intl.NumberFormatOptions = { | |
| style: 'currency', | |
| currency, | |
| minimumFractionDigits: 0, | |
| maximumFractionDigits: 2, | |
| }; |
| import { Action } from 'redux/store-types'; | |
| import { Dispatch, MiddlewareAPI, Store } from 'redux'; | |
| export const authMiddleware = (_api: MiddlewareAPI<Store<void>>) => ( | |
| next: Dispatch<void> | |
| ) => <A extends Action>(action: A) => { | |
| return next(action); | |
| }; |
Validate email syntax in JavaScript
| Is valid |
|---|
| const arrayMove = (array, from, to) => { | |
| // Clone the original array | |
| let newArray = array.slice(); | |
| // Get the item that will be moved | |
| const movingItem = newArray.splice(from, 1)[0]; | |
| // Replace that item in the 'to' position | |
| newArray.splice(to, 0, movingItem); | |
| return newArray; | |
| }; |
| /** | |
| * Create permutations from two or more given list | |
| * Based on Heap's Algorithm | |
| */ | |
| function permutations() { | |
| var r = [], arg = arguments, max = arg.length-1; | |
| function helper(arr, i) { | |
| for (var j=0, l=arg[i].length; j<l; j++) { | |
| var a = arr.slice(0); // clone arr | |
| a.push(arg[i][j]); |
| if not exist "C:\mongodb\data\db\" mkdir C:\mongodb\data\db | |
| if not exist "C:\mongodb\data\log\" mkdir C:\mongodb\data\log | |
| @echo off | |
| :: Update the 3.4 if you have another version | |
| cd C:\Program Files\MongoDB\Server\3.4\bin | |
| ::set default port variable | |
| set port=27017 | |
| :: add this line at the end of the ~mongod.exe to write the log on a separated file |
| var gulp = require('gulp'); | |
| var iconfont = require('gulp-iconfont'); | |
| var iconfontCss = require('gulp-iconfont-css'); | |
| var ICONFONT = 'font-file-name'; | |
| // Working Dir | |
| var APP = { | |
| FOLDER: APPFOLDER, | |
| ICONS: APPFOLDER+'/src/icons', |