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

clubhouse-cli

Package Overview
Dependencies
Maintainers
1
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clubhouse-cli - npm Package Compare versions

Comparing version 0.10.1 to 0.10.2

2

package.json
{
"name": "clubhouse-cli",
"version": "0.10.1",
"version": "0.10.2",
"description": "A command line tool for viewing, creating and updating clubhouse.io stories",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -31,2 +31,13 @@ const chalk = require('chalk');

const project = projects[index];
let created_at = false;
if (program.created)
created_at = parseDateComparator(program.created);
let updated_at = false;
if (program.updated)
updated_at = parseDateComparator(program.updated);
let regexLabel = new RegExp(program.label, 'i');
let regexState = new RegExp(program.state, 'i');
let regexOwner = new RegExp(program.owner, 'i');
let regexText = new RegExp(program.text, 'i');
let regexType = new RegExp(program.type, 'i');
const filtered = stories.map(story => {

@@ -48,22 +59,28 @@ story.project = project;

.map(l => `${l.id},${l.name}`).join(',') + '')
.match(new RegExp(program.label, 'i'))) {
.match(regexLabel)) {
return false;
}
if (!(s.workflow_state_id + ' ' + s.state.name)
.match(new RegExp(program.state, 'i'))) {
.match(regexState)) {
return false;
}
if (program.owner) {
const ownerMatch = new RegExp(program.owner, 'i');
return s.owners.filter(o => {
const owned = s.owners.filter(o => {
return !!`${o.profile.name} ${o.profile.mention_name}`
.match(ownerMatch);
.match(regexOwner);
}).length > 0;
if (!owned) return false;
}
if (!s.name.match(new RegExp(program.text, 'i'))) {
if (!s.name.match(regexText)) {
return false;
}
if (!s.story_type.match(new RegExp(program.type, 'i'))) {
if (!s.story_type.match(regexType)) {
return false;
}
if (created_at && !created_at(s.created_at)) {
return false;
}
if (updated_at && !updated_at(s.updated_at)) {
return false;
}
return true;

@@ -99,3 +116,21 @@ });

const parseDateComparator = (arg) => {
const match = arg.match(/[0-9].*/) || { index: 0, '0': { length: 12 } };
const parsedDate = new Date(arg.slice(match.index));
const comparator = arg.slice(0, match.index);
return (date) => {
switch(comparator) {
case '<':
return new Date(date) < parsedDate;
case '>':
return new Date(date) > parsedDate;
case '=':
default:
return new Date(date.slice(0, match[0].length)).getTime()
== parsedDate.getTime();
}
};
};
module.exports = {

@@ -102,0 +137,0 @@ listStories,

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