New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

util-array-object-or-both

Package Overview
Dependencies
Maintainers
1
Versions
152
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

util-array-object-or-both - npm Package Compare versions

Comparing version 4.1.1 to 4.1.2

6

CHANGELOG.md

@@ -6,2 +6,8 @@ # Change Log

## 4.1.2 (2022-04-18)
### Bug Fixes
- tweak types ([fa71185](https://github.com/codsen/codsen/commit/fa71185b561d052379bbbed0a20ee025f8c929be))
# 4.1.0 (2022-04-10)

@@ -8,0 +14,0 @@

4

dist/util-array-object-or-both.esm.js
/**
* @name util-array-object-or-both
* @fileoverview Validate and normalise user choice: array, object or both?
* @version 4.1.1
* @version 4.1.2
* @author Roy Revelt, Codsen Ltd

@@ -10,2 +10,2 @@ * @license MIT

import r from"lodash.includes";var s="4.1.1";var y=s,l={msg:"",optsVarName:"given variable"};function m(t,a){let o=["object","objects","obj","ob","o"],n=["array","arrays","arr","aray","arr","a"],i=["any","all","everything","both","either","each","whatever","whatevs","e"],e={...l,...a};if(e?.msg&&e.msg.length&&(e.msg=`${e.msg.trim()} `),e.optsVarName!=="given variable"&&(e.optsVarName=`variable "${e.optsVarName}"`),r(o,t.toLowerCase().trim()))return"object";if(r(n,t.toLowerCase().trim()))return"array";if(r(i,t.toLowerCase().trim()))return"any";throw new TypeError(`${e.msg}The ${e.optsVarName} was customised to an unrecognised value: ${t}. Please check it against the API documentation.`)}export{m as arrObjOrBoth,l as defaults,y as version};
import r from"lodash.includes";var s="4.1.2";var y=s,c={msg:"",optsVarName:"given variable"};function m(t,a){let o=["object","objects","obj","ob","o"],n=["array","arrays","arr","aray","arr","a"],i=["any","all","everything","both","either","each","whatever","whatevs","e"],e={...c,...a};if(e?.msg&&e.msg.length&&(e.msg=`${e.msg.trim()} `),e.optsVarName!=="given variable"&&(e.optsVarName=`variable "${e.optsVarName}"`),r(o,t.toLowerCase().trim()))return"object";if(r(n,t.toLowerCase().trim()))return"array";if(r(i,t.toLowerCase().trim()))return"any";throw new TypeError(`${e.msg}The ${e.optsVarName} was customised to an unrecognised value: ${t}. Please check it against the API documentation.`)}export{m as arrObjOrBoth,c as defaults,y as version};
/**
* @name util-array-object-or-both
* @fileoverview Validate and normalise user choice: array, object or both?
* @version 4.1.1
* @version 4.1.2
* @author Roy Revelt, Codsen Ltd

@@ -10,2 +10,2 @@ * @license MIT

var utilArrayObjectOrBoth=(()=>{var V=Object.create;var o=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames,g=Object.getOwnPropertySymbols,L=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable;var l=(r,t,e)=>t in r?o(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,p=(r,t)=>{for(var e in t||(t={}))h.call(t,e)&&l(r,e,t[e]);if(g)for(var e of g(t))P.call(t,e)&&l(r,e,t[e]);return r};var S=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),k=(r,t)=>{for(var e in t)o(r,e,{get:t[e],enumerable:!0})},m=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of $(t))!h.call(r,s)&&s!==e&&o(r,s,{get:()=>t[s],enumerable:!(n=E(t,s))||n.enumerable});return r};var F=(r,t,e)=>(e=r!=null?V(L(r)):{},m(t||!r||!r.__esModule?o(e,"default",{value:r,enumerable:!0}):e,r)),M=r=>m(o({},"__esModule",{value:!0}),r);var N=S((Tr,x)=>{var j=1/0,w=9007199254740991,B=17976931348623157e292,O=0/0,C="[object Arguments]",R="[object Function]",D="[object GeneratorFunction]",G="[object String]",K="[object Symbol]",_=/^\s+|\s+$/g,X=/^[-+]0x[0-9a-f]+$/i,H=/^0b[01]+$/i,U=/^0o[0-7]+$/i,Y=/^(?:0|[1-9]\d*)$/,q=parseInt;function v(r,t){for(var e=-1,n=r?r.length:0,s=Array(n);++e<n;)s[e]=t(r[e],e,r);return s}function z(r,t,e,n){for(var s=r.length,i=e+(n?1:-1);n?i--:++i<s;)if(t(r[i],i,r))return i;return-1}function J(r,t,e){if(t!==t)return z(r,Q,e);for(var n=e-1,s=r.length;++n<s;)if(r[n]===t)return n;return-1}function Q(r){return r!==r}function W(r,t){for(var e=-1,n=Array(r);++e<r;)n[e]=t(e);return n}function Z(r,t){return v(t,function(e){return r[e]})}function rr(r,t){return function(e){return r(t(e))}}var a=Object.prototype,f=a.hasOwnProperty,c=a.toString,tr=a.propertyIsEnumerable,er=rr(Object.keys,Object),nr=Math.max;function ir(r,t){var e=A(r)||ur(r)?W(r.length,String):[],n=e.length,s=!!n;for(var i in r)(t||f.call(r,i))&&!(s&&(i=="length"||or(i,n)))&&e.push(i);return e}function sr(r){if(!ar(r))return er(r);var t=[];for(var e in Object(r))f.call(r,e)&&e!="constructor"&&t.push(e);return t}function or(r,t){return t=t==null?w:t,!!t&&(typeof r=="number"||Y.test(r))&&r>-1&&r%1==0&&r<t}function ar(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||a;return r===e}function cr(r,t,e,n){r=b(r)?r:jr(r),e=e&&!n?lr(e):0;var s=r.length;return e<0&&(e=nr(s+e,0)),br(r)?e<=s&&r.indexOf(t,e)>-1:!!s&&J(r,t,e)>-1}function ur(r){return pr(r)&&f.call(r,"callee")&&(!tr.call(r,"callee")||c.call(r)==C)}var A=Array.isArray;function b(r){return r!=null&&fr(r.length)&&!yr(r)}function pr(r){return d(r)&&b(r)}function yr(r){var t=y(r)?c.call(r):"";return t==R||t==D}function fr(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=w}function y(r){var t=typeof r;return!!r&&(t=="object"||t=="function")}function d(r){return!!r&&typeof r=="object"}function br(r){return typeof r=="string"||!A(r)&&d(r)&&c.call(r)==G}function dr(r){return typeof r=="symbol"||d(r)&&c.call(r)==K}function gr(r){if(!r)return r===0?r:0;if(r=hr(r),r===j||r===-j){var t=r<0?-1:1;return t*B}return r===r?r:0}function lr(r){var t=gr(r),e=t%1;return t===t?e?t-e:t:0}function hr(r){if(typeof r=="number")return r;if(dr(r))return O;if(y(r)){var t=typeof r.valueOf=="function"?r.valueOf():r;r=y(t)?t+"":t}if(typeof r!="string")return r===0?r:+r;r=r.replace(_,"");var e=H.test(r);return e||U.test(r)?q(r.slice(2),e?2:8):X.test(r)?O:+r}function mr(r){return b(r)?ir(r):sr(r)}function jr(r){return r?Z(r,mr(r)):[]}x.exports=cr});var xr={};k(xr,{arrObjOrBoth:()=>Ar,defaults:()=>I,version:()=>wr});var u=F(N(),1);var T="4.1.1";var wr=T,I={msg:"",optsVarName:"given variable"};function Ar(r,t){let e=["object","objects","obj","ob","o"],n=["array","arrays","arr","aray","arr","a"],s=["any","all","everything","both","either","each","whatever","whatevs","e"],i=p(p({},I),t);if((i==null?void 0:i.msg)&&i.msg.length&&(i.msg=`${i.msg.trim()} `),i.optsVarName!=="given variable"&&(i.optsVarName=`variable "${i.optsVarName}"`),(0,u.default)(e,r.toLowerCase().trim()))return"object";if((0,u.default)(n,r.toLowerCase().trim()))return"array";if((0,u.default)(s,r.toLowerCase().trim()))return"any";throw new TypeError(`${i.msg}The ${i.optsVarName} was customised to an unrecognised value: ${r}. Please check it against the API documentation.`)}return M(xr);})();
var utilArrayObjectOrBoth=(()=>{var V=Object.create;var o=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames,g=Object.getOwnPropertySymbols,L=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable;var l=(r,t,e)=>t in r?o(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,p=(r,t)=>{for(var e in t||(t={}))h.call(t,e)&&l(r,e,t[e]);if(g)for(var e of g(t))P.call(t,e)&&l(r,e,t[e]);return r};var S=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),k=(r,t)=>{for(var e in t)o(r,e,{get:t[e],enumerable:!0})},m=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of $(t))!h.call(r,s)&&s!==e&&o(r,s,{get:()=>t[s],enumerable:!(n=E(t,s))||n.enumerable});return r};var F=(r,t,e)=>(e=r!=null?V(L(r)):{},m(t||!r||!r.__esModule?o(e,"default",{value:r,enumerable:!0}):e,r)),M=r=>m(o({},"__esModule",{value:!0}),r);var N=S((Tr,x)=>{var j=1/0,w=9007199254740991,B=17976931348623157e292,O=0/0,C="[object Arguments]",R="[object Function]",D="[object GeneratorFunction]",G="[object String]",K="[object Symbol]",_=/^\s+|\s+$/g,X=/^[-+]0x[0-9a-f]+$/i,H=/^0b[01]+$/i,U=/^0o[0-7]+$/i,Y=/^(?:0|[1-9]\d*)$/,q=parseInt;function z(r,t){for(var e=-1,n=r?r.length:0,s=Array(n);++e<n;)s[e]=t(r[e],e,r);return s}function J(r,t,e,n){for(var s=r.length,i=e+(n?1:-1);n?i--:++i<s;)if(t(r[i],i,r))return i;return-1}function Q(r,t,e){if(t!==t)return J(r,W,e);for(var n=e-1,s=r.length;++n<s;)if(r[n]===t)return n;return-1}function W(r){return r!==r}function Z(r,t){for(var e=-1,n=Array(r);++e<r;)n[e]=t(e);return n}function v(r,t){return z(t,function(e){return r[e]})}function rr(r,t){return function(e){return r(t(e))}}var a=Object.prototype,f=a.hasOwnProperty,c=a.toString,tr=a.propertyIsEnumerable,er=rr(Object.keys,Object),nr=Math.max;function ir(r,t){var e=A(r)||ur(r)?Z(r.length,String):[],n=e.length,s=!!n;for(var i in r)(t||f.call(r,i))&&!(s&&(i=="length"||or(i,n)))&&e.push(i);return e}function sr(r){if(!ar(r))return er(r);var t=[];for(var e in Object(r))f.call(r,e)&&e!="constructor"&&t.push(e);return t}function or(r,t){return t=t==null?w:t,!!t&&(typeof r=="number"||Y.test(r))&&r>-1&&r%1==0&&r<t}function ar(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||a;return r===e}function cr(r,t,e,n){r=b(r)?r:jr(r),e=e&&!n?lr(e):0;var s=r.length;return e<0&&(e=nr(s+e,0)),br(r)?e<=s&&r.indexOf(t,e)>-1:!!s&&Q(r,t,e)>-1}function ur(r){return pr(r)&&f.call(r,"callee")&&(!tr.call(r,"callee")||c.call(r)==C)}var A=Array.isArray;function b(r){return r!=null&&fr(r.length)&&!yr(r)}function pr(r){return d(r)&&b(r)}function yr(r){var t=y(r)?c.call(r):"";return t==R||t==D}function fr(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=w}function y(r){var t=typeof r;return!!r&&(t=="object"||t=="function")}function d(r){return!!r&&typeof r=="object"}function br(r){return typeof r=="string"||!A(r)&&d(r)&&c.call(r)==G}function dr(r){return typeof r=="symbol"||d(r)&&c.call(r)==K}function gr(r){if(!r)return r===0?r:0;if(r=hr(r),r===j||r===-j){var t=r<0?-1:1;return t*B}return r===r?r:0}function lr(r){var t=gr(r),e=t%1;return t===t?e?t-e:t:0}function hr(r){if(typeof r=="number")return r;if(dr(r))return O;if(y(r)){var t=typeof r.valueOf=="function"?r.valueOf():r;r=y(t)?t+"":t}if(typeof r!="string")return r===0?r:+r;r=r.replace(_,"");var e=H.test(r);return e||U.test(r)?q(r.slice(2),e?2:8):X.test(r)?O:+r}function mr(r){return b(r)?ir(r):sr(r)}function jr(r){return r?v(r,mr(r)):[]}x.exports=cr});var xr={};k(xr,{arrObjOrBoth:()=>Ar,defaults:()=>I,version:()=>wr});var u=F(N(),1);var T="4.1.2";var wr=T,I={msg:"",optsVarName:"given variable"};function Ar(r,t){let e=["object","objects","obj","ob","o"],n=["array","arrays","arr","aray","arr","a"],s=["any","all","everything","both","either","each","whatever","whatevs","e"],i=p(p({},I),t);if((i==null?void 0:i.msg)&&i.msg.length&&(i.msg=`${i.msg.trim()} `),i.optsVarName!=="given variable"&&(i.optsVarName=`variable "${i.optsVarName}"`),(0,u.default)(e,r.toLowerCase().trim()))return"object";if((0,u.default)(n,r.toLowerCase().trim()))return"array";if((0,u.default)(s,r.toLowerCase().trim()))return"any";throw new TypeError(`${i.msg}The ${i.optsVarName} was customised to an unrecognised value: ${r}. Please check it against the API documentation.`)}return M(xr);})();
{
"name": "util-array-object-or-both",
"version": "4.1.1",
"version": "4.1.2",
"description": "Validate and normalise user choice: array, object or both?",

@@ -5,0 +5,0 @@ "keywords": [

@@ -9,5 +9,5 @@ declare const version: string;

str: string,
originalOpts?: Partial<Opts>
opts?: Partial<Opts>
): "array" | "object" | "any";
export { arrObjOrBoth, defaults, version };
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