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

metautil

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metautil - npm Package Compare versions

Comparing version 3.7.1 to 3.7.2

36

lib/async.js
'use strict';
const { EventEmitter } = require('node:events');
const polyfillAbortController = () => {
const emitter = new EventEmitter();
const signal = {
emitter,
onabort: null,
aborted: false,
reason: undefined,
removeEventListener(name, callback) {
emitter.removeListener(name, callback);
},
addEventListener(name, callback) {
emitter.on(name, callback);
},
};
return {
signal,
abort(reason) {
if (signal.aborted) return;
signal.aborted = true;
signal.reason = reason ? reason : new Error('AbortError');
const event = { type: 'abort', target: signal };
if (signal.onabort) signal.onabort(event);
emitter.emit(event.type, event);
},
};
};
const nativeAbortController = () => new AbortController();
const createAbortController = global.AbortController
? nativeAbortController
: polyfillAbortController;
const timeout = (msec, signal = null) =>

@@ -61,5 +26,4 @@ new Promise((resolve, reject) => {

module.exports = {
createAbortController,
timeout,
delay,
};

17

package.json
{
"name": "metautil",
"version": "3.7.1",
"version": "3.7.2",
"author": "Timur Shemsedinov <timur.shemsedinov@gmail.com>",
"license": "MIT",
"description": "Metarhia utilities",
"keywords": ["node.js", "metarhia", "util"],
"keywords": [
"node.js",
"metarhia",
"util"
],
"main": "metautil.js",
"types": "metautil.d.ts",
"files": ["lib/", "metautil.d.ts"],
"files": [
"lib/",
"metautil.d.ts"
],
"engines": {
"node": "^14.18 || 16 || 18 || 19"
"node": "16 || 18 || 19 || 20"
},

@@ -42,4 +49,4 @@ "repository": {

"prettier": "^2.8.4",
"typescript": "^4.9.5"
"typescript": "^5.0.4"
}
}
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