inline-style-parser 0.2.5 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  [![NPM](https://nodei.co/npm/inline-style-parser.png)](https://nodei.co/npm/inline-style-parser/)
4
4
 
5
- [![NPM version](https://badgen.net/npm/v/inline-style-parser)](https://www.npmjs.com/package/inline-style-parser)
6
- [![Bundlephobia minified + gzip](https://badgen.net/bundlephobia/minzip/inline-style-parser)](https://bundlephobia.com/package/inline-style-parser)
5
+ [![NPM version](https://img.shields.io/npm/v/inline-style-parser)](https://www.npmjs.com/package/inline-style-parser)
6
+ [![NPM bundle size](https://img.shields.io/bundlephobia/minzip/inline-style-parser)](https://bundlephobia.com/package/inline-style-parser)
7
7
  [![build](https://github.com/remarkablemark/inline-style-parser/actions/workflows/build.yml/badge.svg)](https://github.com/remarkablemark/inline-style-parser/actions/workflows/build.yml)
8
8
  [![codecov](https://codecov.io/gh/remarkablemark/inline-style-parser/branch/master/graph/badge.svg?token=B8EEK5709W)](https://codecov.io/gh/remarkablemark/inline-style-parser)
9
- [![NPM downloads](https://badgen.net/npm/dm/inline-style-parser)](https://www.npmjs.com/package/inline-style-parser)
9
+ [![NPM downloads](https://img.shields.io/npm/dm/inline-style-parser)](https://www.npmjs.com/package/inline-style-parser)
10
10
 
11
11
  Inline style parser copied from [`css/lib/parse/index.js`](https://github.com/reworkcss/css/blob/v2.2.4/lib/parse/index.js):
12
12
 
@@ -31,7 +31,7 @@ Output:
31
31
  position: Position { start: [Object], end: [Object], source: undefined } } ]
32
32
  ```
33
33
 
34
- [JSFiddle](https://jsfiddle.net/remarkablemark/hcxbpwq8/) | [Replit](https://replit.com/@remarkablemark/inline-style-parser) | [Examples](https://github.com/remarkablemark/inline-style-parser/tree/master/examples)
34
+ [JSFiddle](https://jsfiddle.net/remarkablemark/hcxbpwq8/) | [Examples](https://github.com/remarkablemark/inline-style-parser/tree/master/examples)
35
35
 
36
36
  ## Installation
37
37
 
@@ -0,0 +1,34 @@
1
+ interface Position {
2
+ start: {
3
+ line: number;
4
+ column: number;
5
+ };
6
+ end: {
7
+ line: number;
8
+ column: number;
9
+ };
10
+ source?: string;
11
+ }
12
+
13
+ export interface Declaration {
14
+ type: 'declaration';
15
+ property: string;
16
+ value: string;
17
+ position: Position;
18
+ }
19
+
20
+ export interface Comment {
21
+ type: 'comment';
22
+ comment: string;
23
+ position: Position;
24
+ }
25
+
26
+ interface Options {
27
+ source?: string;
28
+ silent?: boolean;
29
+ }
30
+
31
+ export default function InlineStyleParser(
32
+ style: string,
33
+ options?: Options
34
+ ): (Declaration | Comment)[];
@@ -0,0 +1,34 @@
1
+ interface Position {
2
+ start: {
3
+ line: number;
4
+ column: number;
5
+ };
6
+ end: {
7
+ line: number;
8
+ column: number;
9
+ };
10
+ source?: string;
11
+ }
12
+
13
+ export interface Declaration {
14
+ type: 'declaration';
15
+ property: string;
16
+ value: string;
17
+ position: Position;
18
+ }
19
+
20
+ export interface Comment {
21
+ type: 'comment';
22
+ comment: string;
23
+ position: Position;
24
+ }
25
+
26
+ interface Options {
27
+ source?: string;
28
+ silent?: boolean;
29
+ }
30
+
31
+ export default function InlineStyleParser(
32
+ style: string,
33
+ options?: Options
34
+ ): (Declaration | Comment)[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inline-style-parser",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "An inline style parser.",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./esm/index.mjs",
@@ -11,18 +11,19 @@
11
11
  "default": "./esm/index.mjs"
12
12
  },
13
13
  "require": {
14
- "types": "./cjs/index.d.ts",
14
+ "types": "./cjs/index.d.cts",
15
15
  "default": "./cjs/index.js"
16
16
  }
17
17
  },
18
18
  "scripts": {
19
19
  "build": "run-s build:*",
20
- "build:cjs": "rollup --config rollup.cjs.config.mjs --failAfterWarnings",
21
- "build:esm": "rollup --config rollup.esm.config.mjs --failAfterWarnings",
20
+ "build:cjs": "rollup --config rollup.cjs.config.mjs --failAfterWarnings && cp index.d.ts cjs/index.d.cts",
21
+ "build:esm": "rollup --config rollup.esm.config.mjs --failAfterWarnings && cp index.d.ts esm/index.d.mts",
22
22
  "build:umd": "rollup --config rollup.umd.config.mjs --failAfterWarnings",
23
23
  "clean": "rm -rf cjs dist esm",
24
24
  "lint": "eslint .",
25
25
  "lint:fix": "npm run lint -- --fix",
26
+ "lint:package": "publint",
26
27
  "prepare": "husky",
27
28
  "prepublishOnly": "npm run lint && npm run build && npm test",
28
29
  "test": "jest --colors --testPathIgnorePatterns=test/index.test.mjs",
@@ -47,23 +48,24 @@
47
48
  "devDependencies": {
48
49
  "@commitlint/cli": "20.1.0",
49
50
  "@commitlint/config-conventional": "20.0.0",
50
- "@eslint/compat": "1.4.0",
51
+ "@eslint/compat": "2.0.0",
51
52
  "@eslint/eslintrc": "3.3.1",
52
- "@eslint/js": "9.36.0",
53
- "@rollup/plugin-commonjs": "28.0.6",
54
- "@rollup/plugin-node-resolve": "16.0.1",
53
+ "@eslint/js": "9.39.1",
54
+ "@rollup/plugin-commonjs": "29.0.0",
55
+ "@rollup/plugin-node-resolve": "16.0.3",
55
56
  "@rollup/plugin-terser": "0.4.4",
56
57
  "css": "3.0.0",
57
- "eslint": "9.36.0",
58
+ "eslint": "9.39.1",
58
59
  "eslint-plugin-prettier": "5.5.4",
59
60
  "eslint-plugin-simple-import-sort": "12.1.1",
60
- "globals": "16.4.0",
61
+ "globals": "16.5.0",
61
62
  "husky": "9.1.7",
62
63
  "jest": "30.2.0",
63
- "lint-staged": "16.2.3",
64
+ "lint-staged": "16.2.6",
65
+ "npm-run-all": "4.1.5",
64
66
  "prettier": "3.6.2",
65
- "rollup": "4.52.3",
66
- "npm-run-all": "4.1.5"
67
+ "publint": "0.3.15",
68
+ "rollup": "4.53.2"
67
69
  },
68
70
  "files": [
69
71
  "/cjs",