@@ -112,7 +112,7 @@ $ echo $?
112112To use the API with a callback function:
113113
114114``` js
115- var gitBranchIs = require (' git-branch-is' );
115+ const gitBranchIs = require (' git-branch-is' );
116116gitBranchIs (' main' , function (err , result ) {
117117 if (err) console .error (err);
118118 else console .log (result ? ' On main' : ' Not on main' );
@@ -123,7 +123,7 @@ Alternatively, if a callback is not provided, `gitBranchIs` will return a
123123` Promise ` :
124124
125125``` js
126- var gitBranchIs = require (' git-branch-is' );
126+ const gitBranchIs = require (' git-branch-is' );
127127gitBranchIs (' main' ).then (
128128 function (result ) { console .log (result ? ' On main' : ' Not on main' ); },
129129 function (err ) { console .error (err); }
@@ -134,7 +134,7 @@ Additionally, instead of a string, a checking function can be passed to
134134perform arbitrary checking against the branch name:
135135
136136``` js
137- var gitBranchIs = require (' git-branch-is' );
137+ const gitBranchIs = require (' git-branch-is' );
138138gitBranchIs (function (branchName ) { / ^ main$ / .test (branchName); }).then (
139139 function (result ) { console .log (result ? ' On main' : ' Not on main' ); },
140140 function (err ) { console .error (err); }
0 commit comments