UNPKG

dop-website-sdk

Version:

Wisetracker website sdk ( dop-website-sdk )

56 lines (55 loc) 938 B
export class SProperties { constructor() {} putAll(obj) { try { if (obj === null || typeof obj !== 'object') return; for (var attr in obj) { if (obj.hasOwnProperty(attr)) { this[attr] = obj[attr]; } } } catch (e) { console.log(e); } return this; } clearAll() { try { if (Object.keys(this).length > 0) { for (let key in this) { delete this[key]; } } } catch (e) { console.log(e); } return this; } remove(key) { if (key != "") { delete this[key]; } return this; } /** * set key And value * @public **/ set(key, value) { try { this[key] = value; } catch (e) { console.log(e); } return this; } stringify() { let str = ""; try { str = JSON.stringify(this); } catch (e) { console.log(e); } return str; } }