UNPKG

@sudoo/marked

Version:

JavaScript & TypeScript code runner in JavaScript, safe with marked territory, asynchronous

23 lines (22 loc) 839 B
"use strict"; /** * @author WMXPY * @namespace Operation_MemberExpression * @description Sand BigInt */ Object.defineProperty(exports, "__esModule", { value: true }); exports.memberExpressionSandBigInt = void 0; const error_code_1 = require("../../declare/error-code"); const error_1 = require("../../util/error/error"); const wrap_member_function_1 = require("../../util/wrap-member-function"); const memberExpressionSandBigInt = (sandbox, bigint, key) => { switch (key) { case "toString": { return (0, wrap_member_function_1.wrapMemberFunction)(sandbox, () => { return bigint.toNativeBigInt().toString(); }); } } throw (0, error_1.error)(error_code_1.ERROR_CODE.ONLY_STRING_AVAILABLE_FOR_BIGINT); }; exports.memberExpressionSandBigInt = memberExpressionSandBigInt;