skipped-periodic-values
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "skipped-periodic-values.js", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"homepage": "https://github.com/jmeas/skipped-periodic-values.js", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -1,14 +0,7 @@ | ||
(function (root, factory) { | ||
if (typeof define === "function" && define.amd) { | ||
define(["nearest-periodic-value"], factory); | ||
} else if (typeof exports !== "undefined") { | ||
var nearestPeriodicValue = require("nearest-periodic-value"); | ||
module.exports = factory(nearestPeriodicValue); | ||
} else { | ||
root.skippedPeriodicValues = factory(root.nearestPeriodicValue); | ||
} | ||
(function (global, factory) { | ||
typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory(require("nearest-periodic-value")) : typeof define === "function" && define.amd ? define(["nearest-periodic-value"], factory) : global.skippedPeriodicValues = factory(global.nearestPeriodicValue); | ||
})(this, function (nearestPeriodicValue) { | ||
"use strict"; | ||
var skippedPeriodicValues = function (start, distance, value, period) { | ||
function skippedPeriodicValues(start, distance, value, period) { | ||
var nearest = nearestPeriodicValue(start, value, period); | ||
@@ -36,9 +29,8 @@ | ||
} | ||
}; | ||
} | ||
var skipped_periodic_values = skippedPeriodicValues; | ||
return skippedPeriodicValues; | ||
return skipped_periodic_values; | ||
}); | ||
//# sourceMappingURL=skipped-periodic-values.js.map | ||
//# sourceMappingURL=./skipped-periodic-values.js.map |
@@ -1,2 +0,2 @@ | ||
!function(a,b){if("function"==typeof define&&define.amd)define(["nearest-periodic-value"],b);else if("undefined"!=typeof exports){var c=require("nearest-periodic-value");module.exports=b(c)}else a.skippedPeriodicValues=b(a.nearestPeriodicValue)}(this,function(a){"use strict";var b=function(b,c,d,e){var f=a(b,d,e);return f===b&&0===c?0:(0>f-b&&(f+=e),f-b>c?0:1+parseInt((c-f)/(e-1)))};return b}); | ||
!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b(require("nearest-periodic-value")):"function"==typeof define&&define.amd?define(["nearest-periodic-value"],b):a.skippedPeriodicValues=b(a.nearestPeriodicValue)}(this,function(a){"use strict";function b(b,c,d,e){var f=a(b,d,e);return f===b&&0===c?0:(0>f-b&&(f+=e),f-b>c?0:1+parseInt((c-f)/(e-1)))}var c=b;return c}); | ||
//# sourceMappingURL=skipped-periodic-values.min.js.map |
@@ -5,3 +5,7 @@ var gulp = require('gulp'); | ||
}); | ||
const fs = require('fs'); | ||
const del = require('del'); | ||
const path = require('path'); | ||
const isparta = require('isparta'); | ||
const esperanto = require('esperanto'); | ||
const browserify = require('browserify'); | ||
@@ -32,3 +36,4 @@ const runSequence = require('run-sequence'); | ||
gulp.task('lint:src', function() { | ||
return gulp.src(['src/**/*.js', '!src/wrapper.js']) | ||
return gulp.src(['src/**/*.js']) | ||
.pipe($.plumber()) | ||
.pipe($.jshint()) | ||
@@ -43,2 +48,3 @@ .pipe($.jshint.reporter('jshint-stylish')) | ||
return gulp.src(['test/unit/**/*.js']) | ||
.pipe($.plumber()) | ||
.pipe($.jshint()) | ||
@@ -51,18 +57,33 @@ .pipe($.jshint.reporter('jshint-stylish')) | ||
// Build two versions of the library | ||
gulp.task('build', ['lint:src', 'clean'], function() { | ||
return gulp.src('src/wrapper.js') | ||
.pipe($.template(config)) | ||
.pipe($.preprocess()) | ||
.pipe($.rename(config.exportFileName + '.js')) | ||
.pipe($.sourcemaps.init()) | ||
.pipe($.to5({blacklist: ['useStrict'], modules: 'ignore'})) | ||
.pipe($.sourcemaps.write('./')) | ||
.pipe(gulp.dest(config.destinationFolder)) | ||
.pipe($.filter(['*', '!**/*.js.map'])) | ||
.pipe($.rename(config.exportFileName + '.min.js')) | ||
.pipe($.uglifyjs({ | ||
outSourceMap: true, | ||
inSourceMap: config.destinationFolder + '/' + config.exportFileName + '.js.map', | ||
})) | ||
.pipe(gulp.dest(config.destinationFolder)); | ||
gulp.task('build', ['lint:src', 'clean'], function(done) { | ||
esperanto.bundle({ | ||
base: 'src', | ||
entry: config.entryFileName, | ||
}).then(function(bundle) { | ||
res = bundle.toUmd({ | ||
sourceMap: true, | ||
sourceMapSource: config.entryFileName + '.js', | ||
sourceMapFile: config.exportFileName + '.js', | ||
name: config.exportVarName | ||
}); | ||
// Write the generated sourcemap | ||
fs.mkdirSync(config.destinationFolder); | ||
fs.writeFileSync(path.join(config.destinationFolder, config.exportFileName + '.js'), res.map.toString()); | ||
$.file(config.exportFileName + '.js', res.code, { src: true }) | ||
.pipe($.plumber()) | ||
.pipe($.sourcemaps.init({ loadMaps: true })) | ||
.pipe($.to5({ blacklist: ['useStrict'] })) | ||
.pipe($.sourcemaps.write('./', {addComment: false})) | ||
.pipe(gulp.dest(config.destinationFolder)) | ||
.pipe($.filter(['*', '!**/*.js.map'])) | ||
.pipe($.rename(config.exportFileName + '.min.js')) | ||
.pipe($.uglifyjs({ | ||
outSourceMap: true, | ||
inSourceMap: config.destinationFolder + '/' + config.exportFileName + '.js.map', | ||
})) | ||
.pipe(gulp.dest(config.destinationFolder)) | ||
.on('end', done); | ||
}); | ||
}); | ||
@@ -74,3 +95,4 @@ | ||
gulp.task('compile_browser_script', function() { | ||
return gulp.src(['src/**/*.js', '!src/wrapper.js']) | ||
return gulp.src(['src/**/*.js']) | ||
.pipe($.plumber()) | ||
.pipe($.to5({modules: 'common'})) | ||
@@ -87,2 +109,7 @@ .pipe(gulp.dest('tmp')) | ||
return bundleStream | ||
.on('error', function(err){ | ||
console.log(err.message); | ||
this.emit('end'); | ||
}) | ||
.pipe($.plumber()) | ||
.pipe(source('./tmp/__spec-build.js')) | ||
@@ -94,4 +121,6 @@ .pipe(gulp.dest('')) | ||
gulp.task('coverage', function(done) { | ||
gulp.src(['src/*.js', '!src/wrapper.js']) | ||
.pipe($.istanbul()) | ||
gulp.src(['src/*.js']) | ||
.pipe($.plumber()) | ||
.pipe($.istanbul({ instrumenter: isparta.Instrumenter })) | ||
.pipe($.istanbul.hookRequire()) | ||
.on('finish', function() { | ||
@@ -106,2 +135,3 @@ return test() | ||
return gulp.src(['test/setup/node.js', 'test/unit/**/*.js'], {read: false}) | ||
.pipe($.plumber()) | ||
.pipe($.mocha({reporter: 'dot', globals: config.mochaGlobals})); | ||
@@ -122,13 +152,9 @@ }; | ||
// This is used when testing in the browser. Reloads the tests | ||
// when the lib, or the tests themselves, change. | ||
gulp.task('watch', function() { | ||
// Set up a livereload environment for our spec runner | ||
gulp.task('test:browser', ['build_in_sequence'], function() { | ||
$.livereload.listen({port: 35729, host: 'localhost', start: true}); | ||
gulp.watch(['src/**/*.js', 'test/**/*', '.jshintrc', 'test/.jshintrc', 'config/index.json'], ['build_in_sequence']); | ||
return gulp.watch(['src/**/*.js', 'test/**/*', '.jshintrc', 'test/.jshintrc', 'config/index.json'], ['build_in_sequence']); | ||
}); | ||
// Set up a livereload environment for our spec runner | ||
gulp.task('test:browser', ['build_in_sequence', 'watch']); | ||
// An alias of test | ||
gulp.task('default', ['test']); |
{ | ||
"name": "skipped-periodic-values", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Given a point and a distance, determine how many periodic values were skipped.", | ||
@@ -29,10 +29,12 @@ "main": "dist/skipped-periodic-values.js", | ||
"devDependencies": { | ||
"6to5": "^2.12.6", | ||
"6to5": "^3.3.3", | ||
"browserify": "^8.1.1", | ||
"chai": "^1.10.0", | ||
"del": "^1.1.1", | ||
"esperanto": "^0.6.7", | ||
"gulp": "^3.8.10", | ||
"gulp-6to5": "^2.0.2", | ||
"gulp-6to5": "^3.0.0", | ||
"gulp-file": "^0.2.0", | ||
"gulp-filter": "^2.0.0", | ||
"gulp-istanbul": "git://github.com/jmeas/gulp-istanbul.git#isparta", | ||
"gulp-istanbul": "^0.6.0", | ||
"gulp-jshint": "^1.9.0", | ||
@@ -43,7 +45,7 @@ "gulp-livereload": "^3.4.0", | ||
"gulp-notify": "^2.1.0", | ||
"gulp-preprocess": "^1.2.0", | ||
"gulp-plumber": "^0.6.6", | ||
"gulp-rename": "^1.2.0", | ||
"gulp-sourcemaps": "^1.3.0", | ||
"gulp-template": "^2.0.0", | ||
"gulp-uglifyjs": "^0.5.0", | ||
"isparta": "^1.0.1", | ||
"jshint-stylish": "^1.0.0", | ||
@@ -50,0 +52,0 @@ "mocha": "^2.1.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
26059
414
27
21
2