// Resolves key path for given object into an event and adds it to provided fragment

'use strict';

var forEach     = require('es5-ext/object/for-each')
  , resolvePath = require('dbjs/_setup/utils/resolve-property-path')

  , hasOwnProperty = Object.prototype.hasOwnProperty
  , tokenize = resolvePath.tokenize, resolveObject = resolvePath.resolveObject;

module.exports = function (obj, path) {
	var names = tokenize(path), event
	  , propertyObj = resolveObject(obj, names)
	  , sKey = names[names.length - 1]
	  , desc = propertyObj._getDescriptor_(sKey)
	  , events = [];
	if (desc.master === obj.master) {
		event = desc._lastOwnEvent_;
		if (event) events.push(event);
	}
	if (!propertyObj.hasOwnProperty('__multiples__')) return events;
	if (!hasOwnProperty.call(propertyObj.__multiples__, sKey)) return events;
	forEach(propertyObj.__multiples__[sKey], function (item) {
		var event;
		if (!item.__id__) return;
		event = item._lastOwnEvent_;
		if (event) events.push(event);
	});
	return events;
};

@@ -5,16 +5,37 @@
 esolves 
+events for specifiec 
 key path
@@ -35,19 +35,18 @@
 ey path 
-for
+on
  given o
@@ -54,55 +54,8 @@
 ject
- into an event and adds it to provided fragment
 %0A%0A'u

Fix documentation