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

cjt

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cjt - npm Package Compare versions

Comparing version 1.1.5 to 1.2.0

9

dist/cjt.js

@@ -26,5 +26,8 @@ 'use strict';

var format = function format(row, sep) {
var r = _.map(row, _.trim);
var h = _.join(r, sep);
return '' + sep + h + sep;
var r1 = _.map(row, _.trim);
var r2 = _.map(r1, function (r) {
return _.isEmpty(r) ? ' ' : r;
});
var s = _.join(r2, sep);
return '' + sep + s + sep;
};

@@ -31,0 +34,0 @@

@@ -5,3 +5,3 @@ 'use strict';

var argparse = require('argparse');
var cjt = require('cjt');
var cjt = require('./cjt');

@@ -8,0 +8,0 @@ var printJt = function printJt(err, data) {

{
"name": "cjt",
"version": "1.1.5",
"version": "1.2.0",
"description": "A library to convert CSV text to Jira's table notation",

@@ -25,4 +25,4 @@ "main": "dist/index.js",

"lint": "standard --env mocha --fix",
"watch": "onchange '*.json' --delay 1000 'src/*' -- npm run build",
"build": "npm run lint && babel src/ -d dist/ --presets=env",
"watch": "onchange '*.json' --delay 1000 'src/*' 'test/*' -- npm run build",
"build": "npm run lint && npm run test && babel src/ -d dist/ --presets=env",
"start": "npm run build && npm run watch"

@@ -29,0 +29,0 @@ },

@@ -38,1 +38,4 @@ # cjt

## Related App
- [cjt \- Chrome Web Store](https://chrome.google.com/webstore/detail/cjt/pagmnllnggjajagmlelanjlbompjelmd)

@@ -29,5 +29,6 @@ 'use strict'

const format = (row, sep) => {
const r = _.map(row, _.trim)
const h = _.join(r, sep)
return `${sep}${h}${sep}`
const r1 = _.map(row, _.trim)
const r2 = _.map(r1, (r) => { return _.isEmpty(r) ? ' ' : r })
const s = _.join(r2, sep)
return `${sep}${s}${sep}`
}

@@ -34,0 +35,0 @@

@@ -5,3 +5,3 @@ 'use strict'

const argparse = require('argparse')
const cjt = require('cjt')
const cjt = require('./cjt')

@@ -8,0 +8,0 @@ const printJt = (err, data) => {

@@ -19,4 +19,5 @@ 'use strict'

})
describe('Convert CSV string to Jira\'s table notation', () => {
it('should return index when the value is present', () => {
it('should convert correctly', () => {
assert.equal(cjt.convert(csv), jiraTable)

@@ -27,2 +28,14 @@ })

})
it('should handle the blank CSV field', () => {
csv = `
heading 1,heading 2,heading 3
col A1,,col A3
col B1,col B2,col B3
`
jiraTable =
'||heading 1||heading 2||heading 3||' +
'\n|col A1| |col A3|' +
'\n|col B1|col B2|col B3|'
assert.equal(cjt.convert(`\n\n${csv}\n\n`), jiraTable)
})
it('should return zero-length string when the input is empty', () => {

@@ -29,0 +42,0 @@ assert.equal(cjt.convert(''), '')

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