jquery.initialize
jquery.initialize copied to clipboard
Include deprecated warning for old API
Add console warning for old API from #6.
Example:
console.warn("Calling deprecated function!");
Call console.error() if the jQuery version (jQuery().jquery) is >= 3.1.1.
Maybe something like:
console.info('jQuery.initialiaze: Deprecated API, see: https://github.com/pie6k/jquery.initialize/issues/6');
if (jQuery().jquery.localeCompare('3.1.1', undefined, { numeric: true, sensitivity: 'base' }) == -1) {
console.warn('jQuery.initialiaze: $.fn.initialize() is deprecated. Use $.fn.initialize() instead.');
} else {
console.error('jQuery.initialiaze: $.fn.initialize() is not supported. Use $.fn.initialize() instead.');
throw new Error("jQuery.initialiaze deprecated API call.");
}
Although it might just be more semantic (and easier) to check for this.selector being null. localeCompare may not be that reliable also.
Release 1.3.1
~/src/jquery.initialize$ npm publish
npm notice
npm notice 📦 [email protected]
npm notice === Tarball Contents ===
npm notice 1.1kB LICENSE
npm notice 3.0kB README.md
npm notice 352B bower.json
npm notice 7.3kB jquery.initialize.js
npm notice 2.7kB jquery.initialize.min.js
npm notice 501B package.json
npm notice 1.5kB test.html
npm notice 3.6kB test2.html
npm notice === Tarball Details ===
npm notice name: jquery.initialize
npm notice version: 1.3.1
npm notice filename: jquery.initialize-1.3.1.tgz
npm notice package size: 6.1 kB
npm notice unpacked size: 20.1 kB
npm notice shasum: 96c6da43dbc555b615513639b971c7d0b5332dc1
npm notice integrity: sha512-jQzVQaUi89m0J[...]IkG9K2BJKZ2ag==
npm notice total files: 8
npm notice
npm notice Publishing to https://registry.npmjs.org/ with tag latest and default access
+ [email protected]