<commit_before>const assertType = require('./internals/assertType')('delay');

// >>> PUBLIC <<<

module.exports = function(numberOfMs = 0) {
  assertType('Number', numberOfMs);

  return new Promise((resolve) => {
    setTimeout(resolve, numberOfMs);
  });
};
<commit_msg>Delay assert passed prop is of correct type<commit_after>// >>> PUBLIC <<<

module.exports = function(numberOfMs = 0) {
  const delay = Number(numberOfMs);
  if (Number.isNaN(delay)) {
    const tag = Object.prototype.toString.call(numberOfMs);
    throw new TypeError(`delay: expected [Number] but got ${tag}`);
  }

  return new Promise((resolve) => {
    setTimeout(resolve, numberOfMs);
  });
};

{'fraction_non_alphanumeric': 0.1664190193164933, 'fraction_numerical': 0.0029717682020802376, 'mean_word_length': 4.524590163934426, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5234095', 'n_tokens_mistral': 214, 'n_tokens_neox': 208, 'n_words': 47}