Skip to content

Commit

Permalink
update patches
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Jun 9, 2023
1 parent c9012b4 commit d3e3dfd
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 0 deletions.
28 changes: 28 additions & 0 deletions patches/express+4.18.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/node_modules/express/lib/router/index.js b/node_modules/express/lib/router/index.js
index 5174c34..84076b7 100644
--- a/node_modules/express/lib/router/index.js
+++ b/node_modules/express/lib/router/index.js
@@ -515,12 +515,17 @@ proto.route = function route(path) {
};

// create Router#VERB functions
-methods.concat('all').forEach(function(method){
- proto[method] = function(path){
- var route = this.route(path)
- route[method].apply(route, slice.call(arguments, 1));
- return this;
- };
+methods.concat('all').forEach(function (method) {
+ Object.defineProperty(proto, method, {
+ value: function (path) {
+ var route = this.route(path)
+ route[method].apply(route, slice.call(arguments, 1));
+ return this;
+ },
+ writable: true,
+ enumerable: true,
+ configurable: true
+ });
});

// append methods to a list of methods
48 changes: 48 additions & 0 deletions patches/node-fetch+2.6.11.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
diff --git a/node_modules/node-fetch/lib/index.js b/node_modules/node-fetch/lib/index.js
index 337d6e5..75b33d4 100644
--- a/node_modules/node-fetch/lib/index.js
+++ b/node_modules/node-fetch/lib/index.js
@@ -1,3 +1,4 @@
+// @ts-nocheck
'use strict';

Object.defineProperty(exports, '__esModule', { value: true });
@@ -154,9 +155,23 @@ function FetchError(message, type, systemError) {
Error.captureStackTrace(this, this.constructor);
}

-FetchError.prototype = Object.create(Error.prototype);
-FetchError.prototype.constructor = FetchError;
-FetchError.prototype.name = 'FetchError';
+function makeErrorish(errorConstructor, name) {
+ errorConstructor.prototype = Object.create(Error.prototype, {
+ constructor: {
+ value: errorConstructor,
+ writable: true,
+ enumerable: true,
+ configurable: true
+ },
+ name: {
+ value: name,
+ writable: true,
+ enumerable: true,
+ configurable: true
+ },
+ });
+}
+makeErrorish(FetchError, 'FetchError');

let convert;
try {
@@ -1400,10 +1415,7 @@ function AbortError(message) {
// hide custom error implementation details from end-users
Error.captureStackTrace(this, this.constructor);
}
-
-AbortError.prototype = Object.create(Error.prototype);
-AbortError.prototype.constructor = AbortError;
-AbortError.prototype.name = 'AbortError';
+makeErrorish(AbortError, 'AbortError');

const URL$1 = Url.URL || whatwgUrl.URL;

25 changes: 25 additions & 0 deletions patches/rxjs+7.8.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
diff --git a/node_modules/rxjs/dist/cjs/internal/util/createErrorClass.js b/node_modules/rxjs/dist/cjs/internal/util/createErrorClass.js
index 98a6e52..815dd25 100644
--- a/node_modules/rxjs/dist/cjs/internal/util/createErrorClass.js
+++ b/node_modules/rxjs/dist/cjs/internal/util/createErrorClass.js
@@ -7,8 +7,18 @@ function createErrorClass(createImpl) {
instance.stack = new Error().stack;
};
var ctorFunc = createImpl(_super);
- ctorFunc.prototype = Object.create(Error.prototype);
- ctorFunc.prototype.constructor = ctorFunc;
+ ctorFunc.prototype = Object.create(Error.prototype, {
+ constructor: {
+ value: ctorFunc,
+ writable: true,
+ // enumerable: true would accurately preserve the behavior of the
+ // original assignment, but I'm guessing that was not intentional.
+ // For an actual error subclass, this property would not
+ // be enumerable.
+ enumerable: false,
+ configurable: true,
+ }
+ });
return ctorFunc;
}
exports.createErrorClass = createErrorClass;

0 comments on commit d3e3dfd

Please sign in to comment.