Comparing version 0.3.1 to 0.3.2
@@ -12,4 +12,17 @@ /* | ||
var fs = require('fs'); | ||
var inherits = require('util').inherits; | ||
inherit(Native.FSEvents, EventEmitter); | ||
function FSEvents(path, handler) { | ||
EventEmitter.call(this); | ||
Object.defineProperty(this, '_impl', { | ||
value: new Native.FSEvents(String(path || ''), handler), | ||
enumerable: false, | ||
writable: false | ||
}); | ||
} | ||
inherits(FSEvents, EventEmitter); | ||
proxies(FSEvents, Native.FSEvents); | ||
module.exports = watch; | ||
@@ -21,3 +34,3 @@ module.exports.getInfo = getInfo; | ||
function watch(path) { | ||
var fse = new Native.FSEvents(String(path || ''), handler); | ||
var fse = new FSEvents(String(path || ''), handler); | ||
EventEmitter.call(fse); | ||
@@ -45,21 +58,14 @@ return fse; | ||
function inherit(ctor, superCtor) { | ||
ctor.super_ = superCtor; | ||
var proto = Object.create(superCtor.prototype, { | ||
constructor: { | ||
value: ctor, | ||
enumerable: false, | ||
writable: true, | ||
configurable: true | ||
function proxies(ctor, target) { | ||
for (var key in target.prototype) { | ||
if (typeof target.prototype[key] !== 'function') { | ||
continue; | ||
} | ||
}); | ||
Object.keys(ctor.prototype).forEach(function(key) { | ||
Object.defineProperty(proto, key, { | ||
value: ctor.prototype[key], | ||
writable: true, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
}); | ||
ctor.prototype = proto; | ||
ctor.prototype[key] = function() { | ||
console.log('invoke', key); | ||
this._impl[key].apply(this._impl, arguments); | ||
return this; | ||
} | ||
} | ||
} | ||
@@ -66,0 +72,0 @@ |
{ | ||
"name": "fsevents", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Native Access to Mac OS-X FSEvents", | ||
"main": "fsevents.js", | ||
"dependencies": { | ||
"nan": "~1.3.0" | ||
"nan": "~1.5.0" | ||
}, | ||
@@ -9,0 +9,0 @@ "os": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26410
189
+ Addednan@1.5.3(transitive)
- Removednan@1.3.0(transitive)
Updatednan@~1.5.0