First commit
This commit is contained in:
19
node_modules/@ldapjs/dn/lib/utils/is-dotted-decimal.js
generated
vendored
Normal file
19
node_modules/@ldapjs/dn/lib/utils/is-dotted-decimal.js
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
'use strict'
|
||||
|
||||
const partIsNotNumeric = part => /^\d+$/.test(part) === false
|
||||
|
||||
/**
|
||||
* Determines if a passed in string is a dotted decimal string.
|
||||
*
|
||||
* @param {string} value
|
||||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
module.exports = function isDottedDecimal (value) {
|
||||
if (typeof value !== 'string') return false
|
||||
|
||||
const parts = value.split('.')
|
||||
const nonNumericParts = parts.filter(partIsNotNumeric)
|
||||
|
||||
return nonNumericParts.length === 0
|
||||
}
|
||||
Reference in New Issue
Block a user