const getJsonArrayEntrybyValue = <T> (attributes: any, value : String) => {
    for (let i = 0; i < attributes.length; i++) {
        if (attributes[i].attribute === value) {
            return attributes[i] as T;
        }
    }
}

const getJsonArrayEntryIDbyValue = (attributes: any, value : String) => {
    for (let index = 0; index < attributes.length; index++) {
        if (attributes[index].attribute === value) {
            return index;
        }
    }
}

const getJsonArrayEntryValuebyProperty = <T> (attributes : any, prop : String) => {
    for (let index = 0; index < attributes.length; index++) {
        if (attributes[index].attribute === prop) {
            return attributes[index].value  as T;
        }
    }
}
export const jsonUtilities = {
    getJsonArrayEntrybyValue,
    getJsonArrayEntryIDbyValue,
    getJsonArrayEntryValuebyProperty,
}