Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@extra-array/head.min

Package Overview
Dependencies
Maintainers
1
Versions
382
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@extra-array/head.min - npm Package Compare versions

Comparing version
2.9.12
to
2.9.21
+2
-1
index.d.ts
/**
* Gets first value.
* @param x an array
* @param vd default value
*/
declare function head<T>(x: T[]): T;
declare function head<T>(x: T[], vd?: T): T;
export default head;
//# sourceMappingURL=index.d.ts.map

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

{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,iBAAS,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAE1B;AACD,eAAe,IAAI,CAAC"}
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,iBAAS,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAElC;AACD,eAAe,IAAI,CAAC"}

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

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).array_head=e()}}(function(){return function(){return function e(n,r,t){function o(i,u){if(!r[i]){if(!n[i]){var d="function"==typeof require&&require;if(!u&&d)return d(i,!0);if(f)return f(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var p=r[i]={exports:{}};n[i][0].call(p.exports,function(e){return o(n[i][1][e]||e)},p,p.exports,e,n,r,t)}return r[i].exports}for(var f="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}}()({1:[function(e,n,r){"use strict";n.exports=function(e){return e[0]}},{}]},{},[1])(1)});
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).array_head=e()}}(function(){return function(){return function e(n,r,t){function o(i,u){if(!r[i]){if(!n[i]){var d="function"==typeof require&&require;if(!u&&d)return d(i,!0);if(f)return f(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[i]={exports:{}};n[i][0].call(l.exports,function(e){return o(n[i][1][e]||e)},l,l.exports,e,n,r,t)}return r[i].exports}for(var f="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}}()({1:[function(e,n,r){"use strict";n.exports=function(e,n){return e.length>0?e[0]:n}},{}]},{},[1])(1)});

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

{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,SAAS,IAAI,CAAI,CAAM;IACrB,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AACd,CAAC;AACD,eAAe,IAAI,CAAC"}
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,SAAS,IAAI,CAAI,CAAM,EAAE,EAAM;IAC7B,OAAO,CAAC,CAAC,MAAM,GAAC,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC/B,CAAC;AACD,eAAe,IAAI,CAAC"}
/**
* Gets first value.
* @param x an array
* @param vd default value
*/
function head(x) {
return x[0];
function head(x, vd) {
return x.length > 0 ? x[0] : vd;
}
export default head;
//# sourceMappingURL=index.js.map
/**
* Gets first value.
* @param x an array
* @param vd default value
*/
function head<T>(x: T[]): T {
return x[0];
function head<T>(x: T[], vd?: T): T {
return x.length>0? x[0] : vd;
}
export default head;
{
"name": "@extra-array/head.min",
"version": "2.9.12",
"version": "2.9.21",
"description": "Gets first value.",

@@ -18,2 +18,10 @@ "main": "index.js",

"array",
"accumulate",
"bsearch",
"bsearchAny",
"bsearchClosest",
"bsearchRight",
"bubbleSort",
"cartesianProduct",
"chunk",
"head"

@@ -20,0 +28,0 @@ ],