"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.convertUnicode = convertUnicode;
const UNICODE_PATTERN = /\\+u([0-9a-fA-F]{4})/g;

function convertUnicode(jsonStr) {
  if (!jsonStr.includes('\\u')) {
    return jsonStr;
  }

  UNICODE_PATTERN.lastIndex = 0;
  return jsonStr.replace(UNICODE_PATTERN, (_, hex) => String.fromCharCode(Number.parseInt(hex, 16)));
}