| @@ -383,13 +383,16 @@ | |||||
| Context.prototype.resolvePipelineOperator = function resolvePipelineOperator (value, pipelines){ | Context.prototype.resolvePipelineOperator = function resolvePipelineOperator (value, pipelines){ | ||||
| var self = this; | var self = this; | ||||
| var pipelineResolver = function pipelineResolver (val, func){ | var pipelineResolver = function pipelineResolver (val, func){ | ||||
| if (self.view.hasOwnProperty(func)){ | |||||
| return self.view[func](val); | |||||
| } else if (self.parent && self.parent.view.hasOwnProperty(func)){ | |||||
| return self.parent.view[func](val); | |||||
| } else { | |||||
| return val; | |||||
| var findFunction = function(instance, functionToFind, valueToPutInFindedFunction, depth){ | |||||
| if(depth <= 0 || !instance) return null; | |||||
| if(instance.view.hasOwnProperty(functionToFind)) return instance.view[func](valueToPutInFindedFunction); | |||||
| return findFunction(instance.parent, functionToFind, val, depth) | |||||
| } | } | ||||
| var findedFunction = findFunction(self, func, val, 20) | |||||
| return findedFunction ? findedFunction : val | |||||
| }; | }; | ||||
| return pipelines.reduce(pipelineResolver,value); | return pipelines.reduce(pipelineResolver,value); | ||||
| }; | }; | ||||
| @@ -1,6 +1,6 @@ | |||||
| { | { | ||||
| "name": "mustache", | |||||
| "version": "3.0.1", | |||||
| "name": "terun-mustache", | |||||
| "version": "3.0.3", | |||||
| "description": "Logic-less {{mustache}} templates with JavaScript", | "description": "Logic-less {{mustache}} templates with JavaScript", | ||||
| "author": "mustache.js Authors <http://github.com/janl/mustache.js>", | "author": "mustache.js Authors <http://github.com/janl/mustache.js>", | ||||
| "homepage": "https://github.com/janl/mustache.js", | "homepage": "https://github.com/janl/mustache.js", | ||||
| @@ -44,7 +44,7 @@ | |||||
| "eslint": "2.5.1", | "eslint": "2.5.1", | ||||
| "jshint": "^2.9.5", | "jshint": "^2.9.5", | ||||
| "mocha": "^3.0.2", | "mocha": "^3.0.2", | ||||
| "uglify-js": "^3.4.6", | |||||
| "uglify-js": "^3.4.6" | |||||
| "zuul": "^3.11.0", | "zuul": "^3.11.0", | ||||
| "zuul-ngrok": "nolanlawson/zuul-ngrok#patch-1" | "zuul-ngrok": "nolanlawson/zuul-ngrok#patch-1" | ||||
| }, | }, | ||||
| @@ -0,0 +1 @@ | |||||
| Howdy LeBron, CLI rox | |||||
| @@ -3,6 +3,15 @@ | |||||
| job: { | job: { | ||||
| name: 'Developer' | name: 'Developer' | ||||
| }, | }, | ||||
| attributes:[ | |||||
| { | |||||
| name: 'good', | |||||
| options: [ | |||||
| 'outgoing', | |||||
| 'shy' | |||||
| ] | |||||
| } | |||||
| ], | |||||
| numbers:[1,2,3], | numbers:[1,2,3], | ||||
| sumOne:(value)=>{ | sumOne:(value)=>{ | ||||
| return value + 1; | return value + 1; | ||||
| @@ -48,3 +48,10 @@ | |||||
| {{#numbers}} | {{#numbers}} | ||||
| {{. |> sumOne |> setNameFuncion |> lower}} | {{. |> sumOne |> setNameFuncion |> lower}} | ||||
| {{/numbers}} | {{/numbers}} | ||||
| -- Level Array | |||||
| {{#attributes}} | |||||
| {{#options}} | |||||
| {{name |> upper}} | |||||
| {{. |> upper}} | |||||
| {{/options}} | |||||
| {{/attributes}} | |||||
| @@ -48,3 +48,8 @@ Developer | |||||
| 2: this is a value | 2: this is a value | ||||
| 3: this is a value | 3: this is a value | ||||
| 4: this is a value | 4: this is a value | ||||
| -- Level Array | |||||
| GOOD | |||||
| OUTGOING | |||||
| GOOD | |||||
| SHY | |||||