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

@wmfs/pg-delta-file

Package Overview
Dependencies
Maintainers
1
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wmfs/pg-delta-file - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

test/fixtures/expected/with-header.csv

26

CHANGELOG.md

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

# [1.3.0](https://github.com/wmfs/pg-delta-file/compare/v1.2.0...v1.3.0) (2018-08-14)
### ✨ Features
* Added support for fixed header and footer rows ([0345970](https://github.com/wmfs/pg-delta-file/commit/0345970))
### 🛠 Builds
* **deps-dev:** update [@semantic-release](https://github.com/semantic-release)/changelog requirement to 3.0.0 ([bd0ca70](https://github.com/wmfs/pg-delta-file/commit/bd0ca70))
* **deps-dev:** update [@semantic-release](https://github.com/semantic-release)/git requirement to 7.0.1 ([af28ffb](https://github.com/wmfs/pg-delta-file/commit/af28ffb))
* **deps-dev:** update [@wmfs](https://github.com/wmfs)/hl-pg-client requirement to 1.1.3 ([3f44b03](https://github.com/wmfs/pg-delta-file/commit/3f44b03))
* **deps-dev:** update semantic-release requirement from 15.9.3 to 15.9.5 ([26de657](https://github.com/wmfs/pg-delta-file/commit/26de657))
* **deps-dev:** update semantic-release requirement from 15.9.5 to 15.9.6 ([ebcd1f2](https://github.com/wmfs/pg-delta-file/commit/ebcd1f2))
* **deps-dev:** update semantic-release requirement from 15.9.6 to 15.9.7 ([334f97a](https://github.com/wmfs/pg-delta-file/commit/334f97a))
* **deps-dev:** update semantic-release requirement from 15.9.7 to 15.9.8 ([51e5785](https://github.com/wmfs/pg-delta-file/commit/51e5785))
* **deps-dev:** update semantic-release requirement to 15.9.1 ([2515f54](https://github.com/wmfs/pg-delta-file/commit/2515f54))
* **deps-dev:** update semantic-release requirement to 15.9.2 ([f1ed3a5](https://github.com/wmfs/pg-delta-file/commit/f1ed3a5))
* **deps-dev:** update semantic-release requirement to 15.9.3 ([0057108](https://github.com/wmfs/pg-delta-file/commit/0057108))
### ♻️ Chores
* codecov 3.0.2 -> 3.0.4 ([a4dc745](https://github.com/wmfs/pg-delta-file/commit/a4dc745))
# [1.2.0](https://github.com/wmfs/pg-delta-file/compare/v1.1.0...v1.2.0) (2018-07-25)

@@ -2,0 +28,0 @@

@@ -13,2 +13,7 @@ const fs = require('fs')

for (const model of Object.keys(options.csvExtracts)) {
if ((model === '-HEADER-') || (model === '-FOOTER-')) {
writeHeaderLine(info, model, options, deltaFileWriteStream)
continue
}
await extractModel(info, model, options, deltaFileWriteStream)

@@ -23,2 +28,8 @@ }

function writeHeaderLine (info, model, options, outStream) {
const csvTransformer = new Transformer(info, model, options)
csvTransformer.pipe(outStream, {end: false})
csvTransformer.write('DUMMY')
} // writeHeaderLine
function extractModel (info, model, options, outStream) {

@@ -25,0 +36,0 @@ const modified = options.modifiedColumnName || '_modified'

12

package.json
{
"name": "@wmfs/pg-delta-file",
"version": "1.2.0",
"version": "1.3.0",
"description": "Outputs change-only-update CSV files (or “delta” files) that contain all the necessary actions required to re-synchronize rows in a cloned table.",

@@ -31,3 +31,3 @@ "author": "West Midlands Fire Service",

"chai": "4.1.2",
"codecov": "3.0.2",
"codecov": "3.0.4",
"conventional-changelog-metahub": "2.0.2",

@@ -37,7 +37,7 @@ "cz-conventional-changelog": "2.1.0",

"nyc": "12.0.2",
"semantic-release": "15.7.1",
"semantic-release": "15.9.8",
"standard": "11.0.1",
"@semantic-release/changelog": "2.1.1",
"@semantic-release/git": "6.0.1",
"@wmfs/hl-pg-client": "1.1.2"
"@semantic-release/changelog": "3.0.0",
"@semantic-release/git": "7.0.1",
"@wmfs/hl-pg-client": "1.1.3"
},

@@ -44,0 +44,0 @@ "scripts": {

@@ -74,2 +74,51 @@ /* eslint-env mocha */

it('generate delta file with header', async () => {
const outputFile = path.resolve(__dirname, 'output', 'with-header.csv')
const expectedFile = path.resolve(__dirname, 'fixtures', 'expected', 'with-header.csv')
const info = await generateDelta(
{
namespace: 'springfield',
client: client,
since: '2016-06-03 15:02:38.000000 GMT',
outputFilepath: outputFile,
actionAliases: {
insert: 'i',
update: 'u',
delete: 'd'
},
csvExtracts: {
'-HEADER-': [
'a string',
'$ROW_NUM',
'another string',
999
],
people: [
73,
'$ACTION',
'$ROW_NUM',
'@social_security_id',
'@first_name',
'@last_name',
'@age'
],
'-FOOTER-': [
'all done',
'$ROW_NUM',
0,
0
]
}
}
)
expect(info.totalCount).to.eql(7)
const output = readRecords(outputFile)
const expected = readRecords(expectedFile)
expect(output).to.eql(expected)
})
it('should generate delta file for both tables', async () => {

@@ -76,0 +125,0 @@ const outputFile = path.resolve(__dirname, 'output', 'multiple-delta.csv')

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