Skip to content

Commit

Permalink
refactor(td-tools): deprecate findProtocol and findPort
Browse files Browse the repository at this point in the history
Signed-off-by: Hasan Eroglu <[email protected]>
  • Loading branch information
hasanheroglu committed Jul 22, 2024
1 parent 4aaf13d commit 4b90ff3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/td-tools/src/td-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,20 @@

import ThingDescription from "./thing-description";

// need two tests

/**
* @deprecated This function will be removed in the future. Please use '@thingweb/td-utils' package instead.
*/
export function findProtocol(td: ThingDescription): string {
const base: string = td.base;
const columnLoc: number = base.indexOf(":");
return base.substring(0, columnLoc);
}


/**
* @deprecated This function will be removed in the future. Please use '@thingweb/td-utils' package instead.
*/
export function findPort(td: ThingDescription): number {
const base: string = td.base;
const columnLoc: number = base.indexOf(":", 6);
Expand Down

0 comments on commit 4b90ff3

Please sign in to comment.