import jewell from "./jewell" ; import { isFunctionWithZeroOrOneArgs } from "./helpers" ; const exceptionFunctions = [ "constructor" ] ; function isPrototypeException ( property , except ) { return ( exceptionFunctions . indexOf ( property ) !== - 1 || except . indexOf ( property ) !== - 1 ) ; } function prototypeProperty ( klass , property ) { const value = klass . prototype [ property ] ; if ( isFunctionWithZeroOrOneArgs ( value ) ) { jewell ( klass . prototype , property ) ; } } function jewellPrototype ( klass , except = [ ] ) { const properties = Object . getOwnPropertyNames ( klass . prototype ) ; properties . forEach ( ( property ) => { if ( ! isPrototypeException ( property , except ) ) { prototypeProperty ( klass , property ) ; } } ) ; } export default jewellPrototype ;