JSPM

conflicted

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q24479F
  • License MIT

Lets you check whether or not two given branches in your project would produce a conflict when attempting a merge or rebase

Package Exports

  • conflicted

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (conflicted) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

conflicted

Use this package to check if two given references (HEAD, branch name, commit hash, etc.) would produce any conflicts on a merge or rebase attempt.

Usage

npm i --save conflicted

JavaScript API:

const { conflicted, mergable } = require('conflicted');

if (mergable('master', 'feature/branch')) {
  console.log('no conflicts!');
} else {
  console.log('conflicts');
}

// or

if (conflicted('master', 'feature/branch')) {
  console.log('conflicts!');
} else {
  console.log('no conflicts');
}

in a bash script:

Make sure to install conflicted globally to use it as a CLI command (npm i -g conflicted).

#!/bin/bash

if conflicted master feature/branch
then
  echo conflicted
else
  echo mergable
fi

in npm scripts:

{
  "scripts": {
    "postversion": "mergable HEAD master && echo mergable"
  }
}

TODO

  • tests