plugins-compat-data.js.map 1.71 KB
{"version":3,"names":["keys","Object","plugins","filterAvailable","originalPlugins","pluginsBugfixes","originalPluginsBugfixes","overlappingPlugins","originalOverlappingPlugins","data","result","plugin","hasOwnProperty","call","availablePlugins"],"sources":["../src/plugins-compat-data.ts"],"sourcesContent":["import originalPlugins from \"@babel/compat-data/plugins\";\nimport originalPluginsBugfixes from \"@babel/compat-data/plugin-bugfixes\";\nimport originalOverlappingPlugins from \"@babel/compat-data/overlapping-plugins\";\nimport availablePlugins from \"./available-plugins\";\n\nconst keys: <O extends object>(o: O) => (keyof O)[] = Object.keys;\n\nexport const plugins = filterAvailable(originalPlugins);\nexport const pluginsBugfixes = filterAvailable(originalPluginsBugfixes);\nexport const overlappingPlugins = filterAvailable(originalOverlappingPlugins);\n\nfunction filterAvailable<Data extends { [name: string]: unknown }>(\n  data: Data,\n): { [Name in keyof Data & keyof typeof availablePlugins]: Data[Name] } {\n  const result = {} as any;\n  for (const plugin of keys(data)) {\n    if (Object.hasOwnProperty.call(availablePlugins, plugin)) {\n      result[plugin] = data[plugin];\n    }\n  }\n  return result;\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AAEA,MAAMA,IAA6C,GAAGC,MAAM,CAACD,IAAI;AAE1D,MAAME,OAAO,GAAGC,eAAe,CAACC,QAAe,CAAC;AAAC;AACjD,MAAMC,eAAe,GAAGF,eAAe,CAACG,eAAuB,CAAC;AAAC;AACjE,MAAMC,kBAAkB,GAAGJ,eAAe,CAACK,mBAA0B,CAAC;AAAC;AAE9E,SAASL,eAAe,CACtBM,IAAU,EAC4D;EACtE,MAAMC,MAAM,GAAG,CAAC,CAAQ;EACxB,KAAK,MAAMC,MAAM,IAAIX,IAAI,CAACS,IAAI,CAAC,EAAE;IAC/B,IAAIR,MAAM,CAACW,cAAc,CAACC,IAAI,CAACC,yBAAgB,EAAEH,MAAM,CAAC,EAAE;MACxDD,MAAM,CAACC,MAAM,CAAC,GAAGF,IAAI,CAACE,MAAM,CAAC;IAC/B;EACF;EACA,OAAOD,MAAM;AACf"}