695afb9ad3eb901b778c78b3bf86f542ba814b1c7a2203e08c0eacab28ad575cc48999cb824707d404cc43d022b4c0b012bd9d24c0a5429954b2f1dc9459b6 549 B

123456789
  1. // When writing files on Windows, translate the characters to their
  2. // 0xf000 higher-encoded versions.
  3. const raw = ['|', '<', '>', '?', ':'];
  4. const win = raw.map(char => String.fromCharCode(0xf000 + char.charCodeAt(0)));
  5. const toWin = new Map(raw.map((char, i) => [char, win[i]]));
  6. const toRaw = new Map(win.map((char, i) => [char, raw[i]]));
  7. export const encode = (s) => raw.reduce((s, c) => s.split(c).join(toWin.get(c)), s);
  8. export const decode = (s) => win.reduce((s, c) => s.split(c).join(toRaw.get(c)), s);
  9. //# sourceMappingURL=winchars.js.map