Detect the OCF object type from an unknown value.
This is useful when you receive data that could be any OCF type and need to determine which type it is before processing.
const type = detectOcfObjectType(data); switch (type) { case 'ISSUER': // Handle issuer break; case 'STAKEHOLDER': // Handle stakeholder break; // ... } Copy
const type = detectOcfObjectType(data); switch (type) { case 'ISSUER': // Handle issuer break; case 'STAKEHOLDER': // Handle stakeholder break; // ... }
Detect the OCF object type from an unknown value.
This is useful when you receive data that could be any OCF type and need to determine which type it is before processing.