mirror of
https://github.com/actions/github-script.git
synced 2026-10-15 20:06:55 +00:00
Move wrapRequire to its own module
This commit is contained in:
3 files changed
+116
-112
No files matched your search
@@ -0,0 +1,16 @@
|
||||
import * as path from 'path'
|
||||
|
||||
declare const __non_webpack_require__: NodeRequire
|
||||
|
||||
export const wrapRequire = new Proxy(__non_webpack_require__, {
|
||||
apply: (target, thisArg, [moduleID]) => {
|
||||
if (moduleID.startsWith('.')) {
|
||||
moduleID = path.join(process.cwd(), moduleID)
|
||||
}
|
||||
return target.apply(thisArg, [moduleID])
|
||||
},
|
||||
|
||||
get: (target, prop, receiver) => {
|
||||
Reflect.get(target, prop, receiver)
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user