@metreeca/qest - v0.9.2
    Preparing search index...

    Function decodeResource

    • Decodes a resource state from a JSON string.

      If base is provided, resolves internal IRIs (matching isIRI(value, "internal")) to absolute IRIs using resolve(), recursively throughout the json structure. Otherwise, performs plain JSON parsing.

      Parameters

      Returns { readonly [property: string]: Values | Indexed<Values> }

      The decoded resource, with resolved IRIs if base is provided

      If json is not a string, not a valid Resource, or opts is not a valid CodecOpts

      decodeResource(
      '{"id":"/products/42","name":"Widget","price":29.99}',
      { base: "https://example.com/" }
      );
      // → { id: "https://example.com/products/42", name: "Widget", price: 29.99 }