last in loop variable?

1 view
Skip to first unread message

Michael

unread,
Aug 5, 2010, 2:07:49 PM8/5/10
to Normal-Template
Hi George,

Testing out Normal Template for a JSDoc 3 project and need a way to
output some text after items in a reduction, but not after the last
item. Example would be: a comma after every name except the last one.
Is there a way already available to do that inside a reduction loop?
If not I have a patch I can send you.

Regards,
Michael

George Moschovitis

unread,
Aug 5, 2010, 2:28:50 PM8/5/10
to normal-...@googlegroups.com
Hey Michael,

I don't think this can be done in the current version (it should be 'baked-in' in the data dictionary).
I am wondering if you can find an elegant solution to add this feature so I would love to see your patch!

thanks,
-g.

Michael

unread,
Aug 5, 2010, 6:23:35 PM8/5/10
to Normal-Template
I'm not sure it would be called "elegant" but it certainly works for
me: pull request has been sent. Thanks for sharing your project, by
the way. It's rather nice.

On Aug 5, 7:28 pm, George Moschovitis <george.moschovi...@gmail.com>
wrote:
> Hey Michael,
>
> I don't think this can be done in the current version (it should be
> 'baked-in' in the data dictionary).
> I am wondering if you can find an elegant solution to add this feature so I
> would love to see your patch!
>
> thanks,
> -g.
>

Michael

unread,
Aug 5, 2010, 6:53:02 PM8/5/10
to Normal-Template
Or ignore that pull request. It fails on nested reduce loops. But I'm
working on it :)

George Moschovitis

unread,
Aug 6, 2010, 1:13:09 AM8/6/10
to normal-...@googlegroups.com
Or ignore that pull request. It fails on nested reduce loops. But I'm
working on it :)

Great, I 'll wait for the final patch ;-)
I am glad you like normal-template, if you have any more ideas for extra feature with minimal extra complexity, please let me know.

-g.
 

George Moschovitis

unread,
Aug 6, 2010, 2:36:33 AM8/6/10
to normal-...@googlegroups.com
I added the change. Converted the test unit to standard CommonJS test unit format.

-g.
Reply all
Reply to author
Forward
0 new messages