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

@azure-tools/codegen

Package Overview
Dependencies
Maintainers
1
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@azure-tools/codegen - npm Package Compare versions

Comparing version 2.1.237 to 2.1.240

11

dist/safe-eval.d.ts

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

export declare const safeEval: <T>(expression: string, context?: any) => T;
/**
* A sandboxed eval function
*
* @deprecated consumers should create a local sandbox to reuse. (@see createSandbox )
* */
export declare const safeEval: <T>(code: string, context?: any) => T;
/**
* Creates a reusable safe-eval sandbox to execute code in.
*/
export declare function createSandbox(): <T>(code: string, context?: any) => T;
//# sourceMappingURL=safe-eval.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/*---------------------------------------------------------------------------------------------

@@ -6,5 +7,33 @@ * Copyright (c) Microsoft Corporation. All rights reserved.

*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
/* eslint-disable */
exports.safeEval = require('safe-eval');
const vm = require("vm");
/**
* A sandboxed eval function
*
* @deprecated consumers should create a local sandbox to reuse. (@see createSandbox )
* */
exports.safeEval = createSandbox();
/**
* Creates a reusable safe-eval sandbox to execute code in.
*/
function createSandbox() {
const sandbox = vm.createContext({});
return (code, context) => {
var response = 'SAFE_EVAL_' + Math.floor(Math.random() * 1000000);
sandbox[response] = {};
if (context) {
for (const key of Object.keys(context)) {
sandbox[key] = context[key];
}
vm.runInContext(`${response} = ${code}`, sandbox);
for (const key of Object.keys(context)) {
delete sandbox[key];
}
}
else {
vm.runInContext(`${response} = ${code}`, sandbox);
}
return sandbox[response];
};
}
exports.createSandbox = createSandbox;
//# sourceMappingURL=safe-eval.js.map

9

package.json
{
"name": "@azure-tools/codegen",
"version": "2.1.237",
"version": "2.1.240",
"patchOffset": 100,

@@ -51,8 +51,7 @@ "description": "Autorest Code generator common and base classes",

"dependencies": {
"@azure-tools/async-io": "~3.0.214",
"@azure-tools/linq": "~3.1.222",
"@azure-tools/async-io": "~3.0.215",
"@azure-tools/linq": "~3.1.223",
"js-yaml": "3.13.1",
"semver": "^5.5.1",
"safe-eval": "^0.3.0"
"semver": "^5.5.1"
}
}

Sorry, the diff of this file is not supported yet

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