Socket
Socket
Sign inDemoInstall

style-attr

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    style-attr

Parse and stringify style attributes


Version published
Maintainers
1
Install size
5.97 kB
Created

Readme

Source

style-attr

Very simple parsing and stringifying of style attributes.

Build Status

parse

Convert a style attribute string to an object.

  • inputs:

    • string (eg. anything you might see in a style attribute)
    • options (optional)
  • return: object

stringify

Convert an object into an attribute string

  • input: object
  • return: string

normalize

Normalize an attribute string (eg. collapse duplicates)

  • inputs:

  • return: string

Args

options

Options for parse() and normalize follow the same format:

{
  preserveNumbers: boolean // (default: false)
}

Setting preserveNumbers to true recognises number values and converts them to a Number.

License

MIT

Keywords

FAQs

Last updated on 02 Jun 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc