UNPKG

node-nlp

Version:

Library for NLU (Natural Language Understanding) done in Node.js

13 lines (9 loc) 282 B
import absFloor from './abs-floor'; export default function toInt(argumentForCoercion) { var coercedNumber = +argumentForCoercion, value = 0; if (coercedNumber !== 0 && isFinite(coercedNumber)) { value = absFloor(coercedNumber); } return value; }