Sha256: b1b2b3e0c5a82ad83960acb785a7680b874d9cbd74b4ba0303bf802153bb48f4

Contents?: true

Size: 396 Bytes

Versions: 4

Compression:

Stored size: 396 Bytes

Contents

window.Set ?= class Set
  constructor: ->
    @clear()

  clear: ->
    @values = []

  has: (value) ->
    @values.indexOf(value) isnt -1

  add: (value) ->
    unless @has(value)
      @values.push(value)
    this

  delete: (value) ->
    if (index = @values.indexOf(value)) is -1
      false
    else
      @values.splice(index, 1)
      true

  forEach: ->
    @values.forEach(arguments...)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vapid-0.1.3 lib/vapid/vendor/trix/polyfills/set.coffee
vapid-0.1.2 lib/vapid/vendor/trix/polyfills/set.coffee
vapid-0.1.1 lib/vapid/vendor/trix/polyfills/set.coffee
vapid-0.1.0 lib/vapid/vendor/trix/polyfills/set.coffee