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

baset-core

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

baset-core - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

src/types/json-beautify.d.ts

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

<a name="0.2.2"></a>
## [0.2.2](https://github.com/Igmat/baset/compare/v0.2.1...v0.2.2) (2018-01-22)
### Bug Fixes
* **Core:** Adding beautifier for JSON output and using relative pathes in console ([bc81077](https://github.com/Igmat/baset/commit/bc81077))
<a name="0.2.1"></a>

@@ -8,0 +19,0 @@ ## [0.2.1](https://github.com/Igmat/baset/compare/v0.2.0...v0.2.1) (2018-01-18)

14

dist/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const fs = require("fs");
const beautify = require("json-beautify");
const path = require("path");
function test(specs, baselines) {
const files = specs.map(name => ({
name,
output: JSON.stringify(require(name)),
output: beautify(require(path.resolve(name)), undefined, 4, 20),
}));
files.forEach(file => {
const baselinePath = file.name.replace(/.spec.js$/, '.base');
const baselinePath = path.resolve(file.name.replace(/.spec.js$/, '.base'));
const baseline = fs.existsSync(baselinePath)
? fs.readFileSync(baselinePath, { encoding: 'utf-8' })
: false;
fs.writeFile(file.name.replace(/.spec.js$/, '.base.tmp'), file.output, err => {
fs.writeFile(path.resolve(file.name.replace(/.spec.js$/, '.base.tmp')), file.output, err => {
if (err)

@@ -29,7 +31,7 @@ return console.log(err);

files.forEach(file => {
const baseline = fs.readFileSync(file, { encoding: 'utf-8' });
const baseline = fs.readFileSync(path.resolve(file), { encoding: 'utf-8' });
const filePath = file.replace(/.tmp$/, '');
fs.writeFile(filePath, baseline, err => {
fs.writeFile(path.resolve(filePath), baseline, err => {
console.log(err || `Baseline ${filePath} is written.`);
fs.unlinkSync(file);
fs.unlinkSync(path.resolve(file));
});

@@ -36,0 +38,0 @@ });

{
"name": "baset-core",
"version": "0.2.1",
"version": "0.2.2",
"description": "",

@@ -17,5 +17,9 @@ "main": "dist/index.js",

"@types/node": "^9.3.0",
"baset": "^0.2.2",
"tslint": "^5.9.1",
"typescript": "^2.6.2"
},
"dependencies": {
"json-beautify": "^1.0.1"
}
}
import * as fs from 'fs';
import * as beautify from 'json-beautify';
import * as path from 'path';

@@ -6,6 +8,6 @@ export function test(specs: string[], baselines: string[]) {

name,
output: JSON.stringify(require(name)),
output: beautify(require(path.resolve(name)), undefined, 4, 20),
}));
files.forEach(file => {
const baselinePath = file.name.replace(/.spec.js$/, '.base');
const baselinePath = path.resolve(file.name.replace(/.spec.js$/, '.base'));
const baseline = fs.existsSync(baselinePath)

@@ -15,3 +17,3 @@ ? fs.readFileSync(baselinePath, { encoding: 'utf-8'})

fs.writeFile(
file.name.replace(/.spec.js$/, '.base.tmp'),
path.resolve(file.name.replace(/.spec.js$/, '.base.tmp')),
file.output,

@@ -31,12 +33,12 @@ err => {

files.forEach(file => {
const baseline = fs.readFileSync(file, { encoding: 'utf-8' });
const baseline = fs.readFileSync(path.resolve(file), { encoding: 'utf-8' });
const filePath = file.replace(/.tmp$/, '');
fs.writeFile(
filePath,
path.resolve(filePath),
baseline,
err => {
console.log(err || `Baseline ${filePath} is written.`);
fs.unlinkSync(file);
fs.unlinkSync(path.resolve(file));
});
});
}

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