8000 Cleaner conversion functions · ui-frontend/immutable-js@07a7219 · GitHub
[go: up one dir, main page]

Skip to content

Commit 07a7219

Browse files
committed
Cleaner conversion functions
1 parent e56149c commit 07a7219

File tree

2 files changed

+8
-18
lines changed

2 files changed

+8
-18
lines changed

dist/Sequence.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,22 @@ var Immutable = require('./Immutable');
5454

5555
Sequence.prototype.toVector=function() {"use strict";
5656
// Use Late Binding here to solve the circular dependency.
57-
return require('./Vector').empty().merge(this.values());
57+
return require('./Vector').from(this);
5858
};
5959

6060
Sequence.prototype.toMap=function() {"use strict";
6161
// Use Late Binding here to solve the circular dependency.
62-
return require('./Map').empty().merge(this);
62+
return require('./Map').from(this);
6363
};
6464

6565
Sequence.prototype.toOrderedMap=function() {"use strict";
6666
// Use Late Binding here to solve the circular dependency.
67-
return require('./OrderedMap').empty().merge(this);
67+
return require('./OrderedMap').from(this);
6868
};
6969

7070
Sequence.prototype.toSet=function() {"use strict";
7171
// Use Late Binding here to solve the circular dependency.
72-
return require('./Set').empty().union(this);
72+
return require('./Set').from(this);
7373
};
7474

7575
Sequence.prototype.equals=function(other) {"use strict";
@@ -464,11 +464,6 @@ for(var Sequence____Key in Sequence){if(Sequence.hasOwnProperty(Sequence____Key)
464464
return array;
465465
};
466466

467-
IndexedSequence.prototype.toVector=function() {"use strict";
468-
// Use Late Binding here to solve the circular dependency.
469-
return require('./Vector').empty().merge(this);
470-
};
471-
472467
IndexedSequence.prototype.fromEntries=function() {"use strict";
473468
var sequence = this;
474469
var fromEntriesSequence = sequence.__makeSequence();

src/Sequence.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,22 @@ class Sequence {
5454

5555
toVector() {
5656
// Use Late Binding here to solve the circular dependency.
57-
return require('./Vector').empty().merge(this.values());
57+
return require('./Vector').from(this);
5858
}
5959

6060
toMap() {
6161
// Use Late Binding here to solve the circular dependency.
62-
return require('./Map').empty().merge(this);
62+
return require('./Map').from(this);
6363
}
6464

6565
toOrderedMap() {
6666
// Use Late Binding here to solve the circular dependency.
67-
return require('./OrderedMap').empty().merge(this);
67+
return require('./OrderedMap').from(this);
6868
}
6969

7070
toSet() {
7171
// Use Late Binding here to solve the circular dependency.
72-
return require('./Set').empty().union(this);
72+
return require('./Set').from(this);
7373
}
7474

7575
equals(other) {
@@ -464,11 +464,6 @@ class IndexedSequence extends Sequence {
464464
return array;
465465
}
466466

467-
toVector() {
468-
// Use Late Binding here to solve the circular dependency.
469-
return require('./Vector').empty().merge(this);
470-
}
471-
472467
fromEntries() {
473468
var sequence = this;
474469
var fromEntriesSequence = sequence.__makeSequence();

0 commit comments

Comments
 (0)
0