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

@-0/utils

Package Overview
Dependencies
Maintainers
1
Versions
125
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@-0/utils - npm Package Compare versions

Comparing version 0.2.78 to 0.2.79

tests/stringify_type.test.js

11

lib/stringify_fn.js
export const stringify_fn = (x, indent) => JSON.stringify(x, (key, value) => {
if (typeof value === "function") {
return (value
.toString()
.replace(/\r?\n|\r/g, "")
.replace(/\s\s+/g, " ")
.slice(0, 12) + "...");
if (typeof value === 'function') {
return value.toString()
.replace(/\r?\n|\r/g, '')
.replace(/\s\s+/g, ' ')
.slice(0, 12) + '...';
}

@@ -9,0 +8,0 @@ else {

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

export declare const stringify_type: (x: any) => "THUNK" | "FUNCTION" | "PROMISE" | "OBJECT" | "type_str NOT FOUND";
export declare const stringify_type: (x: any) => "NULLARY" | "UNARY" | "BINARY" | "N-ARY" | "PROMISE" | "OBJECT" | "type_str NOT FOUND";

@@ -1,7 +0,11 @@

import { isObject, isFunction, isPromise } from "@thi.ng/checks";
import { isObject, isFunction, isPromise } from '@thi.ng/checks';
export const stringify_type = x => {
if (isFunction(x) && x.length === 0)
return "THUNK";
if (isFunction(x) && x.length > 0)
return "FUNCTION";
return "NULLARY";
if (isFunction(x) && x.length === 1)
return "UNARY";
if (isFunction(x) && x.length === 2)
return "BINARY";
if (isFunction(x) && x.length > 2)
return "N-ARY";
if (isPromise(x))

@@ -8,0 +12,0 @@ return "PROMISE";

@@ -5,3 +5,3 @@ {

"license": "MIT",
"version": "0.2.78",
"version": "0.2.79",
"description": "utilities for the `-0` org/framework built on @thi.ng/umbrella ecosystem",

@@ -34,3 +34,3 @@ "main": "./lib/index.js",

"peerDependencies": {
"@-0/keys": "^0.2.81",
"@-0/keys": "^0.2.82",
"@thi.ng/checks": "^2.8.0",

@@ -41,3 +41,3 @@ "@thi.ng/rstream": "^5.1.0"

"@babel/plugin-transform-modules-commonjs": "^7.12.1",
"@-0/keys": "^0.2.81",
"@-0/keys": "^0.2.82",
"@thi.ng/checks": "^2.8.0",

@@ -53,3 +53,3 @@ "@thi.ng/rstream": "^5.1.0",

"prettier": "^2.2.1",
"ts-jest": "^26.4.4"
"ts-jest": "^26.5.0"
},

@@ -56,0 +56,0 @@ "publishConfig": {

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