Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(encoding/csv): add deprecation to obsolete exports #2633

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions encoding/csv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,42 @@ import type { ReadOptions } from "./csv/_io.ts";
import { Parser } from "./csv/_parser.ts";

export {
/**
* @deprecated This export will be removed soon. Use `"bare \" in non-quoted-field"` instead.
*/
ERR_BARE_QUOTE,
/**
* @deprecated This export will be removed soon. Use `"wrong number of fields"` instead.
*/
ERR_FIELD_COUNT,
/**
* @deprecated This export will be removed soon. Use `"Invalid Delimiter"` instead.
*/
ERR_INVALID_DELIM,
/**
* @deprecated This export will be removed soon. Use `"extraneous or missing \" in quoted-field"` instead.
*/
ERR_QUOTE,
/**
* @deprecated This export will be removed soon. Use `Error` instead.
*/
ParseError,
} from "./csv/_io.ts";

/**
* @deprecated This export will be removed soon.
*/
export type { ReadOptions } from "./csv/_io.ts";

const QUOTE = '"';
/**
* @deprecated This export will be removed soon. Use `"\r\n"` instead.
*/
export const NEWLINE = "\r\n";

/**
* @deprecated This export will be removed soon. Use `Error` instead.
*/
export class StringifyError extends Error {
override readonly name = "StringifyError";
}
Expand Down Expand Up @@ -85,13 +110,15 @@ function normalizeColumn(column: Column): NormalizedColumn {
header = String(column);
prop = [column];
}

return { header, prop };
}

type ObjectWithStringPropertyKeys = Record<string, unknown>;

/** An object (plain or array) */
/**
* An object (plain or array)
* @deprecated This export will be removed soon. use `Record<string, unknown> | unknown[]` instead.
*/
export type DataItem = ObjectWithStringPropertyKeys | unknown[];

/**
Expand Down