hapijs / hapijs/joi

Is order of object keys preserved?

Open
#2,653 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
21.2k
Forks
1.5k
Avg merge
4h 57m
Merged PRs (30d)
14

Description

#### Support plan

* *is this issue currently blocking your project?* (yes/no): no
* *is this issue affecting a production system?* (yes/no): yes

#### How can we help?

```js
resultObject = schemaObject.validate(dataObject)
values1 = Object.values(dataObject)
values2 = Object.values(resultObject.value)
keys1 = Object.keys(dataObject)
keys2 = Object.keys(resultObject.value)
```

Is the order of the keys preserved in the `validate` function?

Are `values1` and `values2` guaranteed to be in the same order, and are `keys1` and `keys2` guaranteed to be the same? (Assuming the schema didn't add or remove any keys from the object, but might have done conversions such as trimming a string.)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.