Package Exports
- khal
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (khal) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Khal
Utils for node project
API
cl(args)
- Works like console.log, but it return the args passed. If no arg passed, it just return the timestamp. If only one arg is passed, it return the arg, if many it return arrayce(args)
- Same as above for console.errorclone(obj)
- Make a clone of an object (useful is you don't want to keep ref)intersect(arr, arr)
- Return an array being the intersect of arrays givenunion(arr,arr)
- Return an array being the union of arrays givenis
- Test a given argument being of type/state expectedarr
int
number
float
string
bool
obj
fn
def
undef
promise
obs
event
geo
- Handle geoCordinatecreate(lat, lon)
- returns a GeoCordinate objectgeocordinateStringToGeoCoordinateObject(str)
- transform a str "43.597446,1.454469" to a geoObjectcalculateDistance(geoCordinate, geoCordinate, [unit{str}, [precision {int}]])
- get distance between two geoObject, can be inkm
,m
ormiles
,convert(float)
toMiles()
- convert to Miles a value in meterstoMeters()
- convert to Meters a value in miles
math
- Handle mathradianToDegree(rad)
degreeToRadian(deg)
randomBetweenMinAndMax(min,max,[precision])
misc
- Handle stuffformatByteSize(bytes,[isSIForm])
- Make bytes readable using IEEC (MB) or SI (MiB) formsizeOfObject(obj)
- Get bytes size from obj (number, object or string)sizeOfObjectReadable(obj,[isSIForm])
- Make bytes readable using IEEC (MB) or SI (MiB) form from obj
regex
regTest(reg, val)
- Handy shortcut for regex testingisUUIDV4(uuid)
- Test a valid UUID V4isUsername(username)
- Test a valid usernameisBirthdate(birthday)
- Test a valid birthdateisGender(gender)
- Test a valid genderisPassword(password)
- Test a valid passwordisEmail(email)
- Test a valid emailisUnicodeEmail(email)
- Test a valid unicode email