OCA_Backend/api/node_modules/validator/es/lib/isMongoId.js

6 lines
206 B
JavaScript
Raw Permalink Normal View History

2022-01-22 13:36:44 +00:00
import assertString from './util/assertString';
import isHexadecimal from './isHexadecimal';
export default function isMongoId(str) {
assertString(str);
return isHexadecimal(str) && str.length === 24;
}