@kbss-cvut/s-forms
Version:
Semantic forms generator and processor
30 lines (29 loc) • 1.31 kB
TypeScript
export default class Utils {
/**
* Calculates a simple hash of the specified string, much like usual Java implementations.
* @param str The string to compute has for
* @return {number}
*/
static getStringHash(str: any): number;
/**
* Wraps passed object into new array if it is not array already.
* @param object_or_array An object or array.
* @returns {*} New array containing passed object or passed array.
*/
static asArray(object_or_array: any): any;
static findQuestionById(id: any, question: any, reflexive: any, asserted: any, transitive: any): any;
/**
* Finds the first key in an array of objects that matches any of the specified keys.
*
* @param {Object[]} objectList - The array of objects to search through.
* @param {string[]} keysToCheck - An array of keys to check in each object.
* @returns {?string} - The first key that exists in any of the objects, or null if none are found.
*/
static findKeyInObjects(objectList: Object[], keysToCheck: string[]): string | null;
/**
* Checks whether the feedback for option questions is enabled in the options.
* @param options
* @returns {*|boolean}
*/
static isOptionQuestionFeedbackEnabled(options: any): any | boolean;
}