Initial commit

This commit is contained in:
Developer
2025-04-21 16:03:20 +02:00
commit 2832896157
22874 changed files with 3092801 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016, Jon Schlinkert.
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.

View File

@@ -0,0 +1,174 @@
'use strict';
var typeOf = require('kind-of');
var copyDescriptor = require('copy-descriptor');
var define = require('define-property');
/**
* Copy static properties, prototype properties, and descriptors from one object to another.
*
* ```js
* function App() {}
* var proto = App.prototype;
* App.prototype.set = function() {};
* App.prototype.get = function() {};
*
* var obj = {};
* copy(obj, proto);
* ```
* @param {Object} `receiver`
* @param {Object} `provider`
* @param {String|Array} `omit` One or more properties to omit
* @return {Object}
* @api public
*/
function copy(receiver, provider, omit) {
if (!isObject(receiver)) {
throw new TypeError('expected receiving object to be an object.');
}
if (!isObject(provider)) {
throw new TypeError('expected providing object to be an object.');
}
var props = nativeKeys(provider);
var keys = Object.keys(provider);
var len = props.length;
omit = arrayify(omit);
while (len--) {
var key = props[len];
if (has(keys, key)) {
define(receiver, key, provider[key]);
} else if (!(key in receiver) && !has(omit, key)) {
copyDescriptor(receiver, provider, key);
}
}
};
/**
* Return true if the given value is an object or function
*/
function isObject(val) {
return typeOf(val) === 'object' || typeof val === 'function';
}
/**
* Returns true if an array has any of the given elements, or an
* object has any of the give keys.
*
* ```js
* has(['a', 'b', 'c'], 'c');
* //=> true
*
* has(['a', 'b', 'c'], ['c', 'z']);
* //=> true
*
* has({a: 'b', c: 'd'}, ['c', 'z']);
* //=> true
* ```
* @param {Object} `obj`
* @param {String|Array} `val`
* @return {Boolean}
*/
function has(obj, val) {
val = arrayify(val);
var len = val.length;
if (isObject(obj)) {
for (var key in obj) {
if (val.indexOf(key) > -1) {
return true;
}
}
var keys = nativeKeys(obj);
return has(keys, val);
}
if (Array.isArray(obj)) {
var arr = obj;
while (len--) {
if (arr.indexOf(val[len]) > -1) {
return true;
}
}
return false;
}
throw new TypeError('expected an array or object.');
}
/**
* Cast the given value to an array.
*
* ```js
* arrayify('foo');
* //=> ['foo']
*
* arrayify(['foo']);
* //=> ['foo']
* ```
*
* @param {String|Array} `val`
* @return {Array}
*/
function arrayify(val) {
return val ? (Array.isArray(val) ? val : [val]) : [];
}
/**
* Returns true if a value has a `contructor`
*
* ```js
* hasConstructor({});
* //=> true
*
* hasConstructor(Object.create(null));
* //=> false
* ```
* @param {Object} `value`
* @return {Boolean}
*/
function hasConstructor(val) {
return isObject(val) && typeof val.constructor !== 'undefined';
}
/**
* Get the native `ownPropertyNames` from the constructor of the
* given `object`. An empty array is returned if the object does
* not have a constructor.
*
* ```js
* nativeKeys({a: 'b', b: 'c', c: 'd'})
* //=> ['a', 'b', 'c']
*
* nativeKeys(function(){})
* //=> ['length', 'caller']
* ```
*
* @param {Object} `obj` Object that has a `constructor`.
* @return {Array} Array of keys.
*/
function nativeKeys(val) {
if (!hasConstructor(val)) return [];
return Object.getOwnPropertyNames(val);
}
/**
* Expose `copy`
*/
module.exports = copy;
/**
* Expose `copy.has` for tests
*/
module.exports.has = has;

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015, Jon Schlinkert.
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.

View File

@@ -0,0 +1,77 @@
# define-property [![NPM version](https://badge.fury.io/js/define-property.svg)](http://badge.fury.io/js/define-property)
> Define a non-enumerable property on an object.
## Install
Install with [npm](https://www.npmjs.com/)
```sh
$ npm i define-property --save
```
## Usage
**Params**
* `obj`: The object on which to define the property.
* `prop`: The name of the property to be defined or modified.
* `descriptor`: The descriptor for the property being defined or modified.
```js
var define = require('define-property');
var obj = {};
define(obj, 'foo', function(val) {
return val.toUpperCase();
});
console.log(obj);
//=> {}
console.log(obj.foo('bar'));
//=> 'BAR'
```
**get/set**
```js
define(obj, 'foo', {
get: function() {},
set: function() {}
});
```
## Related projects
* [delegate-object](https://www.npmjs.com/package/delegate-object): Copy properties from an object to another object, where properties with function values will be… [more](https://www.npmjs.com/package/delegate-object) | [homepage](https://github.com/doowb/delegate-object)
* [forward-object](https://www.npmjs.com/package/forward-object): Copy properties from an object to another object, where properties with function values will be… [more](https://www.npmjs.com/package/forward-object) | [homepage](https://github.com/doowb/forward-object)
* [mixin-deep](https://www.npmjs.com/package/mixin-deep): Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone. | [homepage](https://github.com/jonschlinkert/mixin-deep)
* [mixin-object](https://www.npmjs.com/package/mixin-object): Mixin the own and inherited properties of other objects onto the first object. Pass an… [more](https://www.npmjs.com/package/mixin-object) | [homepage](https://github.com/jonschlinkert/mixin-object)
## Running tests
Install dev dependencies:
```sh
$ npm i -d && npm test
```
## Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/define-property/issues/new).
## Author
**Jon Schlinkert**
+ [github/jonschlinkert](https://github.com/jonschlinkert)
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
## License
Copyright © 2015 Jon Schlinkert
Released under the MIT license.
***
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on August 31, 2015._

View File

@@ -0,0 +1,31 @@
/*!
* define-property <https://github.com/jonschlinkert/define-property>
*
* Copyright (c) 2015, Jon Schlinkert.
* Licensed under the MIT License.
*/
'use strict';
var isDescriptor = require('is-descriptor');
module.exports = function defineProperty(obj, prop, val) {
if (typeof obj !== 'object' && typeof obj !== 'function') {
throw new TypeError('expected an object or function.');
}
if (typeof prop !== 'string') {
throw new TypeError('expected `prop` to be a string.');
}
if (isDescriptor(val) && ('set' in val || 'get' in val)) {
return Object.defineProperty(obj, prop, val);
}
return Object.defineProperty(obj, prop, {
configurable: true,
enumerable: false,
writable: true,
value: val
});
};

View File

@@ -0,0 +1,82 @@
{
"_from": "define-property@^0.2.5",
"_id": "define-property@0.2.5",
"_inBundle": false,
"_integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
"_location": "/object-copy/define-property",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "define-property@^0.2.5",
"name": "define-property",
"escapedName": "define-property",
"rawSpec": "^0.2.5",
"saveSpec": null,
"fetchSpec": "^0.2.5"
},
"_requiredBy": [
"/object-copy"
],
"_resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
"_shasum": "c35b1ef918ec3c990f9a5bc57be04aacec5c8116",
"_spec": "define-property@^0.2.5",
"_where": "D:\\developments\\teaser-inertia\\nova-components\\NovaLeader\\node_modules\\object-copy",
"author": {
"name": "Jon Schlinkert",
"url": "https://github.com/jonschlinkert"
},
"bugs": {
"url": "https://github.com/jonschlinkert/define-property/issues"
},
"bundleDependencies": false,
"dependencies": {
"is-descriptor": "^0.1.0"
},
"deprecated": false,
"description": "Define a non-enumerable property on an object.",
"devDependencies": {
"mocha": "*",
"should": "^7.0.4"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"index.js"
],
"homepage": "https://github.com/jonschlinkert/define-property",
"keywords": [
"define",
"define-property",
"enumerable",
"key",
"non",
"non-enumerable",
"object",
"prop",
"property",
"value"
],
"license": "MIT",
"main": "index.js",
"name": "define-property",
"repository": {
"type": "git",
"url": "git+https://github.com/jonschlinkert/define-property.git"
},
"scripts": {
"test": "mocha"
},
"verb": {
"related": {
"list": [
"mixin-deep",
"mixin-object",
"delegate-object",
"forward-object"
]
}
},
"version": "0.2.5"
}

View File

@@ -0,0 +1,80 @@
{
"_from": "object-copy@^0.1.0",
"_id": "object-copy@0.1.0",
"_inBundle": false,
"_integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=",
"_location": "/object-copy",
"_phantomChildren": {
"is-descriptor": "0.1.6"
},
"_requested": {
"type": "range",
"registry": true,
"raw": "object-copy@^0.1.0",
"name": "object-copy",
"escapedName": "object-copy",
"rawSpec": "^0.1.0",
"saveSpec": null,
"fetchSpec": "^0.1.0"
},
"_requiredBy": [
"/static-extend"
],
"_resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz",
"_shasum": "7e7d858b781bd7c991a41ba975ed3812754e998c",
"_spec": "object-copy@^0.1.0",
"_where": "D:\\developments\\teaser-inertia\\nova-components\\NovaLeader\\node_modules\\static-extend",
"author": {
"name": "Jon Schlinkert",
"url": "https://github.com/jonschlinkert"
},
"bugs": {
"url": "https://github.com/jonschlinkert/object-copy/issues"
},
"bundleDependencies": false,
"dependencies": {
"copy-descriptor": "^0.1.0",
"define-property": "^0.2.5",
"kind-of": "^3.0.3"
},
"deprecated": false,
"description": "Copy static properties, prototype properties, and descriptors from one object to another.",
"devDependencies": {
"gulp-format-md": "*",
"mocha": "*"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"index.js"
],
"homepage": "https://github.com/jonschlinkert/object-copy",
"keywords": [
"copy",
"object"
],
"license": "MIT",
"main": "index.js",
"name": "object-copy",
"repository": {
"type": "git",
"url": "git+https://github.com/jonschlinkert/object-copy.git"
},
"scripts": {
"test": "mocha"
},
"verb": {
"layout": "default",
"plugins": [
"gulp-format-md"
],
"related": {
"list": []
},
"reflinks": [
"verb"
]
},
"version": "0.1.0"
}