figma-transformer
Advanced tools
Comparing version 2.0.8 to 2.1.0
@@ -5,6 +5,2 @@ 'use strict'; | ||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
var fromEntries = _interopDefault(require('object.fromentries')); | ||
function _extends() { | ||
@@ -79,3 +75,3 @@ _extends = Object.assign || function (target) { | ||
}; | ||
return fromEntries(Object.entries(obj).map(function (_ref) { | ||
return Object.fromEntries(Object.entries(obj).map(function (_ref) { | ||
var k = _ref[0], | ||
@@ -82,0 +78,0 @@ v = _ref[1]; |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=(e=require("object.fromentries"))&&"object"==typeof e&&"default"in e?e.default:e;function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var n=function(e){return s(function(e,t){return e.reduce((function(e,t){return(e[t.type]=e[t.type]||[]).push(t),e}),{})}((t=e,r=new Set,t.filter((function(e){return!r.has(t=e.id)&&r.add(t);var t})))));var t,r},s=function(e){var r={DOCUMENT:"documents",COMPONENT:"components",CANVAS:"pages",LINE:"lines",INSTANCE:"instances",FRAME:"frames",GROUP:"groups",VECTOR:"vectors",BOOLEAN:"booleans",STAR:"stars",ELLIPSE:"ellipses",REGULAR_POLYGON:"regularPolygon",RECTANGLE:"rectangles",TEXT:"texts",SLICE:"slices",STYLE:"styles"};return t(Object.entries(e).map((function(e){return[r[e[0]],e[1]]})))};function i(e,t,s,i){var o=new Map(Object.entries(t)),u=new Map(Object.entries(s));return function e(t,s){var c=t.id,l=t.styles,a=t.children,d=function(e,t){if(null==e)return{};var r,n,s={},i=Object.keys(e);for(n=0;n<i.length;n++)t.indexOf(r=i[n])>=0||(s[r]=e[r]);return s}(t,["id","styles","children"]),f=[];if(null!=l&&(f=Object.entries(l).map((function(e){var n=e[0],s=e[1];return r({id:s},o.get(s),{styles:t[n+"s"],textStyles:t.style,type:"STYLE"})}))),null==a||0===a.length)return[[r({id:c,parentId:s,fileId:i},d)],f];var p=a.reduce((function(t,r){var n=t[0],s=t[1],i=e(r,c),o=i[0],u=i[1];return[[].concat(n,o),[].concat(s,o,u)]}),[[],[]]),v=p[0],O=p[1],y=u.get(c);return[[r({id:c,parentId:s,fileId:i},d,y&&y,{children:v,shortcuts:n(O)})],O]}(e,"0:0")}exports.processFile=function(e,t){var r=e.name,s=e.lastModified,o=e.thumbnailUrl,u=e.version,c=i(e.document,e.styles,e.components,t);return{fileId:t,name:r,lastModified:s,thumbnailUrl:o,version:u,children:c[0][0].children,shortcuts:n(c[1])}},exports.processNodes=i; | ||
"use strict";function e(){return(e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}Object.defineProperty(exports,"__esModule",{value:!0});var t=function(e){return n(function(e,t){return e.reduce((function(e,t){return(e[t.type]=e[t.type]||[]).push(t),e}),{})}((t=e,r=new Set,t.filter((function(e){return!r.has(t=e.id)&&r.add(t);var t})))));var t,r},n=function(e){var t={DOCUMENT:"documents",COMPONENT:"components",CANVAS:"pages",LINE:"lines",INSTANCE:"instances",FRAME:"frames",GROUP:"groups",VECTOR:"vectors",BOOLEAN:"booleans",STAR:"stars",ELLIPSE:"ellipses",REGULAR_POLYGON:"regularPolygon",RECTANGLE:"rectangles",TEXT:"texts",SLICE:"slices",STYLE:"styles"};return Object.fromEntries(Object.entries(e).map((function(e){return[t[e[0]],e[1]]})))};function r(n,r,s,i){var o=new Map(Object.entries(r)),c=new Map(Object.entries(s));return function n(r,s){var u=r.id,l=r.styles,a=r.children,d=function(e,t){if(null==e)return{};var n,r,s={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(s[n]=e[n]);return s}(r,["id","styles","children"]),f=[];if(null!=l&&(f=Object.entries(l).map((function(t){var n=t[0],s=t[1];return e({id:s},o.get(s),{styles:r[n+"s"],textStyles:r.style,type:"STYLE"})}))),null==a||0===a.length)return[[e({id:u,parentId:s,fileId:i},d)],f];var p=a.reduce((function(e,t){var r=e[0],s=e[1],i=n(t,u),o=i[0],c=i[1];return[[].concat(r,o),[].concat(s,o,c)]}),[[],[]]),O=p[0],v=p[1],E=c.get(u);return[[e({id:u,parentId:s,fileId:i},d,E&&E,{children:O,shortcuts:t(v)})],v]}(n,"0:0")}exports.processFile=function(e,n){var s=e.name,i=e.lastModified,o=e.thumbnailUrl,c=e.version,u=r(e.document,e.styles,e.components,n);return{fileId:n,name:s,lastModified:i,thumbnailUrl:o,version:c,children:u[0][0].children,shortcuts:t(u[1])}},exports.processNodes=r; | ||
//# sourceMappingURL=figma-transformer.cjs.production.min.js.map |
@@ -1,3 +0,1 @@ | ||
import fromEntries from 'object.fromentries'; | ||
function _extends() { | ||
@@ -72,3 +70,3 @@ _extends = Object.assign || function (target) { | ||
}; | ||
return fromEntries(Object.entries(obj).map(function (_ref) { | ||
return Object.fromEntries(Object.entries(obj).map(function (_ref) { | ||
var k = _ref[0], | ||
@@ -75,0 +73,0 @@ v = _ref[1]; |
{ | ||
"name": "figma-transformer", | ||
"version": "2.0.8", | ||
"version": "2.1.0", | ||
"license": "MIT", | ||
@@ -41,7 +41,5 @@ "keywords": [ | ||
"@types/jest": "^26.0.14", | ||
"@types/object.fromentries": "^2.0.0", | ||
"bundlesize": "^0.18.0", | ||
"figma-js": "^1.13.0", | ||
"husky": "^4.3.0", | ||
"object.fromentries": "^2.0.2", | ||
"tsdx": "^0.14.0", | ||
@@ -48,0 +46,0 @@ "typescript": "3.9.7" |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
6
0
51304
348
1