// @flow strict-local import type {AST, MutableAsset, TransformerResult} from '@parcel/types'; import {hashString} from '@parcel/hash'; import type {PostHTMLNode} from 'posthtml'; import PostHTML from 'posthtml'; const SCRIPT_TYPES = { 'application/javascript': 'js', 'text/javascript': 'js', 'application/json': false, 'application/ld+json': 'jsonld', 'text/html': false, module: 'js', }; interface ExtractInlineAssetsResult { hasScripts: boolean; assets: Array; } export default function extractInlineAssets( asset: MutableAsset, ast: AST, ): ExtractInlineAssetsResult { let program: PostHTMLNode = ast.program; let key = 0; // Extract inline