debt - enable type check in JS files (#216534)

* debt - enable type check in JS files

* fix require
This commit is contained in:
Benjamin Pasero 2024-06-18 20:30:17 +02:00 committed by GitHub
parent 03476c3864
commit ec121acd62
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View file

@ -3,9 +3,8 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
//@ts-check
'use strict';
(function () {
@ -42,6 +41,7 @@
// Identify browser environment when following property is not present
// https://nodejs.org/dist/latest-v16.x/docs/api/perf_hooks.html#performancenodetiming
// @ts-ignore
if (typeof performance === 'object' && typeof performance.mark === 'function' && !performance.nodeTiming) {
// in a browser context, reuse performance-util
@ -119,6 +119,7 @@
module.exports = _factory(sharedObj);
} else {
console.trace('perf-util defined in UNKNOWN context (neither requirejs or commonjs)');
// @ts-ignore
sharedObj.perf = _factory(sharedObj);
}

View file

@ -3,6 +3,8 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path="../../../typings/require.d.ts" />
//@ts-check
'use strict';
@ -17,6 +19,7 @@
// The property `process.uncHostAllowlist` is not available in official node.js
// releases, only in our own builds, so we have to probe for availability
// @ts-ignore
return process.uncHostAllowlist;
}
@ -113,6 +116,7 @@
return;
}
// @ts-ignore
process.restrictUNCAccess = false;
}
@ -121,6 +125,7 @@
return true;
}
// @ts-ignore
return process.restrictUNCAccess === false;
}