to-assigned 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.mjs +1 -1
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@ Create a new object, array, function, or special object by copying enumerable pr
|
|
|
4
4
|
|
|
5
5
|
> Recommended: set "type": "module" in your package.json to use this module with ES6 imports.
|
|
6
6
|
|
|
7
|
+
For more awesome packages, check out [my homepage💛](https://baendlorel.github.io/?repoType=npm)
|
|
8
|
+
|
|
7
9
|
## Features
|
|
8
10
|
|
|
9
11
|
- Does not modify the sources.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
// # index.d.ts
|
|
1
2
|
/**
|
|
3
|
+
* ## Usage
|
|
2
4
|
* Creates a new object, array, function, or special object with properties from the provided sources.
|
|
3
5
|
* Prototype and type are determined by the first non-primitive source (see below):
|
|
4
6
|
*
|
|
@@ -14,6 +16,15 @@
|
|
|
14
16
|
* - Only enumerable properties (including symbol keys) are copied from all sources.
|
|
15
17
|
*
|
|
16
18
|
* @returns A new object, array, function, or special object with merged properties and inherited prototype/type.
|
|
19
|
+
*
|
|
20
|
+
* ## About
|
|
21
|
+
* @package ToAssigned
|
|
22
|
+
* @author KasukabeTsumugi <futami16237@gmail.com>
|
|
23
|
+
* @version 1.1.3 (Last Update: 2025.08.15 01:31:39.237)
|
|
24
|
+
* @license MIT
|
|
25
|
+
* @link git+https://github.com/baendlorel/to-assigned.git
|
|
26
|
+
* @description Like Object.assign but will return a new object and ignores non-object arguments.
|
|
27
|
+
* @copyright Copyright (c) 2025 KasukabeTsumugi. All rights reserved.
|
|
17
28
|
*/
|
|
18
29
|
declare function toAssigned(...sources: any[]): any;
|
|
19
30
|
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=Reflect.ownKeys,t=Reflect.setPrototypeOf,n=Reflect.getPrototypeOf,o=Object.prototype.propertyIsEnumerable,c=Array.isArray,f=Reflect.defineProperty,r=e=>null!==e&&("object"==typeof e||"function"==typeof e);function a(e){const o=e.find(r);if(!o)return{};const a=n(o);let i;if(c(o))i=[];else if("function"==typeof o){let e;(e=>{try{return new new Proxy(e,{construct:()=>({})}),!1}catch{return!0}})(o)?e=(...e)=>o(...e):(e=function(...e){return o(...e)},e.bind=(e,...t)=>o.bind(e,...t)),f(e,"name",{value:o.name,configurable:!0}),f(e,"length",{value:o.length,configurable:!0}),i=e}else i=o instanceof Map?new Map(o.entries()):o instanceof Set?new Set(o.values()):o instanceof WeakMap?new WeakMap:o instanceof WeakSet?new WeakSet:o instanceof Date?new Date(o.getTime()):{};return t(i,a),i}function i(...t){if(0===t.length)return{};const n=a(t);for(let c=0;c<t.length;c++){const f=t[c];if(f&&"object"==typeof f)for(const t of e(f))o.call(f,t)&&(n[t]=f[t])}return n}Reflect.set(i,Symbol("version"),"
|
|
1
|
+
const e=Reflect.ownKeys,t=Reflect.setPrototypeOf,n=Reflect.getPrototypeOf,o=Object.prototype.propertyIsEnumerable,c=Array.isArray,f=Reflect.defineProperty,r=e=>null!==e&&("object"==typeof e||"function"==typeof e);function a(e){const o=e.find(r);if(!o)return{};const a=n(o);let i;if(c(o))i=[];else if("function"==typeof o){let e;(e=>{try{return new new Proxy(e,{construct:()=>({})}),!1}catch{return!0}})(o)?e=(...e)=>o(...e):(e=function(...e){return o(...e)},e.bind=(e,...t)=>o.bind(e,...t)),f(e,"name",{value:o.name,configurable:!0}),f(e,"length",{value:o.length,configurable:!0}),i=e}else i=o instanceof Map?new Map(o.entries()):o instanceof Set?new Set(o.values()):o instanceof WeakMap?new WeakMap:o instanceof WeakSet?new WeakSet:o instanceof Date?new Date(o.getTime()):{};return t(i,a),i}function i(...t){if(0===t.length)return{};const n=a(t);for(let c=0;c<t.length;c++){const f=t[c];if(f&&"object"==typeof f)for(const t of e(f))o.call(f,t)&&(n[t]=f[t])}return n}Reflect.set(i,Symbol("version"),"__VERSION__");export{i as toAssigned};
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "to-assigned",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "KasukabeTsumugi",
|
|
6
6
|
"email": "futami16237@gmail.com"
|
|
7
7
|
},
|
|
8
8
|
"description": "Like Object.assign but will return a new object and ignores non-object arguments.",
|
|
9
|
+
"description_zh": "类似于Object.assign,但会返回一个新对象,并忽略非对象的入参",
|
|
9
10
|
"type": "module",
|
|
10
11
|
"exports": {
|
|
11
12
|
"import": "./dist/index.mjs",
|
|
@@ -48,6 +49,7 @@
|
|
|
48
49
|
"@rollup/plugin-typescript": "^12.1.3",
|
|
49
50
|
"@types/node": "^24.0.4",
|
|
50
51
|
"eslint": "^9.30.0",
|
|
52
|
+
"prettier": "^3.6.2",
|
|
51
53
|
"rimraf": "^6.0.1",
|
|
52
54
|
"rollup": "^4.44.1",
|
|
53
55
|
"rollup-plugin-dts": "^6.2.1",
|