Socket
Socket
Sign inDemoInstall

modulejs

Package Overview
Dependencies
0
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.7.0 to 2.8.0

.eslintrc.yml

16

dist/modulejs.js

@@ -1,2 +0,2 @@

/*! modulejs v2.7.0 - https://larsjung.de/modulejs/ */
/*! modulejs v2.8.0 - https://larsjung.de/modulejs/ */
(function webpackUniversalModuleDefinition(root, factory) {

@@ -104,3 +104,3 @@ if(typeof exports === 'object' && typeof module === 'object')

assert = _require.assert,
forOwn = _require.forOwn,
for_own = _require.for_own,
has = _require.has,

@@ -149,3 +149,3 @@ resolve = _require.resolve;

var res = {};
forOwn(definitions, function (def, id) {
for_own(definitions, function (def, id) {
res[id] = {

@@ -160,5 +160,5 @@ // direct dependencies

});
forOwn(definitions, function (def, id) {
for_own(definitions, function (def, id) {
var inv = [];
forOwn(definitions, function (def2, id2) {
for_own(definitions, function (def2, id2) {
if (res[id2].reqs.indexOf(id) >= 0) {

@@ -177,3 +177,3 @@ inv.push(id2);

var out = '\n';
forOwn(state(), function (st, id) {
for_own(state(), function (st, id) {
var list = inv ? st.reqd : st.reqs;

@@ -210,3 +210,3 @@ out += "".concat(st.init ? '*' : ' ', " ").concat(id, " -> [ ").concat(list.join(', '), " ]\n");

var forOwn = function forOwn(x, fn) {
var for_own = function for_own(x, fn) {
Object.keys(x).forEach(function (k) {

@@ -280,3 +280,3 @@ return fn(x[k], k);

assert: assert,
forOwn: forOwn,
for_own: for_own,
has: has,

@@ -283,0 +283,0 @@ resolve: resolve,

@@ -1,2 +0,2 @@

/*! modulejs v2.7.0 - https://larsjung.de/modulejs/ */
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("modulejs",[],n):"object"==typeof exports?exports.modulejs=n():e.modulejs=n()}("undefined"!=typeof self?self:this,function(){return function(t){var r={};function o(e){if(r[e])return r[e].exports;var n=r[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=t,o.c=r,o.d=function(e,n,t){o.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(n,e){if(1&e&&(n=o(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var t=Object.create(null);if(o.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var r in n)o.d(t,r,function(e){return n[e]}.bind(null,r));return t},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},o.p="",o(o.s=0)}([function(e,n,t){var r=t(1),o=r.assert,i=r.forOwn,c=r.has,f=r.resolve;e.exports=function e(){function n(){var o={};return i(u,function(e,n){o[n]={deps:e.deps.slice(),reqs:f(u,null,n),init:c(t,n)}}),i(u,function(e,t){var r=[];i(u,function(e,n){0<=o[n].reqs.indexOf(t)&&r.push(n)}),o[t].reqd=r}),o}var u={},t={};return{create:e,define:function(e,n,t){if(void 0===t){var r=[[],n];n=r[0],t=r[1]}o("string"==typeof e,"id must be string: ".concat(e)),o(!c(u,e),"id already defined: ".concat(e)),o(Array.isArray(n),"deps must be array: ".concat(e)),u[e]={id:e,deps:n,fn:"function"==typeof t?t:function(){return t}}},log:function(r){var o="\n";return i(n(),function(e,n){var t=r?e.reqd:e.reqs;o+="".concat(e.init?"*":" "," ").concat(n," -> [ ").concat(t.join(", ")," ]\n")}),o},require:function(e,n){return o("string"==typeof e,"id must be string: ".concat(e)),f(u,n||t,e)},state:n,_d:u,_i:t}}()},function(e,n){function a(e,n){if(!e)throw new Error("[modulejs] ".concat(n))}function s(e,n){return(e||{}).hasOwnProperty(n)}function d(e){var t={};return e.filter(function(e){var n=!t[e];return t[e]=1,n})}e.exports={assert:a,forOwn:function(n,t){Object.keys(n).forEach(function(e){return t(n[e],e)})},has:s,resolve:function t(r,o,e,u){var i=!o;if(!i&&s(o,e))return o[e];var n=r[e];a(n,"id not defined: ".concat(e)),(u=(u||[]).slice()).push(e);var c=[];if(n.deps.forEach(function(e){a(u.indexOf(e)<0,"circular dependencies: ".concat(e," in ").concat(u));var n=t(r,o,e,u);i?(c=c.concat(n)).push(e):c.push(n)}),i)return d(c);var f=n.fn.apply(void 0,c);return o[e]=f},uniq:d}}])});
/*! modulejs v2.8.0 - https://larsjung.de/modulejs/ */
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("modulejs",[],n):"object"==typeof exports?exports.modulejs=n():e.modulejs=n()}("undefined"!=typeof self?self:this,function(){return r={},o.m=t=[function(e,n,t){var r=t(1),o=r.assert,i=r.for_own,c=r.has,f=r.resolve;e.exports=function e(){function n(){var o={};return i(u,function(e,n){o[n]={deps:e.deps.slice(),reqs:f(u,null,n),init:c(t,n)}}),i(u,function(e,t){var r=[];i(u,function(e,n){0<=o[n].reqs.indexOf(t)&&r.push(n)}),o[t].reqd=r}),o}var u={},t={};return{create:e,define:function(e,n,t){var r;void 0===t&&(n=(r=[[],n])[0],t=r[1]),o("string"==typeof e,"id must be string: ".concat(e)),o(!c(u,e),"id already defined: ".concat(e)),o(Array.isArray(n),"deps must be array: ".concat(e)),u[e]={id:e,deps:n,fn:"function"==typeof t?t:function(){return t}}},log:function(r){var o="\n";return i(n(),function(e,n){var t=r?e.reqd:e.reqs;o+="".concat(e.init?"*":" "," ").concat(n," -> [ ").concat(t.join(", ")," ]\n")}),o},require:function(e,n){return o("string"==typeof e,"id must be string: ".concat(e)),f(u,n||t,e)},state:n,_d:u,_i:t}}()},function(e,n){function a(e,n){if(!e)throw new Error("[modulejs] ".concat(n))}function s(e,n){return(e||{}).hasOwnProperty(n)}function d(e){var t={};return e.filter(function(e){var n=!t[e];return t[e]=1,n})}e.exports={assert:a,for_own:function(n,t){Object.keys(n).forEach(function(e){return t(n[e],e)})},has:s,resolve:function t(r,o,e,u){var i=!o;if(!i&&s(o,e))return o[e];var n=r[e];a(n,"id not defined: ".concat(e)),(u=(u||[]).slice()).push(e);var c=[];if(n.deps.forEach(function(e){a(u.indexOf(e)<0,"circular dependencies: ".concat(e," in ").concat(u));var n=t(r,o,e,u);i?(c=c.concat(n)).push(e):c.push(n)}),i)return d(c);var f=n.fn.apply(void 0,c);return o[e]=f},uniq:d}}],o.c=r,o.d=function(e,n,t){o.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(n,e){if(1&e&&(n=o(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var t=Object.create(null);if(o.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var r in n)o.d(t,r,function(e){return n[e]}.bind(null,r));return t},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},o.p="",o(o.s=0);function o(e){if(r[e])return r[e].exports;var n=r[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,o),n.l=!0,n.exports}var t,r});

@@ -1,2 +0,2 @@

const {assert, forOwn, has, resolve} = require('./util');
const {assert, for_own, has, resolve} = require('./util');

@@ -42,3 +42,3 @@ const create = () => {

forOwn(definitions, (def, id) => {
for_own(definitions, (def, id) => {
res[id] = {

@@ -57,6 +57,6 @@

forOwn(definitions, (def, id) => {
for_own(definitions, (def, id) => {
const inv = [];
forOwn(definitions, (def2, id2) => {
for_own(definitions, (def2, id2) => {
if (res[id2].reqs.indexOf(id) >= 0) {

@@ -78,3 +78,3 @@ inv.push(id2);

forOwn(state(), (st, id) => {
for_own(state(), (st, id) => {
const list = inv ? st.reqd : st.reqs;

@@ -81,0 +81,0 @@ out += `${st.init ? '*' : ' '} ${id} -> [ ${list.join(', ')} ]\n`;

@@ -9,3 +9,3 @@ // Throws an error if `expr` is falsy.

// Iterates over all own props of an object.
const forOwn = (x, fn) => {
const for_own = (x, fn) => {
Object.keys(x).forEach(k => fn(x[k], k));

@@ -81,3 +81,3 @@ };

assert,
forOwn,
for_own,
has,

@@ -84,0 +84,0 @@ resolve,

{
"name": "modulejs",
"version": "2.7.0",
"version": "2.8.0",
"description": "Lightweight JavaScript module system.",
"homepage": "https://larsjung.de/modulejs/",
"bugs": "https://github.com/lrsjng/modulejs/issues",
"author": "Lars Jung <lrsjng@gmail.com> (https://larsjung.de)",

@@ -23,13 +22,10 @@ "license": "MIT",

"devDependencies": {
"@babel/core": "7.4.4",
"@babel/preset-env": "7.4.4",
"@babel/register": "7.4.4",
"eslint": "5.16.0",
"ghu": "0.19.0",
"nyc": "14.0.0",
"scar": "1.7.0"
},
"engines": {
"node": ">=8.0.0"
"@babel/core": "7.10.5",
"@babel/preset-env": "7.10.4",
"@babel/register": "7.10.5",
"eslint": "7.5.0",
"ghu": "0.26.0",
"nyc": "15.1.0",
"scar": "2.3.0"
}
}
# modulejs
[![license][license-img]][github] [![web][web-img]][web] [![github][github-img]][github] [![npm][npm-img]][npm]
[![version][npm-v-img]][npm] [![downloads][npm-dm-img]][npm] [![build status][travis-img]][travis]
[![version][npm-v-img]][npm] [![downloads][npm-dm-img]][npm]

@@ -12,3 +12,3 @@ Lightweight JavaScript module system.

Copyright (c) 2019 Lars Jung (https://larsjung.de)
Copyright (c) 2020 Lars Jung (https://larsjung.de)

@@ -37,3 +37,2 @@ Permission is hereby granted, free of charge, to any person obtaining a copy

[npm]: https://www.npmjs.org/package/modulejs
[travis]: https://travis-ci.org/lrsjng/modulejs

@@ -47,2 +46,1 @@ [license-img]: https://img.shields.io/badge/license-MIT-a0a060.svg?style=flat-square

[npm-dm-img]: https://img.shields.io/npm/dm/modulejs.svg?style=flat-square
[travis-img]: https://img.shields.io/travis/lrsjng/modulejs.svg?style=flat-square

@@ -5,3 +5,3 @@ const {test} = require('scar');

require('./sub/assert');
require('./sub/forOwn');
require('./sub/for_own');
require('./sub/has');

@@ -8,0 +8,0 @@ require('./sub/resolve');

@@ -10,3 +10,3 @@ const {test, assert, insp} = require('scar');

'assert',
'forOwn',
'for_own',
'has',

@@ -13,0 +13,0 @@ 'resolve',

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc