@harmoniclabs/plu-ts-onchain
Version:
An embedded DSL for Cardano smart contracts creation coupled with a library for Cardano transactions, all in Typescript
29 lines (28 loc) • 1.04 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ptoData = exports.toData = void 0;
var obj_utils_1 = require("@harmoniclabs/obj-utils");
var addUtilityForType_1 = require("../../UtilityTerms/addUtilityForType.js");
var papp_1 = require("../../../papp.js");
var toData_minimal_1 = require("./toData_minimal.js");
function toData(t) {
return function (term) {
var theTerm = (0, toData_minimal_1._toData)(t)(term);
return (0, addUtilityForType_1.addUtilityForType)(theTerm.type)(theTerm);
};
}
exports.toData = toData;
function ptoData(t) {
var term = (0, toData_minimal_1._ptoData)(t);
return (0, obj_utils_1.definePropertyIfNotPresent)(term, "$", {
get: function () { return function (other) {
var theTerm = (0, papp_1.papp)(term, other);
theTerm.isConstant = other.isConstant;
return theTerm;
}; },
set: function () { },
configurable: false,
enumerable: true
});
}
exports.ptoData = ptoData;