 isFunction      = require 'util-ex/lib/is/type/function'
 defineProperty  = require 'util-ex/lib/defineProperty'
 getObjectKeys   = Object.keys
+getOwnPropertyNames = Object.getOwnPropertyNames
 
 ###
   Usage 1:

      aExclude = []
    for k, v of vNames
      continue if v in aExclude
      #continue if aSerialized and (k[0] is '$')
      vAttr = @[k]
      vValue = src[v] || src[k]
      if k is 'name'

      type: 'Boolean'
###
module.exports = class AbstractTypeAttributes
  merge: (attrs)->@mergeTo attrs, @
  mergeTo: (attrs, dest)->
    for name, attr of attrs
      attr = type:attr if isString attr
      vAttr = dest[name]
      if vAttr is undefined
        dest[name] = attr
      else
        vAttr[k] = v for k, v of attr
    return dest
  _initialize: (aOptions)-> @merge(aOptions)
  initialize: (aOptions)->
    @_initialize(aOptions)
