mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-13 01:54:52 +08:00
This also upgrades PostCSS to 8.3.11. DISABLE_THIRD_PARTY_CHECK=Updating Stylelint configuration R=szuend@chromium.org Bug: none Change-Id: I606540b03509d7c6e73f3d490327cd4174e03d31 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3259541 Reviewed-by: Simon Zünd <szuend@chromium.org> Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
25 lines
717 B
JavaScript
25 lines
717 B
JavaScript
'use strict';
|
|
|
|
const beforeBlockString = require('./beforeBlockString');
|
|
const hasBlock = require('./hasBlock');
|
|
const rawNodeString = require('./rawNodeString');
|
|
|
|
/** @typedef {import('postcss').Rule} Rule */
|
|
/** @typedef {import('postcss').AtRule} AtRule */
|
|
|
|
/**
|
|
* 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 {Rule | AtRule} statement - postcss rule or at-rule node
|
|
* @returns {string}
|
|
*/
|
|
module.exports = function blockString(statement) {
|
|
if (!hasBlock(statement)) {
|
|
return '';
|
|
}
|
|
|
|
return rawNodeString(statement).slice(beforeBlockString(statement).length);
|
|
};
|