smartobject/ts/tools/exists.ts
2022-03-07 15:28:32 +01:00

14 lines
375 B
TypeScript

import * as plugins from '../smartobject.plugins';
/**
* checks if an object has a parameter with a given key name, returns true if yes.
* @param parentObject
* @param childParam
* @returns {boolean}
*/
export let exists = (parentObject: object, childParam: string): boolean => {
if (parentObject.hasOwnProperty(childParam)) {
return true;
}
return false;
};