How to use the monocle-ts.Getter function in monocle-ts

To help you get started, we’ve selected a few monocle-ts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github unmock / unmock-js / packages / unmock-core / src / generator.ts View on Github external
new Prism(
        s =>
          isReference(s)
            ? getParameterFromRef(oai, s.$ref.split("/")[3])
            : some(s),
        a => a,
      ),
    )
    .composePrism(
      new Prism(
        s =>
          s.in === (header ? "header" : "query") && s.required ? some(s) : none,
        a => a,
      ),
    )
    .composeGetter(new Getter(i => i))
    .getAll(p)
    .filter(a =>
      a.schema ? !isNone(schemaPrism(oai).getOption(a.schema)) : false,
    )
    .map(b => ({
      ...b,
      schema: b.schema
        ? isReference(b.schema)
          ? changeRef(b.schema)
          : changeRefs(b.schema)
        : { type: "string" },
    }));