Skip to content

Commit

Permalink
chore: move copy-prototype-methods up one level
Browse files Browse the repository at this point in the history
  • Loading branch information
mroderick committed Dec 30, 2023
1 parent 88e9278 commit 3d3a038
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import throwsOnProto from "../throws-on-proto.mjs";
var call = Function.call;
import throwsOnProto from "./throws-on-proto.mjs";

var disallowedProperties = [
// ignore size because it throws from Map
Expand All @@ -22,6 +21,8 @@ if (throwsOnProto) {
* @returns {object} A new object that has the same methods of the prototype
*/
function copyPrototypeMethods(prototype) {
const call = Function.call;

// eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods
return Object.getOwnPropertyNames(prototype).reduce(function (
result,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/prototypes/array.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import copyPrototype from "./copy-prototype-methods.mjs";
import copyPrototype from "../copy-prototype-methods.mjs";

export default copyPrototype(Array.prototype);
2 changes: 1 addition & 1 deletion lib/prototypes/function.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import copyPrototype from "./copy-prototype-methods.mjs";
import copyPrototype from "../copy-prototype-methods.mjs";

export default copyPrototype(Function.prototype);
2 changes: 1 addition & 1 deletion lib/prototypes/map.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import copyPrototype from "./copy-prototype-methods.mjs";
import copyPrototype from "../copy-prototype-methods.mjs";

export default copyPrototype(Map.prototype);
2 changes: 1 addition & 1 deletion lib/prototypes/object.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import copyPrototype from "./copy-prototype-methods.mjs";
import copyPrototype from "../copy-prototype-methods.mjs";

export default copyPrototype(Object.prototype);
2 changes: 1 addition & 1 deletion lib/prototypes/set.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import copyPrototype from "./copy-prototype-methods.mjs";
import copyPrototype from "../copy-prototype-methods.mjs";

export default copyPrototype(Set.prototype);
2 changes: 1 addition & 1 deletion lib/prototypes/string.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import copyPrototype from "./copy-prototype-methods.mjs";
import copyPrototype from "../copy-prototype-methods.mjs";

export default copyPrototype(String.prototype);

0 comments on commit 3d3a038

Please sign in to comment.