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

docs: add deprecation message to td-tools #1310

Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions packages/td-tools/src/td-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ export function findPort(td: ThingDescription): number {
return parseInt(returnString);
}

/**
* @deprecated This function will be removed in the future.
*/
export function setContextLanguage(thing: ThingDescription, language: string, forceOverride: boolean): void {
// forceOverride == false -> set @language if no @language set
// forceOverride == true -> set/override @language in any case
Expand Down
10 changes: 8 additions & 2 deletions packages/td-tools/src/td-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ function adjustBooleanField(affordance: AffordanceElement, key: string) {
}
}

/** Parses a TD into a Thing object */
/** Parses a TD into a Thing object
*
* @deprecated This function will be removed in the future.
*/
export function parseTD(td: string, normalize?: boolean): Thing {
logDebug(`parseTD() parsing\n\`\`\`\n${td}\n\`\`\``);

Expand Down Expand Up @@ -220,7 +223,10 @@ export function parseTD(td: string, normalize?: boolean): Thing {
return thing;
}

/** Serializes a Thing object into a TD */
/** Serializes a Thing object into a TD
*
* @deprecated This function will be removed in the future.
*/
export function serializeTD(thing: Thing): string {
const copy: Thing = JSON.parse(JSON.stringify(thing));

Expand Down
Loading