Skip to content

Commit 9b9ca25

Browse files
Better detect dupplicate declarations of the same interface
* Ignore required * Ignore collection * Ignore description Only properties / parameters should determine if the interface is the same
1 parent f304ea6 commit 9b9ca25

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lib/dynamic-param-interfaces.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,13 @@ const flushParamInterfaces = (API, addToOutput) => {
7373
return
7474
}
7575
if (declared[paramKey]) {
76-
if (!_.isEqual(paramInterfacesToDeclare[paramKey], declared[paramKey])) {
76+
const toDeclareCheck = Object.assign({}, paramInterfacesToDeclare[paramKey])
77+
const declaredCheck = Object.assign({}, declared[paramKey])
78+
for (const prop of ['type', 'collection', 'required', 'description']) {
79+
delete toDeclareCheck[prop]
80+
delete declaredCheck[prop]
81+
}
82+
if (!_.isEqual(toDeclareCheck, declaredCheck)) {
7783
throw new Error('Ruh roh, "' + paramKey + '" is already declared')
7884
}
7985
delete paramInterfacesToDeclare[paramKey]

vendor/fetch-docs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const mkdirp = require('mkdirp').sync
77
const os = require('os')
88

99
const downloadPath = path.join(os.tmpdir(), 'electron-api-tmp')
10-
const ELECTRON_COMMIT = 'cb3c5ded0f99a15edc99b61d227d135f7c3521c8'
10+
const ELECTRON_COMMIT = 'f469059e9059aa0bda756022deb53322688dac29'
1111

1212
rm(downloadPath)
1313

0 commit comments

Comments
 (0)