pug-php/pug-filter-react

View on GitHub
src/Pug/React/Filter.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace Pug\React;

use NodejsPhpFallback\React;
use Pug\Filter\Script;

class Filter extends Script
{
    protected $textType = 'javascript';

    public function parse($code)
    {
        $react = new React($code);

        return preg_replace(
            '/\n\s+\/\/#\s+sourceMappingURL=.+\.map\s*$/',
            '',
            $react->getResult()
        );
    }
}