New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ffras4vnpm/voluptatem-odio-minima

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

@ffras4vnpm/voluptatem-odio-minima

[![Build status][travis-image]][travis-url] [![NPM version][npm-image]][npm-url] [![js-xo-style][codestyle-image]][codestyle-url]

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@ffras4vnpm/voluptatem-odio-minima

Build status NPM version js-xo-style

Unnest/flatten a Unistyle Object to a structure which resembles real CSS

Installation

Install @ffras4vnpm/voluptatem-odio-minima using npm:

npm install --save @ffras4vnpm/voluptatem-odio-minima

Usage

Module usage

Nesting
var flat = require('@ffras4vnpm/voluptatem-odio-minima');

flat({
	a: {
		':hover': {
			fontWeight: 'bold'
		}
	}
});
/**
 * {
 *   'a:hover': {
 *     fontWeight: 'bold'
 *   }
 * }
 */
References
var flat = require('@ffras4vnpm/voluptatem-odio-minima');

flat({
	a: {
		'& + span': {
			fontWeight: 'bold'
		}
	}
});
/**
 * {
 *   'a + span': {
 *     fontWeight: 'bold'
 *   }
 * }
 */
Media Queries
var flat = require('@ffras4vnpm/voluptatem-odio-minima');

flat({
	p: {
		fontSize: '1em',
		'@media only screen and (max-width: 700px)': {
			fontSize: '.8em'
		}
	}
});
/**
 * {
 *   p: {
 *     fontSize: '1em'
 *   },
 *   '@media only screen and (max-width: 700px)': {
 *     p: {
 *       fontSize: '.8em'
 *     }
 *   }
 * }
 */
Arrays
var flat = require('@ffras4vnpm/voluptatem-odio-minima');

flat([
	{body: {color: 'white'}},
	{body: {background: 'blue'}}
]);
/**
 * {
 *   body: {
 *     color: 'white',
 *     background: 'blue'
 *   }
 * }
 */
Grouping of selectors
var flat = require('@ffras4vnpm/voluptatem-odio-minima');

flat({
	'.item1': {color: 'white'},
	'.item2': {color: 'white', background: 'blue'}
});
/**
 * {
 *   '.item1, .item2': {
 *     color: 'white'
 *   },
 *   '.item2': {
 *     background: 'blue'
 *   }
 * }
 */

API

flat(obj)

NameTypeDescription
obj`ObjectArray`

Returns: Object, the flattened/unnested object.

License

MIT © Joakim Carlstein

Keywords

FAQs

Package last updated on 25 Apr 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc