First development of the deploy action (#6)
Some checks failed
Lint / pre-commit Linting (push) Has been cancelled
Some checks failed
Lint / pre-commit Linting (push) Has been cancelled
Deploy js code to an instance of screeps. Some debugging tools are implemented. Reviewed-on: #6 Co-authored-by: Philipp Horstenkamp <philipp@horstenkamp.de> Co-committed-by: Philipp Horstenkamp <philipp@horstenkamp.de>
This commit is contained in:
36
node_modules/fetch-ponyfill/fetch-node.js
generated
vendored
Normal file
36
node_modules/fetch-ponyfill/fetch-node.js
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
'use strict';
|
||||
|
||||
var fetch = require('node-fetch');
|
||||
|
||||
function wrapFetchForNode(fetch) {
|
||||
// Support schemaless URIs on the server for parity with the browser.
|
||||
// https://github.com/matthew-andrews/isomorphic-fetch/pull/10
|
||||
return function (u, options) {
|
||||
if (typeof u === 'string' && u.slice(0, 2) === '//') {
|
||||
return fetch('https:' + u, options);
|
||||
}
|
||||
|
||||
return fetch(u, options);
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = function (context) {
|
||||
// Support webpack module import weirdness.
|
||||
var fetchFn = fetch.default ? fetch.default : fetch;
|
||||
|
||||
// This modifies the global `node-fetch` object, which isn't great, since
|
||||
// different callers to `fetch-ponyfill` which pass a different Promise
|
||||
// implementation would each expect to have their implementation used. But,
|
||||
// given the way `node-fetch` is implemented, this is the only way to make
|
||||
// it work at all.
|
||||
if (context && context.Promise) {
|
||||
fetchFn.Promise = context.Promise;
|
||||
}
|
||||
|
||||
return {
|
||||
fetch: wrapFetchForNode(fetchFn),
|
||||
Headers: fetch.Headers,
|
||||
Request: fetch.Request,
|
||||
Response: fetch.Response
|
||||
};
|
||||
};
|
Reference in New Issue
Block a user