Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

is-unautosquashed-commit-message

shinnn9MIT-01.0.1

Check if the value is a commit message that'll be melded into another by git -i --autosquash

string, message, git, commit, fixup, squash, autosquash, autosquashable, check, if

readme

is-unautosquashed-commit-message

npm version Build Status Coverage Status

Check if a given value is a message of Git commit that'll be melded into another by git -i --autosquash:

When the commit log message begins with "squash! …​" (or "fixup! …​"), and there is a commit whose title begins with the same …​, automatically modify the todo list of rebase -i so that the commit marked for squashing comes right after the commit to be modified, and change the action of the moved commit from pick to squash (or fixup).

isUnautosquashedCommitMessage('Update README'); //=> false
isUnautosquashedCommitMessage('fixup! Update README'); //=> true

Installation

Use npm.

npm install is-unautosquashed-commit-message

API

import isUnautosquashedCommitMessage from 'is-unautosquashed-commit-message';

isUnautosquashedCommitMessage(message)

message: any type (but always return false when non-string value is passed)
Return: boolean

// Returns `true`
isUnautosquashedCommitMessage('fixup! add index.js');
isUnautosquashedCommitMessage('squash!          use Set\n\ninstead of Array');
isUnautosquashedCommitMessage(' fixup! bump version');
isUnautosquashedCommitMessage('\tsquash!\n🔧');

// Returns `false`
isUnautosquashedCommitMessage('add index.js');
isUnautosquashedCommitMessage('fixup!add index.js');
isUnautosquashedCommitMessage('squash!');
isUnautosquashedCommitMessage('fixup!                    ');
isUnautosquashedCommitMessage(['this', 'is', 'a', 'non-string', 'value']);
isUnautosquashedCommitMessage();

License

MIT No Attribution © 2019 Shinnosuke Watanabe