---
lang: en
title: 'API docs: repository.ensurepromise'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/repository
permalink: /doc/en/lb4/apidocs.repository.ensurepromise.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [ensurePromise](./repository.ensurepromise.md)

## ensurePromise() function

Ensure the value is a promise

**Signature:**

```typescript
export declare function ensurePromise<T>(p: legacy.PromiseOrVoid<T>): Promise<T>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  p | legacy.PromiseOrVoid&lt;T&gt; | Promise or void |

**Returns:**

Promise&lt;T&gt;


