Socket
Book a DemoInstallSign in
Socket

false-transform

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

false-transform

## Install ```bash npm install false-transform --save-dev ``` ## Usage ```js import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import falseTransform from 'false-transform' export default defineConfig({ plugins: [ vue({ t

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

false-transform

Install

npm install false-transform --save-dev

Usage

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import falseTransform from 'false-transform'
export default defineConfig({
  plugins: [
    vue({
      template: {
        compilerOptions: {
          nodeTransforms: [falseTransform]
        }
      }
    })
  ]
})

Use attributes without bound values to represent truthy values, like:

<CustomComp visible />

The component receives the visible value as true. However, when you need to pass false, you have to explicitly bind it:

<CustomComp :visible="false" />

This transformer allows you to use an attribute starting with ! to represent false, like this:

<CustomComp !visible />

FAQs

Package last updated on 17 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts