parse-rect

WebJar for parse-rect

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

parse-rect
Last Version

Last Version

1.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

parse-rect
WebJar for parse-rect
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/dy/parse-rect

Download parse-rect

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/parse-rect/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>parse-rect</artifactId>
    <version>1.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/parse-rect/
implementation 'org.webjars.npm:parse-rect:1.2.0'
// https://jarcasting.com/artifacts/org.webjars.npm/parse-rect/
implementation ("org.webjars.npm:parse-rect:1.2.0")
'org.webjars.npm:parse-rect:jar:1.2.0'
<dependency org="org.webjars.npm" name="parse-rect" rev="1.2.0">
  <artifact name="parse-rect" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='parse-rect', version='1.2.0')
)
libraryDependencies += "org.webjars.npm" % "parse-rect" % "1.2.0"
[org.webjars.npm/parse-rect "1.2.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : pick-by-alias jar [1.2.0,2)

Project Modules

There are no modules declared in this project.

parse-rect experimental Build Status

Take any rectangle-like argument and return rectangle values.

npm install parse-rect

const parseRect = require('parse-rect')

// {x: 10, y: 20, width: 90, height: 80}
parseRect('10 20 100 100')
parseRect(10, 20, 100, 100)
parseRect([10, 20, 100, 100])
parseRect({ x: 10, y: 20, width: 90, height: 80 })
parseRect({ x: 10, y: 20, w: 90, h: 80 })
parseRect({ l: 10, t: 20, r: 100, b: 100 })
parseRect({ left: 10, top: 20, right: 100, bottom: 100 })

// {x: 0, y: 0, width: 90, height: 80}
parseRect({ width: 90, height: 80 })
parseRect([ 90, 80 ])

// {x: 0, y: 0, width: 90, height: 90}
parseRect(90)
parseRect([90])

License

(c) 2018 Dmitry Yv. MIT License

Versions

Version
1.2.0
1.1.1