website/themes/hugo-theme-wave/static/bower_components/lunr.js/lib/utils.js
2020-01-12 23:32:32 +01:00

43 lines
935 B
JavaScript

/*!
* lunr.utils
* Copyright (C) @YEAR Oliver Nightingale
*/
/**
* A namespace containing utils for the rest of the lunr library
*/
lunr.utils = {}
/**
* Print a warning message to the console.
*
* @param {String} message The message to be printed.
* @memberOf Utils
*/
lunr.utils.warn = (function (global) {
return function (message) {
if (global.console && console.warn) {
console.warn(message)
}
}
})(this)
/**
* Convert an object to a string.
*
* In the case of `null` and `undefined` the function returns
* the empty string, in all other cases the result of calling
* `toString` on the passed object is returned.
*
* @param {Any} obj The object to convert to a string.
* @return {String} string representation of the passed object.
* @memberOf Utils
*/
lunr.utils.asString = function (obj) {
if (obj === void 0 || obj === null) {
return ""
} else {
return obj.toString()
}
}