From 4e63a6de21fb45f0af175d9c373637d10a5c501c Mon Sep 17 00:00:00 2001 From: Greg Franko Date: Fri, 17 Jan 2014 02:33:05 -0500 Subject: [PATCH] Releasing v0.5.0 --- build/amdclean.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/amdclean.min.js b/build/amdclean.min.js index 260aafc..43a69ae 100644 --- a/build/amdclean.min.js +++ b/build/amdclean.min.js @@ -1 +1 @@ -!function(e,n){"use strict";"function"==typeof define&&define.amd?(n.env="undefined"!=typeof exports?"node":"web",n.amd=!0,define(["esprima","estraverse","escodegen","underscore"],function(e,r,t,i){return n({esprima:e,estraverse:r,escodegen:t,underscore:i})})):"undefined"!=typeof exports?(n.env="node",n()):(n.env="web",e.amdclean=n())}(this,function cleanamd(amdDependencies){var codeEnv=cleanamd.env,esprima=cleanamd.amd?amdDependencies.esprima:"node"===codeEnv?require("esprima"):window.esprima,estraverse=cleanamd.amd?amdDependencies.estraverse:"node"===codeEnv?require("estraverse"):window.estraverse,escodegen=cleanamd.amd?amdDependencies.escodegen.generate?amdDependencies.escodegen:"node"===codeEnv?require("escodegen"):window.escodegen:require("escodegen"),_=cleanamd.amd?amdDependencies.underscore:"node"===codeEnv?require("lodash"):window._,fs="node"===codeEnv?require("fs"):{},publicAPI={VERSION:"0.4.0",defaultOptions:{globalObject:!1,globalObjectName:"amdclean",rememberGlobalObject:!0,removeAllRequires:!1,ignoreModules:[],escodegen:{},esprima:{comment:!0,loc:!0},globalModules:[],commentCleanName:"amdclean"},env:codeEnv,errorMsgs:{emptyCode:"There is no code to generate the AST with",emptyAst:function(e){return"An AST is not being passed to the "+e+"() method"},invalidObject:function(e){return"An object is not being passed as the first parameter to the "+e+"() method"},lodash:"There is not an _.isPlainObject() method. Make sure you have included lodash (https://github.com/lodash/lodash).",esprima:"There is not an esprima.parse() method. Make sure you have included esprima (https://github.com/ariya/esprima).",estraverse:"There is not an estraverse.replace() method. Make sure you have included estraverse (https://github.com/Constellation/estraverse).",escodegen:"There is not an escodegen.generate() method. Make sure you have included escodegen (https://github.com/Constellation/escodegen)."},dependencyBlacklist:{require:!0,exports:!0,module:!0},readFile:function(e){return"node"!==publicAPI.env?"":fs.readFileSync(e,"utf8")},isDefine:function(e){var n=e.expression||{},r=n.callee;return"ExpressionStatement"===e.type&&!_.isUndefined(n)&&"CallExpression"===n.type&&"Identifier"===r.type&&"define"===r.name},isRequire:function(e){var n=e.expression||{},r=n.callee;return"ExpressionStatement"===e.type&&!_.isUndefined(n)&&"CallExpression"===n.type&&"Identifier"===r.type&&"require"===r.name},isRequireExpression:function(e){return"CallExpression"===e.type&&e.callee&&"require"===e.callee.name},isObjectExpression:function(e){return e&&_.isPlainObject(e)&&"ObjectExpression"===e.type},isFunctionExpression:function(e){return e&&_.isPlainObject(e)&&"FunctionExpression"===e.type},prefixReservedWords:function(name){var reservedWord=!1;try{name.length&&eval("var "+name+" = 1;")}catch(e){reservedWord=!0}return reservedWord===!0?"_"+name:name},normalizeModuleName:function(e){if(e=e||"","{}"===e)return e;var n=e.replace(/\./g,"").replace(/[^A-Za-z0-9_$]/g,"_").replace(/^_+/,"");return publicAPI.prefixReservedWords(n)},returnExpressionIdentifier:function(e){return{type:"ExpressionStatement",expression:{type:"Identifier",name:e}}},convertToObjectDeclaration:function(e){var n=(e.node,e.moduleName),r=e.moduleReturnValue,t=publicAPI.options,i=function(){return t.globalObject===!0&&t.globalObjectName?{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",computed:!0,object:{type:"Identifier",name:t.globalObjectName},property:{type:"Literal",value:n,raw:""+n}},right:r}}:{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:n},init:r}],kind:"var"}}();return i},convertToIIFE:function(e){var n=e.callbackFuncParams,r=e.callbackFunc,t=e.dependencyNames;return{type:"ExpressionStatement",expression:{type:"CallExpression",callee:{type:"FunctionExpression",id:null,params:n,defaults:[],body:r.body,rest:r.rest,generator:r.generator,expression:r.expression},arguments:t}}},convertToIIFEDeclaration:function(e){var n=e.moduleName,r=e.callbackFuncParams,t=e.callbackFunc,i=e.dependencyNames,o=publicAPI.options,a={type:"CallExpression",callee:{type:"FunctionExpression",id:{type:"Identifier",name:""},params:r,defaults:[],body:t.body,rest:t.rest,generator:t.generator,expression:t.expression},arguments:i},s=function(){return o.globalObject===!0&&o.globalObjectName?{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",computed:!0,object:{type:"Identifier",name:o.globalObjectName},property:{type:"Literal",value:n,raw:""+n}},right:a}}:{type:"VariableDeclaration",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:n},init:a}],kind:"var"}}();return s},convertToFunctionExpression:function(e){var n=e.isDefine,r=e.isRequire,t=(e.node,e.moduleName),i=e.dependencies,o=i.length,a=publicAPI.options,s=function(){for(var e,n=[],r=-1;++r