@jsonlines/core
Version:
parse and stringify jsonlines files through streams
67 lines (51 loc) • 1.44 kB
JavaScript
function _classPrivateFieldGet(receiver, privateMap) {
var descriptor = privateMap.get(receiver);
if (!descriptor) {
throw new TypeError("attempted to get private field on non-instance");
}
if (descriptor.get) {
return descriptor.get.call(receiver);
}
return descriptor.value;
}
function _classPrivateFieldSet(receiver, privateMap, value) {
var descriptor = privateMap.get(receiver);
if (!descriptor) {
throw new TypeError("attempted to set private field on non-instance");
}
if (descriptor.set) {
descriptor.set.call(receiver, value);
} else {
if (!descriptor.writable) {
throw new TypeError("attempted to set read only private field");
}
descriptor.value = value;
}
return value;
}
function getRawLinesSep(option) {
switch (option) {
case "\n":
case "lf":
return "\n";
case "\r\n":
case "crlf":
return "\r\n";
default:
return option;
}
}
function getLineSepSplitter(option) {
const raw = getRawLinesSep(option);
return raw === "auto" ? /\r?\n/ : raw;
}
function isWin() {
return process.platform === "win32";
}
function getLineSepString(option) {
const raw = getRawLinesSep(option);
return raw === "auto" ? //
isWin() ? "\r\n" : "\n" : raw;
}
export { _classPrivateFieldSet as _, _classPrivateFieldGet as a, getLineSepString as b, getLineSepSplitter as g };
//# sourceMappingURL=line-sep-6e4e0e79.js.map