Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
grid-util-js
Advanced tools
JavaScript utilities for handling [Grid] URLs and API.
Through npm
npm install --save grid-util-js
or jspm
jspm install npm:grid-util-js
You need a modern browsers implementing fetch
and Promise
or you can polyfill those methods.
import GridUtils from 'grid-util-js';
var grid = new GridUtils({
apiBaseUrl: 'http://root.api.of.grid'
});
Finds the Grid image ID in an URL. The URL can be anything, the media or crop link, or the link of the public image as long as the media ID is inside the URL.
grid.excractMediaId('http://deployed.image/12345...abcde')
Returns and object containing
{
id: 'grid id',
crop: 'crop id, if present'
}
Calls the API to retrieve the image information. It uses hypermedia Grid API.
grid.getImage('12345...abcde')
Returns a promise that resolves with the JSON response or rejects in case of error.
Get a specified crop from the image API response.
grid.filterCrops(apiResponse)
returns all cropsgrid.filterCrops(apiResponse, 'crop_id')
returns the crop with id crop_id
grid.filterCrops(apiResponse, filterFunction)
returns all crops matching filterFunction
.filterFunction
receives as only parameter the crop data.
When dragging a crop from the Grid, the crop information is inside the event dataTransfer
.
grid.getCropFromEvent(evt)
Returns a JSON object.
When dragging a crop from the Grid, the event dataTransfer
contains the original image URL in the Grid.
grid.getGridUrlFromEvent(evt)
Returns the URL as a string.
FAQs
JS helpers for the Grid
We found that grid-util-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.