@Ricky Raghavan hope this will help you., below code works for me.
public static getDocSetOrFolder(endPoint,listTitle,folerName):Promise<any>{
let web = new Web(endPoint);
const xml=this.returnCamlQueryToGetDocSetOrFolder(folerName);
const q: CamlQuery = {
ViewXml: xml,
};
return web.lists.getByTitle(listTitle).getItemsByCAMLQuery(q).then((docDetails)=>{
console.log("Folder details",docDetails);
return docDetails;
});
}
public static returnCamlQueryToGetDocSetOrFolder(folerName){
const viewXml =
"<View>" +
"<Query>" +
"<Where>" +
"<And>" +
"<Eq>" +
"<FieldRef Name=\"FSObjType\"/>" +
"<Value Type=\"Integer\">1</Value>" +
"</Eq>" +
"<Eq>" +
"<FieldRef Name=\"FileLeafRef\" />" +
"<Value Type=\"Text\">" + folerName + "</Value>" +
"</Eq>" +
"</And>" +
"</Where>" +
"</Query>" +
"<RowLimit>1</RowLimit>" +
"</View>";
return viewXml;
}