New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@digshare/script

Package Overview
Dependencies
Maintainers
2
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@digshare/script - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

40

bld/library/script/dev-run.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.devRun = void 0;
const _utils_1 = require("./@utils");
const api_1 = require("./api");
const storage_1 = require("./storage");
async function devRun(script, { storage = {}, payload, dryRun = false } = {}) {
await script(payload, {
dryRun,
requestId: 'dev',
token: 'dev',
api: new api_1.DevScriptAPI(storage),
storage: new storage_1.ScriptStorage(storage),
});
let done = _utils_1.devLog;
try {
let api = new api_1.DevScriptAPI(storage);
let storageObject = new storage_1.ScriptStorage(await api.getStorage());
let context = {
dryRun,
requestId: 'dev',
token: 'dev',
api,
storage: storageObject,
};
let creation = await script(payload, context);
if (dryRun) {
return done({
creation,
storage: storageObject.raw,
});
}
if (creation) {
await api.publishMessage(creation);
}
if (storageObject.changed) {
await api.updateStorage(storageObject.raw);
}
return done({});
}
catch (error) {
console.error(error);
return done({
error: error.message,
});
}
}
exports.devRun = devRun;
//# sourceMappingURL=dev-run.js.map

2

package.json
{
"name": "@digshare/script",
"version": "0.2.0",
"version": "0.2.1",
"license": "MIT",

@@ -5,0 +5,0 @@ "author": "Chengdu Mufan Technology Co., Ltd.",

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

import {devLog} from './@utils';
import {DevScriptAPI} from './api';

@@ -22,9 +23,41 @@ import {Script} from './script';

): Promise<void> {
await script(payload, {
dryRun,
requestId: 'dev',
token: 'dev',
api: new DevScriptAPI(storage),
storage: new ScriptStorage(storage),
});
let done = devLog;
try {
let api = new DevScriptAPI(storage);
let storageObject = new ScriptStorage(await api.getStorage());
let context = {
dryRun,
requestId: 'dev',
token: 'dev',
api,
storage: storageObject,
};
let creation = await script(payload, context);
if (dryRun) {
return done({
creation,
storage: storageObject.raw,
});
}
if (creation) {
await api.publishMessage(creation);
}
if (storageObject.changed) {
await api.updateStorage(storageObject.raw);
}
return done({});
} catch (error: any) {
console.error(error);
return done({
error: error.message,
});
}
}

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