'use strict';

var gpio = require('../build/Release/gpio.node');
var ts   = require('typesystem');

var isPin = function (value) {
    return ts.isUInt(value) && value <= 53;
};

exports.input = function (pin) {
    ts.check(pin, isPin);

    gpio.setAsInput(pin);

    return function () {
        return !!gpio.getLevel(pin);
    };
};

exports.output = function (pin) {
    ts.check(pin, isPin);

    gpio.setAsOutput(pin);

    return function (level) {
        gpio.setLevel(pin, !!level);
    };
};

@@ -144,12 +144,15 @@
 s.is
-U
 Int
+eger
 (val
@@ -157,16 +157,30 @@
 alue) &&
+ value %3E= 0 &&
  value %3C
@@ -226,32 +226,40 @@
 ) %7B%0A    ts.check
+Argument
 (pin, isPin);%0A%0A 
@@ -403,16 +403,24 @@
 ts.check
+Argument
 (pin, is

Fix code