-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Require Node.js 18 and add TypeScript types
- Loading branch information
1 parent
0fd027f
commit ae336b0
Showing
20 changed files
with
317 additions
and
420 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = tab | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.yml] | ||
indent_style = space | ||
indent_size = 2 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: CI | ||
on: | ||
- push | ||
- pull_request | ||
jobs: | ||
test: | ||
name: Node.js ${{ matrix.node-version }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
node-version: | ||
- 20 | ||
- 18 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- run: npm install | ||
- run: npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,2 @@ | ||
.nyc_output/ | ||
coverage/ | ||
node_modules/ | ||
npm-debug.log | ||
package-lock.json | ||
node_modules | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package-lock=false |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
Merges "own" properties from a source to a destination object, including non-enumerable and accessor-defined properties. It retains original values and descriptors, ensuring the destination receives a complete and accurate copy of the source's properties. | ||
@param destination - The object to receive properties. | ||
@param source - The object providing properties. | ||
@param overwrite - Optional boolean to control overwriting of existing properties. Defaults to true. | ||
@returns The modified destination object. | ||
*/ | ||
declare function mergeDescriptors<T, U>(destination: T, source: U, overwrite?: boolean): T & U; | ||
|
||
export = mergeDescriptors; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,26 @@ | ||
/*! | ||
* merge-descriptors | ||
* Copyright(c) 2014 Jonathan Ong | ||
* Copyright(c) 2015 Douglas Christopher Wilson | ||
* MIT Licensed | ||
*/ | ||
'use strict'; | ||
|
||
'use strict' | ||
function mergeDescriptors(destination, source, overwrite = true) { | ||
if (!destination) { | ||
throw new TypeError('The `destination` argument is required.'); | ||
} | ||
|
||
/** | ||
* Module exports. | ||
* @public | ||
*/ | ||
if (!source) { | ||
throw new TypeError('The `source` argument is required.'); | ||
} | ||
|
||
module.exports = merge | ||
for (const name of Object.getOwnPropertyNames(source)) { | ||
if (!overwrite && Object.hasOwn(destination, name)) { | ||
// Skip descriptor | ||
continue; | ||
} | ||
|
||
/** | ||
* Module variables. | ||
* @private | ||
*/ | ||
// Copy descriptor | ||
const descriptor = Object.getOwnPropertyDescriptor(source, name); | ||
Object.defineProperty(destination, name, descriptor); | ||
} | ||
|
||
var hasOwnProperty = Object.prototype.hasOwnProperty | ||
|
||
/** | ||
* Merge the property descriptors of `src` into `dest` | ||
* | ||
* @param {object} dest Object to add descriptors to | ||
* @param {object} src Object to clone descriptors from | ||
* @param {boolean} [redefine=true] Redefine `dest` properties with `src` properties | ||
* @returns {object} Reference to dest | ||
* @public | ||
*/ | ||
|
||
function merge (dest, src, redefine) { | ||
if (!dest) { | ||
throw new TypeError('argument dest is required') | ||
} | ||
|
||
if (!src) { | ||
throw new TypeError('argument src is required') | ||
} | ||
|
||
if (redefine === undefined) { | ||
// Default to true | ||
redefine = true | ||
} | ||
|
||
Object.getOwnPropertyNames(src).forEach(function forEachOwnPropertyName (name) { | ||
if (!redefine && hasOwnProperty.call(dest, name)) { | ||
// Skip descriptor | ||
return | ||
} | ||
|
||
// Copy descriptor | ||
var descriptor = Object.getOwnPropertyDescriptor(src, name) | ||
Object.defineProperty(dest, name, descriptor) | ||
}) | ||
|
||
return dest | ||
return destination; | ||
} | ||
|
||
module.exports = mergeDescriptors; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
MIT License | ||
|
||
Copyright (c) Jonathan Ong <me@jongleberry.com> | ||
Copyright (c) Douglas Christopher Wilson <doug@somethingdoug.com> | ||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
Oops, something went wrong.