@@ -49,6 +49,9 @@ var isURI = require( '@stdlib/assert/is-uri' );
49
49
* @param {boolean } [options.wiki] - boolean indicating whether a repository should have a wiki
50
50
* @param {boolean } [options.downloads] - boolean indicating whether downloads should be enabled
51
51
* @param {boolean } [options.init] - boolean indicating whether to initialize the repository with an empty README
52
+ * @param {boolean } [options.allowSquashMerge] - boolean indicating whether to allow squash-merging
53
+ * @param {boolean } [options.allowMergeCommit] - boolean indicating whether to allow merging pull requests with a merge commit
54
+ * @param {boolean } [options.allowRebaseMerge] - boolean indicating whether to allow rebase-merging pull requests
52
55
* @returns {(Error|null) } error or null
53
56
*/
54
57
function validate ( opts , options ) {
@@ -137,6 +140,24 @@ function validate( opts, options ) {
137
140
return new TypeError ( 'invalid option. `init` option must be a boolean primitive. Option: `' + opts . init + '`.' ) ;
138
141
}
139
142
}
143
+ if ( hasOwnProp ( options , 'allowSquashMerge' ) ) {
144
+ opts . allowSquashMerge = options . allowSquashMerge ;
145
+ if ( ! isBoolean ( opts . allowSquashMerge ) ) {
146
+ return new TypeError ( 'invalid option. `allowSquashMerge` option must be a boolean primitive. Option: `' + opts . allowSquashMerge + '`.' ) ;
147
+ }
148
+ }
149
+ if ( hasOwnProp ( options , 'allowMergeCommit' ) ) {
150
+ opts . allowMergeCommit = options . allowMergeCommit ;
151
+ if ( ! isBoolean ( opts . allowMergeCommit ) ) {
152
+ return new TypeError ( 'invalid option. `allowMergeCommit` option must be a boolean primitive. Option: `' + opts . allowMergeCommit + '`.' ) ;
153
+ }
154
+ }
155
+ if ( hasOwnProp ( options , 'allowRebaseMerge' ) ) {
156
+ opts . allowRebaseMerge = options . allowRebaseMerge ;
157
+ if ( ! isBoolean ( opts . allowRebaseMerge ) ) {
158
+ return new TypeError ( 'invalid option. `allowRebaseMerge` option must be a boolean primitive. Option: `' + opts . allowRebaseMerge + '`.' ) ;
159
+ }
160
+ }
140
161
return null ;
141
162
}
142
163
0 commit comments