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

@solid-primitives/utils

Package Overview
Dependencies
Maintainers
2
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solid-primitives/utils - npm Package Compare versions

Comparing version 0.0.150 to 0.0.200

19

dist/cjs/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toArray = exports.toInt = exports.toFloat = exports.concat = exports.stringConcat = exports.promiseTimeout = exports.withAccess = exports.accessAsArray = exports.access = void 0;
const access = (v) => typeof v === 'function' ? v() : v;
exports.toArray = exports.toInt = exports.toFloat = exports.concat = exports.stringConcat = exports.objectOmit = exports.promiseTimeout = exports.withAccess = exports.accessAsArray = exports.access = exports.isClient = void 0;
exports.isClient = typeof window !== "undefined";
const access = (v) => typeof v === "function" ? v() : v;
exports.access = access;

@@ -13,12 +14,20 @@ const accessAsArray = (value) => {

const _value = (0, exports.access)(value);
if (typeof _value !== 'undefined' && _value !== null)
if (typeof _value !== "undefined" && _value !== null)
fn(_value);
};
exports.withAccess = withAccess;
const promiseTimeout = (ms, throwOnTimeout = false, reason = 'Timeout') => new Promise((resolve, reject) => throwOnTimeout ? setTimeout(() => reject(reason), ms) : setTimeout(resolve, ms));
const promiseTimeout = (ms, throwOnTimeout = false, reason = "Timeout") => new Promise((resolve, reject) => throwOnTimeout ? setTimeout(() => reject(reason), ms) : setTimeout(resolve, ms));
exports.promiseTimeout = promiseTimeout;
const objectOmit = (object, ...keys) => {
const copy = Object.assign({}, object);
for (const key of keys) {
delete copy[key];
}
return copy;
};
exports.objectOmit = objectOmit;
//
// SIGNAL BUILDERS:
//
const stringConcat = (...a) => a.reduce((t, c) => t + (0, exports.access)(c), '');
const stringConcat = (...a) => a.reduce((t, c) => t + (0, exports.access)(c), "");
exports.stringConcat = stringConcat;

@@ -25,0 +34,0 @@ const concat = (...a) => a.reduce((t, c) => {

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

import type { Accessor } from 'solid-js';
import type { Accessor } from "solid-js";
export declare type Fn<R = void> = () => R;

@@ -10,2 +10,3 @@ export declare type Many<T> = T | T[];

export declare type MaybeAccessorValue<T extends MaybeAccessor<any>> = T extends Fn ? ReturnType<T> : T;
export declare const isClient: boolean;
export declare const access: <T extends unknown>(v: T) => MaybeAccessorValue<T>;

@@ -15,2 +16,3 @@ export declare const accessAsArray: <T extends unknown, V = MaybeAccessorValue<T>>(value: T) => V extends any[] ? V : V[];

export declare const promiseTimeout: (ms: number, throwOnTimeout?: boolean, reason?: string) => Promise<void>;
export declare const objectOmit: <T extends Object, K extends (keyof T)[]>(object: T, ...keys: K) => Omit<T, ItemsOf<K>>;
export declare const stringConcat: (...a: MaybeAccessor<any>[]) => string;

@@ -17,0 +19,0 @@ export declare const concat: <A extends any[], V = MaybeAccessorValue<ItemsOf<A>>>(...a: A) => (V extends any[] ? ItemsOf<V> : V)[];

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

export const access = (v) => typeof v === 'function' ? v() : v;
export const isClient = typeof window !== "undefined";
export const access = (v) => typeof v === "function" ? v() : v;
export const accessAsArray = (value) => {

@@ -8,10 +9,17 @@ const _value = access(value);

const _value = access(value);
if (typeof _value !== 'undefined' && _value !== null)
if (typeof _value !== "undefined" && _value !== null)
fn(_value);
};
export const promiseTimeout = (ms, throwOnTimeout = false, reason = 'Timeout') => new Promise((resolve, reject) => throwOnTimeout ? setTimeout(() => reject(reason), ms) : setTimeout(resolve, ms));
export const promiseTimeout = (ms, throwOnTimeout = false, reason = "Timeout") => new Promise((resolve, reject) => throwOnTimeout ? setTimeout(() => reject(reason), ms) : setTimeout(resolve, ms));
export const objectOmit = (object, ...keys) => {
const copy = Object.assign({}, object);
for (const key of keys) {
delete copy[key];
}
return copy;
};
//
// SIGNAL BUILDERS:
//
export const stringConcat = (...a) => a.reduce((t, c) => t + access(c), '');
export const stringConcat = (...a) => a.reduce((t, c) => t + access(c), "");
export const concat = (...a) => a.reduce((t, c) => {

@@ -18,0 +26,0 @@ const v = access(c);

{
"name": "@solid-primitives/utils",
"version": "0.0.150",
"version": "0.0.200",
"description": "A bunch of reactive utility types and functions, for building primitives with Solid.js",

@@ -13,3 +13,3 @@ "author": "Damian Tarnawski @thetarnav <gthetarnav@gmail.com>",

"private": false,
"main": "dist/index.js",
"main": "dist/cjs/index.cjs",
"module": "dist/index.js",

@@ -21,3 +21,3 @@ "types": "dist/index.d.ts",

"exports": {
"require": "./dist/cjs/index.js",
"require": "./dist/cjs/index.cjs",
"import": "./dist/index.js",

@@ -51,2 +51,2 @@ "default": "./dist/index.js"

}
}
}
# @solid-primitives/utils
Solid Primitives Utilities is a support and helper package for a number of primitives in our library. Please free to augment or centralise useful utilities and methods in this package for sharing.
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