Assign_.Pre

Undocumented in source.
  1. enum Pre;
    template Assign_(string node, string field, T, bool typeDSL = false, idMap idMap_ = idMap.init)
    static if(!(isOptional!T && T.Types.length == 2))
    static if(!(isEither!T && T.Types.length == 1))
    static if(typeDSL && Filter!(isSomeString, Types).length > 0)
    enum Pre = format!q"EOS Node n; if (%1$s.type == NodeType.string) { import std.algorithm : endsWith; auto s = %1$s.as!string; if (s.endsWith("[]?")) { n.add("null"); n.add([ "type": "array", "items": s[0..$-3], ]); } else if (s.endsWith("[]")) { n.add([ "type": "array", "items": s[0..$-2], ]); } else if (s.endsWith("?")) { n.add("null"); n.add(s[0..$-1]); } else { n = Node(s); } } else { n = %1$s; } EOS"(node);
  2. enum Pre;

Meta