sistema creado v0.5.0
This commit is contained in:
11
api/node_modules/merge-descriptors/index.d.ts
generated
vendored
11
api/node_modules/merge-descriptors/index.d.ts
generated
vendored
@@ -1,11 +0,0 @@
|
||||
/**
|
||||
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;
|
||||
74
api/node_modules/merge-descriptors/index.js
generated
vendored
74
api/node_modules/merge-descriptors/index.js
generated
vendored
@@ -1,26 +1,60 @@
|
||||
'use strict';
|
||||
/*!
|
||||
* merge-descriptors
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
function mergeDescriptors(destination, source, overwrite = true) {
|
||||
if (!destination) {
|
||||
throw new TypeError('The `destination` argument is required.');
|
||||
}
|
||||
'use strict'
|
||||
|
||||
if (!source) {
|
||||
throw new TypeError('The `source` argument is required.');
|
||||
}
|
||||
/**
|
||||
* Module exports.
|
||||
* @public
|
||||
*/
|
||||
|
||||
for (const name of Object.getOwnPropertyNames(source)) {
|
||||
if (!overwrite && Object.hasOwn(destination, name)) {
|
||||
// Skip descriptor
|
||||
continue;
|
||||
}
|
||||
module.exports = merge
|
||||
|
||||
// Copy descriptor
|
||||
const descriptor = Object.getOwnPropertyDescriptor(source, name);
|
||||
Object.defineProperty(destination, name, descriptor);
|
||||
}
|
||||
/**
|
||||
* Module variables.
|
||||
* @private
|
||||
*/
|
||||
|
||||
return destination;
|
||||
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
|
||||
}
|
||||
|
||||
module.exports = mergeDescriptors;
|
||||
|
||||
26
api/node_modules/merge-descriptors/license
generated
vendored
26
api/node_modules/merge-descriptors/license
generated
vendored
@@ -1,11 +1,23 @@
|
||||
MIT License
|
||||
(The 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)
|
||||
Copyright (c) 2013 Jonathan Ong <me@jongleberry.com>
|
||||
Copyright (c) 2015 Douglas Christopher Wilson <doug@somethingdoug.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:
|
||||
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 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.
|
||||
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.
|
||||
|
||||
85
api/node_modules/merge-descriptors/package.json
generated
vendored
85
api/node_modules/merge-descriptors/package.json
generated
vendored
@@ -1,50 +1,39 @@
|
||||
{
|
||||
"name": "merge-descriptors",
|
||||
"version": "2.0.0",
|
||||
"description": "Merge objects using their property descriptors",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/merge-descriptors",
|
||||
"funding": "https://github.com/sponsors/sindresorhus",
|
||||
"contributors": [
|
||||
"Jonathan Ong <me@jongleberry.com>",
|
||||
"Douglas Christopher Wilson <doug@somethingdoug.com>",
|
||||
"Mike Grabowski <grabbou@gmail.com>",
|
||||
"Sindre Sorhus <sindresorhus@gmail.com>"
|
||||
],
|
||||
"exports": {
|
||||
"types": "./index.d.ts",
|
||||
"default": "./index.js"
|
||||
},
|
||||
"main": "./index.js",
|
||||
"types": "./index.d.ts",
|
||||
"sideEffects": false,
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"merge",
|
||||
"descriptors",
|
||||
"object",
|
||||
"property",
|
||||
"properties",
|
||||
"merging",
|
||||
"getter",
|
||||
"setter"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "^5.3.1",
|
||||
"xo": "^0.56.0"
|
||||
},
|
||||
"xo": {
|
||||
"rules": {
|
||||
"unicorn/prefer-module": "off"
|
||||
}
|
||||
}
|
||||
"name": "merge-descriptors",
|
||||
"description": "Merge objects using descriptors",
|
||||
"version": "1.0.3",
|
||||
"author": {
|
||||
"name": "Jonathan Ong",
|
||||
"email": "me@jongleberry.com",
|
||||
"url": "http://jongleberry.com",
|
||||
"twitter": "https://twitter.com/jongleberry"
|
||||
},
|
||||
"contributors": [
|
||||
"Douglas Christopher Wilson <doug@somethingdoug.com>",
|
||||
"Mike Grabowski <grabbou@gmail.com>"
|
||||
],
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/merge-descriptors",
|
||||
"funding": "https://github.com/sponsors/sindresorhus",
|
||||
"devDependencies": {
|
||||
"eslint": "5.9.0",
|
||||
"eslint-config-standard": "12.0.0",
|
||||
"eslint-plugin-import": "2.14.0",
|
||||
"eslint-plugin-node": "7.0.1",
|
||||
"eslint-plugin-promise": "4.0.1",
|
||||
"eslint-plugin-standard": "4.0.0",
|
||||
"mocha": "5.2.0",
|
||||
"nyc": "13.1.0"
|
||||
},
|
||||
"files": [
|
||||
"HISTORY.md",
|
||||
"LICENSE",
|
||||
"README.md",
|
||||
"index.js"
|
||||
],
|
||||
"scripts": {
|
||||
"lint": "eslint .",
|
||||
"test": "mocha test/",
|
||||
"test-cov": "nyc --reporter=html --reporter=text npm test"
|
||||
}
|
||||
}
|
||||
|
||||
66
api/node_modules/merge-descriptors/readme.md
generated
vendored
66
api/node_modules/merge-descriptors/readme.md
generated
vendored
@@ -1,55 +1,49 @@
|
||||
# merge-descriptors
|
||||
|
||||
> Merge objects using their property descriptors
|
||||
[![NPM Version][npm-image]][npm-url]
|
||||
[![NPM Downloads][downloads-image]][downloads-url]
|
||||
[![Build Status][travis-image]][travis-url]
|
||||
[![Test Coverage][coveralls-image]][coveralls-url]
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
npm install merge-descriptors
|
||||
```
|
||||
|
||||
## Usage
|
||||
Merge objects using descriptors.
|
||||
|
||||
```js
|
||||
import mergeDescriptors from 'merge-descriptors';
|
||||
|
||||
const thing = {
|
||||
get name() {
|
||||
return 'John'
|
||||
}
|
||||
var thing = {
|
||||
get name() {
|
||||
return 'jon'
|
||||
}
|
||||
}
|
||||
|
||||
const animal = {};
|
||||
var animal = {
|
||||
|
||||
mergeDescriptors(animal, thing);
|
||||
}
|
||||
|
||||
console.log(animal.name);
|
||||
//=> 'John'
|
||||
merge(animal, thing)
|
||||
|
||||
animal.name === 'jon'
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### merge(destination, source, overwrite?)
|
||||
### merge(destination, source)
|
||||
|
||||
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.
|
||||
Redefines `destination`'s descriptors with `source`'s. The return value is the
|
||||
`destination` object.
|
||||
|
||||
Returns the modified destination object.
|
||||
### merge(destination, source, false)
|
||||
|
||||
#### destination
|
||||
Defines `source`'s descriptors on `destination` if `destination` does not have
|
||||
a descriptor by the same name. The return value is the `destination` object.
|
||||
|
||||
Type: `object`
|
||||
## License
|
||||
|
||||
The object to receive properties.
|
||||
[MIT](LICENSE)
|
||||
|
||||
#### source
|
||||
|
||||
Type: `object`
|
||||
|
||||
The object providing properties.
|
||||
|
||||
#### overwrite
|
||||
|
||||
Type: `boolean`\
|
||||
Default: `true`
|
||||
|
||||
A boolean to control overwriting of existing properties.
|
||||
[npm-image]: https://img.shields.io/npm/v/merge-descriptors.svg
|
||||
[npm-url]: https://npmjs.org/package/merge-descriptors
|
||||
[travis-image]: https://img.shields.io/travis/component/merge-descriptors/master.svg
|
||||
[travis-url]: https://travis-ci.org/component/merge-descriptors
|
||||
[coveralls-image]: https://img.shields.io/coveralls/component/merge-descriptors/master.svg
|
||||
[coveralls-url]: https://coveralls.io/r/component/merge-descriptors?branch=master
|
||||
[downloads-image]: https://img.shields.io/npm/dm/merge-descriptors.svg
|
||||
[downloads-url]: https://npmjs.org/package/merge-descriptors
|
||||
|
||||
Reference in New Issue
Block a user