Skip to content

Commit

Permalink
Fix linting issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
davepgreene committed Sep 3, 2017
1 parent 4df38ad commit b84ee89
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions lib/interface.js
Expand Up @@ -52,7 +52,7 @@ const implementationErrors = (identity, klass) => (obj, contract, mode) => {
* @param {Integer} mode
* @return {Interface}
*/
const Interface = (klass, m) => {
const InterfaceFactory = (klass, m) => {
if (typeof m === 'undefined') {
m = Mode.STRICT; // eslint-disable-line no-param-reassign
}
Expand Down Expand Up @@ -87,10 +87,10 @@ const Interface = (klass, m) => {
return Interface;
};

Interface.STRICT = Mode.STRICT;
Interface.LOOSE = Mode.LOOSE;
Interface.StrictInterface = klass => Interface(klass, Interface.STRICT);
Interface.LooseInterface = klass => Interface(klass, Interface.LOOSE);
InterfaceFactory.STRICT = Mode.STRICT;
InterfaceFactory.LOOSE = Mode.LOOSE;
InterfaceFactory.StrictInterface = klass => InterfaceFactory(klass, InterfaceFactory.STRICT);
InterfaceFactory.LooseInterface = klass => InterfaceFactory(klass, InterfaceFactory.LOOSE);

/**
* "Static" method to check a class against the interface it extends
Expand All @@ -102,13 +102,13 @@ Interface.LooseInterface = klass => Interface(klass, Interface.LOOSE);
* @param {Boolean} [strict] - Whether strict mode rules should apply
* @returns {boolean}
*/
Interface.check = (obj, strict) => {
InterfaceFactory.check = (obj, strict) => {
const contract = obj.interface;
const impl = Interface(contract, strict);
const impl = InterfaceFactory(contract, strict);
const mode = (strict || strict === undefined) ? Mode.STRICT : Mode.LOOSE;
const errors = impl.implementationErrors(obj.prototype, contract.prototype, mode);

return (errors.size === 0);
};

module.exports = Interface;
module.exports = InterfaceFactory;
2 changes: 1 addition & 1 deletion test/test-interface.js
Expand Up @@ -38,7 +38,7 @@ test('Loose Mode - Returns false if all methods are not implemented in the proto
TestLooseImpl.prototype.method1 = () => { };
const valid = Interface.check(TestInheritLooseImpl, false);
t.is(valid, false);
})
});

test('Strict Mode - Returns true if all methods are implemented correctly', (t) => {
TestStrictImpl.prototype.method1 = () => { };
Expand Down

0 comments on commit b84ee89

Please sign in to comment.