expand-path
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -1,46 +0,1 @@ | ||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.expandPath = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
var Consumed = require('consumed'); | ||
var braces = { | ||
'[': ']', | ||
'{': '}', | ||
'<': '>' | ||
}; | ||
var _stringContainsAny = function(path, arr) { | ||
for (var i = 0; i < arr.length; i++) { | ||
if (path.indexOf(arr[i]) > -1) { | ||
return arr[i]; | ||
} | ||
} | ||
}; | ||
var _extendStr = function(addition, original) { | ||
return original += addition; | ||
}; | ||
var _reducePaths = function(paths, memo, br) { | ||
return memo.concat(paths.map(_extendStr.bind(null, br))); | ||
}; | ||
module.exports = function(path) { | ||
var consumer = new Consumed(path); | ||
var brace = _stringContainsAny(path, ['{', '[', '<']); | ||
if (!brace) { | ||
return [path]; | ||
} else { | ||
var paths = ['']; | ||
while (consumer.str.indexOf(brace) > -1) { | ||
var staticStr = consumer.consumeTill(brace); | ||
if (staticStr) { | ||
paths = paths.map(_extendStr.bind(null, staticStr)); | ||
} | ||
var braceStr = consumer.consumeTill(braces[brace], true); | ||
var branches = braceStr.replace(brace, '').replace(braces[brace], '').split(/\s*,\s*/g); | ||
paths = branches.reduce(_reducePaths.bind(null, paths), []); | ||
} | ||
return paths; | ||
} | ||
}; | ||
},{"consumed":2}],2:[function(require,module,exports){ | ||
(function() { | ||
@@ -78,3 +33,54 @@ var Consumed = function(str) { | ||
},{}]},{},[1])(1) | ||
}); | ||
(function() { | ||
var isNode = typeof module !== 'undefined' && this.module !== module; | ||
var Consumed = isNode ? require('consumed') : window.Consumed; | ||
var braces = { | ||
'[': ']', | ||
'{': '}', | ||
'<': '>' | ||
}; | ||
var _stringContainsAny = function(path, arr) { | ||
for (var i = 0; i < arr.length; i++) { | ||
if (path.indexOf(arr[i]) > -1) { | ||
return arr[i]; | ||
} | ||
} | ||
}; | ||
var _extendStr = function(addition, original) { | ||
return original += addition; | ||
}; | ||
var _reducePaths = function(paths, memo, br) { | ||
return memo.concat(paths.map(_extendStr.bind(null, br))); | ||
}; | ||
var expandPath = function(path) { | ||
var consumer = new Consumed(path); | ||
var brace = _stringContainsAny(path, [ '{', '[', '<' ]); | ||
if (!brace) { | ||
return [path]; | ||
} else { | ||
var paths = ['']; | ||
while (consumer.str.indexOf(brace) > -1) { | ||
var staticStr = consumer.consumeTill(brace); | ||
if (staticStr) { | ||
paths = paths.map(_extendStr.bind(null, staticStr)); | ||
} | ||
var braceStr = consumer.consumeTill(braces[brace], true); | ||
var branches = braceStr.replace(brace, '').replace(braces[brace], '').split(/\s*,\s*/g); | ||
paths = branches.reduce(_reducePaths.bind(null, paths), []); | ||
} | ||
return paths; | ||
} | ||
}; | ||
/* istanbul ignore else */ | ||
if (isNode) { | ||
module.exports = expandPath; | ||
} else { | ||
window.expandPath = expandPath; | ||
} | ||
})(); |
@@ -1,1 +0,1 @@ | ||
!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.expandPath=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){var d=a("consumed"),e={"[":"]","{":"}","<":">"},f=function(a,b){for(var c=0;c<b.length;c++)if(a.indexOf(b[c])>-1)return b[c]},g=function(a,b){return b+=a},h=function(a,b,c){return b.concat(a.map(g.bind(null,c)))};b.exports=function(a){var b=new d(a),c=f(a,["{","[","<"]);if(c){for(var i=[""];b.str.indexOf(c)>-1;){var j=b.consumeTill(c);j&&(i=i.map(g.bind(null,j)));var k=b.consumeTill(e[c],!0),l=k.replace(c,"").replace(e[c],"").split(/\s*,\s*/g);i=l.reduce(h.bind(null,i),[])}return i}return[a]}},{consumed:2}],2:[function(a,b,c){!function(){var a=function(a){this.str=a};a.prototype._updateString=function(a){this.str=this.str.replace(a,"")},a.prototype.consumeTill=function(a,b){var c=this.str.substring(0,this.str.indexOf(a)+(b?1:0));return this._updateString(c),c},a.prototype.consume=function(a){var b=this.str.match(a);return b?(this._updateString(a),b[0]):void 0},"object"==typeof b&&b.exports&&(b.exports=a),"undefined"!=typeof window&&(window.Consumed=a)}()},{}]},{},[1])(1)}); | ||
!function(){var a=function(a){this.str=a};a.prototype._updateString=function(a){this.str=this.str.replace(a,"")},a.prototype.consumeTill=function(a,b){var c=this.str.substring(0,this.str.indexOf(a)+(b?1:0));return this._updateString(c),c},a.prototype.consume=function(a){var b=this.str.match(a);if(b)return this._updateString(a),b[0]},"object"==typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&(window.Consumed=a)}(),function(){var a="undefined"!=typeof module&&this.module!==module,b=a?require("consumed"):window.Consumed,c={"[":"]","{":"}","<":">"},d=function(a,b){for(var c=0;c<b.length;c++)if(a.indexOf(b[c])>-1)return b[c]},e=function(a,b){return b+=a},f=function(a,b,c){return b.concat(a.map(e.bind(null,c)))},g=function(a){var g=new b(a),h=d(a,["{","[","<"]);if(h){for(var i=[""];g.str.indexOf(h)>-1;){var j=g.consumeTill(h);j&&(i=i.map(e.bind(null,j)));var k=g.consumeTill(c[h],!0),l=k.replace(h,"").replace(c[h],"").split(/\s*,\s*/g);i=l.reduce(f.bind(null,i),[])}return i}return[a]};a?module.exports=g:window.expandPath=g}(); |
@@ -1,18 +0,1 @@ | ||
var tm = require('task-master'); | ||
module.exports = function(grunt) { | ||
tm(grunt, { | ||
jit: { | ||
travis: 'grunt-travis-matrix', | ||
matrix: 'grunt-travis-matrix', | ||
mochacov: 'grunt-mocha-cov' | ||
} | ||
}); | ||
grunt.registerTask('mocha', ['mochaTest:test']); | ||
grunt.registerTask('test', ['jshint:all', 'mocha', 'testem:ci:browser']); | ||
grunt.registerTask('default', ['browserify:dist', 'test']); | ||
grunt.registerTask('coverage', ['mochacov:html', 'open:coverage']); | ||
grunt.registerTask('ci', ['test', 'travis']); | ||
grunt.registerTask('build', ['clean:dist', 'browserify:dist', 'uglify:dist']); | ||
grunt.registerTask('browser', ['browserify:dist', 'testem:run:browser']); | ||
}; | ||
module.exports = require('task-master'); |
@@ -1,42 +0,53 @@ | ||
var Consumed = require('consumed'); | ||
var braces = { | ||
'[': ']', | ||
'{': '}', | ||
'<': '>' | ||
}; | ||
(function() { | ||
var isNode = typeof module !== 'undefined' && this.module !== module; | ||
var _stringContainsAny = function(path, arr) { | ||
for (var i = 0; i < arr.length; i++) { | ||
if (path.indexOf(arr[i]) > -1) { | ||
return arr[i]; | ||
var Consumed = isNode ? require('consumed') : window.Consumed; | ||
var braces = { | ||
'[': ']', | ||
'{': '}', | ||
'<': '>' | ||
}; | ||
var _stringContainsAny = function(path, arr) { | ||
for (var i = 0; i < arr.length; i++) { | ||
if (path.indexOf(arr[i]) > -1) { | ||
return arr[i]; | ||
} | ||
} | ||
} | ||
}; | ||
}; | ||
var _extendStr = function(addition, original) { | ||
return original += addition; | ||
}; | ||
var _extendStr = function(addition, original) { | ||
return original += addition; | ||
}; | ||
var _reducePaths = function(paths, memo, br) { | ||
return memo.concat(paths.map(_extendStr.bind(null, br))); | ||
}; | ||
var _reducePaths = function(paths, memo, br) { | ||
return memo.concat(paths.map(_extendStr.bind(null, br))); | ||
}; | ||
module.exports = function(path) { | ||
var consumer = new Consumed(path); | ||
var brace = _stringContainsAny(path, ['{', '[', '<']); | ||
if (!brace) { | ||
return [path]; | ||
} else { | ||
var paths = ['']; | ||
while (consumer.str.indexOf(brace) > -1) { | ||
var staticStr = consumer.consumeTill(brace); | ||
if (staticStr) { | ||
paths = paths.map(_extendStr.bind(null, staticStr)); | ||
var expandPath = function(path) { | ||
var consumer = new Consumed(path); | ||
var brace = _stringContainsAny(path, [ '{', '[', '<' ]); | ||
if (!brace) { | ||
return [path]; | ||
} else { | ||
var paths = ['']; | ||
while (consumer.str.indexOf(brace) > -1) { | ||
var staticStr = consumer.consumeTill(brace); | ||
if (staticStr) { | ||
paths = paths.map(_extendStr.bind(null, staticStr)); | ||
} | ||
var braceStr = consumer.consumeTill(braces[brace], true); | ||
var branches = braceStr.replace(brace, '').replace(braces[brace], '').split(/\s*,\s*/g); | ||
paths = branches.reduce(_reducePaths.bind(null, paths), []); | ||
} | ||
var braceStr = consumer.consumeTill(braces[brace], true); | ||
var branches = braceStr.replace(brace, '').replace(braces[brace], '').split(/\s*,\s*/g); | ||
paths = branches.reduce(_reducePaths.bind(null, paths), []); | ||
return paths; | ||
} | ||
return paths; | ||
}; | ||
/* istanbul ignore else */ | ||
if (isNode) { | ||
module.exports = expandPath; | ||
} else { | ||
window.expandPath = expandPath; | ||
} | ||
}; | ||
})(); |
{ | ||
"name": "expand-path", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Super light-weight brace expansion for node", | ||
"main": "lib/expand-path.js", | ||
"scripts": { | ||
"test": "grunt" | ||
"test": "grunt", | ||
"travis": "grunt ci", | ||
"codeclimate": "codeclimate-test-reporter < coverage/lcov.info" | ||
}, | ||
@@ -29,22 +31,21 @@ "repository": { | ||
"devDependencies": { | ||
"codeclimate-test-reporter": "^0.4.0", | ||
"coffee-script": "^1.9.3", | ||
"expect.js": "^0.3.1", | ||
"grunt": "^0.4.5", | ||
"grunt-browserify": "^3.8.0", | ||
"grunt-contrib-clean": "^0.6.0", | ||
"grunt-contrib-jshint": "^0.11.2", | ||
"grunt-contrib-testem": "^0.5.16", | ||
"grunt-contrib-uglify": "^0.9.1", | ||
"grunt-contrib-watch": "^0.6.1", | ||
"grunt-mocha-cov": "^0.4.0", | ||
"grunt-mocha-test": "^0.12.7", | ||
"eslint-codeframe-formatter": "^1.0.2", | ||
"grunt": "^1.0.1", | ||
"grunt-cli": "^1.2.0", | ||
"grunt-contrib-clean": "^1.0.0", | ||
"grunt-contrib-concat": "^1.0.1", | ||
"grunt-contrib-uglify": "^2.0.0", | ||
"grunt-contrib-watch": "^1.0.0", | ||
"grunt-eslint": "^19.0.0", | ||
"grunt-mocha-test": "^0.13.2", | ||
"grunt-open": "^0.2.3", | ||
"grunt-travis-matrix": "0.0.5", | ||
"indeed": "^1.0.6", | ||
"jshint-stylish": "^2.0.1", | ||
"mocha": "^2.2.5", | ||
"grunt-shell": "^2.1.0", | ||
"grunt-simple-istanbul": "^3.0.2", | ||
"grunt-testem-mincer": "^0.5.18", | ||
"grunt-travis-matrix": "1.0.0", | ||
"mocha": "^3.2.0", | ||
"mocha-given": "^0.1.3", | ||
"mocha-lcov-reporter": "0.0.2", | ||
"proxyquire": "^1.5.0", | ||
"sinon": "^1.15.4", | ||
"should": "^11.1.2", | ||
"task-master": "^2.2.1" | ||
@@ -54,10 +55,3 @@ }, | ||
"consumed": "^1.0.0" | ||
}, | ||
"config": { | ||
"blanket": { | ||
"pattern": [ | ||
"expand-path/lib" | ||
] | ||
} | ||
} | ||
} |
@@ -5,7 +5,7 @@ module.exports = { | ||
ui: 'mocha-given', | ||
require: 'coffee-script/register' | ||
require: ['should', 'coffee-script/register'] | ||
}, | ||
test: { | ||
src: ['test/**/*.coffee', '!test/browser/**'] | ||
src: ['test/**/*.coffee'] | ||
} | ||
}; |
module.exports = { | ||
coverage: { | ||
path: 'coverage/coverage.html' | ||
path: 'coverage/lcov-report/index.html' | ||
} | ||
}; |
@@ -5,6 +5,6 @@ module.exports = { | ||
'test/helpers/bind-polyfill.js', | ||
'node_modules/should/should.js', | ||
'dist/expand-path.js', | ||
'node_modules/mocha-given/browser/mocha-given.js', | ||
'test/helpers/setup.js', | ||
'node_modules/expect.js/index.js', | ||
'test/*.coffee' | ||
@@ -15,3 +15,2 @@ ], | ||
parallel: 2, | ||
reporter: 'tap', | ||
launch_in_ci: ['PhantomJS'], | ||
@@ -18,0 +17,0 @@ launch_in_dev: ['PhantomJS', 'Chrome', 'Firefox', 'Safari'], |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
17674
20
27
355
0
1