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

valentine

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

valentine - npm Package Compare versions

Comparing version 1.5.5 to 1.5.6

2

make/build.js

@@ -12,2 +12,3 @@ require('smoosh').config({

, "forin": false
, "laxcomma": true
, "curly": false

@@ -22,3 +23,2 @@ , "debug": false

, "indent": 2
, "whitespace": true
, "asi": true

@@ -25,0 +25,0 @@ , "laxbreak": true

{
"name": "valentine"
, "description": "JavaScripts Functional Sister. Utilitiy, Iterators, type checking"
, "version": "1.5.5"
, "version": "1.5.6"
, "homepage": "https://github.com/ded/valentine"

@@ -16,2 +16,3 @@ , "author": "Dustin Diaz <dustin@dustindiaz.com> (http://dustindiaz.com)"

"sink-test": ">= 1.0.1"
, "smoosh": "0.4.x"
}

@@ -18,0 +19,0 @@ , "scripts": {

@@ -38,33 +38,54 @@ \ / _. | _ ._ _|_ o ._ _

* v.each(ar || obj, callback[, scope])
* v.map(ar || obj, callback[, scope])
* v.every(ar, callback[, scope])
* v.some(ar, callback[, scope])
* v.filter(ar, callback[, scope])
* v.reject(ar, callback[, scope])
* v.each(array || object, callback[, scope])
* v.map(array || object, callback[, scope])
* v.every(ar, *callback[, scope])
* v.some(ar, *callback[, scope])
* v.filter(ar, *callback[, scope])
* v.reject(ar, *callback[, scope])
* v.indexOf(ar, item[, start])
* v.lastIndexOf(ar, item[, start])
* v.reduce(ar, callback, memo[, scope])
* v.reduceRight(ar, callback, memo[, scope])
* v.reduce(ar, **callback, memo[, scope])
* v.reduceRight(ar, **callback, memo[, scope])
*`callback` is defined as:
``` js
// when array
function callback(item, index, array) {
}
// when object
function callback(key, value, object) {
}
```
**`calback` is defined as:
``` js
function callback(memo, item, index, array) {
}
```
<h3>utility</h3>
* v.extend(obj[, obj2[, obj3[...]]])
* v.merge(ar1, ar2)
* v.pluck(ar, key)
* v.toArray(sparse)
* v.size(ar)
* v.find(ar, key)
* v.compact(ar)
* v.flatten(ar)
* v.uniq(ar)
* v.first(ar)
* v.last(ar)
* v.keys(obj)
* v.values(obj)
* v.trim(str)
* v.bind(scope, fn, [curried args])
* v.curry(fn, [curried args])
* v.inArray(ar, needle)
* v.parallel([fn args])
* v.extend(obj[, obj2[, obj3[...]]]) => object
* v.merge(ar1, ar2) => array (ar1 modified)
* v.pluck(array||object, key) => array
* v.toArray(sparse) => array (duh)
* v.size(array) => number
* v.find(array, key) => *value
* v.compact(array) => array
* v.flatten(array) => array
* v.uniq(array) => array
* v.first(array) => *value
* v.last(array) => *value
* v.keys(object) => array
* v.values(object) => array
* v.trim(string) => string
* v.bind(scope, fn, [curried args]) => function
* v.curry(fn, [curried args]) => function
* v.inArray(array, needle) => boolean
* v.parallel([fn args]) => void

@@ -135,2 +156,3 @@ ``` js

<h3>type checking</h3>
Each method returns a boolean

@@ -137,0 +159,0 @@ * v.is.fun(o)

/*!
* Valentine: JavaScript's functional Sister
* (c) Dustin Diaz 2012
* (c) Dustin Diaz 2013
* https://github.com/ded/valentine
* License MIT
*/

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

(function (name, definition) {
(function (name, context, definition) {
if (typeof module != 'undefined') module.exports = definition()
else if (typeof define == 'function') define(definition)
else this[name] = this['v'] = definition()
})('valentine', function () {
else context[name] = context['v'] = definition()
})('valentine', this, function () {

@@ -7,0 +7,0 @@ var context = this

@@ -82,3 +82,3 @@ if (typeof module !== 'undefined' && module.exports) {

return el == a[i];
}), 'filters out viruses');
}), 'rejects out viruses');
});

@@ -85,0 +85,0 @@

/*!
* Valentine: JavaScript's functional Sister
* (c) Dustin Diaz 2012
* (c) Dustin Diaz 2013
* https://github.com/ded/valentine

@@ -8,7 +8,7 @@ * License MIT

(function (name, definition) {
(function (name, context, definition) {
if (typeof module != 'undefined') module.exports = definition()
else if (typeof define == 'function') define(definition)
else this[name] = this['v'] = definition()
})('valentine', function () {
else context[name] = context['v'] = definition()
})('valentine', this, function () {

@@ -15,0 +15,0 @@ var context = this

/*!
* Valentine: JavaScript's functional Sister
* (c) Dustin Diaz 2012
* (c) Dustin Diaz 2013
* https://github.com/ded/valentine
* License MIT
*/
(function(a,b){typeof module!="undefined"?module.exports=b():typeof define=="function"?define(b):this[a]=this.v=b()})("valentine",function(){function n(a){this.values=a,this.index=0}function o(a,b){return new q(a,b)}function p(a,b){for(var c in b)a[c]=b[c]}function q(a,b){this.val=a,this._scope=b||e,this._chained=0}var a=this,b=a.v,c=[],d=Object.prototype.hasOwnProperty,e=null,f=c.slice,g="map"in c,h="reduce"in c,i=/(^\s*|\s*$)/g,j={each:g?function(a,b,d){c.forEach.call(a,b,d)}:function(a,b,c){for(var d=0,e=a.length;d<e;d++)d in a&&b.call(c,a[d],d,a)},map:g?function(a,b,d){return c.map.call(a,b,d)}:function(a,b,c){var d=[],e;for(e=0,l=a.length;e<l;e++)e in a&&(d[e]=b.call(c,a[e],e,a));return d},some:g?function(a,b,c){return a.some(b,c)}:function(a,b,c){for(var d=0,e=a.length;d<e;d++)if(d in a&&b.call(c,a[d],d,a))return!0;return!1},every:g?function(a,b,c){return a.every(b,c)}:function(a,b,c){for(var d=0,e=a.length;d<e;d++)if(d in a&&!b.call(c,a[d],d,a))return!1;return!0},filter:g?function(a,b,c){return a.filter(b,c)}:function(a,b,c){for(var d=[],e=0,f=0,g=a.length;e<g;e++)if(e in a){if(!b.call(c,a[e],e,a))continue;d[f++]=a[e]}return d},indexOf:g?function(a,b,c){return a.indexOf(b,isFinite(c)?c:0)}:function(a,b,c){c=c||0,c=c<0?0:c,c=c>a.length?a.length:c;for(var d=c;d<a.length;d++)if(d in a&&a[d]===b)return d;return-1},lastIndexOf:g?function(a,b,c){return a.lastIndexOf(b,isFinite(c)?c:a.length)}:function(a,b,c){c=c||a.length,c=c>=a.length?a.length:c<0?a.length+c:c;for(var d=c;d>=0;--d)if(d in a&&a[d]===b)return d;return-1},reduce:h?function(a,b,d,e){return c.reduce.call(a,b,d,e)}:function(a,b,c,d){a||(a=[]);var e=0,f=a.length;if(arguments.length<3)do{if(e in a){c=a[e++];break}if(++e>=f)throw new TypeError("Empty array")}while(1);for(;e<f;e++)e in a&&(c=b.call(d,c,a[e],e,a));return c},reduceRight:h?function(a,b,d,e){return c.reduceRight.call(a,b,d,e)}:function(a,b,c,d){!a&&(a=[]);var e=a.length,f=e-1;if(arguments.length<3)do{if(f in a){c=a[f--];break}if(--f<0)throw new TypeError("Empty array")}while(1);for(;f>=0;f--)f in a&&(c=b.call(d,c,a[f],f,a));return c},find:function(a,b,c){var d;return j.some(a,function(a,e,f){if(b.call(c,a,e,f))return d=a,!0}),d},reject:function(a,b,c){var d=[];for(var e=0,f=0,g=a.length;e<g;e++)if(e in a){if(b.call(c,a[e],e,a))continue;d[f++]=a[e]}return d},size:function(a){return m.toArray(a).length},compact:function(a){return j.filter(a,function(a){return!!a})},flatten:function(a){return j.reduce(a,function(a,b){return k.arr(b)?a.concat(j.flatten(b)):(a[a.length]=b,a)},[])},uniq:function(a,b){var c=[],d,e;a=b?j.map(a,b):a;a:for(d=0;d<a.length;d++){for(e=0;e<c.length;e++)if(c[e]===a[d])continue a;c[c.length]=a[d]}return c},merge:function(a,b){var c=a.length,d=0,e;if(isFinite(b.length))for(e=b.length;d<e;d++)a[c++]=b[d];else while(b[d]!==undefined)first[c++]=second[d++];return a.length=c,a},inArray:function(a,b){return!!~j.indexOf(a,b)}},k={fun:function(a){return typeof a=="function"},str:function(a){return typeof a=="string"},ele:function(a){return!!a&&!!a.nodeType&&a.nodeType==1},arr:function(a){return a instanceof Array},arrLike:function(a){return a&&a.length&&isFinite(a.length)},num:function(a){return typeof a=="number"},bool:function(a){return a===!0||a===!1},args:function(a){return!!a&&!!d.call(a,"callee")},emp:function(a){var b=0;return k.arr(a)?a.length===0:k.obj(a)?function(){for(var c in a){b++;break}return b===0}():a===""},dat:function(a){return!!(a&&a.getTimezoneOffset&&a.setUTCFullYear)},reg:function(a){return!(!(a&&a.test&&a.exec)||!a.ignoreCase&&a.ignoreCase!==!1)},nan:function(a){return a!==a},nil:function(a){return a===e},und:function(a){return typeof a=="undefined"},def:function(a){return typeof a!="undefined"},obj:function(a){return a instanceof Object&&!k.fun(a)&&!k.arr(a)}},m={each:function(a,b,c){k.arrLike(a)?j.each(a,b,c):function(){for(var e in a)d.call(a,e)&&b.call(c,e,a[e],a)}()},map:function(a,b,c){var e=[],f=0;return k.arrLike(a)?j.map(a,b,c):!function(){for(var g in a)d.call(a,g)&&(e[f++]=b.call(c,g,a[g],a))}()&&e},pluck:function(a,b){return k.arrLike(a)?j.map(a,function(a){return a[b]}):m.map(a,function(a,c){return c[b]})},toArray:function(a){return a?k.arr(a)?a:a.toArray?a.toArray():k.args(a)?f.call(a):j.map(a,function(a){return a}):[]},first:function(a){return a[0]},last:function(a){return a[a.length-1]},keys:Object.keys?function(a){return Object.keys(a)}:function(a){var b=[],c;for(c in a)d.call(a,c)&&(b[b.length]=c);return b},values:function(a){return m.map(a,function(a,b){return b})},extend:function(){var a,b,c,d,f,g=arguments[0],h=1,i=arguments.length;for(;h<i;h++)if((a=arguments[h])!==e)for(b in a){c=g[b],d=a[b];if(g===d)continue;d&&k.obj(d)?(f=c&&k.obj(c)?c:{},g[b]=m.extend(f,d)):d!==undefined&&(g[b]=d)}return g},trim:String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(i,"")},bind:function(a,b){var c=arguments.length>2?f.call(arguments,2):null;return function(){return b.apply(a,c?c.concat(f.call(arguments)):arguments)}},curry:function(a){if(arguments.length==1)return a;var b=f.call(arguments,1);return function(){return a.apply(null,b.concat(f.call(arguments)))}},parallel:function(a,b){var c=m.toArray(arguments),d=0,f=[],g=[];if(k.arr(a)&&a.length===0||k.fun(a)&&c.length===1)throw new TypeError("Empty parallel array");k.arr(a)||(b=c.pop(),a=c),j.each(a,function(c,h){c(function(){var c=m.toArray(arguments),i=c.shift();if(i)return b(i);f[h]=c,a.length==++d&&(f.unshift(e),j.each(f,function(a){g=g.concat(a)}),b.apply(e,g))})})},waterfall:function(a,b){var c=m.toArray(arguments),d=0;if(k.arr(a)&&a.length===0||k.fun(a)&&c.length===1)throw new TypeError("Empty waterfall array");k.arr(a)||(b=c.pop(),a=c),function f(){var c=m.toArray(arguments);c.push(f);var d=c.shift();!d&&a.length?a.shift().apply(e,c):(c.pop(),c.unshift(d),b.apply(e,c))}(e)},queue:function(a){return new n(k.arrLike(a)?a:m.toArray(arguments))}};return n.prototype.next=function(){return this.index<this.values.length&&this.values[this.index++](),this},p(o,j),p(o,m),o.is=k,o.v=o,o.each(o.extend({},j,m),function(a,b){q.prototype[a]=function(){var a=o.toArray(arguments);a.unshift(this.val);var c=b.apply(this._scope,a);return this.val=c,this._chained?this:c}}),p(q.prototype,{chain:function(){return this._chained=1,this},value:function(){return this.val}}),o.noConflict=function(){return a.v=b,this},o})
(function(e,t,n){typeof module!="undefined"?module.exports=n():typeof define=="function"?define(n):t[e]=t.v=n()})("valentine",this,function(){function p(e){this.values=e,this.index=0}function d(e,t){return new m(e,t)}function v(e,t){for(var n in t)e[n]=t[n]}function m(e,t){this.val=e,this._scope=t||i,this._chained=0}var e=this,t=e.v,n=[],r=Object.prototype.hasOwnProperty,i=null,s=n.slice,o="map"in n,u="reduce"in n,a=/(^\s*|\s*$)/g,f={each:o?function(e,t,r){n.forEach.call(e,t,r)}:function(e,t,n){for(var r=0,i=e.length;r<i;r++)r in e&&t.call(n,e[r],r,e)},map:o?function(e,t,r){return n.map.call(e,t,r)}:function(e,t,n){var r=[],i;for(i=0,l=e.length;i<l;i++)i in e&&(r[i]=t.call(n,e[i],i,e));return r},some:o?function(e,t,n){return e.some(t,n)}:function(e,t,n){for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r,e))return!0;return!1},every:o?function(e,t,n){return e.every(t,n)}:function(e,t,n){for(var r=0,i=e.length;r<i;r++)if(r in e&&!t.call(n,e[r],r,e))return!1;return!0},filter:o?function(e,t,n){return e.filter(t,n)}:function(e,t,n){for(var r=[],i=0,s=0,o=e.length;i<o;i++)if(i in e){if(!t.call(n,e[i],i,e))continue;r[s++]=e[i]}return r},indexOf:o?function(e,t,n){return e.indexOf(t,isFinite(n)?n:0)}:function(e,t,n){n=n||0,n=n<0?0:n,n=n>e.length?e.length:n;for(var r=n;r<e.length;r++)if(r in e&&e[r]===t)return r;return-1},lastIndexOf:o?function(e,t,n){return e.lastIndexOf(t,isFinite(n)?n:e.length)}:function(e,t,n){n=n||e.length,n=n>=e.length?e.length:n<0?e.length+n:n;for(var r=n;r>=0;--r)if(r in e&&e[r]===t)return r;return-1},reduce:u?function(e,t,r,i){return n.reduce.call(e,t,r,i)}:function(e,t,n,r){e||(e=[]);var i=0,s=e.length;if(arguments.length<3)do{if(i in e){n=e[i++];break}if(++i>=s)throw new TypeError("Empty array")}while(1);for(;i<s;i++)i in e&&(n=t.call(r,n,e[i],i,e));return n},reduceRight:u?function(e,t,r,i){return n.reduceRight.call(e,t,r,i)}:function(e,t,n,r){!e&&(e=[]);var i=e.length,s=i-1;if(arguments.length<3)do{if(s in e){n=e[s--];break}if(--s<0)throw new TypeError("Empty array")}while(1);for(;s>=0;s--)s in e&&(n=t.call(r,n,e[s],s,e));return n},find:function(e,t,n){var r;return f.some(e,function(e,i,s){if(t.call(n,e,i,s))return r=e,!0}),r},reject:function(e,t,n){var r=[];for(var i=0,s=0,o=e.length;i<o;i++)if(i in e){if(t.call(n,e[i],i,e))continue;r[s++]=e[i]}return r},size:function(e){return h.toArray(e).length},compact:function(e){return f.filter(e,function(e){return!!e})},flatten:function(e){return f.reduce(e,function(e,t){return c.arr(t)?e.concat(f.flatten(t)):(e[e.length]=t,e)},[])},uniq:function(e,t){var n=[],r,i;e=t?f.map(e,t):e;e:for(r=0;r<e.length;r++){for(i=0;i<n.length;i++)if(n[i]===e[r])continue e;n[n.length]=e[r]}return n},merge:function(e,t){var n=e.length,r=0,i;if(isFinite(t.length))for(i=t.length;r<i;r++)e[n++]=t[r];else while(t[r]!==undefined)first[n++]=second[r++];return e.length=n,e},inArray:function(e,t){return!!~f.indexOf(e,t)}},c={fun:function(e){return typeof e=="function"},str:function(e){return typeof e=="string"},ele:function(e){return!!e&&!!e.nodeType&&e.nodeType==1},arr:function(e){return e instanceof Array},arrLike:function(e){return e&&e.length&&isFinite(e.length)},num:function(e){return typeof e=="number"},bool:function(e){return e===!0||e===!1},args:function(e){return!!e&&!!r.call(e,"callee")},emp:function(e){var t=0;return c.arr(e)?e.length===0:c.obj(e)?function(){for(var n in e){t++;break}return t===0}():e===""},dat:function(e){return!!(e&&e.getTimezoneOffset&&e.setUTCFullYear)},reg:function(e){return!(!(e&&e.test&&e.exec)||!e.ignoreCase&&e.ignoreCase!==!1)},nan:function(e){return e!==e},nil:function(e){return e===i},und:function(e){return typeof e=="undefined"},def:function(e){return typeof e!="undefined"},obj:function(e){return e instanceof Object&&!c.fun(e)&&!c.arr(e)}},h={each:function(e,t,n){c.arrLike(e)?f.each(e,t,n):function(){for(var i in e)r.call(e,i)&&t.call(n,i,e[i],e)}()},map:function(e,t,n){var i=[],s=0;return c.arrLike(e)?f.map(e,t,n):!function(){for(var o in e)r.call(e,o)&&(i[s++]=t.call(n,o,e[o],e))}()&&i},pluck:function(e,t){return c.arrLike(e)?f.map(e,function(e){return e[t]}):h.map(e,function(e,n){return n[t]})},toArray:function(e){return e?c.arr(e)?e:e.toArray?e.toArray():c.args(e)?s.call(e):f.map(e,function(e){return e}):[]},first:function(e){return e[0]},last:function(e){return e[e.length-1]},keys:Object.keys?function(e){return Object.keys(e)}:function(e){var t=[],n;for(n in e)r.call(e,n)&&(t[t.length]=n);return t},values:function(e){return h.map(e,function(e,t){return t})},extend:function(){var e,t,n,r,s,o=arguments[0],u=1,a=arguments.length;for(;u<a;u++)if((e=arguments[u])!==i)for(t in e){n=o[t],r=e[t];if(o===r)continue;r&&c.obj(r)?(s=n&&c.obj(n)?n:{},o[t]=h.extend(s,r)):r!==undefined&&(o[t]=r)}return o},trim:String.prototype.trim?function(e){return e.trim()}:function(e){return e.replace(a,"")},bind:function(e,t){var n=arguments.length>2?s.call(arguments,2):null;return function(){return t.apply(e,n?n.concat(s.call(arguments)):arguments)}},curry:function(e){if(arguments.length==1)return e;var t=s.call(arguments,1);return function(){return e.apply(null,t.concat(s.call(arguments)))}},parallel:function(e,t){var n=h.toArray(arguments),r=0,s=[],o=[];if(c.arr(e)&&e.length===0||c.fun(e)&&n.length===1)throw new TypeError("Empty parallel array");c.arr(e)||(t=n.pop(),e=n),f.each(e,function(n,u){n(function(){var n=h.toArray(arguments),a=n.shift();if(a)return t(a);s[u]=n,e.length==++r&&(s.unshift(i),f.each(s,function(e){o=o.concat(e)}),t.apply(i,o))})})},waterfall:function(e,t){var n=h.toArray(arguments),r=0;if(c.arr(e)&&e.length===0||c.fun(e)&&n.length===1)throw new TypeError("Empty waterfall array");c.arr(e)||(t=n.pop(),e=n),function s(){var n=h.toArray(arguments);n.push(s);var r=n.shift();!r&&e.length?e.shift().apply(i,n):(n.pop(),n.unshift(r),t.apply(i,n))}(i)},queue:function(e){return new p(c.arrLike(e)?e:h.toArray(arguments))}};return p.prototype.next=function(){return this.index<this.values.length&&this.values[this.index++](),this},v(d,f),v(d,h),d.is=c,d.v=d,d.each(d.extend({},f,h),function(e,t){m.prototype[e]=function(){var e=d.toArray(arguments);e.unshift(this.val);var n=t.apply(this._scope,e);return this.val=n,this._chained?this:n}}),v(m.prototype,{chain:function(){return this._chained=1,this},value:function(){return this.val}}),d.noConflict=function(){return e.v=t,this},d})
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