Files
ldap-to-oauth2/node_modules/@ldapjs/dn/lib/utils/is-dotted-decimal.js
2025-10-08 11:12:59 -04:00

20 lines
432 B
JavaScript

'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
}