How to use the pegjs.util.values function in pegjs

To help you get started, we’ve selected a few pegjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pegjs / pegjs / test / api / pegjs-util.spec.js View on Github external
it( "can extract values like Object.values", function () {

            expect( util.values( map ) )
                .to.be.an( "array" )
                .with.a.lengthOf( 3 )
                .and.includes.members( [ 1, 2, 3 ] );

        } );
github pegjs / pegjs / test / api / pegjs-util.spec.js View on Github external
it( "extend an object", function () {

            const target = util.extend( {}, source );
            const utils = Object.keys( util );

            expect( util.extend( target, util ) )
                .to.include.keys( utils );

            expect( util.values( target ) )
                .to.have.a.lengthOf( 5 + utils.length );

        } );
github pegjs / pegjs / test / api / pegjs-util.spec.js View on Github external
it( "extend an empty object", function () {

            const target = {};

            expect( util.extend( target, source ) )
                .to.be.an( "object" )
                .that.includes.keys( Object.keys( source ) );

            expect( util.values( target ) )
                .to.include.members( [ 4, 5, 6, 7, 8 ] )
                .and.have.a.lengthOf( 5 );

        } );