Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cropduster

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cropduster - npm Package Compare versions

Comparing version 3.4.0 to 3.4.1

yarn.lock

20

lib/cropduster.js

@@ -10,13 +10,25 @@ window.CD = {

param: function(name) {
return CD.params()[name];
},
params: function(name) {
if(typeof(CD._urlParams) == "undefined") {
CD._urlParams = {};
var match,
search = /([^&=]+)=?([^&]*)/g,
query = window.location.search.substring(1);
var match;
var search = /([^&=]+)=?([^&]*)/g;
var query = CD._searchString();
while (match = search.exec(query))
CD._urlParams[decodeURIComponent(match[1])] = decodeURIComponent(match[2]);
}
return CD._urlParams[name];
if (name) {
return CD._urlParams[name];
} else {
return CD._urlParams;
}
},
_searchString: function() {
return window.location.search.substring(1);
},
autofill: function() {

@@ -23,0 +35,0 @@ CD.param("init"); // inits CD._urlParams

2

package.json
{
"name": "cropduster",
"version": "3.4.0",
"version": "3.4.1",
"description": "Library for building web pages for use with Movable Ink Web Crops",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -164,2 +164,5 @@ # Cropduster

### 3.4.1
* Adds `CD.params()`, returning an object with all parameters.
### 3.4.0

@@ -166,0 +169,0 @@ * Exposes the `content-type` response header within the callback of `CD.get()`.

@@ -6,2 +6,7 @@ var container = $("<div style='position: absolute; left: -5000px;'></div>").appendTo('body');

// Stub out search string
CD._searchString = function() {
return 'foo=bar&baz%20test=quux%20value';
};
var imageSuccessStub = function() {

@@ -29,2 +34,14 @@ var self = this;

QUnit.test("CD.param when parameter is found", function() {
equal(CD.param('foo'), 'bar', "returns value");
});
QUnit.test("CD.params returns all query params", function() {
deepEqual(CD.params(), {'baz test': 'quux value', foo: 'bar'}, "returns the url params");
});
QUnit.test("CD.params with argument returns that query param", function() {
equal(CD.params('baz test'), 'quux value', "returns the url param");
});
// can't test CD.param returning query params from here, unfortunately...

@@ -37,3 +54,2 @@

CD._urlParams = {foo: 'bar'};
CD.autofill();

@@ -40,0 +56,0 @@ equal(el.html(), 'bar', "auto-fills the query param into the element");

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc