Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Support serializing Async functions #28

@balazsnemeth

Description

@balazsnemeth

Tried to serialized an async function, and get this error:

UnhandledPromiseRejectionWarning: TypeError: Function.prototype.toString requires that 'this' be a Function
    at AsyncFunction.toString (<anonymous>)
    at String (<anonymous>)
    at isNativeFunction (/Users/nbalazs/Work/projects/stylers/Meta/MetaBase.CLI/MigrateMetadata/node_modules/lave/index.js:386:16)
    at getExpression (/Users/nbalazs/Work/projects/stylers/Meta/MetaBase.CLI/MigrateMetadata/node_modules/lave/index.js:155:13)
    at getExpression (/Users/nbalazs/Work/projects/stylers/Meta/MetaBase.CLI/MigrateMetadata/node_modules/lave/index.js:294:27)
    at getExpression (/Users/nbalazs/Work/projects/stylers/Meta/MetaBase.CLI/MigrateMetadata/node_modules/lave/index.js:269:25)
    at getExpression (/Users/nbalazs/Work/projects/stylers/Meta/MetaBase.CLI/MigrateMetadata/node_modules/lave/index.js:190:25)
    at getExpression (/Users/nbalazs/Work/projects/stylers/Meta/MetaBase.CLI/MigrateMetadata/node_modules/lave/index.js:269:25)
    at lave (/Users/nbalazs/Work/projects/stylers/Meta/MetaBase.CLI/MigrateMetadata/node_modules/lave/index.js:13:20)
    at main (/Users/nbalazs/Work/projects/stylers/Meta/MetaBase.CLI/MigrateMetadata/break_metadata.js:117:24)

Example function:

const fn = async (args) => {
                console.log(args.entities);
                for (const entity of args.entities) {
                    if (entity.Name) {
                        entity.Name = 'SS_' + entity.Name;
                    }
                }
                return await commit();
            }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions