vscode-jsonrpc
Advanced tools
Comparing version 3.3.0-alpha.2 to 3.3.0-alpha.3
@@ -23,2 +23,4 @@ export declare namespace Touch { | ||
forEachReverse(callbackfn: (value: V, key: K, map: LinkedMap<K, V>) => void, thisArg?: any): void; | ||
values(): V[]; | ||
keys(): K[]; | ||
private addItemFirst(item); | ||
@@ -25,0 +27,0 @@ private addItemLast(item); |
@@ -122,2 +122,59 @@ "use strict"; | ||
}; | ||
LinkedMap.prototype.values = function () { | ||
var result = []; | ||
var current = this._head; | ||
while (current) { | ||
result.push(current.value); | ||
current = current.next; | ||
} | ||
return result; | ||
}; | ||
LinkedMap.prototype.keys = function () { | ||
var result = []; | ||
var current = this._head; | ||
while (current) { | ||
result.push(current.key); | ||
current = current.next; | ||
} | ||
return result; | ||
}; | ||
/* JSON RPC run on es5 which has no Symbol.iterator | ||
public keys(): IterableIterator<K> { | ||
let current = this._head; | ||
let iterator: IterableIterator<K> = { | ||
[Symbol.iterator]() { | ||
return iterator; | ||
}, | ||
next():IteratorResult<K> { | ||
if (current) { | ||
let result = { value: current.key, done: false }; | ||
current = current.next; | ||
return result; | ||
} else { | ||
return { value: undefined, done: true }; | ||
} | ||
} | ||
}; | ||
return iterator; | ||
} | ||
public values(): IterableIterator<V> { | ||
let current = this._head; | ||
let iterator: IterableIterator<V> = { | ||
[Symbol.iterator]() { | ||
return iterator; | ||
}, | ||
next():IteratorResult<V> { | ||
if (current) { | ||
let result = { value: current.value, done: false }; | ||
current = current.next; | ||
return result; | ||
} else { | ||
return { value: undefined, done: true }; | ||
} | ||
} | ||
}; | ||
return iterator; | ||
} | ||
*/ | ||
LinkedMap.prototype.addItemFirst = function (item) { | ||
@@ -187,2 +244,5 @@ // First time Insert | ||
if (item === this._tail) { | ||
// previous must be defined since item was not head but is tail | ||
// So there are more than on item in the map | ||
previous.next = undefined; | ||
this._tail = previous; | ||
@@ -209,2 +269,5 @@ } | ||
if (item === this._head) { | ||
// next must be defined since item was not tail but is head | ||
// So there are more than on item in the map | ||
next.previous = undefined; | ||
this._head = next; | ||
@@ -211,0 +274,0 @@ } |
{ | ||
"name": "vscode-jsonrpc", | ||
"description": "A json rpc implementation over streams", | ||
"version": "3.3.0-alpha.2", | ||
"version": "3.3.0-alpha.3", | ||
"author": "Microsoft Corporation", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
124658
2971