🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@forestadmin-experimental/plugin-define-enum

Package Overview
Dependencies
Maintainers
5
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@forestadmin-experimental/plugin-define-enum

The plugin allows you to create fields based on enums when your database stores technical values (0, 1, 2, 3).

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
5
Created
Source

The plugin allows you to create fields based on enums when your database stores technical values (0, 1, 2, 3).

import { createAgent } from '@forestadmin/agent';
import { Schema } from './typings';

import defineEnum from '@forestadmin-experimental/plugin-define-enum';
import type { DefineEnumOption } from '@forestadmin-experimental/plugin-define-enum';

const BandStatus = {
  JustCreated: 0,
  GrowingHigh: 50,
  BrokenUp: 100,
} as const

await createAgent<Schema>(Options)
  .addDataSource(DataSourceOptions)
  .customizeCollection('users', usersCollection => {
    .use<DefineEnumOption<Schema, 'users'>>(defineEnum, {
      fieldName: 'bandStatus',
      enumObject: BandStatus,
    })
  })

FAQs

Package last updated on 12 May 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