**refactor(cli): remove obsolete command and streamline TextEncoder/TextDecoder usage**
- Removed the `test-tensorflow-textencoder` command from `cli.ts` as part of deprecating redundant tests and unused CLI functionality. - Simplified `TextEncoder` and `TextDecoder` definitions in `brainy-wrapper.js` by replacing direct constructor usage with shorthand properties within a utility object. This refactor reduces unnecessary complexity in CLI commands and improves maintainability by aligning with current project goals and streamlined test structure.
This commit is contained in:
parent
e863f652e5
commit
8460865398
2 changed files with 3 additions and 18 deletions
|
|
@ -31,9 +31,9 @@ if (
|
|||
isTypedArray: (arr) => {
|
||||
return !!(ArrayBuffer.isView(arr) && !(arr instanceof DataView))
|
||||
},
|
||||
// Use native TextEncoder and TextDecoder
|
||||
TextEncoder: TextEncoder,
|
||||
TextDecoder: TextDecoder
|
||||
// Instead of using constructors directly, create a utility object with constructors
|
||||
TextEncoder,
|
||||
TextDecoder
|
||||
}
|
||||
|
||||
// Initialize TextEncoder/TextDecoder instances
|
||||
|
|
|
|||
|
|
@ -1360,21 +1360,6 @@ augmentCommand
|
|||
// Add the augment command to the program
|
||||
program.addCommand(augmentCommand)
|
||||
|
||||
// Add a top-level test-tensorflow-textencoder command
|
||||
program
|
||||
.command('test-tensorflow-textencoder')
|
||||
.description('Test TensorFlow.js and TextEncoder functionality')
|
||||
.action(async () => {
|
||||
try {
|
||||
// Import the test function from the test file
|
||||
const { runTest } = await import('./test-tensorflow-textencoder.js')
|
||||
await runTest()
|
||||
} catch (error) {
|
||||
console.error('Error:', (error as Error).message)
|
||||
process.exit(1)
|
||||
}
|
||||
})
|
||||
|
||||
// Add a top-level test-pipeline command that redirects to augment test-pipeline
|
||||
program
|
||||
.command('test-pipeline')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue