Compare commits

..

2 Commits

Author SHA1 Message Date
e7933cd7f4 3.0.17 2020-02-07 16:32:58 +00:00
56a8d9182b fix(core): update 2020-02-07 16:32:58 +00:00
3 changed files with 11 additions and 8 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/lik",
"version": "3.0.16",
"version": "3.0.17",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/lik",
"version": "3.0.16",
"version": "3.0.17",
"private": false,
"description": "light little helpers for node",
"main": "dist/index.js",

View File

@ -137,11 +137,15 @@ export class Objectmap<T> {
*/
public getOneAndRemove(): T {
const keys = this.fastMap.getKeys();
const keyToUse = keys[keys.length - 1];
if (keys.length === 0) {
return null;
} else {
const keyToUse = keys[0];
const removedItem = this.fastMap.removeFromMap(keyToUse);
this.eventSubject.next('remove');
return removedItem;
}
}
/**
* returns a cloned array of all the objects currently in the Objectmap
@ -181,6 +185,5 @@ export class Objectmap<T> {
for (const keyArg of this.fastMap.getKeys()) {
this.fastMap.removeFromMap(keyArg);
}
}
}