@aaoeclipse/gym_backend 中文文档教程
Gym Backend
我的第一个包测试
Installation
npm i @aaoeclipse/gym_backend
Examples
import { Workout, Exercise } from '@aaoeclipse/gym_backend'
const workout = new Workout('name');
// returns name
workout.getName()
Error handling
import { EmptyNameError } from '@aaoeclipse/gym_backend'
const name = '';
try {
const test = new Workout(name)
}catch (err){
// EmptyNameError
}
所有错误类型:
- EmptyNameError: name is empty
Gym Backend
My first package test
Installation
npm i @aaoeclipse/gym_backend
Examples
import { Workout, Exercise } from '@aaoeclipse/gym_backend'
const workout = new Workout('name');
// returns name
workout.getName()
Error handling
import { EmptyNameError } from '@aaoeclipse/gym_backend'
const name = '';
try {
const test = new Workout(name)
}catch (err){
// EmptyNameError
}
All error types:
- EmptyNameError: name is empty