REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 1.36 KB
Close
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/text-mask-addons/src/emailPipe.js
Text
Base64
const atSymbol = '@' const allAtSymbolsRegExp = /@/g const emptyString = '' const atDot = '@.' const dot = '.' const dotDot = '..' const emptyArray = [] const allDotsRegExp = /\./g export default function emailPipe(conformedValue, config) { const {currentCaretPosition, rawValue, previousConformedValue, placeholderChar} = config let value = conformedValue value = removeAllAtSymbolsButFirst(value) const indexOfAtDot = value.indexOf(atDot) const emptyEmail = rawValue.match(new RegExp(`[^@\\s.${placeholderChar}]`)) === null if (emptyEmail) { return emptyString } if ( value.indexOf(dotDot) !== -1 || indexOfAtDot !== -1 && currentCaretPosition !== (indexOfAtDot + 1) || rawValue.indexOf(atSymbol) === -1 && previousConformedValue !== emptyString && rawValue.indexOf(dot) !== -1 ) { return false } const indexOfAtSymbol = value.indexOf(atSymbol) const domainPart = value.slice(indexOfAtSymbol + 1, value.length) if ( (domainPart.match(allDotsRegExp) || emptyArray).length > 1 && value.substr(-1) === dot && currentCaretPosition !== rawValue.length ) { value = value.slice(0, value.length - 1) } return value } function removeAllAtSymbolsButFirst(str) { let atSymbolCount = 0 return str.replace(allAtSymbolsRegExp, () => { atSymbolCount++ return (atSymbolCount === 1) ? atSymbol : emptyString }) }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 5
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
createAutoCorrectedDatePipe.js
2.17 KB
lrw-r--r--
2026-02-28 00:28:20
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
createNumberMask.js
4.23 KB
lrw-r--r--
2026-02-28 00:28:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
emailMask.js
3.46 KB
lrw-r--r--
2026-02-28 00:28:26
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
emailPipe.js
1.36 KB
lrw-r--r--
2026-02-28 00:28:28
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js
197 B
lrw-r--r--
2026-02-28 00:28:28
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).