FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
mathjs/src/function/utils/clone.js at develop · CalmWeb/mathjs · GitHub
CalmWeb
/
mathjs
Public
forked from
josdejong/mathjs
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
mathjs
/
src
/
function
/
utils
/
clone.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
29 lines (27 loc) · 873 Bytes
Breadcrumbs
mathjs
/
src
/
function
/
utils
/
clone.js
Copy path
File metadata and controls
29 lines (27 loc) · 873 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import
{
clone
as
objectClone
}
from
'../../utils/object.js'
import
{
factory
}
from
'../../utils/factory.js'
const
name
=
'clone'
const
dependencies
=
[
'typed'
]
export
const
createClone
=
/* #__PURE__ */
factory
(
name
,
dependencies
,
(
{
typed
}
)
=>
{
/**
* Clone an object. Will make a deep copy of the data.
*
* Syntax:
*
* math.clone(x)
*
* Examples:
*
* math.clone(3.5) // returns number 3.5
* math.clone(math.complex('2-4i')) // returns Complex 2 - 4i
* math.clone(math.unit(45, 'deg')) // returns Unit 45 deg
* math.clone([[1, 2], [3, 4]]) // returns Array [[1, 2], [3, 4]]
* math.clone("hello world") // returns string "hello world"
*
*
@param
{
*
} x Object to be cloned
*
@return
{
*
} A clone of object x
*/
return
typed
(
name
,
{
any
:
objectClone
}
)
}
)
Back
|
FazBrowse Home
|
New Git URL