style-to-object 0.4.1 → 0.4.2

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,10 +2,11 @@
2
2
 
3
3
  [![NPM](https://nodei.co/npm/style-to-object.png)](https://nodei.co/npm/style-to-object/)
4
4
 
5
- [![NPM version](https://img.shields.io/npm/v/style-to-object.svg)](https://www.npmjs.com/package/style-to-object)
5
+ [![NPM version](https://badgen.net/npm/v/style-to-object)](https://www.npmjs.com/package/style-to-object)
6
+ [![Bundlephobia minified + gzip](https://badgen.net/bundlephobia/minzip/style-to-object)](https://bundlephobia.com/package/style-to-object)
6
7
  [![build](https://github.com/remarkablemark/style-to-object/actions/workflows/build.yml/badge.svg)](https://github.com/remarkablemark/style-to-object/actions/workflows/build.yml)
7
8
  [![codecov](https://codecov.io/gh/remarkablemark/style-to-object/branch/master/graph/badge.svg?token=XWxph9dpa4)](https://codecov.io/gh/remarkablemark/style-to-object)
8
- [![NPM downloads](https://img.shields.io/npm/dm/style-to-object.svg?style=flat-square)](https://www.npmjs.com/package/style-to-object)
9
+ [![NPM downloads](https://badgen.net/npm/dm/style-to-object)](https://www.npmjs.com/package/style-to-object)
9
10
 
10
11
  Parses inline style to object:
11
12
 
@@ -1,317 +1,320 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
- typeof define === 'function' && define.amd ? define(factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.StyleToObject = factory());
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
+ typeof define === 'function' && define.amd ? define(factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.StyleToObject = factory());
5
5
  })(this, (function () { 'use strict';
6
6
 
7
- exports["default"] = {};
8
- var styleToObject = {
9
- get exports(){ return exports["default"]; },
10
- set exports(v){ exports["default"] = v; },
11
- };
12
-
13
- // http://www.w3.org/TR/CSS21/grammar.html
14
- // https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027
15
- var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
16
-
17
- var NEWLINE_REGEX = /\n/g;
18
- var WHITESPACE_REGEX = /^\s*/;
19
-
20
- // declaration
21
- var PROPERTY_REGEX = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/;
22
- var COLON_REGEX = /^:\s*/;
23
- var VALUE_REGEX = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/;
24
- var SEMICOLON_REGEX = /^[;\s]*/;
25
-
26
- // https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill
27
- var TRIM_REGEX = /^\s+|\s+$/g;
28
-
29
- // strings
30
- var NEWLINE = '\n';
31
- var FORWARD_SLASH = '/';
32
- var ASTERISK = '*';
33
- var EMPTY_STRING = '';
34
-
35
- // types
36
- var TYPE_COMMENT = 'comment';
37
- var TYPE_DECLARATION = 'declaration';
38
-
39
- /**
40
- * @param {String} style
41
- * @param {Object} [options]
42
- * @return {Object[]}
43
- * @throws {TypeError}
44
- * @throws {Error}
45
- */
46
- var inlineStyleParser = function(style, options) {
47
- if (typeof style !== 'string') {
48
- throw new TypeError('First argument must be a string');
49
- }
50
-
51
- if (!style) return [];
52
-
53
- options = options || {};
54
-
55
- /**
56
- * Positional.
57
- */
58
- var lineno = 1;
59
- var column = 1;
60
-
61
- /**
62
- * Update lineno and column based on `str`.
63
- *
64
- * @param {String} str
65
- */
66
- function updatePosition(str) {
67
- var lines = str.match(NEWLINE_REGEX);
68
- if (lines) lineno += lines.length;
69
- var i = str.lastIndexOf(NEWLINE);
70
- column = ~i ? str.length - i : column + str.length;
71
- }
72
-
73
- /**
74
- * Mark position and patch `node.position`.
75
- *
76
- * @return {Function}
77
- */
78
- function position() {
79
- var start = { line: lineno, column: column };
80
- return function(node) {
81
- node.position = new Position(start);
82
- whitespace();
83
- return node;
84
- };
85
- }
86
-
87
- /**
88
- * Store position information for a node.
89
- *
90
- * @constructor
91
- * @property {Object} start
92
- * @property {Object} end
93
- * @property {undefined|String} source
94
- */
95
- function Position(start) {
96
- this.start = start;
97
- this.end = { line: lineno, column: column };
98
- this.source = options.source;
99
- }
100
-
101
- /**
102
- * Non-enumerable source string.
103
- */
104
- Position.prototype.content = style;
105
-
106
- /**
107
- * Error `msg`.
108
- *
109
- * @param {String} msg
110
- * @throws {Error}
111
- */
112
- function error(msg) {
113
- var err = new Error(
114
- options.source + ':' + lineno + ':' + column + ': ' + msg
115
- );
116
- err.reason = msg;
117
- err.filename = options.source;
118
- err.line = lineno;
119
- err.column = column;
120
- err.source = style;
121
-
122
- if (options.silent) ; else {
123
- throw err;
124
- }
125
- }
126
-
127
- /**
128
- * Match `re` and return captures.
129
- *
130
- * @param {RegExp} re
131
- * @return {undefined|Array}
132
- */
133
- function match(re) {
134
- var m = re.exec(style);
135
- if (!m) return;
136
- var str = m[0];
137
- updatePosition(str);
138
- style = style.slice(str.length);
139
- return m;
140
- }
141
-
142
- /**
143
- * Parse whitespace.
144
- */
145
- function whitespace() {
146
- match(WHITESPACE_REGEX);
147
- }
148
-
149
- /**
150
- * Parse comments.
151
- *
152
- * @param {Object[]} [rules]
153
- * @return {Object[]}
154
- */
155
- function comments(rules) {
156
- var c;
157
- rules = rules || [];
158
- while ((c = comment())) {
159
- if (c !== false) {
160
- rules.push(c);
161
- }
162
- }
163
- return rules;
164
- }
165
-
166
- /**
167
- * Parse comment.
168
- *
169
- * @return {Object}
170
- * @throws {Error}
171
- */
172
- function comment() {
173
- var pos = position();
174
- if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return;
175
-
176
- var i = 2;
177
- while (
178
- EMPTY_STRING != style.charAt(i) &&
179
- (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1))
180
- ) {
181
- ++i;
182
- }
183
- i += 2;
184
-
185
- if (EMPTY_STRING === style.charAt(i - 1)) {
186
- return error('End of comment missing');
187
- }
188
-
189
- var str = style.slice(2, i - 2);
190
- column += 2;
191
- updatePosition(str);
192
- style = style.slice(i);
193
- column += 2;
194
-
195
- return pos({
196
- type: TYPE_COMMENT,
197
- comment: str
198
- });
199
- }
200
-
201
- /**
202
- * Parse declaration.
203
- *
204
- * @return {Object}
205
- * @throws {Error}
206
- */
207
- function declaration() {
208
- var pos = position();
209
-
210
- // prop
211
- var prop = match(PROPERTY_REGEX);
212
- if (!prop) return;
213
- comment();
214
-
215
- // :
216
- if (!match(COLON_REGEX)) return error("property missing ':'");
217
-
218
- // val
219
- var val = match(VALUE_REGEX);
220
-
221
- var ret = pos({
222
- type: TYPE_DECLARATION,
223
- property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)),
224
- value: val
225
- ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING))
226
- : EMPTY_STRING
227
- });
228
-
229
- // ;
230
- match(SEMICOLON_REGEX);
231
-
232
- return ret;
233
- }
234
-
235
- /**
236
- * Parse declarations.
237
- *
238
- * @return {Object[]}
239
- */
240
- function declarations() {
241
- var decls = [];
242
-
243
- comments(decls);
244
-
245
- // declarations
246
- var decl;
247
- while ((decl = declaration())) {
248
- if (decl !== false) {
249
- decls.push(decl);
250
- comments(decls);
251
- }
252
- }
253
-
254
- return decls;
255
- }
256
-
257
- whitespace();
258
- return declarations();
259
- };
260
-
261
- /**
262
- * Trim `str`.
263
- *
264
- * @param {String} str
265
- * @return {String}
266
- */
267
- function trim(str) {
268
- return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;
269
- }
270
-
271
- var parse = inlineStyleParser;
272
-
273
- /**
274
- * Parses inline style to object.
275
- *
276
- * @example
277
- * // returns { 'line-height': '42' }
278
- * StyleToObject('line-height: 42;');
279
- *
280
- * @param {String} style - The inline style.
281
- * @param {Function} [iterator] - The iterator function.
282
- * @return {null|Object}
283
- */
284
- function StyleToObject(style, iterator) {
285
- var output = null;
286
- if (!style || typeof style !== 'string') {
287
- return output;
288
- }
289
-
290
- var declaration;
291
- var declarations = parse(style);
292
- var hasIterator = typeof iterator === 'function';
293
- var property;
294
- var value;
295
-
296
- for (var i = 0, len = declarations.length; i < len; i++) {
297
- declaration = declarations[i];
298
- property = declaration.property;
299
- value = declaration.value;
300
-
301
- if (hasIterator) {
302
- iterator(property, value, declaration);
303
- } else if (value) {
304
- output || (output = {});
305
- output[property] = value;
306
- }
307
- }
308
-
309
- return output;
310
- }
311
-
312
- styleToObject.exports = StyleToObject;
313
- exports["default"].default = StyleToObject; // ESM support
314
-
315
- return exports["default"];
7
+ function getDefaultExportFromCjs (x) {
8
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
9
+ }
10
+
11
+ var styleToObject = {exports: {}};
12
+
13
+ // http://www.w3.org/TR/CSS21/grammar.html
14
+ // https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027
15
+ var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
16
+
17
+ var NEWLINE_REGEX = /\n/g;
18
+ var WHITESPACE_REGEX = /^\s*/;
19
+
20
+ // declaration
21
+ var PROPERTY_REGEX = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/;
22
+ var COLON_REGEX = /^:\s*/;
23
+ var VALUE_REGEX = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/;
24
+ var SEMICOLON_REGEX = /^[;\s]*/;
25
+
26
+ // https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill
27
+ var TRIM_REGEX = /^\s+|\s+$/g;
28
+
29
+ // strings
30
+ var NEWLINE = '\n';
31
+ var FORWARD_SLASH = '/';
32
+ var ASTERISK = '*';
33
+ var EMPTY_STRING = '';
34
+
35
+ // types
36
+ var TYPE_COMMENT = 'comment';
37
+ var TYPE_DECLARATION = 'declaration';
38
+
39
+ /**
40
+ * @param {String} style
41
+ * @param {Object} [options]
42
+ * @return {Object[]}
43
+ * @throws {TypeError}
44
+ * @throws {Error}
45
+ */
46
+ var inlineStyleParser = function(style, options) {
47
+ if (typeof style !== 'string') {
48
+ throw new TypeError('First argument must be a string');
49
+ }
50
+
51
+ if (!style) return [];
52
+
53
+ options = options || {};
54
+
55
+ /**
56
+ * Positional.
57
+ */
58
+ var lineno = 1;
59
+ var column = 1;
60
+
61
+ /**
62
+ * Update lineno and column based on `str`.
63
+ *
64
+ * @param {String} str
65
+ */
66
+ function updatePosition(str) {
67
+ var lines = str.match(NEWLINE_REGEX);
68
+ if (lines) lineno += lines.length;
69
+ var i = str.lastIndexOf(NEWLINE);
70
+ column = ~i ? str.length - i : column + str.length;
71
+ }
72
+
73
+ /**
74
+ * Mark position and patch `node.position`.
75
+ *
76
+ * @return {Function}
77
+ */
78
+ function position() {
79
+ var start = { line: lineno, column: column };
80
+ return function(node) {
81
+ node.position = new Position(start);
82
+ whitespace();
83
+ return node;
84
+ };
85
+ }
86
+
87
+ /**
88
+ * Store position information for a node.
89
+ *
90
+ * @constructor
91
+ * @property {Object} start
92
+ * @property {Object} end
93
+ * @property {undefined|String} source
94
+ */
95
+ function Position(start) {
96
+ this.start = start;
97
+ this.end = { line: lineno, column: column };
98
+ this.source = options.source;
99
+ }
100
+
101
+ /**
102
+ * Non-enumerable source string.
103
+ */
104
+ Position.prototype.content = style;
105
+
106
+ /**
107
+ * Error `msg`.
108
+ *
109
+ * @param {String} msg
110
+ * @throws {Error}
111
+ */
112
+ function error(msg) {
113
+ var err = new Error(
114
+ options.source + ':' + lineno + ':' + column + ': ' + msg
115
+ );
116
+ err.reason = msg;
117
+ err.filename = options.source;
118
+ err.line = lineno;
119
+ err.column = column;
120
+ err.source = style;
121
+
122
+ if (options.silent) ; else {
123
+ throw err;
124
+ }
125
+ }
126
+
127
+ /**
128
+ * Match `re` and return captures.
129
+ *
130
+ * @param {RegExp} re
131
+ * @return {undefined|Array}
132
+ */
133
+ function match(re) {
134
+ var m = re.exec(style);
135
+ if (!m) return;
136
+ var str = m[0];
137
+ updatePosition(str);
138
+ style = style.slice(str.length);
139
+ return m;
140
+ }
141
+
142
+ /**
143
+ * Parse whitespace.
144
+ */
145
+ function whitespace() {
146
+ match(WHITESPACE_REGEX);
147
+ }
148
+
149
+ /**
150
+ * Parse comments.
151
+ *
152
+ * @param {Object[]} [rules]
153
+ * @return {Object[]}
154
+ */
155
+ function comments(rules) {
156
+ var c;
157
+ rules = rules || [];
158
+ while ((c = comment())) {
159
+ if (c !== false) {
160
+ rules.push(c);
161
+ }
162
+ }
163
+ return rules;
164
+ }
165
+
166
+ /**
167
+ * Parse comment.
168
+ *
169
+ * @return {Object}
170
+ * @throws {Error}
171
+ */
172
+ function comment() {
173
+ var pos = position();
174
+ if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return;
175
+
176
+ var i = 2;
177
+ while (
178
+ EMPTY_STRING != style.charAt(i) &&
179
+ (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1))
180
+ ) {
181
+ ++i;
182
+ }
183
+ i += 2;
184
+
185
+ if (EMPTY_STRING === style.charAt(i - 1)) {
186
+ return error('End of comment missing');
187
+ }
188
+
189
+ var str = style.slice(2, i - 2);
190
+ column += 2;
191
+ updatePosition(str);
192
+ style = style.slice(i);
193
+ column += 2;
194
+
195
+ return pos({
196
+ type: TYPE_COMMENT,
197
+ comment: str
198
+ });
199
+ }
200
+
201
+ /**
202
+ * Parse declaration.
203
+ *
204
+ * @return {Object}
205
+ * @throws {Error}
206
+ */
207
+ function declaration() {
208
+ var pos = position();
209
+
210
+ // prop
211
+ var prop = match(PROPERTY_REGEX);
212
+ if (!prop) return;
213
+ comment();
214
+
215
+ // :
216
+ if (!match(COLON_REGEX)) return error("property missing ':'");
217
+
218
+ // val
219
+ var val = match(VALUE_REGEX);
220
+
221
+ var ret = pos({
222
+ type: TYPE_DECLARATION,
223
+ property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)),
224
+ value: val
225
+ ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING))
226
+ : EMPTY_STRING
227
+ });
228
+
229
+ // ;
230
+ match(SEMICOLON_REGEX);
231
+
232
+ return ret;
233
+ }
234
+
235
+ /**
236
+ * Parse declarations.
237
+ *
238
+ * @return {Object[]}
239
+ */
240
+ function declarations() {
241
+ var decls = [];
242
+
243
+ comments(decls);
244
+
245
+ // declarations
246
+ var decl;
247
+ while ((decl = declaration())) {
248
+ if (decl !== false) {
249
+ decls.push(decl);
250
+ comments(decls);
251
+ }
252
+ }
253
+
254
+ return decls;
255
+ }
256
+
257
+ whitespace();
258
+ return declarations();
259
+ };
260
+
261
+ /**
262
+ * Trim `str`.
263
+ *
264
+ * @param {String} str
265
+ * @return {String}
266
+ */
267
+ function trim(str) {
268
+ return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;
269
+ }
270
+
271
+ var parse = inlineStyleParser;
272
+
273
+ /**
274
+ * Parses inline style to object.
275
+ *
276
+ * @example
277
+ * // returns { 'line-height': '42' }
278
+ * StyleToObject('line-height: 42;');
279
+ *
280
+ * @param {String} style - The inline style.
281
+ * @param {Function} [iterator] - The iterator function.
282
+ * @return {null|Object}
283
+ */
284
+ function StyleToObject(style, iterator) {
285
+ var output = null;
286
+ if (!style || typeof style !== 'string') {
287
+ return output;
288
+ }
289
+
290
+ var declaration;
291
+ var declarations = parse(style);
292
+ var hasIterator = typeof iterator === 'function';
293
+ var property;
294
+ var value;
295
+
296
+ for (var i = 0, len = declarations.length; i < len; i++) {
297
+ declaration = declarations[i];
298
+ property = declaration.property;
299
+ value = declaration.value;
300
+
301
+ if (hasIterator) {
302
+ iterator(property, value, declaration);
303
+ } else if (value) {
304
+ output || (output = {});
305
+ output[property] = value;
306
+ }
307
+ }
308
+
309
+ return output;
310
+ }
311
+
312
+ styleToObject.exports = StyleToObject;
313
+ styleToObject.exports.default = StyleToObject; // ESM support
314
+
315
+ var styleToObjectExports = styleToObject.exports;
316
+ var index = /*@__PURE__*/getDefaultExportFromCjs(styleToObjectExports);
317
+
318
+ return index;
316
319
 
317
320
  }));
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).StyleToObject=t()}(this,(function(){"use strict";exports.default={};var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,i=/^[;\s]*/,f=/^\s+|\s+$/g,s="";function a(e){return e?e.replace(f,s):s}var c=function(f,c){if("string"!=typeof f)throw new TypeError("First argument must be a string");if(!f)return[];c=c||{};var l=1,p=1;function h(e){var r=e.match(t);r&&(l+=r.length);var n=e.lastIndexOf("\n");p=~n?e.length-n:p+e.length}function d(){var e={line:l,column:p};return function(t){return t.position=new v(e),y(),t}}function v(e){this.start=e,this.end={line:l,column:p},this.source=c.source}function m(e){var t=new Error(c.source+":"+l+":"+p+": "+e);if(t.reason=e,t.filename=c.source,t.line=l,t.column=p,t.source=f,!c.silent)throw t}function g(e){var t=e.exec(f);if(t){var r=t[0];return h(r),f=f.slice(r.length),t}}function y(){g(r)}function x(e){var t;for(e=e||[];t=w();)!1!==t&&e.push(t);return e}function w(){var e=d();if("/"==f.charAt(0)&&"*"==f.charAt(1)){for(var t=2;s!=f.charAt(t)&&("*"!=f.charAt(t)||"/"!=f.charAt(t+1));)++t;if(t+=2,s===f.charAt(t-1))return m("End of comment missing");var r=f.slice(2,t-2);return p+=2,h(r),f=f.slice(t),p+=2,e({type:"comment",comment:r})}}function A(){var t=d(),r=g(n);if(r){if(w(),!g(o))return m("property missing ':'");var f=g(u),c=t({type:"declaration",property:a(r[0].replace(e,s)),value:f?a(f[0].replace(e,s)):s});return g(i),c}}return v.prototype.content=f,y(),function(){var e,t=[];for(x(t);e=A();)!1!==e&&(t.push(e),x(t));return t}()};function l(e,t){var r,n=null;if(!e||"string"!=typeof e)return n;for(var o,u,i=c(e),f="function"==typeof t,s=0,a=i.length;s<a;s++)o=(r=i[s]).property,u=r.value,f?t(o,u,r):u&&(n||(n={}),n[o]=u);return n}return{get exports(){return exports.default},set exports(e){exports.default=e}}.exports=l,exports.default.default=l,exports.default}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).StyleToObject=t()}(this,(function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t={exports:{}},r=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,o=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,u=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,f=/^[;\s]*/,a=/^\s+|\s+$/g,s="";function l(e){return e?e.replace(a,s):s}var p=function(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var a=1,p=1;function h(e){var t=e.match(n);t&&(a+=t.length);var r=e.lastIndexOf("\n");p=~r?e.length-r:p+e.length}function v(){var e={line:a,column:p};return function(t){return t.position=new d(e),g(),t}}function d(e){this.start=e,this.end={line:a,column:p},this.source=t.source}function m(r){var n=new Error(t.source+":"+a+":"+p+": "+r);if(n.reason=r,n.filename=t.source,n.line=a,n.column=p,n.source=e,!t.silent)throw n}function y(t){var r=t.exec(e);if(r){var n=r[0];return h(n),e=e.slice(n.length),r}}function g(){y(o)}function x(e){var t;for(e=e||[];t=w();)!1!==t&&e.push(t);return e}function w(){var t=v();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var r=2;s!=e.charAt(r)&&("*"!=e.charAt(r)||"/"!=e.charAt(r+1));)++r;if(r+=2,s===e.charAt(r-1))return m("End of comment missing");var n=e.slice(2,r-2);return p+=2,h(n),e=e.slice(r),p+=2,t({type:"comment",comment:n})}}function b(){var e=v(),t=y(i);if(t){if(w(),!y(u))return m("property missing ':'");var n=y(c),o=e({type:"declaration",property:l(t[0].replace(r,s)),value:n?l(n[0].replace(r,s)):s});return y(f),o}}return d.prototype.content=e,g(),function(){var e,t=[];for(x(t);e=b();)!1!==e&&(t.push(e),x(t));return t}()};function h(e,t){var r,n=null;if(!e||"string"!=typeof e)return n;for(var o,i,u=p(e),c="function"==typeof t,f=0,a=u.length;f<a;f++)o=(r=u[f]).property,i=r.value,c?t(o,i,r):i&&(n||(n={}),n[o]=i);return n}return t.exports=h,t.exports.default=h,e(t.exports)}));
2
2
  //# sourceMappingURL=style-to-object.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"style-to-object.min.js","sources":["../node_modules/inline-style-parser/index.js","../index.js"],"sourcesContent":["// http://www.w3.org/TR/CSS21/grammar.html\n// https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027\nvar COMMENT_REGEX = /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g;\n\nvar NEWLINE_REGEX = /\\n/g;\nvar WHITESPACE_REGEX = /^\\s*/;\n\n// declaration\nvar PROPERTY_REGEX = /^(\\*?[-#/*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)\\s*/;\nvar COLON_REGEX = /^:\\s*/;\nvar VALUE_REGEX = /^((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^)]*?\\)|[^};])+)/;\nvar SEMICOLON_REGEX = /^[;\\s]*/;\n\n// https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill\nvar TRIM_REGEX = /^\\s+|\\s+$/g;\n\n// strings\nvar NEWLINE = '\\n';\nvar FORWARD_SLASH = '/';\nvar ASTERISK = '*';\nvar EMPTY_STRING = '';\n\n// types\nvar TYPE_COMMENT = 'comment';\nvar TYPE_DECLARATION = 'declaration';\n\n/**\n * @param {String} style\n * @param {Object} [options]\n * @return {Object[]}\n * @throws {TypeError}\n * @throws {Error}\n */\nmodule.exports = function(style, options) {\n if (typeof style !== 'string') {\n throw new TypeError('First argument must be a string');\n }\n\n if (!style) return [];\n\n options = options || {};\n\n /**\n * Positional.\n */\n var lineno = 1;\n var column = 1;\n\n /**\n * Update lineno and column based on `str`.\n *\n * @param {String} str\n */\n function updatePosition(str) {\n var lines = str.match(NEWLINE_REGEX);\n if (lines) lineno += lines.length;\n var i = str.lastIndexOf(NEWLINE);\n column = ~i ? str.length - i : column + str.length;\n }\n\n /**\n * Mark position and patch `node.position`.\n *\n * @return {Function}\n */\n function position() {\n var start = { line: lineno, column: column };\n return function(node) {\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }\n\n /**\n * Store position information for a node.\n *\n * @constructor\n * @property {Object} start\n * @property {Object} end\n * @property {undefined|String} source\n */\n function Position(start) {\n this.start = start;\n this.end = { line: lineno, column: column };\n this.source = options.source;\n }\n\n /**\n * Non-enumerable source string.\n */\n Position.prototype.content = style;\n\n var errorsList = [];\n\n /**\n * Error `msg`.\n *\n * @param {String} msg\n * @throws {Error}\n */\n function error(msg) {\n var err = new Error(\n options.source + ':' + lineno + ':' + column + ': ' + msg\n );\n err.reason = msg;\n err.filename = options.source;\n err.line = lineno;\n err.column = column;\n err.source = style;\n\n if (options.silent) {\n errorsList.push(err);\n } else {\n throw err;\n }\n }\n\n /**\n * Match `re` and return captures.\n *\n * @param {RegExp} re\n * @return {undefined|Array}\n */\n function match(re) {\n var m = re.exec(style);\n if (!m) return;\n var str = m[0];\n updatePosition(str);\n style = style.slice(str.length);\n return m;\n }\n\n /**\n * Parse whitespace.\n */\n function whitespace() {\n match(WHITESPACE_REGEX);\n }\n\n /**\n * Parse comments.\n *\n * @param {Object[]} [rules]\n * @return {Object[]}\n */\n function comments(rules) {\n var c;\n rules = rules || [];\n while ((c = comment())) {\n if (c !== false) {\n rules.push(c);\n }\n }\n return rules;\n }\n\n /**\n * Parse comment.\n *\n * @return {Object}\n * @throws {Error}\n */\n function comment() {\n var pos = position();\n if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return;\n\n var i = 2;\n while (\n EMPTY_STRING != style.charAt(i) &&\n (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1))\n ) {\n ++i;\n }\n i += 2;\n\n if (EMPTY_STRING === style.charAt(i - 1)) {\n return error('End of comment missing');\n }\n\n var str = style.slice(2, i - 2);\n column += 2;\n updatePosition(str);\n style = style.slice(i);\n column += 2;\n\n return pos({\n type: TYPE_COMMENT,\n comment: str\n });\n }\n\n /**\n * Parse declaration.\n *\n * @return {Object}\n * @throws {Error}\n */\n function declaration() {\n var pos = position();\n\n // prop\n var prop = match(PROPERTY_REGEX);\n if (!prop) return;\n comment();\n\n // :\n if (!match(COLON_REGEX)) return error(\"property missing ':'\");\n\n // val\n var val = match(VALUE_REGEX);\n\n var ret = pos({\n type: TYPE_DECLARATION,\n property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)),\n value: val\n ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING))\n : EMPTY_STRING\n });\n\n // ;\n match(SEMICOLON_REGEX);\n\n return ret;\n }\n\n /**\n * Parse declarations.\n *\n * @return {Object[]}\n */\n function declarations() {\n var decls = [];\n\n comments(decls);\n\n // declarations\n var decl;\n while ((decl = declaration())) {\n if (decl !== false) {\n decls.push(decl);\n comments(decls);\n }\n }\n\n return decls;\n }\n\n whitespace();\n return declarations();\n};\n\n/**\n * Trim `str`.\n *\n * @param {String} str\n * @return {String}\n */\nfunction trim(str) {\n return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;\n}\n","var parse = require('inline-style-parser');\n\n/**\n * Parses inline style to object.\n *\n * @example\n * // returns { 'line-height': '42' }\n * StyleToObject('line-height: 42;');\n *\n * @param {String} style - The inline style.\n * @param {Function} [iterator] - The iterator function.\n * @return {null|Object}\n */\nfunction StyleToObject(style, iterator) {\n var output = null;\n if (!style || typeof style !== 'string') {\n return output;\n }\n\n var declaration;\n var declarations = parse(style);\n var hasIterator = typeof iterator === 'function';\n var property;\n var value;\n\n for (var i = 0, len = declarations.length; i < len; i++) {\n declaration = declarations[i];\n property = declaration.property;\n value = declaration.value;\n\n if (hasIterator) {\n iterator(property, value, declaration);\n } else if (value) {\n output || (output = {});\n output[property] = value;\n }\n }\n\n return output;\n}\n\nmodule.exports = StyleToObject;\nmodule.exports.default = StyleToObject; // ESM support\n"],"names":["COMMENT_REGEX","NEWLINE_REGEX","WHITESPACE_REGEX","PROPERTY_REGEX","COLON_REGEX","VALUE_REGEX","SEMICOLON_REGEX","TRIM_REGEX","EMPTY_STRING","trim","str","replace","parse","style","options","TypeError","lineno","column","updatePosition","lines","match","length","i","lastIndexOf","position","start","line","node","Position","whitespace","this","end","source","error","msg","err","Error","reason","filename","silent","re","m","exec","slice","comments","rules","c","comment","push","pos","charAt","type","declaration","prop","val","ret","property","value","prototype","content","decl","decls","declarations","StyleToObject","iterator","output","hasIterator","len","exports","default"],"mappings":"qQAEIA,EAAgB,kCAEhBC,EAAgB,MAChBC,EAAmB,OAGnBC,EAAiB,yCACjBC,EAAc,QACdC,EAAc,uDACdC,EAAkB,UAGlBC,EAAa,aAMbC,EAAe,GA8OnB,SAASC,EAAKC,GACZ,OAAOA,EAAMA,EAAIC,QAAQJ,EAAYC,GAAgBA,CACvD,CCpQA,IAAII,EDiCa,SAASC,EAAOC,GAC/B,GAAqB,iBAAVD,EACT,MAAM,IAAIE,UAAU,mCAGtB,IAAKF,EAAO,MAAO,GAEnBC,EAAUA,GAAW,GAKrB,IAAIE,EAAS,EACTC,EAAS,EAOb,SAASC,EAAeR,GACtB,IAAIS,EAAQT,EAAIU,MAAMnB,GAClBkB,IAAOH,GAAUG,EAAME,QAC3B,IAAIC,EAAIZ,EAAIa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1
+ {"version":3,"file":"style-to-object.min.js","sources":["../node_modules/inline-style-parser/index.js","../index.js"],"sourcesContent":["// http://www.w3.org/TR/CSS21/grammar.html\n// https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027\nvar COMMENT_REGEX = /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g;\n\nvar NEWLINE_REGEX = /\\n/g;\nvar WHITESPACE_REGEX = /^\\s*/;\n\n// declaration\nvar PROPERTY_REGEX = /^(\\*?[-#/*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)\\s*/;\nvar COLON_REGEX = /^:\\s*/;\nvar VALUE_REGEX = /^((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^)]*?\\)|[^};])+)/;\nvar SEMICOLON_REGEX = /^[;\\s]*/;\n\n// https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill\nvar TRIM_REGEX = /^\\s+|\\s+$/g;\n\n// strings\nvar NEWLINE = '\\n';\nvar FORWARD_SLASH = '/';\nvar ASTERISK = '*';\nvar EMPTY_STRING = '';\n\n// types\nvar TYPE_COMMENT = 'comment';\nvar TYPE_DECLARATION = 'declaration';\n\n/**\n * @param {String} style\n * @param {Object} [options]\n * @return {Object[]}\n * @throws {TypeError}\n * @throws {Error}\n */\nmodule.exports = function(style, options) {\n if (typeof style !== 'string') {\n throw new TypeError('First argument must be a string');\n }\n\n if (!style) return [];\n\n options = options || {};\n\n /**\n * Positional.\n */\n var lineno = 1;\n var column = 1;\n\n /**\n * Update lineno and column based on `str`.\n *\n * @param {String} str\n */\n function updatePosition(str) {\n var lines = str.match(NEWLINE_REGEX);\n if (lines) lineno += lines.length;\n var i = str.lastIndexOf(NEWLINE);\n column = ~i ? str.length - i : column + str.length;\n }\n\n /**\n * Mark position and patch `node.position`.\n *\n * @return {Function}\n */\n function position() {\n var start = { line: lineno, column: column };\n return function(node) {\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }\n\n /**\n * Store position information for a node.\n *\n * @constructor\n * @property {Object} start\n * @property {Object} end\n * @property {undefined|String} source\n */\n function Position(start) {\n this.start = start;\n this.end = { line: lineno, column: column };\n this.source = options.source;\n }\n\n /**\n * Non-enumerable source string.\n */\n Position.prototype.content = style;\n\n var errorsList = [];\n\n /**\n * Error `msg`.\n *\n * @param {String} msg\n * @throws {Error}\n */\n function error(msg) {\n var err = new Error(\n options.source + ':' + lineno + ':' + column + ': ' + msg\n );\n err.reason = msg;\n err.filename = options.source;\n err.line = lineno;\n err.column = column;\n err.source = style;\n\n if (options.silent) {\n errorsList.push(err);\n } else {\n throw err;\n }\n }\n\n /**\n * Match `re` and return captures.\n *\n * @param {RegExp} re\n * @return {undefined|Array}\n */\n function match(re) {\n var m = re.exec(style);\n if (!m) return;\n var str = m[0];\n updatePosition(str);\n style = style.slice(str.length);\n return m;\n }\n\n /**\n * Parse whitespace.\n */\n function whitespace() {\n match(WHITESPACE_REGEX);\n }\n\n /**\n * Parse comments.\n *\n * @param {Object[]} [rules]\n * @return {Object[]}\n */\n function comments(rules) {\n var c;\n rules = rules || [];\n while ((c = comment())) {\n if (c !== false) {\n rules.push(c);\n }\n }\n return rules;\n }\n\n /**\n * Parse comment.\n *\n * @return {Object}\n * @throws {Error}\n */\n function comment() {\n var pos = position();\n if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return;\n\n var i = 2;\n while (\n EMPTY_STRING != style.charAt(i) &&\n (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1))\n ) {\n ++i;\n }\n i += 2;\n\n if (EMPTY_STRING === style.charAt(i - 1)) {\n return error('End of comment missing');\n }\n\n var str = style.slice(2, i - 2);\n column += 2;\n updatePosition(str);\n style = style.slice(i);\n column += 2;\n\n return pos({\n type: TYPE_COMMENT,\n comment: str\n });\n }\n\n /**\n * Parse declaration.\n *\n * @return {Object}\n * @throws {Error}\n */\n function declaration() {\n var pos = position();\n\n // prop\n var prop = match(PROPERTY_REGEX);\n if (!prop) return;\n comment();\n\n // :\n if (!match(COLON_REGEX)) return error(\"property missing ':'\");\n\n // val\n var val = match(VALUE_REGEX);\n\n var ret = pos({\n type: TYPE_DECLARATION,\n property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)),\n value: val\n ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING))\n : EMPTY_STRING\n });\n\n // ;\n match(SEMICOLON_REGEX);\n\n return ret;\n }\n\n /**\n * Parse declarations.\n *\n * @return {Object[]}\n */\n function declarations() {\n var decls = [];\n\n comments(decls);\n\n // declarations\n var decl;\n while ((decl = declaration())) {\n if (decl !== false) {\n decls.push(decl);\n comments(decls);\n }\n }\n\n return decls;\n }\n\n whitespace();\n return declarations();\n};\n\n/**\n * Trim `str`.\n *\n * @param {String} str\n * @return {String}\n */\nfunction trim(str) {\n return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;\n}\n","var parse = require('inline-style-parser');\n\n/**\n * Parses inline style to object.\n *\n * @example\n * // returns { 'line-height': '42' }\n * StyleToObject('line-height: 42;');\n *\n * @param {String} style - The inline style.\n * @param {Function} [iterator] - The iterator function.\n * @return {null|Object}\n */\nfunction StyleToObject(style, iterator) {\n var output = null;\n if (!style || typeof style !== 'string') {\n return output;\n }\n\n var declaration;\n var declarations = parse(style);\n var hasIterator = typeof iterator === 'function';\n var property;\n var value;\n\n for (var i = 0, len = declarations.length; i < len; i++) {\n declaration = declarations[i];\n property = declaration.property;\n value = declaration.value;\n\n if (hasIterator) {\n iterator(property, value, declaration);\n } else if (value) {\n output || (output = {});\n output[property] = value;\n }\n }\n\n return output;\n}\n\nmodule.exports = StyleToObject;\nmodule.exports.default = StyleToObject; // ESM support\n"],"names":["COMMENT_REGEX","NEWLINE_REGEX","WHITESPACE_REGEX","PROPERTY_REGEX","COLON_REGEX","VALUE_REGEX","SEMICOLON_REGEX","TRIM_REGEX","EMPTY_STRING","trim","str","replace","parse","style","options","TypeError","lineno","column","updatePosition","lines","match","length","i","lastIndexOf","position","start","line","node","Position","whitespace","this","end","source","error","msg","err","Error","reason","filename","silent","re","m","exec","slice","comments","rules","c","comment","push","pos","charAt","type","declaration","prop","val","ret","property","value","prototype","content","decl","decls","declarations","StyleToObject","iterator","output","hasIterator","len","styleToObjectModule","exports","default"],"mappings":"qWAEIA,EAAgB,kCAEhBC,EAAgB,MAChBC,EAAmB,OAGnBC,EAAiB,yCACjBC,EAAc,QACdC,EAAc,uDACdC,EAAkB,UAGlBC,EAAa,aAMbC,EAAe,GA8OnB,SAASC,EAAKC,GACZ,OAAOA,EAAMA,EAAIC,QAAQJ,EAAYC,GAAgBA,CACvD,CCpQA,IAAII,EDiCa,SAASC,EAAOC,GAC/B,GAAqB,iBAAVD,EACT,MAAM,IAAIE,UAAU,mCAGtB,IAAKF,EAAO,MAAO,GAEnBC,EAAUA,GAAW,GAKrB,IAAIE,EAAS,EACTC,EAAS,EAOb,SAASC,EAAeR,GACtB,IAAIS,EAAQT,EAAIU,MAAMnB,GAClBkB,IAAOH,GAAUG,EAAME,QAC3B,IAAIC,EAAIZ,EAAIa,YAvCF,MAwCVN,GAAUK,EAAIZ,EAAIW,OAASC,EAAIL,EAASP,EAAIW,MAC7C,CAOD,SAASG,IACP,IAAIC,EAAQ,CAAEC,KAAMV,EAAQC,OAAQA,GACpC,OAAO,SAASU,GAGd,OAFAA,EAAKH,SAAW,IAAII,EAASH,GAC7BI,IACOF,CACb,CACG,CAUD,SAASC,EAASH,GAChBK,KAAKL,MAAQA,EACbK,KAAKC,IAAM,CAAEL,KAAMV,EAAQC,OAAQA,GACnCa,KAAKE,OAASlB,EAAQkB,MACvB,CAeD,SAASC,EAAMC,GACb,IAAIC,EAAM,IAAIC,MACZtB,EAAQkB,OAAS,IAAMhB,EAAS,IAAMC,EAAS,KAAOiB,GAQxD,GANAC,EAAIE,OAASH,EACbC,EAAIG,SAAWxB,EAAQkB,OACvBG,EAAIT,KAAOV,EACXmB,EAAIlB,OAASA,EACbkB,EAAIH,O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Y,EAAMd,GAECiD,CApBW,CAqBnB,CAyBD,OA9JA3B,EAAS8B,UAAUC,QAAU9C,EA6J7BgB,IAjBA,WACE,IAKI+B,EALAC,EAAQ,GAMZ,IAJAjB,EAASiB,GAIDD,EAAOR,MACA,IAATQ,IACFC,EAAMb,KAAKY,GACXhB,EAASiB,IAIb,OAAOA,CACR,CAGMC,EACT,EC7OA,SAASC,EAAclD,EAAOmD,GAC5B,IAKIZ,EALAa,EAAS,KACb,IAAKpD,GAA0B,iBAAVA,EACnB,OAAOoD,EAST,IALA,IAEIT,EACAC,EAHAK,EAAelD,EAAMC,GACrBqD,EAAkC,mBAAbF,EAIhB1C,EAAI,EAAG6C,EAAML,EAAazC,OAAQC,EAAI6C,EAAK7C,IAElDkC,GADAJ,EAAcU,EAAaxC,IACJkC,SACvBC,EAAQL,EAAYK,MAEhBS,EACFF,EAASR,EAAUC,EAAOL,GACjBK,IACTQ,IAAWA,EAAS,CAAA,GACpBA,EAAOT,GAAYC,GAIvB,OAAOQ,CACT,QAEAG,EAAcC,QAAGN,EACKK,EAAAC,QAAAC,QAAGP"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "style-to-object",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Converts inline style to object.",
5
5
  "author": "Mark <mark@remarkablemark.org>",
6
6
  "main": "index.js",
@@ -47,23 +47,23 @@
47
47
  "inline-style-parser": "0.1.1"
48
48
  },
49
49
  "devDependencies": {
50
- "@commitlint/cli": "17.4.2",
51
- "@commitlint/config-conventional": "17.4.2",
52
- "@rollup/plugin-commonjs": "24.0.0",
53
- "@rollup/plugin-node-resolve": "15.0.1",
54
- "@rollup/plugin-terser": "0.3.0",
50
+ "@commitlint/cli": "17.6.7",
51
+ "@commitlint/config-conventional": "17.6.7",
52
+ "@rollup/plugin-commonjs": "25.0.3",
53
+ "@rollup/plugin-node-resolve": "15.1.0",
54
+ "@rollup/plugin-terser": "0.4.3",
55
55
  "dtslint": "4.2.1",
56
- "eslint": "8.32.0",
57
- "eslint-plugin-prettier": "4.2.1",
56
+ "eslint": "8.46.0",
57
+ "eslint-plugin-prettier": "5.0.0",
58
58
  "husky": "8.0.3",
59
- "lint-staged": "13.1.0",
59
+ "lint-staged": "13.2.3",
60
60
  "mocha": "10.2.0",
61
61
  "npm-run-all": "4.1.5",
62
62
  "nyc": "15.1.0",
63
63
  "pinst": "3.0.0",
64
- "prettier": "2.8.3",
64
+ "prettier": "3.0.0",
65
65
  "rollup": "2.79.1",
66
- "typescript": "4.9.4"
66
+ "typescript": "5.1.6"
67
67
  },
68
68
  "files": [
69
69
  "/dist",