mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-05 19:41:12 +08:00
R=jacktfranklin@chromium.org Bug: none Change-Id: I961be18530d3ccbc4efed0c2cda9bd603b14e27b Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3372931 Reviewed-by: Jack Franklin <jacktfranklin@chromium.org> Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
22 lines
603 B
JavaScript
22 lines
603 B
JavaScript
'use strict';
|
|
|
|
const beforeBlockString = require('./beforeBlockString');
|
|
const hasBlock = require('./hasBlock');
|
|
const rawNodeString = require('./rawNodeString');
|
|
|
|
/**
|
|
* Return a CSS statement's block -- the string that starts and `{` and ends with `}`.
|
|
*
|
|
* If the statement has no block (e.g. `@import url(foo.css);`), returns an empty string.
|
|
*
|
|
* @param {import('postcss').Container} statement
|
|
* @returns {string}
|
|
*/
|
|
module.exports = function blockString(statement) {
|
|
if (!hasBlock(statement)) {
|
|
return '';
|
|
}
|
|
|
|
return rawNodeString(statement).slice(beforeBlockString(statement).length);
|
|
};
|