import AssertionError from "./AssertionError"; import isEmpty from "./isEmpty"; export default ( collection: C, msg: string = "value is empty" ): C => { if (isEmpty(collection)) { throw new AssertionError(msg); } return collection; };