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

@bes/snap

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bes/snap - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

3

package.json
{
"name": "@bes/snap",
"version": "1.0.1",
"version": "1.1.0",
"description": "Simple snapshot utility used in boilreact",

@@ -15,2 +15,3 @@ "main": "src/index.js",

"devDependencies": {
"history": "^4.6.1",
"node-notifier": "^5.1.2",

@@ -17,0 +18,0 @@ "nodemon": "^1.11.0",

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

return ({ numId, body, mess }) => {
return ({ numId, body, mess, history }) => {

@@ -38,2 +38,6 @@ const current = jsonStore[numId];

jsonStore[numId] = { mess, numId };
if(history !== undefined) {
const { pathname, search } = history.location;
jsonStore[numId]['href'] = `${pathname}${search}`;
}
fs.writeFileSync(`${outputDir}/${numId}.html`,prettyBody);

@@ -40,0 +44,0 @@ fs.writeJsonSync(outputFile,jsonStore,opts['json']);

const test = require('tape');
const fs = require('fs-extra');
const { createMemoryHistory } = require('history');

@@ -44,1 +45,25 @@ const snap = require('../src');

});
test('Save url/href of history', t => {
const history = createMemoryHistory();
history.push('/profile?the=query');
takeSnap({
numId:'002',
mess:'Hello, History!',
body:'<h1>Hello, History!</h1>',
history:history
});
const snapJson = fs.readJsonSync(`${DIR_TEST}/snap.json`);
t.deepEqual(snapJson['002'],{
mess: 'Hello, History!',
numId: '002',
href: '/profile?the=query',
},'snapJson with href updated successfully');
t.end();
});

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