indefinite
Advanced tools
Comparing version 2.3.1 to 2.3.2
{ | ||
"name": "indefinite", | ||
"description": "Prefix a noun with an indefinite article - a or an - based on whether it begins with a vowel", | ||
"version": "2.3.1", | ||
"version": "2.3.2", | ||
"main": "lib/indefinite.js", | ||
@@ -6,0 +6,0 @@ "browser": "dist/indefinite.js", |
@@ -54,4 +54,23 @@ [![Build Status](https://travis-ci.org/tandrewnichols/indefinite.png)](https://travis-ci.org/tandrewnichols/indefinite) [![downloads](http://img.shields.io/npm/dm/indefinite.svg)](https://npmjs.org/package/indefinite) [![npm](http://img.shields.io/npm/v/indefinite.svg)](https://npmjs.org/package/indefinite) [![Code Climate](https://codeclimate.com/github/tandrewnichols/indefinite/badges/gpa.svg)](https://codeclimate.com/github/tandrewnichols/indefinite) [![Test Coverage](https://codeclimate.com/github/tandrewnichols/indefinite/badges/coverage.svg)](https://codeclimate.com/github/tandrewnichols/indefinite) [![dependencies](https://david-dm.org/tandrewnichols/indefinite.png)](https://david-dm.org/tandrewnichols/indefinite) ![Size](https://img.shields.io/badge/size-2kb-brightgreen.svg) | ||
## Detecting the need for an indefinite article | ||
It's worth mentioning that `indefintite` currently only differentiates between `a` and `an` for you. It doesn't do anything to decide if an indefinite article is required, so if you pass a plural to `indefinite`, you'll get something like "a shoes" back, which is obviously wrong. You can look at [this issue](https://github.com/tandrewnichols/indefinite/issues/23) for more context on why this isn't supported at the moment. It _could_ be in the future, but there are some prohibitive issues to work through first. For now, it is up to you (the consumer) to either call or not call `indefinite` depending on the plurality of the word. You can do something like the suggestion in that issue: | ||
```javascript | ||
const indefinite = require('indefinite'); | ||
const pluralize = require('pluralize'); | ||
module.exports = (subject) => { | ||
if (pluralize(subject) === subject) { | ||
return subject; | ||
} | ||
return indefinite(subject); | ||
}; | ||
``` | ||
Or you can try [is-singular](https://www.npmjs.com/package/is-singular) or [is-plural](https://www.npmjs.com/package/is-plural). | ||
## Contributing | ||
Please see [the contribution guidelines](contributing.md). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50513
76