@wordpress/core-data
Version:
Access to and manipulation of core WordPress entities.
17 lines (16 loc) • 480 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isNumericID;
/**
* Checks argument to determine if it's a numeric ID.
* For example, '123' is a numeric ID, but '123abc' is not.
*
* @param {any} id the argument to determine if it's a numeric ID.
* @return {boolean} true if the string is a numeric ID, false otherwise.
*/
function isNumericID(id) {
return /^\s*\d+\s*$/.test(id);
}
//# sourceMappingURL=is-numeric-id.js.map