from static method
- RdfGraphEncoderOptions options
Creates a JSON-LD encoder options object from generic RDF encoder options
This factory method ensures that when generic RdfGraphEncoderOptions are provided to a method expecting JSON-LD-specific options, they are properly converted.
If the provided options are already a JsonLdEncoderOptions instance, they are returned as-is. Otherwise, a new instance is created with the custom prefixes and default values for generateMissingPrefixes and includeBaseDeclaration.
Implementation
static JsonLdEncoderOptions from(RdfGraphEncoderOptions options) =>
switch (options) {
JsonLdEncoderOptions _ => options,
_ => JsonLdEncoderOptions(
customPrefixes: options.customPrefixes,
),
};