🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

indefinite

Package Overview
Dependencies
Maintainers
1
Versions
22
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
1.0.0
to
1.0.1
+24
gulp/karma.js
var gulp = require('gulp');
var Server = require('karma').Server;
var path = require('path');
gulp.task('browser', function(done) {
new Server({
configFile: path.resolve(__dirname, '../karma.conf.js'),
singleRun: true
}, done).start();
});
gulp.task('phantom', function(done) {
new Server({
configFile: path.resolve(__dirname, '../karma.conf.js'),
browsers: ['PhantomJS'],
singleRun: true
}, done).start();
});
gulp.task('ci', function(done) {
new Server({
configFile: path.resolve(__dirname, '../karma.conf.js')
}, done).start();
});
// Karma configuration
// Generated on Fri Oct 23 2015 14:00:27 GMT-0400 (EDT)
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['mocha'],
// list of files / patterns to load in the browser
files: [
'node_modules/mocha-given/browser/mocha-given.js',
'node_modules/should/should.js',
'dist/indefinite.js',
'test/helpers/**/*.js',
'test/**/*.coffee'
],
// list of files to exclude
exclude: [
],
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'**/*.coffee': ['coffee']
},
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['mocha'],
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['Chrome', 'Firefox', 'PhantomJS'],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,
// Concurrency level
// how many browser should be started simultanous
concurrency: Infinity
})
}
window.require = function(path) {
return window.indefinite;
};
+1
-1

@@ -6,3 +6,3 @@ language: node_js

script:
- "gulp ci"
- "gulp travis"
node_js:

@@ -9,0 +9,0 @@ - "0.10"

(function() {
var isNode = (typeof module !== 'undefined' && this.module !== module);
var indefinite = function (noun) {
return (/[aeiou]/.test(noun.charAt(0).toLowerCase()) ? 'an ' : 'a ') + noun;
var indefinite = function (noun, capitalize) {
var phrase = (/[aeiou]/.test(noun.charAt(0).toLowerCase()) ? 'an ' : 'a ') + noun;
if (capitalize) {
return phrase.charAt(0).toUpperCase() + phrase.slice(1);
} else {
return phrase;
}
};

@@ -7,0 +12,0 @@

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

!function(){var e="undefined"!=typeof module&&this.module!==module,o=function(e){return(/[aeiou]/.test(e.charAt(0).toLowerCase())?"an ":"a ")+e};e?module.exports=o:window.indefinite=o}();
!function(){var e="undefined"!=typeof module&&this.module!==module,o=function(e,o){var t=(/[aeiou]/.test(e.charAt(0).toLowerCase())?"an ":"a ")+e;return o?t.charAt(0).toUpperCase()+t.slice(1):t};e?module.exports=o:window.indefinite=o}();

@@ -5,3 +5,3 @@ var gulp = require('gulp');

gulp.task('codeclimate', ['test'], function(cb) {
gulp.task('codeclimate', function() {
if (process.version.indexOf('v4') > -1) {

@@ -8,0 +8,0 @@ gulp.src('coverage/lcov.info', { read: false })

@@ -6,3 +6,3 @@ var gulp = require('gulp');

gulp.task('cover', ['clean:coverage'], function() {
gulp.task('cover', ['clean:coverage', 'instrument'], function() {
return gulp.src(config.tests, { read: false })

@@ -9,0 +9,0 @@ .pipe(mocha({

var gulp = require('gulp');
require('file-manifest').generate('./gulp', ['**/*.js', '!config.js']);
gulp.task('test', ['instrument', 'cover']);
var sequence = require('gulp-sequence');
require('file-manifest').generate('./gulp', ['**/*.js', '!config.js', '!karma.conf.js']);
gulp.task('travis', sequence(['lint', 'cover', 'phantom'], 'codeclimate'));
gulp.task('test', ['cover', 'browser']);
gulp.task('default', ['lint', 'test']);
gulp.task('dist', ['uglify']);
gulp.task('ci', ['lint', 'codeclimate']);
gulp.task('build', sequence('clean:dist', ['copy', 'uglify']));
(function() {
var isNode = (typeof module !== 'undefined' && this.module !== module);
var indefinite = function (noun) {
return (/[aeiou]/.test(noun.charAt(0).toLowerCase()) ? 'an ' : 'a ') + noun;
var indefinite = function (noun, capitalize) {
var phrase = (/[aeiou]/.test(noun.charAt(0).toLowerCase()) ? 'an ' : 'a ') + noun;
if (capitalize) {
return phrase.charAt(0).toUpperCase() + phrase.slice(1);
} else {
return phrase;
}
};

@@ -7,0 +12,0 @@

{
"name": "indefinite",
"description": "Prefix a noun with an indefinite article - a or an - based on whether it begins with a vowel",
"version": "1.0.0",
"version": "1.0.1",
"main": "lib/indefinite.js",

@@ -42,8 +42,17 @@ "scripts": {

"gulp-rename": "^1.2.2",
"gulp-sequence": "^0.4.1",
"gulp-uglify": "^1.4.2",
"jshint-stylish": "^2.0.1",
"karma": "^0.13.14",
"karma-chrome-launcher": "^0.2.1",
"karma-coffee-preprocessor": "^0.3.0",
"karma-firefox-launcher": "^0.1.6",
"karma-mocha": "^0.2.0",
"karma-mocha-reporter": "^1.1.1",
"karma-phantomjs-launcher": "^0.2.1",
"mocha": "^2.3.3",
"mocha-given": "^0.1.3",
"phantomjs": "^1.9.18",
"should": "^7.1.1"
}
}

@@ -22,2 +22,6 @@ [![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-187b-brightgreen.svg)

console.log(a('banana')); // "a banana"
// You can also capitalize the article by passing "true" as the second argument
console.log(a('apple', true)); // 'An apple'
console.log(a('banana', true)); // 'A banana'
```

@@ -24,0 +28,0 @@

@@ -15,1 +15,8 @@ describe 'indefinite', ->

Then -> @subject('Banana').should.eql 'a Banana'
context 'capitalize the article when the noun has a vowel', ->
Then -> @subject('apple', true).should.eql 'An apple'
context 'capitalize the article when the noun has a consonant', ->
Then -> @subject('banana', true).should.eql 'A banana'