SwiftGen / StencilSwiftKit

A framework bringing additional nodes & filters to Stencil dedicated to Swift code generation
MIT License
289 stars 55 forks source link

question: is map supported for dictionaries? #146

Open sstadelman opened 2 years ago

djbe commented 1 year ago

Not at this point, no.

When generating output, you want that output to be "stable", so that when you generate this output multiple times, it is the same each time. The problem is that mapping over a dictionary is inherently unstable. We'd need to sort the keys first for example.

Could definitely add it, maybe for dictionaries where the keys are Comparable.