codekingpro/portable-devtools
114k
1"use strict";
2// When writing files on Windows, translate the characters to their
3// 0xf000 higher-encoded versions.
4Object.defineProperty(exports, "__esModule", { value: true });
5exports.decode = exports.encode = void 0;
6const raw = ['|', '<', '>', '?', ':'];
7const win = raw.map(char => String.fromCharCode(0xf000 + char.charCodeAt(0)));
8const toWin = new Map(raw.map((char, i) => [char, win[i]]));
9const toRaw = new Map(win.map((char, i) => [char, raw[i]]));
10const encode = (s) => raw.reduce((s, c) => s.split(c).join(toWin.get(c)), s);
11exports.encode = encode;
12const decode = (s) => win.reduce((s, c) => s.split(c).join(toRaw.get(c)), s);
13exports.decode = decode;
14//# sourceMappingURL=winchars.js.map