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

broccoli-output-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

broccoli-output-wrapper - npm Package Compare versions

Comparing version 3.2.0 to 3.2.1

7

dist/index.js

@@ -20,3 +20,4 @@ "use strict";

'symlinkSync',
'utimesSync'
'utimesSync',
'outputFileSync'
]);

@@ -41,2 +42,6 @@ function handleFs(target, propertyName, node, relativePath, ...fsArguments) {

return symlinkOrCopySync(srcPath, outputPath);
case 'outputFileSync':
const content = fsArguments[0];
fsArguments.shift();
return fs_extra_1.outputFileSync(outputPath, content, ...fsArguments);
case 'rmdirSync':

@@ -43,0 +48,0 @@ if (fsArguments[0] && fsArguments[0].recursive) {

2

package.json
{
"name": "broccoli-output-wrapper",
"version": "3.2.0",
"version": "3.2.1",
"description": "Output wrapper is a library to write output file to outputpath.",

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

@@ -26,2 +26,3 @@ # broccoli-output-wrapper

We have polyfilled `recursive: true` option to perform a recursive directory removal. In recursive mode, errors are not reported if path does not exist, and operations are retried on failure. Default: false
* [symlinkOrCopySync](https://github.com/broccolijs/node-symlink-or-copy#node-symlink-or-copy)
* [symlinkOrCopySync](https://github.com/broccolijs/node-symlink-or-copy#node-symlink-or-copy)
* [outputFileSync](https://github.com/jprichardson/node-fs-extra/blob/master/docs/outputFile-sync.md)
import * as fs from 'fs';
import { isAbsolute, resolve } from 'path';
import { readFileSync, existsSync, readdirSync, lstatSync, statSync, writeFileSync, appendFileSync, rmdirSync, mkdirSync, symlinkSync, utimesSync } from 'fs';
import { removeSync } from 'fs-extra';
import { removeSync, outputFileSync } from 'fs-extra';
const symlinkOrCopySync = require('symlink-or-copy').sync;

@@ -22,3 +22,4 @@

'symlinkSync',
'utimesSync'
'utimesSync',
'outputFileSync'
]);

@@ -46,2 +47,6 @@

return symlinkOrCopySync(srcPath, outputPath);
case 'outputFileSync':
const content = fsArguments[0];
fsArguments.shift();
return outputFileSync(outputPath, content, ...fsArguments);
case 'rmdirSync':

@@ -48,0 +53,0 @@ if (fsArguments[0] && fsArguments[0].recursive) {

@@ -37,3 +37,3 @@ const buildOutputWrapper = require('../src');

expect(() => output.writevSync('test.md', 'test')).to.throw(
/^Operation writevSync is not allowed to use. Allowed operations are readFileSync,existsSync,lstatSync,readdirSync,statSync,writeFileSync,appendFileSync,rmdirSync,mkdirSync,unlinkSync,symlinkOrCopySync,symlinkSync,utimesSync$/
/^Operation writevSync is not allowed to use. Allowed operations are readFileSync,existsSync,lstatSync,readdirSync,statSync,writeFileSync,appendFileSync,rmdirSync,mkdirSync,unlinkSync,symlinkOrCopySync,symlinkSync,utimesSync,outputFileSync$/
);

@@ -68,2 +68,7 @@ });

it('can create file with outputFileSync', function () {
output.outputFileSync(`asset/test.md`, `test`);
expect(output.readFileSync('asset/test.md', 'utf-8')).to.be.equal('test');
});
it(`should throw if the dir strutcture doesn't exist and attempt to write`, function() {

@@ -70,0 +75,0 @@ expect(() => output.writeFileSync('test/test.md', 'test')).to.throw(

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