From ba6813f5deb4364329102176f7fc74234848905a Mon Sep 17 00:00:00 2001 From: mattkingshott Date: Fri, 16 Jul 2021 09:29:47 +0000 Subject: [PATCH] Fix styling --- src/iodine.js | 5 +---- tests/test.js | 18 +++++------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/iodine.js b/src/iodine.js index 8942583..c4f0eb7 100644 --- a/src/iodine.js +++ b/src/iodine.js @@ -357,10 +357,7 @@ export class Iodine { const ruleName = chunks.shift(); let rule = ruleName[0].toUpperCase() + ruleName.slice(1); - let result = this[`is${rule}`].apply(this, [ - value, - chunks.join(":"), - ]); + let result = this[`is${rule}`].apply(this, [value, chunks.join(":")]); if (!result) return rules[index]; } diff --git a/tests/test.js b/tests/test.js index 379b984..b83ceed 100644 --- a/tests/test.js +++ b/tests/test.js @@ -434,19 +434,11 @@ describe("validate values against multiple rules", () => { ).toBe(true); }); - test("parameter that contains semicolon(\":\")", () => { - expect( - Iodine.is(":b", ["required", "regexMatch:^:\\w$"]) - ).toBe(true); - expect( - Iodine.is("a:b", ["required", "regexMatch:^:\\w$"]) - ).not.toBe(true); - expect( - Iodine.is(":b", ["required", "regexMatch:^:\\w$"]) - ).toBe(true); - expect( - Iodine.is("a:b", ["required", "regexMatch:^:\\w$"]) - ).not.toBe(true); + test('parameter that contains semicolon(":")', () => { + expect(Iodine.is(":b", ["required", "regexMatch:^:\\w$"])).toBe(true); + expect(Iodine.is("a:b", ["required", "regexMatch:^:\\w$"])).not.toBe(true); + expect(Iodine.is(":b", ["required", "regexMatch:^:\\w$"])).toBe(true); + expect(Iodine.is("a:b", ["required", "regexMatch:^:\\w$"])).not.toBe(true); }); });