This repository was archived by the owner on Aug 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
V.5. Functions
Andrey Bogdanov edited this page Mar 1, 2016
·
30 revisions
-
lord.isAudioType(mimeType)Returns true ifmimeTypeis one of MIME-types for an audio (starts withaudio/). Otherwise returns false. -
lord.isAudioType(mimeType)Returns true ifmimeTypeis one of MIME-types for an image (starts withimage/). Otherwise returns false. -
lord.isVideoType(mimeType)Returns true ifmimeTypeis one of MIME-types for a video (starts withvideo/). Otherwise returns false. -
lord.getCookie(name[, defValue])Returns a cookie with the namename. If the cookie with this name does not exists, returnsdefValue(if specified), orundefined. The cookie is returned as astring(as it is stored by the browser). -
lord.setCookie(name, value, options)Stored a cookie with namenameand valuevalueas astring. Ifoptionscontains theexpiresproperty, the property is converted from aDateobject to a string. See this article for details. -
lord.deleteCookie(name)Deletes a cookie with the namename. -
lord.getLocalObject(key[, defValue])Returns the value stored in localStorage under the keykey. If there is no such value,defValueis returned, if specified, otherwiseundefinedis returned. All errors thrown are catched, you do not need to catch them manually. Note:JSON.parse()is applied to the value before it is returned. -
lord.setLocalObject(key, value)Storesvaluein localStorage under keykey. Returnstrueon success, otherwise returnsfalse. All errors thrown are catched, you do not need to catch them manually. Note:JSON.stringify()is applied to the value before it is stored. -
lord.removeLocalObject(key)Removes the value stored in localStorage under keykey. Returnstrueon success, otherwise returnsfalse. All errors thrown are catched, you do not need to catch them manually. -
lord.getSessionObject(key[, defValue])Returns the value stored in sessionStorage under the keykey. If there is no such value,defValueis returned, if specified, otherwiseundefinedis returned. All errors thrown are catched, you do not need to catch them manually. Note:JSON.parse()is applied to the value before it is returned. -
lord.setSessionObject(key, value)Storesvaluein sessionStorage under keykey. Returnstrueon success, otherwise returnsfalse. All errors thrown are catched, you do not need to catch them manually. Note:JSON.stringify()is applied to the value before it is stored. -
lord.removeSessionObject(key)Removes the value stored in sessionStorage under keykey. Returnstrueon success, otherwise returnsfalse. All errors thrown are catched, you do not need to catch them manually. -
lord.in(arr, val[, strict])Returnstrueif the arrayarrcontains the valueval. Otherwise returns false. Ifstrictcasts tobooleantrue, the comparison is strict (===), otherwise it is not strict (==). -
lord.arr(obj)Creates an array from the array-like objectobj. Returns the array.objproperties must be numeric, and it must have thelengthproperty. -
lord.hasOwnProperties(obj)Returnstrueif the objectobjhas at least one own property (Object.prototype.hasOwnProperties()method is used to perform the chech). Otherwise returnsfalse. -
lord.forIn(obj, f)Applies the functionfto each key-value pair of the objectobj, the value being the first argument, and the key being the second one. -
lord.mapIn(obj, f)Creates an array from the objectobjby applying the functionfto each key-value pair of the objectobj, the value being the first argument, and the key being the second one. The array is populated by the results of the function applications. Returns the array. -
lord.filterIn(obj, f)Creates a new object from the objectobjby applying the functionfto each key-value pair of the objectobj, the value being the first argument, and the key being the second one. The new object is populated by those key-value pairs only, for which the functionfreturns a value which casts tobooleantrue. Returns the new object. Warning: Pay attention to that this function creates an object, unlike other functions from this group. -
lord.toArray(obj)Creates an array from the valuye of the objectobj. Returns the array. - ``
- ``
- ``