forked from InfomediaLtd/ag-grid-ng2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
agGridPropertiesCheck.js
32 lines (27 loc) · 1.4 KB
/
agGridPropertiesCheck.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// satisfy ag-grid HTMLElement dependency
HTMLElement = typeof HTMLElement === 'undefined' ? function () {} : HTMLElement;
HTMLSelectElement = typeof HTMLSelectElement === 'undefined' ? function () {} : HTMLSelectElement;
HTMLInputElement = typeof HTMLInputElement === 'undefined' ? function () {} : HTMLInputElement;
HTMLButtonElement = typeof HTMLButtonElement === 'undefined' ? function () {} : HTMLButtonElement;
var {AgGridNg2} = require('./dist/agGridNg2');
var {ComponentUtil} = require("ag-grid/main");
var missingProperties = [];
ComponentUtil.ALL_PROPERTIES.forEach((property) => {
if (!AgGridNg2.propDecorators.hasOwnProperty(property)) {
missingProperties.push(`Grid property ${property} does not exist on AgGridNg2`)
}
});
var missingEvents = [];
ComponentUtil.EVENTS.forEach((event) => {
if (!AgGridNg2.propDecorators.hasOwnProperty(event)) {
missingEvents.push(`Grid event ${event} does not exist on AgGridNg2`)
}
});
if(missingProperties.length || missingEvents.length) {
console.error("*************************** BUILD FAILED ***************************");
missingProperties.concat(missingEvents).forEach((message) => console.error(message));
console.error("*************************** BUILD FAILED ***************************");
throw("Build Properties Check Failed");
} else {
console.info("*************************** BUILD OK ***************************");
}