New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@fbem/core

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fbem/core

Functional BEM core

latest
Source
npmnpm
Version
2.0.13
Version published
Maintainers
1
Created
Source

@fbem/core npm

@fbem/core is a core package for functional BEM. It provides utility for parsing BEM entities into BEM structure, which is used for code generation.

This package is base for all other packages. Basically you shouldn't use it.

Getting started

npm i @fbem/core

Types

type NamingOptions = {
  prefix: string;
  elem: string;
  modName: string;
  modVal: string;
};

type StringMod = {
  type: 'string';
  values: Record<string, string>;
};

type BooleanMod = {
  type: 'boolean';
  value: string;
};

type Mod = StringMod | BooleanMod;

type BemParams = {
  base: string;
  mods: Record<string, Mod>;
};

type BemFunctionName = string;

type BemStructure = Record<BemFunctionName, BemParams>;

const createBemStructure: (classesMap: Record<string, string>, naming: NamingOptions) => BemStructure;

const parseBem: (className: string, naming: NamingOptions) => {
  block: string;
  elem: string;
  modName: string;
  modVal: string;
}

API

createBemStructure: (classesMap: Record<string, string>, naming: NamingOptions) => BemStructure

Description

The function is used to convert a map of CSS classes into a structure that is used for code generation.

parseBem: (className: string, naming: NamingOptions) => { block: string; elem: string; modName: string; modVal: string; }

Description

The function is used to parse the CSS class into its constituent entities.

Keywords

bem

FAQs

Package last updated on 14 Dec 2023

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