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

@ctx-core/function

Package Overview
Dependencies
Maintainers
1
Versions
525
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ctx-core/function - npm Package Compare versions

Comparing version 10.3.7 to 10.4.1

12

lib/index.d.ts

@@ -345,1 +345,13 @@ export declare type falsy = false | 0 | '' | null | undefined;

export declare function ifelse(conditional: any, fn__if: any, fn__else: any): any;
/**
* Returns first obj property that is in the obj
* @param obj
* @param a1__name
*/
export declare function or__in(obj: any, a1__name: any): any;
/**
* Returns first obj property that is truthy
* @param obj
* @param a1__name
*/
export declare function or__property(obj: any, a1__name: any): any;

@@ -582,2 +582,27 @@ 'use strict';

}
/**
* Returns first obj property that is in the obj
* @param obj
* @param a1__name
*/
function or__in(obj, a1__name) {
for (let i = 0; i < a1__name.length; i++) {
const name = a1__name[i];
if (name in obj)
return name;
}
}
/**
* Returns first obj property that is truthy
* @param obj
* @param a1__name
*/
function or__property(obj, a1__name) {
for (let i = 0; i < a1__name.length; i++) {
const name = a1__name[i];
const value = obj[name];
if (value)
return value;
}
}

@@ -636,2 +661,4 @@ exports._a1__wrap = _a1__wrap;

exports.or__fn = or__fn;
exports.or__in = or__in;
exports.or__property = or__property;
exports.slice__a1__arg = slice__a1__arg;

@@ -638,0 +665,0 @@ exports.tap = tap;

4

package.json
{
"name": "@ctx-core/function",
"version": "10.3.7",
"version": "10.4.1",
"description": "ctx-core function",

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

},
"gitHead": "75e876bac72c5e7ceef4eba4dac44d783c6c3fe6"
"gitHead": "f259d149680a8a776bbc0e7b1aae573e412596b0"
}

@@ -572,1 +572,24 @@ export type falsy = false|0|''|null|undefined

}
/**
* Returns first obj property that is in the obj
* @param obj
* @param a1__name
*/
export function or__in(obj, a1__name) {
for (let i = 0; i < a1__name.length; i++) {
const name = a1__name[i]
if (name in obj) return name
}
}
/**
* Returns first obj property that is truthy
* @param obj
* @param a1__name
*/
export function or__property(obj, a1__name) {
for (let i = 0; i < a1__name.length; i++) {
const name = a1__name[i]
const value = obj[name]
if (value) return value
}
}

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