Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
qunit-migrate
Advanced tools
Migrate old QUnit code to 2.x
npm install --global qunit-migrate
$ qunit-migrate "file1, file2, file3" -d "lib/qunit" -q -w
-w: If you want to write the output to file, default: false
-d: If you want definitions support, this will try to add QUnit deps to AMD definitions and anonymous requires. You can also pass your custom dep instead of qunit like in the example case we are passing lib/qunit. So dep will be added as lib/qunit instead of qunit in requires. Keep in mind, qunit-migrate currently doesn't check if qunit definition is already present or not.
-q: If you want double quoutes support, by default we convert to single quotes
qunit-migrate tries to change old QUnit code to new QUnit specifications.
For e.g. following code will be converted as follows:
// Taken directly from jquery-globalize
// file1.js
define([
"cldr",
"src/core",
"json!cldr-data/supplemental/likelySubtags.json",
"cldr/event"
], function( Cldr, Globalize, likelySubtags ) {
Cldr.load( likelySubtags );
module( "Globalize.locale" );
test( "should allow String locale", function() {
Globalize.locale( "en" );
ok( Globalize.cldr instanceof Cldr );
equal( Globalize.cldr.locale, "en" );
});
});
$ qunit-migrate "file1" -d "lib/qunit" -q -w
to
// Taken directly from jquery-globalize
// file1.js
define( [ "lib/qunit",
"cldr",
"src/core",
"json!cldr-data/supplemental/likelySubtags.json",
"cldr/event"
], function( QUnit, Cldr, Globalize, likelySubtags ) {
Cldr.load( likelySubtags );
QUnit.module( "Globalize.locale" );
QUnit.test( "should allow String locale", function( assert ) {
Globalize.locale( "en" );
assert.ok( Globalize.cldr instanceof Cldr );
assert.equal( Globalize.cldr.locale, "en" );
});
});
$ npm install --save qunit-migrate
var qunitMigrate = require('qunit-migrate');
var data = 'Some old qunit code';
var options = {
quotes: '"', // Kind of quotes you want
definitions: true // or you can pass your custom definition
};
var modifiedData = qunitMigrate(data, options); // Fixed code
MIT © Amanpreet Singh
FAQs
Migrate old QUnit code to 2.x
The npm package qunit-migrate receives a total of 10 weekly downloads. As such, qunit-migrate popularity was classified as not popular.
We found that qunit-migrate demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.