Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it( "shallow clones an object", function () {
expect( util.clone( meta ) )
.to.be.an( "object" )
.that.has.own.includes( meta );
} );
function commented( grammar, comments, options ) {
function toObject( result, comment ) {
result[ comment.offset ] = {
text: comment.text,
multiline: comment.multiline,
};
return result;
}
grammar = util.clone( grammar );
grammar.comments = options.extractComments ? comments.reduce( toObject, {} ) : null;
return grammar;
}