Skip to content

Commit

Permalink
fix(OrderBy): remove deprecation notice about old constraint style
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesfer committed Jun 18, 2018
1 parent abd706a commit 2c35ac9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
18 changes: 9 additions & 9 deletions src/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,22 +412,22 @@ export abstract class Builder<Q> extends SetBlock<Q> {
* // ORDER BY name DESC, occupation
* ```
*
* Valid values for directions are `DESC`, `DESCENDING`, `ASC`, `ASCENDING`.
* `true` and `false` are also accepted (`true` being the same as `DESC` and
* `false` the same as `ASC`), however they should be avoided as they are
* quite ambiguous. Directions always default to `ASC` as it does in cypher.
*
* *Depreciation note:*
* It was previously acceptable to pass an object where each key is the
* It is also acceptable to pass an object where each key is the
* property and the value is a direction. Eg:
* ```javascript
* query.orderBy({
* name: 'DESC',
* occupation: 'ASC',
* })
* ```
* This has been deprecated as the iteration order of objects is not
* always consistent.
* However, the underlying iteration order is not always guaranteed and
* it may cause subtle bugs in your code. It is still accepted but it
* is recommended that you use the array syntax above.
*
* Valid values for directions are `DESC`, `DESCENDING`, `ASC`, `ASCENDING`.
* `true` and `false` are also accepted (`true` being the same as `DESC` and
* `false` the same as `ASC`), however they should be avoided as they are
* quite ambiguous. Directions always default to `ASC` as it does in cypher.
*
* @param {_.Many<string> | OrderConstraints} fields
* @param {Direction} dir
Expand Down
2 changes: 0 additions & 2 deletions src/clauses/order-by.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ export class OrderBy extends Clause {
return { field: field[0], direction: fieldDirection };
});
} else {
// tslint:disable-next-line:max-line-length
console.warn('Warning: Passing constraints to OrderBy using an object is deprecated as the iteration order is not guaranteed. Use an array instead.');
this.constraints = map(fields, (fieldDirection, field) => {
return { field, direction: OrderBy.normalizeDirection(fieldDirection) };
});
Expand Down

0 comments on commit 2c35ac9

Please sign in to comment.