Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

style-to-object

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

style-to-object - npm Package Compare versions

Comparing version 0.4.3 to 0.4.4

57

index.d.ts

@@ -5,35 +5,42 @@ /**

* @example
* import StyleToObject from 'style-to-object';
* StyleToObject('line-height: 42;');
*
* ```ts
* import parse from 'style-to-object';
* parse('line-height: 42;'); // { 'line-height': '42' }
* ```
*/
declare function StyleToObject(
export default function StyleToObject(
style: string,
iterator?: StyleToObject.Iterator
iterator?: Iterator
): { [name: string]: string } | null;
export = StyleToObject;
declare namespace StyleToObject {
interface DeclarationPos {
interface Position {
start: {
line: number;
column: number;
}
};
end: {
line: number;
column: number;
};
source?: string;
}
// declaration is an object from module `inline-style-parser`
interface Declaration {
type: string;
property: string;
value: string;
position: {
start: DeclarationPos;
end: DeclarationPos;
source: any;
};
}
export interface Declaration {
type: 'declaration';
property: string;
value: string;
position: Position;
}
type Iterator = (
property: string,
value: string,
declaration: Declaration
) => void;
export interface Comment {
type: 'comment';
comment: string;
position: Position;
}
type Iterator = (
property: string,
value: string,
declaration: Declaration | Comment
) => void;
{
"name": "style-to-object",
"version": "0.4.3",
"version": "0.4.4",
"description": "Converts inline style to object.",

@@ -23,5 +23,5 @@ "author": "Mark <mark@remarkablemark.org>",

"prepublishOnly": "pinst --disable && run-s lint lint:dts test clean build",
"test": "mocha --exclude **/*.mjs",
"test:coverage": "nyc npm test",
"test:module": "node --experimental-modules test/index.mjs",
"test": "jest",
"test:ci": "CI=true jest --ci --colors --coverage",
"test:esm": "node --test __tests__/index.test.mjs",
"test:watch": "npm run test -- --watch"

@@ -51,13 +51,13 @@ },

"@commitlint/config-conventional": "17.8.0",
"@definitelytyped/dtslint": "0.0.182",
"@rollup/plugin-commonjs": "25.0.5",
"@rollup/plugin-node-resolve": "15.2.3",
"@rollup/plugin-terser": "0.4.4",
"dtslint": "4.2.1",
"@typescript-eslint/parser": "5.62.0",
"eslint": "8.51.0",
"eslint-plugin-prettier": "5.0.1",
"husky": "8.0.3",
"jest": "29.7.0",
"lint-staged": "14.0.1",
"mocha": "10.2.0",
"npm-run-all": "4.1.5",
"nyc": "15.1.0",
"pinst": "3.0.0",

@@ -64,0 +64,0 @@ "prettier": "3.0.3",

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