Socket
Socket
Sign inDemoInstall

@deno/shim-deno

Package Overview
Dependencies
Maintainers
3
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@deno/shim-deno - npm Package Compare versions

Comparing version 0.1.2 to 0.3.0

5

dist/deno/internal/test.js
"use strict";
/// <reference path="../stable/lib.deno.d.ts" />
Object.defineProperty(exports, "__esModule", { value: true });
exports.testDefinitions = void 0;
/** Reference to the array that `Deno.test` calls insert their definition into. */
exports.testDefinitions = [];
var shim_deno_test_1 = require("@deno/shim-deno-test");
Object.defineProperty(exports, "testDefinitions", { enumerable: true, get: function () { return shim_deno_test_1.testDefinitions; } });

2

dist/deno/internal/version.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.typescript = exports.deno = void 0;
exports.deno = "1.17.2";
exports.deno = "1.18.2";
exports.typescript = "4.5.2";
"use strict";
///<reference path="../lib.deno.d.ts" />
var _a, _b;
var _c;
Object.defineProperty(exports, "__esModule", { value: true });

@@ -7,2 +9,3 @@ exports.PermissionStatus = void 0;

// is constant and mocked as Node.js has all doors open.
(_a = (_c = globalThis).EventTarget) !== null && _a !== void 0 ? _a : (_c.EventTarget = (_b = require("events").EventTarget) !== null && _b !== void 0 ? _b : null);
class PermissionStatus extends EventTarget {

@@ -9,0 +12,0 @@ /** @internal */

"use strict";
/// <reference path="../lib.deno.d.ts" />
Object.defineProperty(exports, "__esModule", { value: true });
exports.test = void 0;
const test_js_1 = require("../../internal/test.js");
const test = function test() {
var _a, _b;
let testDef;
const firstArg = arguments[0];
const secondArg = arguments[1];
const thirdArg = arguments[2];
if (typeof firstArg === "string") {
if (typeof secondArg === "object") {
if (typeof thirdArg === "function") {
if (secondArg.fn != null) {
throw new TypeError("Unexpected 'fn' field in options, test function is already provided as the third argument.");
}
}
if (secondArg.name != null) {
throw new TypeError("Unexpected 'name' field in options, test name is already provided as the first argument.");
}
// name, options, fn
testDef = { name: firstArg, fn: thirdArg, ...secondArg };
}
else {
// name, fn
testDef = { name: firstArg, fn: secondArg };
}
}
else if (firstArg instanceof Function) {
// function only
if (firstArg.name.length === 0) {
throw new TypeError("The test function must have a name");
}
testDef = { fn: firstArg, name: firstArg.name };
if (secondArg != null) {
throw new TypeError("Unexpected second argument to Deno.test()");
}
}
else if (typeof firstArg === "object") {
testDef = { ...firstArg };
if (typeof secondArg === "function") {
// options, fn
testDef.fn = secondArg;
if (firstArg.fn != null) {
throw new TypeError("Unexpected 'fn' field in options, test function is already provided as the second argument.");
}
if (testDef.name == null) {
if (secondArg.name.length === 0) {
throw new TypeError("The test function must have a name");
}
// options without name, fn
testDef.name = secondArg.name;
}
}
else {
if (typeof firstArg.fn !== "function") {
throw new TypeError("Expected 'fn' field in the first argument to be a test function.");
}
}
}
else {
throw new TypeError("Unknown test overload");
}
if (typeof testDef.fn !== "function") {
throw new TypeError("Missing test function");
}
if (((_b = (_a = testDef.name) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) === 0) {
throw new TypeError("The test name can't be empty");
}
test_js_1.testDefinitions.push(testDef);
};
exports.test = test;
var shim_deno_test_1 = require("@deno/shim-deno-test");
Object.defineProperty(exports, "test", { enumerable: true, get: function () { return shim_deno_test_1.test; } });
{
"name": "@deno/shim-deno",
"version": "0.1.2",
"version": "0.3.0",
"description": "Deno namespace shim for Node.js",

@@ -33,4 +33,4 @@ "keywords": [

"scripts": {
"build": "tsc",
"prepare": "npm run denolib && npm run --silent build",
"build": "npm run denolib && tsc",
"prepublishOnly": "npm run build",
"clean": "git clean -fXde !node_modules/",

@@ -43,2 +43,3 @@ "test": "node --loader=ts-node/esm tools/run_tests.mjs",

"dependencies": {
"@deno/shim-deno-test": "^0.3.0",
"which": "^2.0.2"

@@ -45,0 +46,0 @@ },

Sorry, the diff of this file is too big to display

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