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

can-param

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

can-param - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

LICENSE.md

13

can-param.md
@module {function} can-param can-param
@parent can-infrastructure
@parent can-routing
@collection can-infrastructure
@package ./package.json
@description Serialize an object or array into a query string.

@@ -23,1 +25,10 @@

@return {String} The params formatted into a form-encoded string.
@body
## Try it
Use this JS Bin to play around with this package:
<a class="jsbin-embed" href="https://jsbin.com/zezamig/embed?js,console">can-param on jsbin.com</a>
<script src="https://static.jsbin.com/js/embed.min.js?4.0.4"></script>

23

CONTRIBUTING.md
# Contributing to can-param
Check out the [contribution guide on CanJS.com](https://canjs.com/doc/guides/contribute.html) for information on:
- [Code of Conduct](https://canjs.com/doc/guides/contribute.html#CodeofConduct)
- [Getting Help](https://canjs.com/doc/guides/contribute.html#GettingHelp)
- [Project Organization](https://canjs.com/doc/guides/contributing/project-organization.html)
- [Reporting Bugs](https://canjs.com/doc/guides/contributing/bug-report.html)
- [Suggesting Features](https://canjs.com/doc/guides/contributing/feature-suggestion.html)
- [Finding Ways to Contribute](https://canjs.com/doc/guides/contributing/finding-ways-to-contribute.html)
The rest of this guide has information that’s specific to this repository.
## Developing Locally

@@ -74,13 +85,1 @@

This will create a `dist/` folder that contains the AMD, CommonJS, and global module versions of the project.
### Building the documentation
To generate the docs:
```shell
npm run document
```
This will create a `docs/` folder that contains a browsable site with all of your documentation.
With the dev server running, you can view the docs at http://localhost:8080/docs/

@@ -1,3 +0,8 @@

/*can-param@1.0.0#can-param*/
define(function (require, exports, module) {
/*can-param@1.0.1#can-param*/
define([
'require',
'exports',
'module',
'can-namespace'
], function (require, exports, module) {
var namespace = require('can-namespace');

@@ -4,0 +9,0 @@ function buildParam(prefix, obj, add) {

@@ -1,2 +0,2 @@

/*can-param@1.0.0#can-param*/
/*can-param@1.0.1#can-param*/
var namespace = require('can-namespace');

@@ -3,0 +3,0 @@ function buildParam(prefix, obj, add) {

/*[global-shim-start]*/
(function(exports, global, doEval){ // jshint ignore:line
(function(exports, global, doEval) {
// jshint ignore:line
var origDefine = global.define;
var get = function(name){
var get = function(name) {
var parts = name.split("."),
cur = global,
i;
for(i = 0 ; i < parts.length; i++){
if(!cur) {
for (i = 0; i < parts.length; i++) {
if (!cur) {
break;

@@ -17,10 +18,12 @@ }

};
var set = function(name, val){
var set = function(name, val) {
var parts = name.split("."),
cur = global,
i, part, next;
for(i = 0; i < parts.length - 1; i++) {
i,
part,
next;
for (i = 0; i < parts.length - 1; i++) {
part = parts[i];
next = cur[part];
if(!next) {
if (!next) {
next = cur[part] = {};

@@ -33,15 +36,24 @@ }

};
var useDefault = function(mod){
if(!mod || !mod.__esModule) return false;
var esProps = { __esModule: true, "default": true };
for(var p in mod) {
if(!esProps[p]) return false;
var useDefault = function(mod) {
if (!mod || !mod.__esModule) return false;
var esProps = { __esModule: true, default: true };
for (var p in mod) {
if (!esProps[p]) return false;
}
return true;
};
var modules = (global.define && global.define.modules) ||
(global._define && global._define.modules) || {};
var ourDefine = global.define = function(moduleName, deps, callback){
var hasCjsDependencies = function(deps) {
return (
deps[0] === "require" && deps[1] === "exports" && deps[2] === "module"
);
};
var modules =
(global.define && global.define.modules) ||
(global._define && global._define.modules) ||
{};
var ourDefine = (global.define = function(moduleName, deps, callback) {
var module;
if(typeof deps === "function") {
if (typeof deps === "function") {
callback = deps;

@@ -52,21 +64,25 @@ deps = [];

i;
for(i =0; i < deps.length; i++) {
args.push( exports[deps[i]] ? get(exports[deps[i]]) : ( modules[deps[i]] || get(deps[i]) ) );
for (i = 0; i < deps.length; i++) {
args.push(
exports[deps[i]]
? get(exports[deps[i]])
: modules[deps[i]] || get(deps[i])
);
}
// CJS has no dependencies but 3 callback arguments
if(!deps.length && callback.length) {
if (hasCjsDependencies(deps) || (!deps.length && callback.length)) {
module = { exports: {} };
var require = function(name) {
args[0] = function(name) {
return exports[name] ? get(exports[name]) : modules[name];
};
args.push(require, module.exports, module);
}
// Babel uses the exports and module object.
else if(!args[0] && deps[0] === "exports") {
args[1] = module.exports;
args[2] = module;
} else if (!args[0] && deps[0] === "exports") {
// Babel uses the exports and module object.
module = { exports: {} };
args[0] = module.exports;
if(deps[1] === "module") {
if (deps[1] === "module") {
args[1] = module;
}
} else if(!args[0] && deps[0] === "module") {
} else if (!args[0] && deps[0] === "module") {
args[0] = { id: moduleName };

@@ -85,4 +101,4 @@ }

var globalExport = exports[moduleName];
if(globalExport && !get(globalExport)) {
if(useDefault(result)) {
if (globalExport && !get(globalExport)) {
if (useDefault(result)) {
result = result["default"];

@@ -92,15 +108,15 @@ }

}
};
});
global.define.orig = origDefine;
global.define.modules = modules;
global.define.amd = true;
ourDefine("@loader", [], function(){
ourDefine("@loader", [], function() {
// shim for @@global-helpers
var noop = function(){};
var noop = function() {};
return {
get: function(){
get: function() {
return { prepareGlobal: noop, retrieveGlobal: noop };
},
global: global,
__exec: function(__load){
__exec: function(__load) {
doEval(__load.source, global);

@@ -110,9 +126,18 @@ }

});
}
)({},window,function(__$source__, __$global__) { // jshint ignore:line
eval("(function() { " + __$source__ + " \n }).call(__$global__);");
}
)
/*can-param@1.0.0#can-param*/
define('can-param', function (require, exports, module) {
})(
{},
typeof self == "object" && self.Object == Object ? self : window,
function(__$source__, __$global__) {
// jshint ignore:line
eval("(function() { " + __$source__ + " \n }).call(__$global__);");
}
);
/*can-param@1.0.1#can-param*/
define('can-param', [
'require',
'exports',
'module',
'can-namespace'
], function (require, exports, module) {
var namespace = require('can-namespace');

@@ -143,6 +168,6 @@ function buildParam(prefix, obj, add) {

/*[global-shim-end]*/
(function(){ // jshint ignore:line
window._define = window.define;
window.define = window.define.orig;
(function(global) { // jshint ignore:line
global._define = global.define;
global.define = global.define.orig;
}
)();
)(typeof self == "object" && self.Object == Object ? self : window);
{
"name": "can-param",
"version": "1.0.1",
"version": "1.0.2",
"description": "Serialize an array or object into a query string.",

@@ -20,3 +20,3 @@ "homepage": "",

"testee": "testee test.html --browsers firefox",
"test": "npm run jshint && npm run testee",
"test": "npm run detect-cycle && npm run jshint && npm run testee",
"jshint": "jshint ./*.js --config",

@@ -27,3 +27,4 @@ "release:patch": "npm version patch && npm publish",

"build": "node build.js",
"develop": "done-serve --static --develop --port 8080"
"develop": "done-serve --static --develop --port 8080",
"detect-cycle": "detect-cyclic-packages --ignore done-serve"
},

@@ -52,2 +53,6 @@ "main": "dist/cjs/can-param",

"devDependencies": {
"detect-cyclic-packages": "^1.1.0",
"done-serve": "^1.0.0",
"donejs-cli": "^1.0.0",
"generator-donejs": "^1.0.0",
"jshint": "^2.9.1",

@@ -57,7 +62,4 @@ "steal": "^1.3.1",

"steal-tools": "^1.2.0",
"testee": "^0.3.0",
"generator-donejs": "^1.0.0",
"donejs-cli": "^1.0.0",
"done-serve": "^1.0.0"
"testee": "^0.3.0"
}
}
# can-param
[![Build Status](https://travis-ci.org/canjs/can-param.png?branch=master)](https://travis-ci.org/canjs/can-param)
[![Join the chat at https://gitter.im/canjs/canjs](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/canjs/canjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/canjs/can-param/blob/master/LICENSE.md)
[![npm version](https://badge.fury.io/js/can-param.svg)](https://www.npmjs.com/package/can-param)
[![Travis build status](https://travis-ci.org/canjs/can-param.svg?branch=master)](https://travis-ci.org/canjs/can-param)
Serialize an array or object into a query string.
## Usage
## Documentation
### ES6 use
Read the [API docs on CanJS.com](https://canjs.com/doc/can-param.html).
With StealJS, you can import this module directly in a template that is autorendered:
## Changelog
```js
import plugin from 'can-param';
```
See the [latest releases on GitHub](https://github.com/canjs/can-param/releases).
### CommonJS use
## Contributing
Use `require` to load `can-param` and everything else
needed to create a template that uses `can-param`:
The [contribution guide](https://github.com/canjs/can-param/blob/master/CONTRIBUTING.md) has information on getting help, reporting bugs, developing locally, and more.
```js
var plugin = require("can-param");
```
## License
## AMD use
Configure the `can-param` package:
```html
<script src="require.js"></script>
<script>
require.config({
packages: [{
name: 'can-param',
location: 'node_modules/can-param/dist/amd',
main: 'lib/can-param'
}]
});
require(["main-amd"], function(){});
</script>
```
### Standalone use
Load the `global` version of the plugin:
```html
<script src='./node_modules/can-param/dist/global/can-param.js'></script>
```
[MIT](https://github.com/canjs/can-param/blob/master/LICENSE.md)

Sorry, the diff of this file is not supported yet

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