<commit_before>// @flow

import path from 'path'
import postcss from 'postcss'
import postcssModules from 'postcss-modules'
import { createFileTransformer, getChunk } from 'pundle-api'

import manifest from '../package.json'
import pluginImportResolver from './plugin-import-resolver'
import { getDevelopmentContents } from './helpers'

function createComponent({
  extensions = ['.css'],
  development = process.env.NODE_ENV !== 'production',
}: { extensions?: Array<string>, development?: boolean } = {}) {
  return createFileTransformer({
    name: 'pundle-transformer-css',
    version: manifest.version,
    priority: 1500,
    async callback({ file, resolve, addChunk, context }) {
      const extName = path.extname(file.filePath)
      if (!extensions.includes(extName)) {
        return null
      }

      let moduleMap = null
      const plugins = []
      const fileIsModule = !file.meta.specified || file.filePath.endsWith(`.module${extName}`)

      if (fileIsModule) {
        plugins.push(
          postcssModules({
            scopeBehaviour: 'local',
            getJSON(_, map) {
              moduleMap = map
            },
          }),
        )
      }
      plugins.push(
        pluginImportResolver({
          file,
          resolve,
          context,
          addChunk,
        }),
      )
<commit_msg>:bug: Fix invalid specified check in transformer-css<commit_after>// @flow

import path from 'path'
import postcss from 'postcss'
import postcssModules from 'postcss-modules'
import { createFileTransformer, getChunk } from 'pundle-api'

import manifest from '../package.json'
import pluginImportResolver from './plugin-import-resolver'
import { getDevelopmentContents } from './helpers'

function createComponent({
  extensions = ['.css'],
  development = process.env.NODE_ENV !== 'production',
}: { extensions?: Array<string>, development?: boolean } = {}) {
  return createFileTransformer({
    name: 'pundle-transformer-css',
    version: manifest.version,
    priority: 1500,
    async callback({ file, resolve, addChunk, context }) {
      const extName = path.extname(file.filePath)
      if (!extensions.includes(extName)) {
        return null
      }

      let moduleMap = null
      const plugins = []
      const fileIsModule = file.meta.specified || file.filePath.endsWith(`.module${extName}`)

      if (fileIsModule) {
        plugins.push(
          postcssModules({
            scopeBehaviour: 'local',
            getJSON(_, map) {
              moduleMap = map
            },
          }),
        )
      }
      plugins.push(
        pluginImportResolver({
          file,
          resolve,
          context,
          addChunk,
        }),
      )

{'fraction_non_alphanumeric': 0.11899482631189948, 'fraction_numerical': 0.0029563932002956393, 'mean_word_length': 2.4616368286445014, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4322841', 'n_tokens_mistral': 748, 'n_tokens_neox': 732, 'n_words': 182}