
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
@xslet/datatype
Advanced tools
Defines data types and utilities used in xslet packages.
Executes following command to install this package from npm.
$ npm install --save @xslet/datatype
<script src="xslet.datatype.min.js"></script>
var Rect = xslet.datatype.Rect;
Rect rect = Rect({ left: 10, top: 20, width: 100, height: 50 })
console.log(rect)
// => { left: 10, top: 20, right: 90, bottom: 30, width: 100, height: 50 }
console.log(rect.right)
// => 110
rect.top = 30
rect.bottom = 200
console.log(rect)
// => { left: 10, top: 30, right: 90, bottom: 200, width: 100, height: 170 }
Represents a rectangle.
Each of .right and .width properties are calculated automatically with another properties and .left.
As well as each of .bottom and .height properties are calculated automatically with another properties and .top.
When .left and .top properties are changed, the rectangle is moved and .width and .height are not changed.
The unit of this value is not specified.
In xslet package, it would be determined by xslet.window.unitOfSize.
Properties:
Constructor:
Rect()
Creates a Rect object of which all properties is zero.
Rect(obj)
Creates a Rect object of which properties are corner positions or size of a rectangle.
Parameters:
obj {object}
An object which supposed to have either or all following properties: .left, .top, .right, .bottom, .width and .height.
If all .left, .right and .width properties are specified but .width is different from .right - .left, .right is changed to .left + .width. It is also same about .top, .bottom and .height.
Show this page: https://xslet.github.io/datatype/test.html.
Copyright (C) 2016-2019 Takayuki Sato
This program is free software under MIT License. See the file LICENSE in this distribution for more details.
FAQs
Defines data types used in xslet packages.
We found that @xslet/datatype demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.