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

Helper Functions to get all functions across the given apis #2

Open
RobLoach opened this issue Oct 16, 2022 · 0 comments
Open

Helper Functions to get all functions across the given apis #2

RobLoach opened this issue Oct 16, 2022 · 0 comments

Comments

@RobLoach
Copy link
Owner

A function that will combine some of the APIs together, and remove the duplicates. Did this for raylib-umka...

/**
 * Retrieve all defines across all the raylib modules.
 */
function getAllDefines() {
    let defineNames = []

    let allDefines = [
        ...raylib.raylib.defines,
        ...raylib.raymath.defines
    ]

    allDefines = allDefines.filter(defineDetails => {
        if (defineNames.includes(defineDetails.name)) {
            return false
        }
        defineNames.push(defineDetails.name)
        return true
    })

    return allDefines
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant