From 2fb81d805f252b509dba76bb0f28c26c020c43ec Mon Sep 17 00:00:00 2001 From: Matt Zabriskie Date: Thu, 28 Aug 2014 15:56:32 -0600 Subject: [PATCH] Adding banner --- Gruntfile.js | 19 ++++++++++++++++++- dist/axios.amd.min.js | 1 + dist/axios.min.js | 1 + package.json | 3 ++- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index a2ec027..628a82c 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -2,6 +2,11 @@ module.exports = function(grunt) { require('load-grunt-tasks')(grunt); grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + meta: { + banner: '/* <%= pkg.name %> v<%= pkg.version %> | (c) <%= grunt.template.today("yyyy") %> by Matt Zabriskie */\n' + }, + clean: { dist: 'dist/**' }, @@ -21,6 +26,18 @@ module.exports = function(grunt) { } }, + usebanner: { + all: { + options: { + banner: '<%= meta.banner %>', + linebreak: false + }, + files: { + src: ['dist/axios.min.js', 'dist/axios.amd.min.js'] + } + } + }, + karma: { options: { configFile: 'karma.conf.js' @@ -53,7 +70,7 @@ module.exports = function(grunt) { grunt.registerTask('test', ['webpack:global', 'nodeunit', 'karma:single']); grunt.registerTask('build', ['webpack']); - grunt.registerTask('publish', ['clean', 'test', 'build', 'update_json']); + grunt.registerTask('publish', ['clean', 'test', 'build', 'usebanner', 'update_json']); function generateWebpackConfig() { var webpack = require('webpack'); diff --git a/dist/axios.amd.min.js b/dist/axios.amd.min.js index 942c904..c855454 100644 --- a/dist/axios.amd.min.js +++ b/dist/axios.amd.min.js @@ -1,2 +1,3 @@ +/* axios v0.0.0 | (c) 2014 by Matt Zabriskie */ define("axios",[],function(){return function(t){function n(r){if(e[r])return e[r].exports;var o=e[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var e={};return n.m=t,n.c=e,n.p="",n(0)}([function(t,n,e){t.exports=e(1)},function(t,n,e){function r(){f.forEach(arguments,function(t){l[t]=function(n,e){return l(f.merge(e||{},{method:t,url:n}))}})}function o(){f.forEach(arguments,function(t){l[t]=function(n,e,r){return l(f.merge(r||{},{method:t,url:n,data:e}))}})}var i=e(7).Promise,s=e(2),c=e(3),u=e(4),a=e(5),f=e(6),l=t.exports=function(t){t=f.merge({method:"get",transformRequest:c.transformRequest,transformResponse:c.transformResponse},t),t.withCredentials=t.withCredentials||c.withCredentials;var n=new i(function(n,e){var r=new(XMLHttpRequest||ActiveXObject)("Microsoft.XMLHTTP"),o=a(t.data,t.headers,t.transformRequest);r.open(t.method,s(t.url,t.params),!0),r.onreadystatechange=function(){if(r&&4===r.readyState){var o=u(r.getAllResponseHeaders()),i={data:a(r.responseText,o,t.transformResponse),status:r.status,headers:o,config:t};r.status>=200&&r.status<300?n(i):e(i),r=null}};var i=f.merge(c.headers.common,c.headers[t.method]||{},t.headers||{});if(f.forEach(i,function(t,n){"undefined"==typeof o&&"content-type"===n.toLowerCase()?delete i[n]:r.setRequestHeader(n,t)}),t.withCredentials&&(r.withCredentials=!0),t.responseType)try{r.responseType=t.responseType}catch(l){if("json"!==r.responseType)throw l}r.send(o)});return n.success=function(t){return n.then(function(n){t(n)}),n},n.error=function(t){return n.then(null,function(n){t(n)}),n},n};l.defaults=c,r("delete","get","head"),o("post","put","patch")},function(t,n,e){"use strict";function r(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}var o=e(6);t.exports=function(t,n){if(!n)return t;var e=[];return o.forEach(n,function(t,n){null!==t&&"undefined"!=typeof t&&(o.isArray(t)||(t=[t]),o.forEach(t,function(t){o.isDate(t)?t=t.toISOString():o.isObject(t)&&(t=JSON.stringify(t)),e.push(r(n)+"="+r(t))}))}),e.length>0&&(t+=(-1===t.indexOf("?")?"?":"&")+e.join("&")),t}},function(t,n,e){"use strict";var r=e(6),o=/^\s*(\[|\{[^\{])/,i=/[\}\]]\s*$/,s=/^\)\]\}',?\n/,c={"Content-Type":"application/json;charset=utf-8"};t.exports={transformRequest:[function(t){return!r.isObject(t)||r.isFile(t)||r.isBlob(t)?null:JSON.stringify(t)}],transformResponse:[function(t){return"string"==typeof t&&(t=t.replace(s,""),o.test(t)&&i.test(t)&&(t=JSON.parse(t))),t}],headers:{common:{Accept:"application/json, text/plain, */*"},patch:r.merge(c),post:r.merge(c),put:r.merge(c)},xsrfCookiName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN"}},function(t,n,e){"use strict";var r=e(6);t.exports=function(t){var n,e,o,i={};return t?(r.forEach(t.split("\n"),function(t){o=t.indexOf(":"),n=r.trim(t.substr(0,o)).toLowerCase(),e=r.trim(t.substr(o+1)),n&&(i[n]=i[n]?i[n]+", "+e:e)}),i):i}},function(t,n,e){"use strict";var r=e(6);t.exports=function(t,n,e){return r.forEach(e,function(e){t=e(t,n)}),t}},function(t){function n(t){return"[object Array]"===a.call(t)}function e(t){return null!==t&&"object"==typeof t}function r(t){return"[object Date]"===a.call(t)}function o(t){return"[object File]"===a.call(t)}function i(t){return"[object Blob]"!==a.call(t)}function s(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}function c(t,n){if(null!==t&&"undefined"!=typeof t){var e=t.constructor===Array||"function"==typeof t.callee;if("object"==typeof t||e||(t=[t]),e)for(var r=0,o=t.length;o>r;r++)n.call(null,t[r],r,t);else for(var i in t)t.hasOwnProperty(i)&&n.call(null,t[i],i,t)}}function u(){var t={};return c(arguments,function(n){c(n,function(n,e){t[e]=n})}),t}var a=Object.prototype.toString;t.exports={isArray:n,isObject:e,isDate:r,isFile:o,isBlob:i,forEach:c,merge:u,trim:s}},function(t,n,e){"use strict";var r=e(8).Promise,o=e(9).polyfill;n.Promise=r,n.polyfill=o},function(t,n,e){"use strict";function r(t){if(!m(t))throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof r))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._subscribers=[],o(t,this)}function o(t,n){function e(t){a(n,t)}function r(t){l(n,t)}try{t(e,r)}catch(o){r(o)}}function i(t,n,e,r){var o,i,s,c,f=m(e);if(f)try{o=e(r),s=!0}catch(p){c=!0,i=p}else o=r,s=!0;u(n,o)||(f&&s?a(n,o):c?l(n,i):t===_?a(n,o):t===E&&l(n,o))}function s(t,n,e,r){var o=t._subscribers,i=o.length;o[i]=n,o[i+_]=e,o[i+E]=r}function c(t,n){for(var e,r,o=t._subscribers,s=t._detail,c=0;c0)){var r=e.shift();r()}},!0),function(t){e.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),e.title="browser",e.browser=!0,e.env={},e.argv=[],e.on=n,e.addListener=n,e.once=n,e.off=n,e.removeListener=n,e.removeAllListeners=n,e.emit=n,e.binding=function(){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(){throw new Error("process.chdir is not supported")}}])}); //# sourceMappingURL=axios.amd.min.map \ No newline at end of file diff --git a/dist/axios.min.js b/dist/axios.min.js index e7795d1..764ac6f 100644 --- a/dist/axios.min.js +++ b/dist/axios.min.js @@ -1,2 +1,3 @@ +/* axios v0.0.0 | (c) 2014 by Matt Zabriskie */ var axios=function(t){function n(r){if(e[r])return e[r].exports;var o=e[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var e={};return n.m=t,n.c=e,n.p="",n(0)}([function(t,n,e){t.exports=e(1)},function(t,n,e){function r(){f.forEach(arguments,function(t){l[t]=function(n,e){return l(f.merge(e||{},{method:t,url:n}))}})}function o(){f.forEach(arguments,function(t){l[t]=function(n,e,r){return l(f.merge(r||{},{method:t,url:n,data:e}))}})}var i=e(7).Promise,s=e(2),c=e(3),u=e(4),a=e(5),f=e(6),l=t.exports=function(t){t=f.merge({method:"get",transformRequest:c.transformRequest,transformResponse:c.transformResponse},t),t.withCredentials=t.withCredentials||c.withCredentials;var n=new i(function(n,e){var r=new(XMLHttpRequest||ActiveXObject)("Microsoft.XMLHTTP"),o=a(t.data,t.headers,t.transformRequest);r.open(t.method,s(t.url,t.params),!0),r.onreadystatechange=function(){if(r&&4===r.readyState){var o=u(r.getAllResponseHeaders()),i={data:a(r.responseText,o,t.transformResponse),status:r.status,headers:o,config:t};r.status>=200&&r.status<300?n(i):e(i),r=null}};var i=f.merge(c.headers.common,c.headers[t.method]||{},t.headers||{});if(f.forEach(i,function(t,n){"undefined"==typeof o&&"content-type"===n.toLowerCase()?delete i[n]:r.setRequestHeader(n,t)}),t.withCredentials&&(r.withCredentials=!0),t.responseType)try{r.responseType=t.responseType}catch(l){if("json"!==r.responseType)throw l}r.send(o)});return n.success=function(t){return n.then(function(n){t(n)}),n},n.error=function(t){return n.then(null,function(n){t(n)}),n},n};l.defaults=c,r("delete","get","head"),o("post","put","patch")},function(t,n,e){"use strict";function r(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}var o=e(6);t.exports=function(t,n){if(!n)return t;var e=[];return o.forEach(n,function(t,n){null!==t&&"undefined"!=typeof t&&(o.isArray(t)||(t=[t]),o.forEach(t,function(t){o.isDate(t)?t=t.toISOString():o.isObject(t)&&(t=JSON.stringify(t)),e.push(r(n)+"="+r(t))}))}),e.length>0&&(t+=(-1===t.indexOf("?")?"?":"&")+e.join("&")),t}},function(t,n,e){"use strict";var r=e(6),o=/^\s*(\[|\{[^\{])/,i=/[\}\]]\s*$/,s=/^\)\]\}',?\n/,c={"Content-Type":"application/json;charset=utf-8"};t.exports={transformRequest:[function(t){return!r.isObject(t)||r.isFile(t)||r.isBlob(t)?null:JSON.stringify(t)}],transformResponse:[function(t){return"string"==typeof t&&(t=t.replace(s,""),o.test(t)&&i.test(t)&&(t=JSON.parse(t))),t}],headers:{common:{Accept:"application/json, text/plain, */*"},patch:r.merge(c),post:r.merge(c),put:r.merge(c)},xsrfCookiName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN"}},function(t,n,e){"use strict";var r=e(6);t.exports=function(t){var n,e,o,i={};return t?(r.forEach(t.split("\n"),function(t){o=t.indexOf(":"),n=r.trim(t.substr(0,o)).toLowerCase(),e=r.trim(t.substr(o+1)),n&&(i[n]=i[n]?i[n]+", "+e:e)}),i):i}},function(t,n,e){"use strict";var r=e(6);t.exports=function(t,n,e){return r.forEach(e,function(e){t=e(t,n)}),t}},function(t){function n(t){return"[object Array]"===a.call(t)}function e(t){return null!==t&&"object"==typeof t}function r(t){return"[object Date]"===a.call(t)}function o(t){return"[object File]"===a.call(t)}function i(t){return"[object Blob]"!==a.call(t)}function s(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}function c(t,n){if(null!==t&&"undefined"!=typeof t){var e=t.constructor===Array||"function"==typeof t.callee;if("object"==typeof t||e||(t=[t]),e)for(var r=0,o=t.length;o>r;r++)n.call(null,t[r],r,t);else for(var i in t)t.hasOwnProperty(i)&&n.call(null,t[i],i,t)}}function u(){var t={};return c(arguments,function(n){c(n,function(n,e){t[e]=n})}),t}var a=Object.prototype.toString;t.exports={isArray:n,isObject:e,isDate:r,isFile:o,isBlob:i,forEach:c,merge:u,trim:s}},function(t,n,e){"use strict";var r=e(8).Promise,o=e(9).polyfill;n.Promise=r,n.polyfill=o},function(t,n,e){"use strict";function r(t){if(!m(t))throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof r))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._subscribers=[],o(t,this)}function o(t,n){function e(t){a(n,t)}function r(t){l(n,t)}try{t(e,r)}catch(o){r(o)}}function i(t,n,e,r){var o,i,s,c,f=m(e);if(f)try{o=e(r),s=!0}catch(p){c=!0,i=p}else o=r,s=!0;u(n,o)||(f&&s?a(n,o):c?l(n,i):t===_?a(n,o):t===E&&l(n,o))}function s(t,n,e,r){var o=t._subscribers,i=o.length;o[i]=n,o[i+_]=e,o[i+E]=r}function c(t,n){for(var e,r,o=t._subscribers,s=t._detail,c=0;c0)){var r=e.shift();r()}},!0),function(t){e.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),e.title="browser",e.browser=!0,e.env={},e.argv=[],e.on=n,e.addListener=n,e.once=n,e.off=n,e.removeListener=n,e.removeAllListeners=n,e.emit=n,e.binding=function(){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(){throw new Error("process.chdir is not supported")}}]); //# sourceMappingURL=axios.min.map \ No newline at end of file diff --git a/package.json b/package.json index 8e5f08e..4c8b20c 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "karma-phantomjs-launcher": "^0.1.4", "karma-jasmine-ajax": "^0.1.4", "grunt-update-json": "^0.1.3", - "grunt-contrib-nodeunit": "^0.4.1" + "grunt-contrib-nodeunit": "^0.4.1", + "grunt-banner": "^0.2.3" } }