Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

indefinite

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

indefinite - npm Package Compare versions

Comparing version 2.3.2 to 2.4.0

5

dist/indefinite.js

@@ -171,4 +171,7 @@ (function webpackUniversalModuleDefinition(root, factory) {

// Adjectives: y like i
'ytterbous', 'ytterbic', 'yttric'];
'ytterbous', 'ytterbic', 'yttric',
// Single letters
'f', 'h', 'l', 'm', 'n', 'r', 's', 'u', 'x'];
/***/ }),

@@ -175,0 +178,0 @@ /* 2 */

2

dist/indefinite.min.js

@@ -1,1 +0,1 @@

!function(e,u){"object"==typeof exports&&"object"==typeof module?module.exports=u():"function"==typeof define&&define.amd?define([],u):"object"==typeof exports?exports.indefinite=u():e.indefinite=u()}("undefined"!=typeof self?self:this,function(){return function(e){function u(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,u),r.l=!0,r.exports}var n={};return u.m=e,u.c=n,u.d=function(e,n,t){u.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:t})},u.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(n,"a",n),n},u.o=function(e,u){return Object.prototype.hasOwnProperty.call(e,u)},u.p="",u(u.s=2)}([function(e,u){var n=/^[aeiouAEIOU]/;u.startsWithVowel=function(e){return n.test(e)},u.capitalize=function(e,u){return u.capitalize&&(e=""+e.charAt(0).toUpperCase()+e.slice(1)),e}},function(e,u){u.check=function(e,n){if(n){var t=new RegExp(n+"$");e=e.replace(t,"")}return u.list.indexOf(e)>-1},u.list=["eunuch","eucalyptus","eugenics","eulogy","euphemism","euphony","euphoria","eureka","euro","european","euphemistic","euphonic","euphoric","euphemistically","euphonically","euphorically","heir","heiress","herb","homage","honesty","honor","honour","hour","honest","honorous","honestly","hourly","one","ouija","once","ubiquity","udometer","ufo","uke","ukelele","ululate","unicorn","unicycle","uniform","unify","union","unison","unit","unity","universe","university","upas","ural","uranium","urea","ureter","urethra","urine","urologist","urology","urus","usage","use","user","usual","usurp","usury","utensil","uterus","utility","utopia","utricle","uvarovite","uvea","uvula","utah","utahn","ubiquitous","ugandan","ukrainian","unanimous","unicameral","unified","unique","unisex","universal","urinal","urological","useful","useless","usurious","usurped","utilitarian","utopic","ubiquitously","unanimously","unicamerally","uniquely","universally","urologically","usefully","uselessly","usuriously","yttria","yggdrasil","ylem","yperite","ytterbia","ytterbium","yttrium","ytterbous","ytterbic","yttric"]},function(e,u,n){var t=n(0),r=t.capitalize,i=n(1),o=n(3),a=function(e){var u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=void 0;return o.some(function(t){if(t.check(e,u))return n=t.run(e,u),!0}),s(n,u,e)},s=function(e,u,n){return e=r(e,u),u.articleOnly?e:e+" "+n};a.irregularWords=i.list,e.exports=a},function(e,u,n){e.exports=[n(4),n(5),n(6)]},function(e,u){var n=/^([0-9,]+)/,t=/^(11|8|18)/,r=/^(11|18)/;u.check=function(e){return n.test(e)},u.run=function(e,u){var i=e.toString().match(n)[1].replace(/,/g,""),o="a";if(t.test(i)){var a=r.test(i);o=a&&4===i.length?"colloquial"===u.numbers?"an":"a":a&&(i.length-2)%3==0?"an":i.startsWith("8")?"an":"a"}return o}},function(e,u,n){var t=n(0),r=t.startsWithVowel,i=/^[A-Z]+$/,o=/^[UFHLMNRSX]/,a=function(e){return o.test(e.charAt(0))},s=function(e,u){return e===u};u.check=function(e,u){return!u.caseInsensitive&&i.test(e.split(" ")[0])},u.run=function(e){var u=a(e),n=r(e);return s(n,u)?"a":"an"}},function(e,u,n){var t=n(0),r=t.startsWithVowel,i=n(1),o=/[\s'-]/,a=function(e){return e.split(o)[0].toLowerCase()},s=function(e,u){return(e||u)&&!(e&&u)},c=function(e){return[null,"s","es","ed"].reduce(function(u,n){return u||i.check(e,n)},!1)};u.check=function(){return!0},u.run=function(e,u){var n=a(e),t=c(n);return s(r(e),t)?"an":"a"}}])});
!function(e,u){"object"==typeof exports&&"object"==typeof module?module.exports=u():"function"==typeof define&&define.amd?define([],u):"object"==typeof exports?exports.indefinite=u():e.indefinite=u()}("undefined"!=typeof self?self:this,function(){return function(e){function u(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,u),r.l=!0,r.exports}var n={};return u.m=e,u.c=n,u.d=function(e,n,t){u.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:t})},u.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(n,"a",n),n},u.o=function(e,u){return Object.prototype.hasOwnProperty.call(e,u)},u.p="",u(u.s=2)}([function(e,u){var n=/^[aeiouAEIOU]/;u.startsWithVowel=function(e){return n.test(e)},u.capitalize=function(e,u){return u.capitalize&&(e=""+e.charAt(0).toUpperCase()+e.slice(1)),e}},function(e,u){u.check=function(e,n){if(n){var t=new RegExp(n+"$");e=e.replace(t,"")}return u.list.indexOf(e)>-1},u.list=["eunuch","eucalyptus","eugenics","eulogy","euphemism","euphony","euphoria","eureka","euro","european","euphemistic","euphonic","euphoric","euphemistically","euphonically","euphorically","heir","heiress","herb","homage","honesty","honor","honour","hour","honest","honorous","honestly","hourly","one","ouija","once","ubiquity","udometer","ufo","uke","ukelele","ululate","unicorn","unicycle","uniform","unify","union","unison","unit","unity","universe","university","upas","ural","uranium","urea","ureter","urethra","urine","urologist","urology","urus","usage","use","user","usual","usurp","usury","utensil","uterus","utility","utopia","utricle","uvarovite","uvea","uvula","utah","utahn","ubiquitous","ugandan","ukrainian","unanimous","unicameral","unified","unique","unisex","universal","urinal","urological","useful","useless","usurious","usurped","utilitarian","utopic","ubiquitously","unanimously","unicamerally","uniquely","universally","urologically","usefully","uselessly","usuriously","yttria","yggdrasil","ylem","yperite","ytterbia","ytterbium","yttrium","ytterbous","ytterbic","yttric","f","h","l","m","n","r","s","u","x"]},function(e,u,n){var t=n(0),r=t.capitalize,i=n(1),o=n(3),a=function(e){var u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=void 0;return o.some(function(t){if(t.check(e,u))return n=t.run(e,u),!0}),s(n,u,e)},s=function(e,u,n){return e=r(e,u),u.articleOnly?e:e+" "+n};a.irregularWords=i.list,e.exports=a},function(e,u,n){e.exports=[n(4),n(5),n(6)]},function(e,u){var n=/^([0-9,]+)/,t=/^(11|8|18)/,r=/^(11|18)/;u.check=function(e){return n.test(e)},u.run=function(e,u){var i=e.toString().match(n)[1].replace(/,/g,""),o="a";if(t.test(i)){var a=r.test(i);o=a&&4===i.length?"colloquial"===u.numbers?"an":"a":a&&(i.length-2)%3==0?"an":i.startsWith("8")?"an":"a"}return o}},function(e,u,n){var t=n(0),r=t.startsWithVowel,i=/^[A-Z]+$/,o=/^[UFHLMNRSX]/,a=function(e){return o.test(e.charAt(0))},s=function(e,u){return e===u};u.check=function(e,u){return!u.caseInsensitive&&i.test(e.split(" ")[0])},u.run=function(e){var u=a(e),n=r(e);return s(n,u)?"a":"an"}},function(e,u,n){var t=n(0),r=t.startsWithVowel,i=n(1),o=/[\s'-]/,a=function(e){return e.split(o)[0].toLowerCase()},s=function(e,u){return(e||u)&&!(e&&u)},c=function(e){return[null,"s","es","ed"].reduce(function(u,n){return u||i.check(e,n)},!1)};u.check=function(){return!0},u.run=function(e,u){var n=a(e),t=c(n);return s(r(e),t)?"an":"a"}}])});

@@ -74,3 +74,6 @@ exports.check = (word, ending) => {

// Adjectives: y like i
'ytterbous', 'ytterbic', 'yttric'
'ytterbous', 'ytterbic', 'yttric',
// Single letters
'f', 'h', 'l', 'm', 'n', 'r', 's', 'u', 'x'
];
{
"name": "indefinite",
"description": "Prefix a noun with an indefinite article - a or an - based on whether it begins with a vowel",
"version": "2.3.2",
"version": "2.4.0",
"main": "lib/indefinite.js",

@@ -6,0 +6,0 @@ "browser": "dist/indefinite.js",

@@ -247,3 +247,29 @@ require('should');

});
context('the letter u', () => {
it('should be prefixed with a', () => {
indefinite('u').should.equal('a u')
});
});
context('the letters f, h, l, m, n, r, s, and x', () => {
it('should be prefixed with an', () => {
indefinite('f').should.equal('an f')
indefinite('h').should.equal('an h')
indefinite('l').should.equal('an l')
indefinite('m').should.equal('an m')
indefinite('n').should.equal('an n')
indefinite('r').should.equal('an r')
indefinite('s').should.equal('an s')
indefinite('x').should.equal('an x')
});
});
context('other letters', () => {
it('should be prefixed as normal', () => {
indefinite('a').should.equal('an a');
indefinite('b').should.equal('a b');
});
});
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc