digitransit-ui/digitransit-search-util/packages/digitransit-search-util-route-name-compare/README.md
Janne Antikainen ff6c0c536a feat: readMes
2020-04-22 12:20:03 +03:00

69 lines
1.5 KiB
Markdown

# @digitransit-search-util/digitransit-search-util-route-name-compare
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## routeNameCompare
Compares routenames
### Parameters
- `a` **[Object][1]** {
shortName: String,
longName: String,
agency: {
name: String
}
}
- `b` **[Object][1]** Same as a
### Examples
```javascript
const a = {
shortName: 'hki',
longName: 'Helsinki',
agency: {
name: 'hsl',
},
};
const b = {
shortName: 'hki',
longName: 'Helsinki',
agency: {
name: 'hsl',
},
};
digitransit-search-util.routeNameCompare(a, b);
//= 0
```
Returns **[Number][2]** 0 True -1 false
[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the digitransit-util project. -->
---
This module is part of the Digitransit-ui project. It is maintained in the
[HSLdevcom/digitransit-ui](https://github.com/HSLdevcom/digitransit-ui) repository, where you can create
PRs and issues.
### Installation
Install this module individually:
```sh
$ npm install @digitransit-search-util/digitransit-search-util-route-name-compare
```
Or install the Digitransit-util module that includes it as a function:
```sh
$ npm install @digitransit-util/digitransit-util
```