🎉 initiate project *astro_rewrite*
This commit is contained in:
parent
ffd4d5e86c
commit
2ba37bfbe3
8658 changed files with 2268794 additions and 2538 deletions
22
node_modules/style-to-object/LICENSE
generated
vendored
Normal file
22
node_modules/style-to-object/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 Menglin "Mark" Xu <mark@remarkablemark.org>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
212
node_modules/style-to-object/README.md
generated
vendored
Normal file
212
node_modules/style-to-object/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,212 @@
|
|||
# style-to-object
|
||||
|
||||
[](https://nodei.co/npm/style-to-object/)
|
||||
|
||||
[](https://www.npmjs.com/package/style-to-object)
|
||||
[](https://github.com/remarkablemark/style-to-object/actions/workflows/build.yml)
|
||||
[](https://codecov.io/gh/remarkablemark/style-to-object)
|
||||
[](https://www.npmjs.com/package/style-to-object)
|
||||
|
||||
Parses inline style to object:
|
||||
|
||||
```js
|
||||
var parse = require('style-to-object');
|
||||
parse('color: #C0FFEE; background: #BADA55;');
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
```js
|
||||
{ color: '#C0FFEE', background: '#BADA55' }
|
||||
```
|
||||
|
||||
[JSFiddle](https://jsfiddle.net/remarkablemark/ykz2meot/) | [Replit](https://replit.com/@remarkablemark/style-to-object) | [Examples](https://github.com/remarkablemark/style-to-object/tree/master/examples)
|
||||
|
||||
## Installation
|
||||
|
||||
[NPM](https://www.npmjs.com/package/style-to-object):
|
||||
|
||||
```sh
|
||||
npm install style-to-object --save
|
||||
```
|
||||
|
||||
[Yarn](https://yarn.fyi/style-to-object):
|
||||
|
||||
```sh
|
||||
yarn add style-to-object
|
||||
```
|
||||
|
||||
[CDN](https://unpkg.com/style-to-object/):
|
||||
|
||||
```html
|
||||
<script src="https://unpkg.com/style-to-object@latest/dist/style-to-object.min.js"></script>
|
||||
<script>
|
||||
window.StyleToObject(/* string */);
|
||||
</script>
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Import the module:
|
||||
|
||||
```js
|
||||
// CommonJS
|
||||
const parse = require('style-to-object');
|
||||
|
||||
// ES Modules
|
||||
import parse from 'style-to-object';
|
||||
```
|
||||
|
||||
Parse single declaration:
|
||||
|
||||
```js
|
||||
parse('line-height: 42');
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
```js
|
||||
{ 'line-height': '42' }
|
||||
```
|
||||
|
||||
Parse multiple declarations:
|
||||
|
||||
```js
|
||||
parse(`
|
||||
border-color: #ACE;
|
||||
z-index: 1337;
|
||||
`);
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
```js
|
||||
{ 'border-color': '#ACE', 'z-index': '1337' }
|
||||
```
|
||||
|
||||
Parse unknown declarations:
|
||||
|
||||
```js
|
||||
parse('answer: 42;');
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
```js
|
||||
{ 'answer': '42' }
|
||||
```
|
||||
|
||||
Invalid declarations/arguments:
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
|
||||
```js
|
||||
parse(`
|
||||
top: ;
|
||||
right: 1em;
|
||||
`); // { right: '1em' }
|
||||
|
||||
parse(); // null
|
||||
parse(null); // null
|
||||
parse(1); // null
|
||||
parse(true); // null
|
||||
parse('top:'); // null
|
||||
parse(':12px'); // null
|
||||
parse(':'); // null
|
||||
parse(';'); // null
|
||||
|
||||
parse('top'); // throws Error
|
||||
parse('/*'); // throws Error
|
||||
```
|
||||
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
### Iterator
|
||||
|
||||
If the 2nd argument is a function, then the parser will return `null`:
|
||||
|
||||
```js
|
||||
parse('color: #f00', function() {}); // null
|
||||
```
|
||||
|
||||
But the function will iterate through each declaration:
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
|
||||
```js
|
||||
parse('color: #f00', function(name, value, declaration) {
|
||||
console.log(name); // 'color'
|
||||
console.log(value); // '#f00'
|
||||
console.log(declaration); // { type: 'declaration', property: 'color', value: '#f00' }
|
||||
});
|
||||
```
|
||||
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
This makes it easy to customize the output:
|
||||
|
||||
```js
|
||||
const style = `
|
||||
color: red;
|
||||
background: blue;
|
||||
`;
|
||||
const output = [];
|
||||
|
||||
function iterator(name, value) {
|
||||
output.push([name, value]);
|
||||
}
|
||||
|
||||
parse(style, iterator);
|
||||
console.log(output); // [['color', 'red'], ['background', 'blue']]
|
||||
```
|
||||
|
||||
## Testing
|
||||
|
||||
Run tests:
|
||||
|
||||
```sh
|
||||
npm test
|
||||
```
|
||||
|
||||
Run tests in watch mode:
|
||||
|
||||
```sh
|
||||
npm run test:watch
|
||||
```
|
||||
|
||||
Run tests with coverage:
|
||||
|
||||
```sh
|
||||
npm run test:coverage
|
||||
```
|
||||
|
||||
Lint files:
|
||||
|
||||
```sh
|
||||
npm run lint
|
||||
```
|
||||
|
||||
Fix lint errors:
|
||||
|
||||
```sh
|
||||
npm run lint:fix
|
||||
```
|
||||
|
||||
Test TypeScript declaration file for style and correctness:
|
||||
|
||||
```sh
|
||||
npm run lint:dts
|
||||
```
|
||||
|
||||
## Release
|
||||
|
||||
Release and publish are automated by [Release Please](https://github.com/googleapis/release-please).
|
||||
|
||||
## Special Thanks
|
||||
|
||||
- [inline-style-parser](https://github.com/remarkablemark/inline-style-parser)
|
||||
- [Contributors](https://github.com/remarkablemark/style-to-object/graphs/contributors)
|
||||
|
||||
## License
|
||||
|
||||
[MIT](https://github.com/remarkablemark/style-to-object/blob/master/LICENSE)
|
||||
317
node_modules/style-to-object/dist/style-to-object.js
generated
vendored
Normal file
317
node_modules/style-to-object/dist/style-to-object.js
generated
vendored
Normal file
|
|
@ -0,0 +1,317 @@
|
|||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.StyleToObject = factory());
|
||||
})(this, (function () { 'use strict';
|
||||
|
||||
exports["default"] = {};
|
||||
var styleToObject = {
|
||||
get exports(){ return exports["default"]; },
|
||||
set exports(v){ exports["default"] = v; },
|
||||
};
|
||||
|
||||
// http://www.w3.org/TR/CSS21/grammar.html
|
||||
// https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027
|
||||
var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
|
||||
|
||||
var NEWLINE_REGEX = /\n/g;
|
||||
var WHITESPACE_REGEX = /^\s*/;
|
||||
|
||||
// declaration
|
||||
var PROPERTY_REGEX = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/;
|
||||
var COLON_REGEX = /^:\s*/;
|
||||
var VALUE_REGEX = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/;
|
||||
var SEMICOLON_REGEX = /^[;\s]*/;
|
||||
|
||||
// https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill
|
||||
var TRIM_REGEX = /^\s+|\s+$/g;
|
||||
|
||||
// strings
|
||||
var NEWLINE = '\n';
|
||||
var FORWARD_SLASH = '/';
|
||||
var ASTERISK = '*';
|
||||
var EMPTY_STRING = '';
|
||||
|
||||
// types
|
||||
var TYPE_COMMENT = 'comment';
|
||||
var TYPE_DECLARATION = 'declaration';
|
||||
|
||||
/**
|
||||
* @param {String} style
|
||||
* @param {Object} [options]
|
||||
* @return {Object[]}
|
||||
* @throws {TypeError}
|
||||
* @throws {Error}
|
||||
*/
|
||||
var inlineStyleParser = function(style, options) {
|
||||
if (typeof style !== 'string') {
|
||||
throw new TypeError('First argument must be a string');
|
||||
}
|
||||
|
||||
if (!style) return [];
|
||||
|
||||
options = options || {};
|
||||
|
||||
/**
|
||||
* Positional.
|
||||
*/
|
||||
var lineno = 1;
|
||||
var column = 1;
|
||||
|
||||
/**
|
||||
* Update lineno and column based on `str`.
|
||||
*
|
||||
* @param {String} str
|
||||
*/
|
||||
function updatePosition(str) {
|
||||
var lines = str.match(NEWLINE_REGEX);
|
||||
if (lines) lineno += lines.length;
|
||||
var i = str.lastIndexOf(NEWLINE);
|
||||
column = ~i ? str.length - i : column + str.length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mark position and patch `node.position`.
|
||||
*
|
||||
* @return {Function}
|
||||
*/
|
||||
function position() {
|
||||
var start = { line: lineno, column: column };
|
||||
return function(node) {
|
||||
node.position = new Position(start);
|
||||
whitespace();
|
||||
return node;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Store position information for a node.
|
||||
*
|
||||
* @constructor
|
||||
* @property {Object} start
|
||||
* @property {Object} end
|
||||
* @property {undefined|String} source
|
||||
*/
|
||||
function Position(start) {
|
||||
this.start = start;
|
||||
this.end = { line: lineno, column: column };
|
||||
this.source = options.source;
|
||||
}
|
||||
|
||||
/**
|
||||
* Non-enumerable source string.
|
||||
*/
|
||||
Position.prototype.content = style;
|
||||
|
||||
/**
|
||||
* Error `msg`.
|
||||
*
|
||||
* @param {String} msg
|
||||
* @throws {Error}
|
||||
*/
|
||||
function error(msg) {
|
||||
var err = new Error(
|
||||
options.source + ':' + lineno + ':' + column + ': ' + msg
|
||||
);
|
||||
err.reason = msg;
|
||||
err.filename = options.source;
|
||||
err.line = lineno;
|
||||
err.column = column;
|
||||
err.source = style;
|
||||
|
||||
if (options.silent) ; else {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Match `re` and return captures.
|
||||
*
|
||||
* @param {RegExp} re
|
||||
* @return {undefined|Array}
|
||||
*/
|
||||
function match(re) {
|
||||
var m = re.exec(style);
|
||||
if (!m) return;
|
||||
var str = m[0];
|
||||
updatePosition(str);
|
||||
style = style.slice(str.length);
|
||||
return m;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse whitespace.
|
||||
*/
|
||||
function whitespace() {
|
||||
match(WHITESPACE_REGEX);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse comments.
|
||||
*
|
||||
* @param {Object[]} [rules]
|
||||
* @return {Object[]}
|
||||
*/
|
||||
function comments(rules) {
|
||||
var c;
|
||||
rules = rules || [];
|
||||
while ((c = comment())) {
|
||||
if (c !== false) {
|
||||
rules.push(c);
|
||||
}
|
||||
}
|
||||
return rules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse comment.
|
||||
*
|
||||
* @return {Object}
|
||||
* @throws {Error}
|
||||
*/
|
||||
function comment() {
|
||||
var pos = position();
|
||||
if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return;
|
||||
|
||||
var i = 2;
|
||||
while (
|
||||
EMPTY_STRING != style.charAt(i) &&
|
||||
(ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1))
|
||||
) {
|
||||
++i;
|
||||
}
|
||||
i += 2;
|
||||
|
||||
if (EMPTY_STRING === style.charAt(i - 1)) {
|
||||
return error('End of comment missing');
|
||||
}
|
||||
|
||||
var str = style.slice(2, i - 2);
|
||||
column += 2;
|
||||
updatePosition(str);
|
||||
style = style.slice(i);
|
||||
column += 2;
|
||||
|
||||
return pos({
|
||||
type: TYPE_COMMENT,
|
||||
comment: str
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse declaration.
|
||||
*
|
||||
* @return {Object}
|
||||
* @throws {Error}
|
||||
*/
|
||||
function declaration() {
|
||||
var pos = position();
|
||||
|
||||
// prop
|
||||
var prop = match(PROPERTY_REGEX);
|
||||
if (!prop) return;
|
||||
comment();
|
||||
|
||||
// :
|
||||
if (!match(COLON_REGEX)) return error("property missing ':'");
|
||||
|
||||
// val
|
||||
var val = match(VALUE_REGEX);
|
||||
|
||||
var ret = pos({
|
||||
type: TYPE_DECLARATION,
|
||||
property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)),
|
||||
value: val
|
||||
? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING))
|
||||
: EMPTY_STRING
|
||||
});
|
||||
|
||||
// ;
|
||||
match(SEMICOLON_REGEX);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse declarations.
|
||||
*
|
||||
* @return {Object[]}
|
||||
*/
|
||||
function declarations() {
|
||||
var decls = [];
|
||||
|
||||
comments(decls);
|
||||
|
||||
// declarations
|
||||
var decl;
|
||||
while ((decl = declaration())) {
|
||||
if (decl !== false) {
|
||||
decls.push(decl);
|
||||
comments(decls);
|
||||
}
|
||||
}
|
||||
|
||||
return decls;
|
||||
}
|
||||
|
||||
whitespace();
|
||||
return declarations();
|
||||
};
|
||||
|
||||
/**
|
||||
* Trim `str`.
|
||||
*
|
||||
* @param {String} str
|
||||
* @return {String}
|
||||
*/
|
||||
function trim(str) {
|
||||
return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;
|
||||
}
|
||||
|
||||
var parse = inlineStyleParser;
|
||||
|
||||
/**
|
||||
* Parses inline style to object.
|
||||
*
|
||||
* @example
|
||||
* // returns { 'line-height': '42' }
|
||||
* StyleToObject('line-height: 42;');
|
||||
*
|
||||
* @param {String} style - The inline style.
|
||||
* @param {Function} [iterator] - The iterator function.
|
||||
* @return {null|Object}
|
||||
*/
|
||||
function StyleToObject(style, iterator) {
|
||||
var output = null;
|
||||
if (!style || typeof style !== 'string') {
|
||||
return output;
|
||||
}
|
||||
|
||||
var declaration;
|
||||
var declarations = parse(style);
|
||||
var hasIterator = typeof iterator === 'function';
|
||||
var property;
|
||||
var value;
|
||||
|
||||
for (var i = 0, len = declarations.length; i < len; i++) {
|
||||
declaration = declarations[i];
|
||||
property = declaration.property;
|
||||
value = declaration.value;
|
||||
|
||||
if (hasIterator) {
|
||||
iterator(property, value, declaration);
|
||||
} else if (value) {
|
||||
output || (output = {});
|
||||
output[property] = value;
|
||||
}
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
styleToObject.exports = StyleToObject;
|
||||
exports["default"].default = StyleToObject; // ESM support
|
||||
|
||||
return exports["default"];
|
||||
|
||||
}));
|
||||
2
node_modules/style-to-object/dist/style-to-object.min.js
generated
vendored
Normal file
2
node_modules/style-to-object/dist/style-to-object.min.js
generated
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
!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}));
|
||||
//# sourceMappingURL=style-to-object.min.js.map
|
||||
1
node_modules/style-to-object/dist/style-to-object.min.js.map
generated
vendored
Normal file
1
node_modules/style-to-object/dist/style-to-object.min.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
38
node_modules/style-to-object/index.d.ts
generated
vendored
Normal file
38
node_modules/style-to-object/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
/**
|
||||
* Parses inline style to object.
|
||||
*
|
||||
* @example
|
||||
* import StyleToObject from 'style-to-object';
|
||||
* StyleToObject('line-height: 42;');
|
||||
*/
|
||||
declare function StyleToObject(
|
||||
style: string,
|
||||
iterator?: StyleToObject.Iterator
|
||||
): { [name: string]: string } | null;
|
||||
|
||||
export = StyleToObject;
|
||||
|
||||
declare namespace StyleToObject {
|
||||
interface DeclarationPos {
|
||||
line: number;
|
||||
column: number;
|
||||
}
|
||||
|
||||
// declaration is an object from module `inline-style-parser`
|
||||
interface Declaration {
|
||||
type: string;
|
||||
property: string;
|
||||
value: string;
|
||||
position: {
|
||||
start: DeclarationPos;
|
||||
end: DeclarationPos;
|
||||
source: any;
|
||||
};
|
||||
}
|
||||
|
||||
type Iterator = (
|
||||
property: string,
|
||||
value: string,
|
||||
declaration: Declaration
|
||||
) => void;
|
||||
}
|
||||
43
node_modules/style-to-object/index.js
generated
vendored
Normal file
43
node_modules/style-to-object/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
var parse = require('inline-style-parser');
|
||||
|
||||
/**
|
||||
* Parses inline style to object.
|
||||
*
|
||||
* @example
|
||||
* // returns { 'line-height': '42' }
|
||||
* StyleToObject('line-height: 42;');
|
||||
*
|
||||
* @param {String} style - The inline style.
|
||||
* @param {Function} [iterator] - The iterator function.
|
||||
* @return {null|Object}
|
||||
*/
|
||||
function StyleToObject(style, iterator) {
|
||||
var output = null;
|
||||
if (!style || typeof style !== 'string') {
|
||||
return output;
|
||||
}
|
||||
|
||||
var declaration;
|
||||
var declarations = parse(style);
|
||||
var hasIterator = typeof iterator === 'function';
|
||||
var property;
|
||||
var value;
|
||||
|
||||
for (var i = 0, len = declarations.length; i < len; i++) {
|
||||
declaration = declarations[i];
|
||||
property = declaration.property;
|
||||
value = declaration.value;
|
||||
|
||||
if (hasIterator) {
|
||||
iterator(property, value, declaration);
|
||||
} else if (value) {
|
||||
output || (output = {});
|
||||
output[property] = value;
|
||||
}
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
module.exports = StyleToObject;
|
||||
module.exports.default = StyleToObject; // ESM support
|
||||
3
node_modules/style-to-object/index.mjs
generated
vendored
Normal file
3
node_modules/style-to-object/index.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
import StyleToObject from './index.js';
|
||||
|
||||
export default StyleToObject;
|
||||
75
node_modules/style-to-object/package.json
generated
vendored
Normal file
75
node_modules/style-to-object/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
{
|
||||
"name": "style-to-object",
|
||||
"version": "0.4.1",
|
||||
"description": "Converts inline style to object.",
|
||||
"author": "Mark <mark@remarkablemark.org>",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"module": "index.mjs",
|
||||
"exports": {
|
||||
"types": "./index.d.ts",
|
||||
"import": "./index.mjs",
|
||||
"require": "./index.js"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "run-s build:*",
|
||||
"build:min": "NODE_ENV=production rollup --config --file dist/style-to-object.min.js --sourcemap",
|
||||
"build:unmin": "NODE_ENV=development rollup --config --file dist/style-to-object.js",
|
||||
"clean": "rm -rf dist",
|
||||
"lint": "eslint --ignore-path .gitignore .",
|
||||
"lint:fix": "npm run lint -- --fix",
|
||||
"lint:dts": "dtslint .",
|
||||
"_postinstall": "husky install",
|
||||
"postpublish": "pinst --enable",
|
||||
"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:watch": "npm run test -- --watch"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/remarkablemark/style-to-object"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/remarkablemark/style-to-object/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"style-to-object",
|
||||
"inline",
|
||||
"style",
|
||||
"parser",
|
||||
"css",
|
||||
"object",
|
||||
"pojo"
|
||||
],
|
||||
"dependencies": {
|
||||
"inline-style-parser": "0.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "17.4.2",
|
||||
"@commitlint/config-conventional": "17.4.2",
|
||||
"@rollup/plugin-commonjs": "24.0.0",
|
||||
"@rollup/plugin-node-resolve": "15.0.1",
|
||||
"@rollup/plugin-terser": "0.3.0",
|
||||
"dtslint": "4.2.1",
|
||||
"eslint": "8.32.0",
|
||||
"eslint-plugin-prettier": "4.2.1",
|
||||
"husky": "8.0.3",
|
||||
"lint-staged": "13.1.0",
|
||||
"mocha": "10.2.0",
|
||||
"npm-run-all": "4.1.5",
|
||||
"nyc": "15.1.0",
|
||||
"pinst": "3.0.0",
|
||||
"prettier": "2.8.3",
|
||||
"rollup": "2.79.1",
|
||||
"typescript": "4.9.4"
|
||||
},
|
||||
"files": [
|
||||
"/dist",
|
||||
"index.d.ts",
|
||||
"index.js",
|
||||
"index.mjs"
|
||||
],
|
||||
"license": "MIT"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue