to-assigned 1.1.4 → 2.0.2
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/dist/index.d.ts +10 -18
- package/dist/index.mjs +7 -1
- package/package.json +7 -28
package/dist/index.d.ts
CHANGED
|
@@ -1,31 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
declare const isObject: (v: unknown) => v is object;
|
|
2
2
|
/**
|
|
3
3
|
* ## Usage
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* - The sources are never modified.
|
|
8
|
-
* - Non-object arguments are ignored.
|
|
9
|
-
* - If all sources are primitive, returns `{}`.
|
|
10
|
-
* - If the first non-primitive source is:
|
|
11
|
-
* - **Array**: result is an array, prototype same as source.
|
|
12
|
-
* - **Function**: result is a function with same `name`, `length`, and prototype. (`caller`, `callee`, `arguments` not copied)
|
|
13
|
-
* - **Map/Set/WeakMap/WeakSet/Date**: result is a new instance of the same type, initialized from the first source (only own enumerable properties are merged, not collection contents).
|
|
14
|
-
* - **Other object**: result is a plain object with the same prototype as the source.
|
|
15
|
-
*
|
|
4
|
+
* A pure function version of `Object.assign`.
|
|
5
|
+
* Use to merge objects like `toAssigned(obj1, obj2)`(obj1 is not changed).
|
|
6
|
+
* - Ignores variables that are not `object`.
|
|
16
7
|
* - Only enumerable properties (including symbol keys) are copied from all sources.
|
|
17
8
|
*
|
|
18
|
-
* @returns A new object
|
|
9
|
+
* @returns A new object.
|
|
19
10
|
*
|
|
20
11
|
* ## About
|
|
21
12
|
* @package ToAssigned
|
|
22
13
|
* @author KasukabeTsumugi <futami16237@gmail.com>
|
|
23
|
-
* @version
|
|
14
|
+
* @version 2.0.2 (Last Update: 2026.02.17 18:56:18.158)
|
|
24
15
|
* @license MIT
|
|
25
|
-
* @link git+https://github.com/baendlorel/
|
|
16
|
+
* @link git+https://github.com/baendlorel/kt-packages.git
|
|
17
|
+
* @link https://baendlorel.github.io/ Welcome to my site!
|
|
26
18
|
* @description Like Object.assign but will return a new object and ignores non-object arguments.
|
|
27
|
-
* @copyright Copyright (c)
|
|
19
|
+
* @copyright Copyright (c) 2026 KasukabeTsumugi. All rights reserved.
|
|
28
20
|
*/
|
|
29
21
|
declare function toAssigned(...sources: any[]): any;
|
|
30
22
|
|
|
31
|
-
export { toAssigned };
|
|
23
|
+
export { isObject, toAssigned };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
const
|
|
1
|
+
const t = Object.assign, e = t => null !== t && "object" == typeof t;
|
|
2
|
+
|
|
3
|
+
function n(...n) {
|
|
4
|
+
return 0 === (n = n.filter(e)).length ? {} : t({}, ...n);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export { e as isObject, n as toAssigned };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "to-assigned",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "KasukabeTsumugi",
|
|
6
6
|
"email": "futami16237@gmail.com"
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
},
|
|
23
23
|
"repository": {
|
|
24
24
|
"type": "git",
|
|
25
|
-
"url": "git+https://github.com/baendlorel/
|
|
25
|
+
"url": "git+https://github.com/baendlorel/kt-packages.git",
|
|
26
|
+
"directory": "packages/to-assigned"
|
|
26
27
|
},
|
|
27
28
|
"keywords": [
|
|
28
|
-
"array",
|
|
29
29
|
"concat",
|
|
30
30
|
"utility",
|
|
31
31
|
"javascript",
|
|
@@ -33,29 +33,8 @@
|
|
|
33
33
|
],
|
|
34
34
|
"license": "MIT",
|
|
35
35
|
"bugs": {
|
|
36
|
-
"url": "https://github.com/baendlorel/
|
|
36
|
+
"url": "https://github.com/baendlorel/kt-packages/issues"
|
|
37
37
|
},
|
|
38
|
-
"homepage": "https://github.com/baendlorel/to-assigned#readme",
|
|
39
|
-
"devDependencies": {
|
|
40
|
-
|
|
41
|
-
"@babel/preset-env": "^7.28.0",
|
|
42
|
-
"@eslint/js": "^9.30.0",
|
|
43
|
-
"@rollup/plugin-alias": "^5.1.1",
|
|
44
|
-
"@rollup/plugin-babel": "^6.0.4",
|
|
45
|
-
"@rollup/plugin-commonjs": "^28.0.6",
|
|
46
|
-
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
47
|
-
"@rollup/plugin-replace": "^6.0.2",
|
|
48
|
-
"@rollup/plugin-terser": "^0.4.4",
|
|
49
|
-
"@rollup/plugin-typescript": "^12.1.3",
|
|
50
|
-
"@types/node": "^24.0.4",
|
|
51
|
-
"eslint": "^9.30.0",
|
|
52
|
-
"prettier": "^3.6.2",
|
|
53
|
-
"rimraf": "^6.0.1",
|
|
54
|
-
"rollup": "^4.44.1",
|
|
55
|
-
"rollup-plugin-dts": "^6.2.1",
|
|
56
|
-
"tslib": "^2.8.1",
|
|
57
|
-
"typescript": "^5.8.3",
|
|
58
|
-
"typescript-eslint": "^8.38.0",
|
|
59
|
-
"vitest": "^3.2.4"
|
|
60
|
-
}
|
|
61
|
-
}
|
|
38
|
+
"homepage": "https://github.com/baendlorel/kt-packages/tree/main/packages/to-assigned#readme",
|
|
39
|
+
"devDependencies": {}
|
|
40
|
+
}
|