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

spica

Package Overview
Dependencies
Maintainers
1
Versions
804
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spica - npm Package Compare versions

Comparing version 0.0.731 to 0.0.732

10

function.ts
export function singleton<f extends (...args: unknown[]) => unknown>(f: f): f {
let result: [unknown];
let result: unknown;
assert(result === noop());
return function (this: unknown, ...as) {
if (result) return result[0];
result = [f.call(this, ...as)];
return result[0];
if (f === noop) return result;
result = f.call(this, ...as);
f = noop as f;
return result;
} as f;

@@ -8,0 +10,0 @@ }

8

package.json
{
"name": "spica",
"version": "0.0.731",
"version": "0.0.732",
"description": "Supervisor, Coroutine, Channel, select, AtomicPromise, Cancellation, Cache, List, Queue, Stack, and some utils.",

@@ -60,3 +60,3 @@ "private": false,

"@types/yallist": "4.0.1",
"@typescript-eslint/parser": "^5.59.8",
"@typescript-eslint/parser": "^5.59.9",
"babel-loader": "^9.1.2",

@@ -69,3 +69,3 @@ "babel-plugin-unassert": "^3.2.0",

"eslint-webpack-plugin": "^4.0.1",
"glob": "^10.2.6",
"glob": "^10.2.7",
"karma": "^6.4.2",

@@ -82,3 +82,3 @@ "karma-chrome-launcher": "^3.2.0",

"typescript": "5.1.3",
"webpack": "^5.85.0",
"webpack": "^5.85.1",
"webpack-cli": "^5.1.3",

@@ -85,0 +85,0 @@ "webpack-merge": "^5.9.0",

export function singleton<f extends (...args: unknown[]) => unknown>(f: f): f {
let result: [unknown];
let result: unknown;
assert(result === noop());
return function (this: unknown, ...as) {
if (result) return result[0];
result = [f.call(this, ...as)];
return result[0];
if (f === noop) return result;
result = f.call(this, ...as);
f = noop as f;
return result;
} as f;

@@ -8,0 +10,0 @@ }

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