Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Molstar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michal Malý
Molstar
Commits
b74cdd2c
Commit
b74cdd2c
authored
6 years ago
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
added missing return types for set utils
parent
e79b2f02
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mol-util/set.ts
+3
-3
3 additions, 3 deletions
src/mol-util/set.ts
with
3 additions
and
3 deletions
src/mol-util/set.ts
+
3
−
3
View file @
b74cdd2c
...
@@ -15,14 +15,14 @@ export function isSuperset<T>(setA: Set<T>, setB: Set<T>) {
...
@@ -15,14 +15,14 @@ export function isSuperset<T>(setA: Set<T>, setB: Set<T>) {
}
}
/** Create set containing elements of both set a and set b. */
/** Create set containing elements of both set a and set b. */
export
function
union
<
T
>
(
setA
:
Set
<
T
>
,
setB
:
Set
<
T
>
)
{
export
function
union
<
T
>
(
setA
:
Set
<
T
>
,
setB
:
Set
<
T
>
)
:
Set
<
T
>
{
const
union
=
new
Set
(
setA
);
const
union
=
new
Set
(
setA
);
for
(
const
elem
of
Array
.
from
(
setB
))
union
.
add
(
elem
);
for
(
const
elem
of
Array
.
from
(
setB
))
union
.
add
(
elem
);
return
union
;
return
union
;
}
}
/** Create set containing elements of set a that are also in set b. */
/** Create set containing elements of set a that are also in set b. */
export
function
intersection
<
T
>
(
setA
:
Set
<
T
>
,
setB
:
Set
<
T
>
)
{
export
function
intersection
<
T
>
(
setA
:
Set
<
T
>
,
setB
:
Set
<
T
>
)
:
Set
<
T
>
{
const
intersection
=
new
Set
();
const
intersection
=
new
Set
();
for
(
const
elem
of
Array
.
from
(
setB
))
{
for
(
const
elem
of
Array
.
from
(
setB
))
{
if
(
setA
.
has
(
elem
))
intersection
.
add
(
elem
);
if
(
setA
.
has
(
elem
))
intersection
.
add
(
elem
);
...
@@ -31,7 +31,7 @@ export function intersection<T>(setA: Set<T>, setB: Set<T>) {
...
@@ -31,7 +31,7 @@ export function intersection<T>(setA: Set<T>, setB: Set<T>) {
}
}
/** Create set containing elements of set a that are not in set b. */
/** Create set containing elements of set a that are not in set b. */
export
function
difference
<
T
>
(
setA
:
Set
<
T
>
,
setB
:
Set
<
T
>
)
{
export
function
difference
<
T
>
(
setA
:
Set
<
T
>
,
setB
:
Set
<
T
>
)
:
Set
<
T
>
{
const
difference
=
new
Set
(
setA
);
const
difference
=
new
Set
(
setA
);
for
(
const
elem
of
Array
.
from
(
setB
))
difference
.
delete
(
elem
);
for
(
const
elem
of
Array
.
from
(
setB
))
difference
.
delete
(
elem
);
return
difference
;
return
difference
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment