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

@hashicorp/hashi-basic-list

Package Overview
Dependencies
Maintainers
13
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hashicorp/hashi-basic-list - npm Package Compare versions

Comparing version 1.0.5 to 2.0.0-alpha.0

114

dist/index.js

@@ -5,80 +5,58 @@ 'use strict';

var preact = require('preact');
var reshapePreactComponents = require('reshape-preact-components');
var React = _interopDefault(require('react'));
var strftime = _interopDefault(require('strftime'));
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _extends() {
_extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
function BasicList(_ref) {
var _data = _ref._data,
var data = _ref.data,
_ref$date_icon = _ref.date_icon,
date_icon = _ref$date_icon === undefined ? 'true' : _ref$date_icon,
date_icon = _ref$date_icon === void 0 ? 'true' : _ref$date_icon,
expire_old = _ref.expire_old;
var data = reshapePreactComponents.decode(_data);
var today = new Date();
var dateIcon = date_icon === 'true' || date_icon === true;
return preact.h(
'ul',
{ 'class': 'g-basic-list' },
data.reduce(function (acc, d) {
var date = d.date ? new Date(d.date) : null;
var renderTopSection = dateIcon && d.location || !dateIcon && date || d.detail;
if (expire_old && date && today.getTime() > date.getTime()) return acc;
acc.push(preact.h(
'li',
{ 'data-id': d.id ? d.id : '' },
date && dateIcon && preact.h(
'div',
{ 'class': 'date' },
preact.h(
'span',
null,
strftime('%d', date)
),
preact.h(
'span',
null,
strftime('%b', date)
)
),
preact.h(
'a',
_extends({}, d.url && { href: d.url }, d.url && d.external && { target: '_blank', rel: 'noopener' }),
preact.h(
'div',
{ 'class': 'content' },
renderTopSection && preact.h(
'div',
{ 'class': 'top' },
!dateIcon && date && preact.h(
'span',
null,
strftime('%d %b %Y', date)
),
d.location && preact.h(
'span',
null,
preact.h('i', { 'class': 'pin' }),
d.location
),
d.detail && preact.h(
'span',
null,
d.detail
)
),
preact.h(
'div',
{ 'class': 'title' },
d.title
)
)
)
));
return acc;
}, [])
);
return React.createElement("ul", {
className: "g-basic-list"
}, data.reduce(function (acc, d) {
var date = d.date ? new Date(d.date) : null;
var renderTopSection = dateIcon && d.location || !dateIcon && date || d.detail;
if (expire_old && date && today.getTime() > date.getTime()) return acc;
acc.push(React.createElement("li", {
"data-id": d.id ? d.id : ''
}, date && dateIcon && React.createElement("div", {
className: "date"
}, React.createElement("span", null, strftime('%d', date)), React.createElement("span", null, strftime('%b', date))), React.createElement("a", _extends({}, d.url && {
href: d.url
}, d.url && d.external && {
target: '_blank',
rel: 'noopener'
}), React.createElement("div", {
className: "content"
}, renderTopSection && React.createElement("div", {
className: "top"
}, !dateIcon && date && React.createElement("span", null, strftime('%d %b %Y', date)), d.location && React.createElement("span", null, React.createElement("i", {
className: "pin"
}), d.location), d.detail && React.createElement("span", null, d.detail)), React.createElement("div", {
className: "title"
}, d.title)))));
return acc;
}, []));
}
module.exports = BasicList;
{
"name": "@hashicorp/hashi-basic-list",
"description": "simple vertical list with optional date and location render",
"version": "1.0.5",
"version": "2.0.0-alpha.0",
"dependencies": {
"react": "^16.8.6",
"strftime": "^0.10.0"
},
"main": "dist",
"peerDependencies": {
"@hashicorp/hashi-global-styles": "^1.0.0",
"preact": "^8.2.7",
"reshape-preact-components": "~0.6.0",
"strftime": "~0.10.0"
},
"publishConfig": {

@@ -18,3 +16,3 @@ "access": "public"

},
"gitHead": "4737f67310fbdaa36a8b3e478d29faee87edccf7"
"gitHead": "5f9b5a0487251e5846a3eabd9ff839d3fe7e1e31"
}

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