private function replaceLibAliases(PortableElementObject $object){

        $id = $object->getTypeIdentifier();
        $object->setRuntimeKey('libraries', array_map(function($lib) use ($id) {
            if(preg_match('/^'.$id.'/', $lib)){
                return $lib.'.js';
            }
            return $lib;
        }, $object->getRuntimeKey('libraries')));

        return $object;
    }