figma-api-stub
Advanced tools
Comparing version 0.0.45 to 0.0.46
@@ -252,2 +252,9 @@ "use strict"; | ||
} | ||
LayoutMixinStub.prototype.rescale = function (scale) { | ||
if (joinedConfig.simulateErrors && scale < 0.01) { | ||
throw new Error('Error: in rescale: Expected "scale" to have value >= 0.01'); | ||
} | ||
this.width = this.width * scale; | ||
this.height = this.height * scale; | ||
}; | ||
LayoutMixinStub.prototype.resize = function (width, height) { | ||
@@ -335,2 +342,17 @@ if (joinedConfig.simulateErrors && isInsideInstance(this)) { | ||
}); | ||
TextNodeStub.prototype.getRangeFontName = function (start, end) { | ||
if (joinedConfig.simulateErrors && start < 0) { | ||
throw new Error("Error: Expected \"start\" to have value >=0"); | ||
} | ||
if (joinedConfig.simulateErrors && end < 0) { | ||
throw new Error("Error: Expected \"end\" to have value >=0"); | ||
} | ||
if (joinedConfig.simulateErrors && end > this._characters.length) { | ||
throw new Error("Error: Range outside of available characters. 'start' must be less than node.characters.length and 'end' must be less than or equal to node.characters.length"); | ||
} | ||
if (joinedConfig.simulateErrors && end === start) { | ||
throw new Error("Error: Empty range selected. 'end' must be greater than 'start'"); | ||
} | ||
return this._fontName || { family: "Roboto", style: "Regular" }; | ||
}; | ||
return TextNodeStub; | ||
@@ -337,0 +359,0 @@ }()); |
{ | ||
"name": "figma-api-stub", | ||
"version": "0.0.45", | ||
"version": "0.0.46", | ||
"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
55417
916