#!/usr/bin/env node
var i=new TextDecoder("utf-8",{fatal:!0}),d=new TextEncoder;function y(t){let e=t;if(!e)return e;let n=!1;for(let r=0;r<e.length;r++){let u=e.charCodeAt(r);if(u>255)return e;u>127&&(n=!0)}if(!n)return e;let o=new Uint8Array(e.length);for(let r=0;r<e.length;r++)o[r]=e.charCodeAt(r);try{return i.decode(o)}catch{return e}}function c(t){if(!t)return t;let e=d.encode(t),n="";for(let o=0;o<e.length;o++)n+=String.fromCharCode(e[o]);return n}var a="";function f(t){let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e}async function x(t,e){return typeof t.readFileBytes=="function"?t.readFileBytes(e):f(await t.readFileBuffer(e))}function s(t){return t.stdoutKind?t.stdoutKind:t.stdoutEncoding==="binary"?"bytes":"text"}function l(t){return s(t)==="bytes"?t.stdout:c(t.stdout)}export{y as a,c as b,a as c,x as d,l as e};
