Skip to content

Instantly share code, notes, and snippets.

@chippinkston
chippinkston / deORM
Last active May 23, 2017 19:41
Adam Tuttle's deORM
/*** Source: http://fusiongrokker.com/post/deorm ***/
public function deORM( obj = this, depth = 1, depthLimit = 10 ){
var deWormed = {};
if (depth >= depthLimit){
return {};
}
if (isSimpleValue( obj )){
deWormed = obj;
}
else if (isObject( obj )){