figma-api-stub
Advanced tools
Comparing version 0.0.20 to 0.0.21
@@ -18,2 +18,8 @@ "use strict"; | ||
}; | ||
var isInsideInstance = function (node) { | ||
if (!node.parent) { | ||
return; | ||
} | ||
return node.parent.type === "INSTANCE" || isInsideInstance(node.parent); | ||
}; | ||
exports.createFigma = function (config) { | ||
@@ -136,2 +142,5 @@ var joinedConfig = __assign({}, defaultConfig, config); | ||
this.removed = true; | ||
if (joinedConfig.simulateErrors && isInsideInstance(this)) { | ||
throw new Error("Error: can't remove item"); | ||
} | ||
if (this.parent) { | ||
@@ -148,2 +157,5 @@ // @ts-ignore | ||
LayoutMixinStub.prototype.resize = function (width, height) { | ||
if (joinedConfig.simulateErrors && isInsideInstance(this)) { | ||
throw new Error("Error: can't change layout inside item"); | ||
} | ||
if (joinedConfig.simulateErrors && width < 0.01) { | ||
@@ -150,0 +162,0 @@ throw new Error('Error: in resize: Expected "width" to have value >= 0.01'); |
{ | ||
"name": "figma-api-stub", | ||
"version": "0.0.20", | ||
"version": "0.0.21", | ||
"description": "Figma API stub", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
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
46583
972