Skip to content

Commit

Permalink
Drop support for Node 14 and 16 (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Oct 29, 2023
1 parent 82db894 commit 11cd91c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
fail-fast: false
matrix:
node-version:
- 21
- 20
- 18
- 16
- 14
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install
Expand Down
6 changes: 3 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export interface Options {
export type Options = {
/**
Skip modifying [non-configurable properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor#Description) instead of throwing an error.
@default false
*/
readonly ignoreNonConfigurable?: boolean;
}
};

/**
Modifies the `to` function to mimic the `from` function. Returns the `to` function.
Expand Down Expand Up @@ -44,7 +44,7 @@ console.log(wrapper.unicorn);
export default function mimicFunction<
ArgumentsType extends unknown[],
ReturnType,
FunctionType extends (...arguments: ArgumentsType) => ReturnType
FunctionType extends (...arguments: ArgumentsType) => ReturnType,
>(
to: (...arguments: ArgumentsType) => ReturnType,
from: FunctionType,
Expand Down
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ const copyProperty = (to, from, property, ignoreNonConfigurable) => {
// - it is non-writable and its value is changed
const canCopyProperty = function (toDescriptor, fromDescriptor) {
return toDescriptor === undefined || toDescriptor.configurable || (
toDescriptor.writable === fromDescriptor.writable &&
toDescriptor.enumerable === fromDescriptor.enumerable &&
toDescriptor.configurable === fromDescriptor.configurable &&
(toDescriptor.writable || toDescriptor.value === fromDescriptor.value)
toDescriptor.writable === fromDescriptor.writable
&& toDescriptor.enumerable === fromDescriptor.enumerable
&& toDescriptor.configurable === fromDescriptor.configurable
&& (toDescriptor.writable || toDescriptor.value === fromDescriptor.value)
);
};

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=14"
"node": ">=18"
},
"scripts": {
"test": "xo && ava && tsd"
Expand All @@ -38,8 +38,8 @@
"change"
],
"devDependencies": {
"ava": "^3.15.0",
"tsd": "^0.14.0",
"xo": "^0.38.2"
"ava": "^5.3.1",
"tsd": "^0.29.0",
"xo": "^0.56.0"
}
}

0 comments on commit 11cd91c

Please sign in to comment.