Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
0f427d89
Commit
0f427d89
authored
May 25, 2023
by
Alejandro Celaya
Committed by
Alejandro Celaya
May 25, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate immutable module to TS
parent
8df748ef
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
immutable.ts
src/sidebar/util/immutable.ts
+2
-5
No files found.
src/sidebar/util/immutable.
j
s
→
src/sidebar/util/immutable.
t
s
View file @
0f427d89
...
...
@@ -5,11 +5,8 @@
*
* This only works for plain objects, arrays and objects where data is stored
* in enumerable fields.
*
* @template {object} T
* @param {T} object
*/
function
deepFreeze
(
object
)
{
function
deepFreeze
<
T
extends
object
>
(
object
:
T
)
{
if
(
Object
.
isFrozen
(
object
))
{
return
object
;
}
...
...
@@ -32,7 +29,7 @@ function deepFreeze(object) {
* @param {T} object
* @return {T} Returns the input object
*/
export
function
immutable
(
object
)
{
export
function
immutable
<
T
extends
object
>
(
object
:
T
)
{
if
(
process
.
env
.
NODE_ENV
===
'production'
)
{
return
object
;
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment