jsx2posthtml
Advanced tools
Comparing version 1.1.2 to 1.2.0
@@ -8,5 +8,11 @@ # Change Log | ||
## [1.2.0] - 2018-03-13 | ||
### Updated | ||
- All dependencies to latest versions. | ||
## [1.1.2] - 2017-06-21 | ||
## Fixed | ||
### Fixed | ||
@@ -17,3 +23,3 @@ - Add prepare script. | ||
## Fixed | ||
### Fixed | ||
@@ -20,0 +26,0 @@ - Remove postinstall script. |
@@ -21,6 +21,3 @@ (function (global, factory) { | ||
***************************************************************************** */ | ||
/* global Reflect, Promise */ | ||
var __assign = Object.assign || function __assign(t) { | ||
@@ -27,0 +24,0 @@ for (var s, i = 1, n = arguments.length; i < n; i++) { |
@@ -1,1 +0,1 @@ | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):n.jsx2posthtml=t()}(this,function(){"use strict";function n(n){return"&"+a[n]+";"}function t(t){return t.replace(f,n)}function e(n){var e=Object.keys(n),r=e.indexOf("dangerouslySetInnerHTML");if(-1!==r&&e.splice(r,1),0===e.length)return null;for(var o={},u=0,a=e;u<a.length;u++){var f=a[u],c=i[f]?i[f]:t(f),s=n[f];o[c]="string"==typeof s?t(s):n[f]}return o}function r(n){return"string"==typeof n?t(n):n&&n.hasOwnProperty("__html")?n.__html:n}function o(n){return n.reduce(function(n,t){return n.concat(Array.isArray(t)?o(t):t)},[])}var u=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o])}return n},a={"&":"amp","<":"lt",">":"gt",'"':"quot","'":"apos"},f=new RegExp("["+Object.keys(a).join("")+"]","g"),i={className:"class",htmlFor:"for"};return function(n,t){for(var a=[],f=2;f<arguments.length;f++)a[f-2]=arguments[f];if(a=o(a),"function"==typeof n)return n(u({},t,{children:a}));var i={tag:n},c=!1;if(t){t.hasOwnProperty("dangerouslySetInnerHTML")&&t.dangerouslySetInnerHTML&&(i.content=[t.dangerouslySetInnerHTML.__html],c=!0);var s=e(t);s&&(i.attrs=s)}return c||0===a.length||(i.content=a.map(r)),i}}); | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):n.jsx2posthtml=t()}(this,function(){"use strict";var f=Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++)for(var o in t=arguments[e])Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n};var t={"&":"amp","<":"lt",">":"gt",'"':"quot","'":"apos"};function e(n){return"&"+t[n]+";"}var r=new RegExp("["+Object.keys(t).join("")+"]","g");function c(n){return n.replace(r,e)}var s={className:"class",htmlFor:"for"};function i(n){return"string"==typeof n?c(n):n&&n.hasOwnProperty("__html")?n.__html:n}return function(n,t){for(var e=[],r=2;r<arguments.length;r++)e[r-2]=arguments[r];if(e=function e(n){return n.reduce(function(n,t){return n.concat(Array.isArray(t)?e(t):t)},[])}(e),"function"==typeof n)return n(f({},t,{children:e}));var o={tag:n},a=!1;if(t){t.hasOwnProperty("dangerouslySetInnerHTML")&&t.dangerouslySetInnerHTML&&(o.content=[t.dangerouslySetInnerHTML.__html],a=!0);var u=function(n){var t=Object.keys(n),e=t.indexOf("dangerouslySetInnerHTML");if(-1!==e&&t.splice(e,1),0===t.length)return null;for(var r={},o=0,a=t;o<a.length;o++){var u=a[o],f=s[u]?s[u]:c(u),i=n[u];r[f]="string"==typeof i?c(i):n[u]}return r}(t);u&&(o.attrs=u)}return a||0===e.length||(o.content=e.map(i)),o}}); |
{ | ||
"name": "jsx2posthtml", | ||
"version": "1.1.2", | ||
"version": "1.2.0", | ||
"description": "Converts JSX to PostHTML node", | ||
@@ -10,5 +10,5 @@ "main": "./es2015-cjs/index.js", | ||
"test": "npm run lint && if-env NODE_TEST_VARIANT=es5 && npm run test:es5-only || npm run test:main", | ||
"test:main": "cross-env TS_NODE_PROJECT=test/tsconfig.json mocha --compilers ts:ts-node/register,tsx:ts-node/register", | ||
"test:main": "cross-env TS_NODE_PROJECT=test/tsconfig.json mocha --require ts-node/register \"test/**/*.{js,ts,tsx}\" ", | ||
"test:es5-only": "mocha", | ||
"lint:scripts-project": "tslint -c tslint-type-check.json -p tsconfig.json --type-check", | ||
"lint:scripts-project": "tslint -c tslint-project.json -p tsconfig.json", | ||
"lint:scripts-other": "tslint \"{*.js,src/*.d.ts,test/*.{ts,tsx}}\"", | ||
@@ -28,3 +28,3 @@ "lint": "npm run lint:scripts-project && npm run lint:scripts-other", | ||
"type": "git", | ||
"url": "git+https://github.com/m18ru/jsx2posthtml.git" | ||
"url": "git+https://github.com/Avol-V/jsx2posthtml.git" | ||
}, | ||
@@ -38,26 +38,26 @@ "keywords": [ | ||
], | ||
"author": "Andrey Avol Volynkin <code@m18.ru>", | ||
"author": "Andrey Volynkin", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/m18ru/jsx2posthtml/issues" | ||
"url": "https://github.com/Avol-V/jsx2posthtml/issues" | ||
}, | ||
"homepage": "https://github.com/m18ru/jsx2posthtml#readme", | ||
"homepage": "https://github.com/Avol-V/jsx2posthtml#readme", | ||
"devDependencies": { | ||
"@types/chai": "^4.0.0", | ||
"@types/mocha": "^2.2.41", | ||
"@types/node": "^8.0.1", | ||
"chai": "^4.0.2", | ||
"cross-env": "^5.0.1", | ||
"if-env": "^1.0.0", | ||
"mocha": "^3.4.2", | ||
"posthtml-parser": "^0.2.1", | ||
"posthtml-render": "^1.0.6", | ||
"rimraf": "^2.6.1", | ||
"rollup": "^0.43.0", | ||
"rollup-plugin-node-resolve": "^3.0.0", | ||
"ts-node": "^3.0.6", | ||
"tslint": "^5.4.3", | ||
"tslint-config-m18": "^1.4.0", | ||
"typescript": "^2.3.4", | ||
"uglify-js": "^3.0.18" | ||
"@types/chai": "^4.1.2", | ||
"@types/mocha": "^2.2.48", | ||
"@types/node": "^9.4.7", | ||
"chai": "^4.1.2", | ||
"cross-env": "^5.1.4", | ||
"if-env": "^1.0.4", | ||
"mocha": "^5.0.4", | ||
"posthtml-parser": "^0.4.1", | ||
"posthtml-render": "^1.1.1", | ||
"rimraf": "^2.6.2", | ||
"rollup": "^0.56.5", | ||
"rollup-plugin-node-resolve": "^3.2.0", | ||
"ts-node": "^5.0.1", | ||
"tslint": "^5.9.1", | ||
"tslint-config-avol": "^2.2.0", | ||
"typescript": "^2.7.2", | ||
"uglify-js": "^3.3.14" | ||
}, | ||
@@ -64,0 +64,0 @@ "optionalDependencies": { |
@@ -242,12 +242,12 @@ [![NPM][npm]][npm-url] | ||
[deps]: https://img.shields.io/david/m18ru/jsx2posthtml.svg | ||
[deps-url]: https://david-dm.org/m18ru/jsx2posthtml | ||
[deps]: https://img.shields.io/david/Avol-V/jsx2posthtml.svg | ||
[deps-url]: https://david-dm.org/Avol-V/jsx2posthtml | ||
[deps-dev]: https://img.shields.io/david/dev/m18ru/jsx2posthtml.svg | ||
[deps-dev-url]: https://david-dm.org/m18ru/jsx2posthtml?type=dev | ||
[deps-dev]: https://img.shields.io/david/dev/Avol-V/jsx2posthtml.svg | ||
[deps-dev-url]: https://david-dm.org/Avol-V/jsx2posthtml?type=dev | ||
[deps-optional]: https://img.shields.io/david/optional/m18ru/jsx2posthtml.svg | ||
[deps-optional-url]: https://david-dm.org/m18ru/jsx2posthtml?type=optional | ||
[deps-optional]: https://img.shields.io/david/optional/Avol-V/jsx2posthtml.svg | ||
[deps-optional-url]: https://david-dm.org/Avol-V/jsx2posthtml?type=optional | ||
[build]: https://img.shields.io/travis/m18ru/jsx2posthtml.svg | ||
[build-url]: https://travis-ci.org/m18ru/jsx2posthtml | ||
[build]: https://img.shields.io/travis/Avol-V/jsx2posthtml.svg | ||
[build-url]: https://travis-ci.org/Avol-V/jsx2posthtml |
@@ -14,6 +14,7 @@ // tslint:disable-next-line:no-reference | ||
attrs: JSX.ElementAnyAttributes, | ||
...content: JSX.ElementContentItem[], | ||
...content: JSX.ElementContentItem[] | ||
): JSX.Element | ||
{ | ||
// If content elements are given as an array | ||
// tslint:disable-next-line:no-parameter-reassignment | ||
content = flattenArray<JSX.ElementContentItem>( content ); | ||
@@ -117,3 +118,3 @@ | ||
/** | ||
* Prepare attrubutes to use in HTML. | ||
* Prepare attributes to use in HTML. | ||
* | ||
@@ -120,0 +121,0 @@ * @param attrs Element attributes. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
69398
2163