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

@endo/compartment-mapper

Package Overview
Dependencies
Maintainers
5
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@endo/compartment-mapper - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

10

CHANGELOG.md

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

### [0.4.1](https://github.com/endojs/endo/compare/@endo/compartment-mapper@0.4.0...@endo/compartment-mapper@0.4.1) (2021-06-20)
### Bug Fixes
* **compartment-mapper:** Export types properly ([54be905](https://github.com/endojs/endo/commit/54be905895e9ebdae69b7542f6c4d7ff3660c2ea))
* **compartment-mapper:** Propagate explicit types ([289c906](https://github.com/endojs/endo/commit/289c906173a450d608f816ab83e702435ad80057))
## [0.4.0](https://github.com/endojs/endo/compare/@endo/compartment-mapper@0.3.2...@endo/compartment-mapper@0.4.0) (2021-06-16)

@@ -8,0 +18,0 @@

14

package.json
{
"name": "@endo/compartment-mapper",
"version": "0.4.0",
"version": "0.4.1",
"description": "The compartment mapper assembles Node applications in a sandbox",

@@ -42,9 +42,9 @@ "keywords": [

"dependencies": {
"@endo/cjs-module-analyzer": "^0.2.3",
"@endo/static-module-record": "^0.5.3",
"@endo/zip": "^0.2.3",
"ses": "^0.13.3"
"@endo/cjs-module-analyzer": "^0.2.4",
"@endo/static-module-record": "^0.5.4",
"@endo/zip": "^0.2.4",
"ses": "^0.13.4"
},
"devDependencies": {
"@endo/eslint-config": "^0.3.10",
"@endo/eslint-config": "^0.3.11",
"ava": "^3.12.1",

@@ -90,3 +90,3 @@ "babel-eslint": "^10.0.3",

},
"gitHead": "f91c84cde6cfe82c085ebe316da939d04ca74aa4"
"gitHead": "9e01f1b96869b8296eed9c6a408e74132a556449"
}
// @ts-check
/* eslint no-shadow: 0 */
/** @typedef {import('./types.js').ArchiveOptions} ArchiveOptions */
/** @typedef {import('./types.js').ArchiveWriter} ArchiveWriter */
/** @typedef {import('./types.js').CompartmentDescriptor} CompartmentDescriptor */
/** @typedef {import('./types.js').ModuleDescriptor} ModuleDescriptor */
/** @typedef {import('./types.js').ParseFn} ParseFn */
/** @typedef {import('./types.js').ReadFn} ReadFn */
/** @typedef {import('./types.js').ReadPowers} ReadPowers */
/** @typedef {import('./types.js').Sources} Sources */
/** @typedef {import('./types.js').WriteFn} WriteFn */
import { writeZip } from '@endo/zip';

@@ -5,0 +15,0 @@ import { resolve } from './node-module-specifier.js';

// @ts-check
/// <reference types="ses" />
/** @typedef {import('ses').ModuleMapHook} ModuleMapHook */
/** @typedef {import('ses').ResolveHook} ResolveHook */
/** @typedef {import('./types.js').ParseFn} ParseFn */
/** @typedef {import('./types.js').ModuleTransforms} ModuleTransforms */
/** @typedef {import('./types.js').Language} Language */
/** @typedef {import('./types.js').ModuleDescriptor} ModuleDescriptor */
/** @typedef {import('./types.js').CompartmentMapDescriptor} CompartmentMapDescriptor */
/** @typedef {import('./types.js').LinkOptions} LinkOptions */
import { resolve } from './node-module-specifier.js';

@@ -5,0 +13,0 @@ import { parseExtension } from './extension.js';

// @ts-check
/* eslint no-shadow: 0 */
/** @typedef {import('ses').ResolveHook} ResolveHook */
/** @typedef {import('ses').PrecompiledStaticModuleInterface} PrecompiledStaticModuleInterface */
/** @typedef {import('./types.js').ParseFn} ParseFn */
/** @typedef {import('./types.js').CompartmentDescriptor} CompartmentDescriptor */
/** @typedef {import('./types.js').CompartmentSources} CompartmentSources */
/** @typedef {import('./types.js').ReadFn} ReadFn */
/** @typedef {import('./types.js').ModuleTransforms} ModuleTransforms */
/** @typedef {import('./types.js').Sources} Sources */
/** @typedef {import('./types.js').WriteFn} WriteFn */
/** @typedef {import('./types.js').ArchiveOptions} ArchiveOptions */
import { resolve } from './node-module-specifier.js';

@@ -59,3 +70,6 @@ import { compartmentMapForNodeModules } from './node-modules.js';

if (record) {
const { imports = [], reexports = [] } = record;
const {
imports = [],
reexports = [],
} = /** @type {PrecompiledStaticModuleInterface} */ (record);
const resolvedImports = {};

@@ -62,0 +76,0 @@ for (const importSpecifier of [...imports, ...reexports]) {

// @ts-check
/* eslint no-shadow: "off" */
/** @typedef {import('ses').ImportHook} ImportHook */
/** @typedef {import('./types.js').ParseFn} ParseFn */
/** @typedef {import('./types.js').ArchiveReader} ArchiveReader */
/** @typedef {import('./types.js').CompartmentDescriptor} CompartmentDescriptor */
/** @typedef {import('./types.js').Application} Application */
/** @typedef {import('./types.js').CompartmentMapDescriptor} CompartmentMapDescriptor */
/** @typedef {import('./types.js').ExecuteFn} ExecuteFn */
/** @typedef {import('./types.js').ReadFn} ReadFn */
/** @typedef {import('./types.js').ExecuteOptions} ExecuteOptions */
import { readZip } from '@endo/zip';

@@ -5,0 +15,0 @@ import { assemble } from './assemble.js';

// @ts-check
/** @typedef {import('ses').ImportHook} ImportHook */
/** @typedef {import('ses').StaticModuleType} StaticModuleType */
/** @typedef {import('./types.js').ReadFn} ReadFn */
/** @typedef {import('./types.js').Sources} Sources */
/** @typedef {import('./types.js').CompartmentDescriptor} CompartmentDescriptor */
/** @typedef {import('./types.js').ImportHookMaker} ImportHookMaker */
import { parseExtension } from './extension.js';

@@ -8,3 +16,11 @@

const { apply } = Reflect;
const { freeze } = Object;
/**
* TypeScript cannot be relied upon to deal with the nuances of Readonly, so we
* borrow the pass-through type definition of harden here.
*
* @type {import('ses').Harden}
*/
const freeze = Object.freeze;
const { hasOwnProperty } = Object.prototype;

@@ -107,4 +123,7 @@ /**

);
const { parser, bytes: transformedBytes } = envelope;
const { record: concreteRecord } = envelope;
const {
parser,
bytes: transformedBytes,
record: concreteRecord,
} = envelope;

@@ -111,0 +130,0 @@ // Facilitate a redirect if the returned record has a different

// @ts-check
/* eslint no-shadow: "off" */
import './types.js';
/** @typedef {import('./types.js').Application} Application */
/** @typedef {import('./types.js').ArchiveOptions} ArchiveOptions */
/** @typedef {import('./types.js').ExecuteFn} ExecuteFn */
/** @typedef {import('./types.js').ExecuteOptions} ExecuteOptions */
/** @typedef {import('./types.js').ParseFn} ParseFn */
/** @typedef {import('./types.js').ReadFn} ReadFn */
/** @typedef {import('./types.js').ReadPowers} ReadPowers */
import { compartmentMapForNodeModules } from './node-modules.js';

@@ -6,0 +13,0 @@ import { search } from './search.js';

// @ts-check
/** @typedef {import('./types.js').Language} Language */
import { join, relativize } from './node-module-specifier.js';

@@ -4,0 +6,0 @@

// @ts-check
/* eslint no-shadow: 0 */
/** @typedef {import('./types.js').Language} Language */
/** @typedef {import('./types.js').ReadFn} ReadFn */
/** @typedef {import('./types.js').CanonicalFn} CanonicalFn */
/** @typedef {import('./types.js').CompartmentMapDescriptor} CompartmentMapDescriptor */
/** @typedef {import('./types.js').ModuleDescriptor} ModuleDescriptor */
/** @typedef {import('./types.js').ScopeDescriptor} ScopeDescriptor */
/** @typedef {import('./types.js').CompartmentDescriptor} CompartmentDescriptor */
/** @typedef {import('./types.js').ReadPowers} ReadPowers */
/**

@@ -5,0 +14,0 @@ * The graph is an intermediate object model that the functions of this module

// @ts-check
/** @typedef {import('./types.js').ReadPowers} ReadPowers */
/** @typedef {import('./types.js').WritePowers} WritePowers */
/**

@@ -4,0 +7,0 @@ * @param {typeof import('fs')} fs

// @ts-check
/** @typedef {import('ses').ThirdPartyStaticModuleInterface} ThirdPartyStaticModuleInterface */
import { analyzeCommonJS } from '@endo/cjs-module-analyzer';

@@ -10,3 +12,6 @@

/** @type {ParseFn} */
const noopExecute = () => {};
freeze(noopExecute);
/** @type {import('./types.js').ParseFn} */
export const parseArchiveCjs = async (

@@ -43,4 +48,9 @@ bytes,

bytes: pre,
record: freeze({ imports, exports, reexports }),
record: /** @type {ThirdPartyStaticModuleInterface} */ (freeze({
imports: freeze(imports),
exports: freeze(exports),
reexports: freeze(reexports),
execute: noopExecute,
})),
};
};

@@ -8,3 +8,3 @@ // @ts-check

/** @type {ParseFn} */
/** @type {import('./types.js').ParseFn} */
export const parseArchiveMjs = async (

@@ -11,0 +11,0 @@ bytes,

// @ts-check
/// <reference types="ses"/>

@@ -10,3 +9,3 @@ import { analyzeCommonJS } from '@endo/cjs-module-analyzer';

/** @type {ParseFn} */
/** @type {import('./types.js').ParseFn} */
export const parseCjs = async (

@@ -13,0 +12,0 @@ bytes,

@@ -5,7 +5,13 @@ // @ts-check

const { freeze } = Object;
/**
* TypeScript cannot be relied upon to deal with the nuances of Readonly, so we
* borrow the pass-through type definition of harden here.
*
* @type {import('ses').Harden}
*/
const freeze = Object.freeze;
const textDecoder = new TextDecoder();
/** @type {ParseFn} */
/** @type {import('./types.js').ParseFn} */
export const parseJson = async (

@@ -18,3 +24,2 @@ bytes,

const source = textDecoder.decode(bytes);
/** @type {Readonly<Array<string>>} */
const imports = freeze([]);

@@ -31,4 +36,8 @@

bytes,
record: freeze({ imports, exports: freeze(['default']), execute }),
record: freeze({
imports,
exports: freeze(['default']),
execute: freeze(execute),
}),
};
};

@@ -7,3 +7,3 @@ // @ts-check

/** @type {ParseFn} */
/** @type {import('./types.js').ParseFn} */
export const parseMjs = async (

@@ -10,0 +10,0 @@ bytes,

@@ -9,3 +9,3 @@ // @ts-check

/** @type {ParseFn} */
/** @type {import('./types.js').ParseFn} */
export const parsePreCjs = async (

@@ -12,0 +12,0 @@ bytes,

@@ -7,3 +7,3 @@ // @ts-check

/** @type {ParseFn} */
/** @type {import('./types.js').ParseFn} */
export const parsePreMjs = async (

@@ -10,0 +10,0 @@ bytes,

// @ts-check
/** @typedef {import('./types.js').ReadFn} ReadFn */
import { relativize } from './node-module-specifier.js';

@@ -4,0 +6,0 @@ import { relative } from './url.js';

// @ts-check
/// <reference types="ses"/>
export const moduleJSDocTypes = true;
/** @typedef {import('ses').FinalStaticModuleType} FinalStaticModuleType */
/** @typedef {import('ses').ImportHook} ImportHook */
/** @typedef {import('ses').StaticModuleType} StaticModuleType */
/** @typedef {import('ses').Transform} Transform */
// /////////////////////////////////////////////////////////////////////////////

@@ -219,3 +226,3 @@

* @property {string} [exit]
* @property {FinalStaticModuleType} [record]
* @property {StaticModuleType} [record]
*/

@@ -222,0 +229,0 @@

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