12345678910111213141516171819202122 |
- class Utilities {
- constructor() {
- }
- getSpecific(key, idset, objectset) {
- var objIndex = 0;
- var objOffsetCounter = 0;
- if(key.indexOf(".") != -1) {
- var counterString = key.split(".");
- objIndex = parseInt(counterString[0]) - 1;
- key = counterString[1];
- }
- objOffsetCounter = objIndex;
- for(var index in idset) {
- var otherItem = objectset[idset[index]];
- if(otherItem.keywords.indexOf(key) != -1 && objOffsetCounter-- == 0) {
- return otherItem;
- }
- }
- }
- }
- module.exports = new Utilities();
|