<commit_before>var resolve = require('./resolve')
var LazyWatcher = require('./lib/lazy-watcher')
var isSame = require('./lib/is-same')
var addCollectionMethods = require('./lib/add-collection-methods')
var onceIdle = require('./once-idle')

module.exports = Map

function Map (obs, lambda, opts) {
  // opts: comparer, maxTime, onRemove

  var comparer = opts && opts.comparer || null
  var releases = []
  var binder = LazyWatcher(update, listen, unlisten)

  if (opts && opts.nextTick) binder.nextTick = true
  if (opts && opts.idle) binder.idle = true

  var itemInvalidators = new global.Map()
  var lastValues = new global.Map()
  var rawSet = new global.Set()

  var items = []

  var raw = []
  var values = []
  var watches = []

  binder.value = values

  // incremental update
  var queue = []
  var maxTime = null
  if (opts && opts.maxTime) {<commit_msg>map: throw early error when lambda not provided<commit_after>var resolve = require('./resolve')
var LazyWatcher = require('./lib/lazy-watcher')
var isSame = require('./lib/is-same')
var addCollectionMethods = require('./lib/add-collection-methods')
var onceIdle = require('./once-idle')

module.exports = Map

function Map (obs, lambda, opts) {
  // opts: comparer, maxTime, onRemove

  if (typeof lambda !== 'function') throw new Error('mutant/map lambda must be a function')

  var comparer = opts && opts.comparer || null
  var releases = []
  var binder = LazyWatcher(update, listen, unlisten)

  if (opts && opts.nextTick) binder.nextTick = true
  if (opts && opts.idle) binder.idle = true

  var itemInvalidators = new global.Map()
  var lastValues = new global.Map()
  var rawSet = new global.Set()

  var items = []

  var raw = []
  var values = []
  var watches = []

  binder.value = values

  // incremental update
  var queue = []
  var maxTime = null
  if (opts && opts.maxTime) {
{'fraction_non_alphanumeric': 0.14024717893605587, 'fraction_numerical': 0.0, 'mean_word_length': 3.5304136253041363, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1380886', 'n_tokens_mistral': 596, 'n_tokens_neox': 578, 'n_words': 179}