Remove unnecessary methods
This commit is contained in:
parent
d721eb5b58
commit
aaa01050e2
1 changed files with 0 additions and 40 deletions
|
@ -5,46 +5,6 @@ const jsesc = require('jsesc')
|
|||
const utils = require('../utils')
|
||||
|
||||
class common extends utils {
|
||||
/**
|
||||
* Return stringified object
|
||||
* @param obj
|
||||
* @returns {string}
|
||||
*/
|
||||
static objToString (obj) {
|
||||
try {
|
||||
return `${obj}`
|
||||
} catch (e) {
|
||||
return `[${e}]`
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return enumerable properties recursively
|
||||
* @param obj
|
||||
* @returns {Array}
|
||||
*/
|
||||
static getAllProperties (obj) {
|
||||
let list = []
|
||||
while (obj) {
|
||||
list = list.concat(Object.getOwnPropertyNames(obj))
|
||||
obj = Object.getPrototypeOf(obj)
|
||||
}
|
||||
return list
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all properties (non-recursive)
|
||||
* @param obj
|
||||
* @returns {Array}
|
||||
*/
|
||||
static getKeysFromHash (obj) {
|
||||
let list = []
|
||||
for (let p in obj) {
|
||||
list.push(p)
|
||||
}
|
||||
return list
|
||||
}
|
||||
|
||||
/**
|
||||
* Escape and quote a string
|
||||
* @param s - String to be quoted
|
||||
|
|
Loading…
Reference in a new issue