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

Create dynamic nested enum for standardization type #4

Open
dhianica opened this issue Oct 28, 2022 · 0 comments
Open

Create dynamic nested enum for standardization type #4

dhianica opened this issue Oct 28, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@dhianica
Copy link
Owner

dhianica commented Oct 28, 2022

Create dynamic nested enum, with combinate all enum

example:

enum Method {
	GET = "Get",
	POST = "Post"
}
enum Type {
	API = "Api",
	DATA = "Data"
}
enum Message {
	SUCCESS = "Success",
	FAILED = "Failed"
}

enum StatusCode {
	OK = 200,
	FAILED = 100
}

/// paramater size dynamically
function createEnum(...args) {

}


const d = createEnum(Method, Message, Type, StatusCode)
console.log(d.OK.GET.DATA.SUCCESS)
{
	StatusCode : "200",
	Method : "Get,
	Type : "Data",
	Message : "Success"
}
@dhianica dhianica self-assigned this Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 🔖 Plan
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant