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

door43-rc

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

door43-rc - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

__mocks__/archiver.js

23

__tests__/container-tests.js
'use strict';
jest.unmock('../lib/container');
jest.mock('fs');
jest.unmock('../lib/main');
describe('Container', () => {
let fs;
let rc;
// TODO: write some tests
beforeEach(() => {
fs = require('fs');
rc = require('../');
fs.writeFileSync('res/container/');
fs.writeFileSync('res/container/package.json', JSON.stringify({
package_version: rc.tools.spec.version
}));
fs.writeFileSync('res/container/content/config.yml', '---');
});
it('should load a container', () => {
let container_path = 'res/container';
return rc.load(container_path)
.then(function(container) {
expect(container.path).toEqual(container_path);
});
});
});

@@ -20,2 +20,4 @@ 'use strict';

const content_dir = 'content';
/**

@@ -48,3 +50,3 @@ * Returns a properly formatted container slug.

try {
config_yaml = fs.readFileSync(path.join(container_directory, 'config.yml'));
config_yaml = fs.readFileSync(path.join(container_directory, content_dir, 'config.yml'));
} catch (err){

@@ -168,3 +170,3 @@ console.error(err);

if(fileUtils.fileExists(container_archive)) {
return loadContainer(container_directory, opts);
return loadContainer(container_directory);
}

@@ -247,2 +249,4 @@ if(opts.compression_method === 'zip') {

type: props.container_type,
// TRICKY: resource.modified_at comes from the format.modified_at in resource.formats.
// we assume this to have been normalized before hand.
modified_at: props.resource.modified_at,

@@ -419,2 +423,16 @@ content_mime_type: mimeType,

/**
* Reads the resource container info without opening it.
*
* @param container_path {string} path to the container archive or directory
* @returns {Promise.<{}>} the resource container info (package.json)
*/
function inspectContainer(container_path) {
return new Promise(function(resolve, reject) {
// TODO: look in the container and get the package info
throw new Error('Not implemented');
// return {};
});
}
module.exports = {

@@ -426,2 +444,3 @@ load: loadContainer,

tools: {
inspect: inspectContainer,
convertResource: convertResource,

@@ -428,0 +447,0 @@ makeSlug: containerSlug,

4

package.json
{
"name": "door43-rc",
"version": "0.2.0",
"version": "0.3.0",
"description": "A utility for managing Door43 Resource Containers",
"main": "./lib/container.js",
"main": "./lib/main.js",
"scripts": {

@@ -7,0 +7,0 @@ "test": "jest"

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