react-from-dom
Advanced tools
Comparing version 0.2.3 to 0.3.0
interface IObject { | ||
[key: string]: any; | ||
} | ||
export declare const styleToObject: (input: string) => {}; | ||
export declare const styleToObject: (input: string) => IObject; | ||
export declare const noTextChildNodes: string[]; | ||
@@ -6,0 +6,0 @@ /** |
@@ -24,3 +24,3 @@ "use strict"; | ||
if (key && value) { | ||
acc[key.replace(/-(\w)/g, function ($0, $1) { return $1.toUpperCase(); })] = Number.isNaN(Number(value)) | ||
acc[key.replace(/-(\w)/g, function (_$0, $1) { return $1.toUpperCase(); })] = Number.isNaN(Number(value)) | ||
? value | ||
@@ -400,1 +400,2 @@ : Number(value); | ||
}; | ||
//# sourceMappingURL=helpers.js.map |
@@ -40,2 +40,3 @@ "use strict"; | ||
}; | ||
/* istanbul ignore else */ | ||
if (node instanceof Element) { | ||
@@ -70,3 +71,3 @@ var nodeClassNames = node.getAttribute('class'); | ||
var children = __spread(childNodeList).map(function (node, index) { | ||
return convertFromNode(node, __assign({}, options, { index: index, level: level + 1 })); | ||
return convertFromNode(node, __assign(__assign({}, options), { index: index, level: level + 1 })); | ||
}) | ||
@@ -124,3 +125,3 @@ .filter(Boolean); | ||
/* istanbul ignore else */ | ||
if (!/[a-zA-Z0-9_]+/.test(nodeText)) { | ||
if (/^\s+$/.test(nodeText)) { | ||
return null; | ||
@@ -189,1 +190,2 @@ } | ||
exports.default = convert; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "react-from-dom", | ||
"version": "0.2.3", | ||
"version": "0.3.0", | ||
"description": "Convert HTML/XML source code or DOM nodes to React elements", | ||
@@ -31,37 +31,37 @@ "author": "Gil Barbara <gilbarbara@gmail.com>", | ||
"devDependencies": { | ||
"@gilbarbara/tsconfig": "^0.1.0", | ||
"@size-limit/preset-small-lib": "^2.2.1", | ||
"@types/enzyme": "^3.10.3", | ||
"@types/jest": "^24.0.15", | ||
"@types/node": "^12.6.8", | ||
"@types/react": "^16.8.23", | ||
"@types/react-dom": "^16.8.5", | ||
"bundlesize": "^0.18.0", | ||
"chalk": "^2.4.2", | ||
"cross-env": "^5.2.0", | ||
"@types/jest": "^24.0.23", | ||
"@types/node": "^12.12.9", | ||
"@types/react": "^16.9.11", | ||
"@types/react-dom": "^16.9.4", | ||
"enzyme": "^3.10.0", | ||
"enzyme-adapter-react-16": "^1.14.0", | ||
"fetch-mock": "^7.3.9", | ||
"husky": "^3.0.1", | ||
"is-ci-cli": "^1.1.1", | ||
"jest": "^24.8.0", | ||
"enzyme-adapter-react-16": "^1.15.1", | ||
"fetch-mock": "^8.0.0", | ||
"husky": "^3.1.0", | ||
"is-ci-cli": "^2.0.0", | ||
"jest": "^24.9.0", | ||
"jest-chain": "^1.1.2", | ||
"jest-enzyme": "^7.0.2", | ||
"jest-enzyme": "^7.1.2", | ||
"jest-extended": "^0.11.2", | ||
"jest-watch-typeahead": "^0.3.1", | ||
"prettier": "^1.18.2", | ||
"react": "^16.8.6", | ||
"react-dom": "^16.8.6", | ||
"rimraf": "^2.6.3", | ||
"serve": "^11.1.0", | ||
"start-server-and-test": "^1.9.1", | ||
"ts-jest": "^24.0.2", | ||
"ts-node": "^8.3.0", | ||
"tslint": "^5.18.0", | ||
"jest-watch-typeahead": "^0.4.2", | ||
"prettier": "^1.19.1", | ||
"react": "^16.12.0", | ||
"react-dom": "^16.12.0", | ||
"repo-tools": "^0.2.0", | ||
"rimraf": "^3.0.0", | ||
"serve": "^11.2.0", | ||
"size-limit": "^2.2.1", | ||
"start-server-and-test": "^1.10.6", | ||
"ts-jest": "^24.1.0", | ||
"ts-node": "^8.5.2", | ||
"tslint": "^5.20.1", | ||
"tslint-config-prettier": "^1.18.0", | ||
"tslint-react": "^4.0.0", | ||
"typescript": "^3.5.3", | ||
"yargs": "^13.3.0" | ||
"tslint-react": "^4.1.0", | ||
"typescript": "^3.7.2" | ||
}, | ||
"scripts": { | ||
"build": "npm run clean && npm run build:ts", | ||
"build:ts": "tsc --outDir lib", | ||
"build:ts": "tsc", | ||
"watch": "npm run build:ts -- -w", | ||
@@ -74,4 +74,4 @@ "clean": "rimraf lib", | ||
"format": "prettier \"**/*.{js,jsx,json,yml,yaml,css,less,scss,ts,tsx,md,graphql,mdx}\" --write", | ||
"validate": "npm run lint && npm run test:coverage && npm run build && npm run bundlesize", | ||
"bundlesize": "bundlesize", | ||
"validate": "npm run lint && npm run test:coverage && npm run size", | ||
"size": "npm run build && size-limit", | ||
"prepublishOnly": "npm run validate" | ||
@@ -85,6 +85,6 @@ }, | ||
}, | ||
"bundlesize": [ | ||
"size-limit": [ | ||
{ | ||
"path": "./lib/index.js", | ||
"maxSize": "3 kB" | ||
"limit": "5 kB" | ||
} | ||
@@ -94,6 +94,6 @@ ], | ||
"hooks": { | ||
"post-merge": "ts-node tools update", | ||
"pre-commit": "ts-node tools has-commits && npm run validate" | ||
"post-merge": "repo-tools install-packages", | ||
"pre-commit": "repo-tools check-remote && npm run validate" | ||
} | ||
} | ||
} |
41444
280533
9
615