UNPKG

961 BSource Map (JSON)View Raw
1{"version":3,"sources":["../src/subject-full-stop.js"],"names":["parsed","when","value","input","subject","negated","hasStop","length"],"mappings":";;;;;;AAAA;;;;;;kBAEe,UAACA,MAAD,EAASC,IAAT,EAAeC,KAAf,EAAyB;AACvC,KAAMC,QAAQH,OAAOI,OAArB;;AAEA,KAAI,CAACD,KAAL,EAAY;AACX,SAAO,CAAC,IAAD,CAAP;AACA;;AAED,KAAME,UAAUJ,SAAS,OAAzB;AACA,KAAMK,UAAUH,MAAMA,MAAMI,MAAN,GAAe,CAArB,MAA4BL,KAA5C;;AAEA,QAAO,CACNG,UAAU,CAACC,OAAX,GAAqBA,OADf,EAEN,uBAAQ,CAAC,SAAD,EAAYD,UAAU,SAAV,GAAsB,MAAlC,EAA0C,oBAA1C,CAAR,CAFM,CAAP;AAIA,C","file":"subject-full-stop.js","sourcesContent":["import message from '@commitlint/message';\n\nexport default (parsed, when, value) => {\n\tconst input = parsed.subject;\n\n\tif (!input) {\n\t\treturn [true];\n\t}\n\n\tconst negated = when === 'never';\n\tconst hasStop = input[input.length - 1] === value;\n\n\treturn [\n\t\tnegated ? !hasStop : hasStop,\n\t\tmessage(['message', negated ? 'may not' : 'must', 'end with full stop'])\n\t];\n};\n"]}
\No newline at end of file