Sha256: 05ac9d4e05825f158b87a3b8928461aed30777d1530296cab519b636e8ec72e0
Contents?: true
Size: 823 Bytes
Versions: 2
Compression:
Stored size: 823 Bytes
Contents
import message from '@commitlint/message'; export const headerTrim = (parsed) => { const { header } = parsed; if (!header) { return [true]; } const startsWithWhiteSpace = header !== header.trimStart(); const endsWithWhiteSpace = header !== header.trimEnd(); switch (true) { case startsWithWhiteSpace && endsWithWhiteSpace: return [ false, message(['header', 'must not be surrounded by whitespace']), ]; case startsWithWhiteSpace: return [false, message(['header', 'must not start with whitespace'])]; case endsWithWhiteSpace: return [false, message(['header', 'must not end with whitespace'])]; default: return [true]; } }; //# sourceMappingURL=header-trim.js.map
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
pcp-server-ruby-sdk-0.0.6 | node_modules/@commitlint/rules/lib/header-trim.js |
pcp-server-ruby-sdk-0.1.0 | node_modules/@commitlint/rules/lib/header-trim.js |