{"action":"created","issue":{"url":"https://api.github.com/repos/janl/mustache.js/issues/480","labels_url":"https://api.github.com/repos/janl/mustache.js/issues/480/labels{/name}","comments_url":"https://api.github.com/repos/janl/mustache.js/issues/480/comments","events_url":"https://api.github.com/repos/janl/mustache.js/issues/480/events","html_url":"https://github.com/janl/mustache.js/issues/480","id":99550158,"number":480,"title":"defining complex helper functions in mustache.js","user":{"login":"nikolas","id":59292,"avatar_url":"https://avatars.githubusercontent.com/u/59292?v=3","gravatar_id":"","url":"https://api.github.com/users/nikolas","html_url":"https://github.com/nikolas","followers_url":"https://api.github.com/users/nikolas/followers","following_url":"https://api.github.com/users/nikolas/following{/other_user}","gists_url":"https://api.github.com/users/nikolas/gists{/gist_id}","starred_url":"https://api.github.com/users/nikolas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikolas/subscriptions","organizations_url":"https://api.github.com/users/nikolas/orgs","repos_url":"https://api.github.com/users/nikolas/repos","events_url":"https://api.github.com/users/nikolas/events{/privacy}","received_events_url":"https://api.github.com/users/nikolas/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-07T00:18:08Z","updated_at":"2015-08-08T11:11:29Z","closed_at":"2015-08-08T11:11:28Z","body":"Is it possible to define a helper function that takes multiple arguments in Mustache.js 2.1.3, like this Handlebars function?\r\n\r\n```js\r\n  /**\r\n   * {{truncate}}\r\n   * Truncates a string given a specified `length`,\r\n   * providing a custom string to denote an `omission`.\r\n   * @param  {[type]} str      [description]\r\n   * @param  {[type]} length   [description]\r\n   * @param  {[type]} omission [description]\r\n   * @return {[type]}          [description]\r\n   */\r\n  truncate: function (str, limit, omission) {\r\n    if (Utils.isUndefined(omission)) {\r\n      omission = '';\r\n    }\r\n    if (str.length > limit) {\r\n      return str.substring(0, limit - omission.length) + omission;\r\n    } else {\r\n      return str;\r\n    }\r\n  },\r\n```\r\n(https://github.com/assemble/handlebars-helpers/blob/master/lib/helpers/helpers-strings.js#L237)\r\n\r\nIf not, would this be complicated to implement? I need this feature for one of my projects."},"comment":{"url":"https://api.github.com/repos/janl/mustache.js/issues/comments/128965162","html_url":"https://github.com/janl/mustache.js/issues/480#issuecomment-128965162","issue_url":"https://api.github.com/repos/janl/mustache.js/issues/480","id":128965162,"user":{"login":"nikolas","id":59292,"avatar_url":"https://avatars.githubusercontent.com/u/59292?v=3","gravatar_id":"","url":"https://api.github.com/users/nikolas","html_url":"https://github.com/nikolas","followers_url":"https://api.github.com/users/nikolas/followers","following_url":"https://api.github.com/users/nikolas/following{/other_user}","gists_url":"https://api.github.com/users/nikolas/gists{/gist_id}","starred_url":"https://api.github.com/users/nikolas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikolas/subscriptions","organizations_url":"https://api.github.com/users/nikolas/orgs","repos_url":"https://api.github.com/users/nikolas/repos","events_url":"https://api.github.com/users/nikolas/events{/privacy}","received_events_url":"https://api.github.com/users/nikolas/received_events","type":"User","site_admin":false},"created_at":"2015-08-08T11:11:28Z","updated_at":"2015-08-08T11:11:28Z","body":"I see.. thanks for the explanation."}}