From 11cd91c5c280452e9e69ef8aa895bc0110e4066a Mon Sep 17 00:00:00 2001 From: ehmicky Date: Sun, 29 Oct 2023 04:37:47 +0000 Subject: [PATCH] Drop support for Node 14 and 16 (#48) --- .github/workflows/main.yml | 8 ++++---- index.d.ts | 6 +++--- index.js | 8 ++++---- package.json | 8 ++++---- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d50ada6..a768beb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 diff --git a/index.d.ts b/index.d.ts index 2a72e0a..5705500 100644 --- a/index.d.ts +++ b/index.d.ts @@ -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. @@ -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, diff --git a/index.js b/index.js index bc9ef7d..9ee97a7 100644 --- a/index.js +++ b/index.js @@ -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) ); }; diff --git a/package.json b/package.json index a524b94..5b9c941 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "type": "module", "exports": "./index.js", "engines": { - "node": ">=14" + "node": ">=18" }, "scripts": { "test": "xo && ava && tsd" @@ -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" } }