knowledgecode / jquery-param Goto Github PK
View Code? Open in Web Editor NEWequivalent function to jQuery.param
License: MIT License
equivalent function to jQuery.param
License: MIT License
This code will never be executed, so it can be removed. All tests pass without errors.
if (rbracket.test(prefix)) { add(prefix, obj[i]); }
How could I import it in typescript for an Angular project?
Shouldn't 1.2.0 be a breaking change instead? Since the files all moved and the .min file was removed, this causes all our builds to fail.
I use [email protected] and [email protected]
I am using the following code to import jquery-param
import param from "jquery-param"
However as I updated to 1.1.1
I see this error message for all modules importing jquery-param
:
"export 'default' (imported as 'param') was not found in 'jquery-param'
I can see the UMD code (the conditional part for module.export
) in both versions are slightly different:
1.0.5
:
typeof module === 'object' && typeof module.exports === 'object'
1.1.1
:
typeof exports === 'object' && typeof module !== 'undefined'
package.json
also now contains a module
entry
"module": "esm/jquery-param.es.js"
I am not sure if the usage should be updated or this is an issue of the library
I am writing another JavaScript library and want to depend on jquery-param.
But a issue encounter to my project.
I am writing ES6 and use babel to translate my code to use UMD format.
The issue is babel will use only one name for both node module and global object(browser).
ex:
import param from 'param';
will translate to
(function (global, factory) {
if (typeof define === 'function' && define.amd) {
define('fetcher', ['exports', 'module', 'param'], factory);
} else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {
factory(exports, module, require('param'));
} else {
var mod = {
exports: {}
};
factory(mod.exports, mod, global.param);
global.fetcher = mod.exports;
}
})(this, function (exports, module, _param2) {
But current jquery-param
use jquery-param
as node module name, and use param
as global object name for browsers. I must have one more post process to deal with this issue.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.