Skip to content

Add support for node::Encode/DecodeBytes/DecodeWrite #250

@royaltm

Description

@royaltm

Could you add support for those handy utils?

#if NODE_VERSION_AT_LEAST(0,11,12)
#define NanEncode(buf, buflen, encoding) \
  node::Encode(v8::Isolate::GetCurrent(), buf, buflen, encoding)
#define NanDecodeBytes(val, encoding) \
  node::DecodeBytes(v8::Isolate::GetCurrent(), val, encoding)
#define NanDecodeWrite(buf, buflen, val, encoding) \
  node::DecodeWrite(v8::Isolate::GetCurrent(), buf, buflen, val, encoding)
#else
#define NanEncode(buf, buflen, encoding) \
  node::Encode(buf, buflen, encoding)
#define NanDecodeBytes(val, encoding) \
  node::DecodeBytes(val, encoding)
#define NanDecodeWrite(buf, buflen, val, encoding) \
  node::DecodeWrite(buf, buflen, val, encoding)
#endif

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions