Commit 6fd3bef2 authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt
Browse files

feat: add has helper-function

parent 1140b802
...@@ -5,3 +5,11 @@ export function uppercaseFirst(string = "") { ...@@ -5,3 +5,11 @@ export function uppercaseFirst(string = "") {
export function lowercaseFirst(string = "") { export function lowercaseFirst(string = "") {
return string.charAt(0).toLowerCase() + string.slice(1) return string.charAt(0).toLowerCase() + string.slice(1)
} }
export function has(obj, prop) {
try {
return Object.prototype.hasOwnProperty.call(obj, prop)
} catch (e) {
return false
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment