mirror of
https://github.com/flynx/types.js.git
synced 2025-10-29 18:40:07 +00:00
minor fix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
032defb38b
commit
62466b83b2
6
Set.js
6
Set.js
@ -13,7 +13,7 @@
|
||||
/*********************************************************************/
|
||||
|
||||
// Set set operation shorthands...
|
||||
Set.prototype.unite = function(other){
|
||||
Set.prototype.unite = function(other=[]){
|
||||
return new Set([...this, ...other]) }
|
||||
Set.prototype.intersect = function(other){
|
||||
var test = other.has ?
|
||||
@ -22,14 +22,14 @@ Set.prototype.intersect = function(other){
|
||||
return new Set([...this]
|
||||
.filter(function(e){
|
||||
return other[test](e) })) }
|
||||
Set.prototype.subtract = function(other){
|
||||
Set.prototype.subtract = function(other=[]){
|
||||
other = new Set(other)
|
||||
return new Set([...this]
|
||||
.filter(function(e){
|
||||
return !other.has(e) })) }
|
||||
|
||||
|
||||
Map.prototype.sort = function(keys){
|
||||
Map.prototype.sort = function(keys=[]){
|
||||
keys = (typeof(keys) == 'function'
|
||||
|| keys === undefined) ?
|
||||
[...this].sort(keys)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ig-types",
|
||||
"version": "3.7.12",
|
||||
"version": "3.7.13",
|
||||
"description": "Generic JavaScript types and type extensions...",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user