adapt-authoring-api 3.5.0 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -327,11 +327,9 @@ class AbstractApiModule extends AbstractModule {
327
327
  * @return {Promise} Resolves with the sanitised data
328
328
  */
329
329
  async sanitise (schemaName, data, options) {
330
+ const schema = await this.getSchema(schemaName, data)
330
331
  const isArray = Array.isArray(data)
331
- const sanitised = await Promise.all((isArray ? data : [data]).map(async d => {
332
- const schema = await this.getSchema(schemaName, d)
333
- return schema.sanitise(d, options)
334
- }))
332
+ const sanitised = (isArray ? data : [data]).map(d => schema.sanitise(d, options))
335
333
  return isArray ? sanitised : sanitised[0]
336
334
  }
337
335
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adapt-authoring-api",
3
- "version": "3.5.0",
3
+ "version": "3.6.0",
4
4
  "description": "Abstract module for creating APIs",
5
5
  "homepage": "https://github.com/adapt-security/adapt-authoring-api",
6
6
  "license": "GPL-3.0",