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

mojito-dimensions-base

Package Overview
Dependencies
Maintainers
4
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mojito-dimensions-base - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

24

addons/rs/super-bundle.server.js

@@ -44,2 +44,10 @@ /*

resourceDepthAsc = function (a, b) {
var da = a.source.pkg.depth,
db = b.source.pkg.depth;
if (da < db) { return -1; }
if (da > db) { return 1; }
return 0;
},
dimensions = [],

@@ -159,2 +167,3 @@ appConfigs = [];

this.beforeHostMethod('addResourceVersion', this.addResourceVersion, this);
this.afterHostMethod('getResourceVersions', this.getResourceVersions, this);
this.afterHostMethod('parseResourceVersion', this.parseResourceVersion, this);

@@ -292,2 +301,15 @@ this.onHostEvent('resolveMojitDetails', this.resolveMojitDetails, this);

getResourceVersions: function (filter) {
var self = this,
res = Y.Do.currentRetVal,
versions;
if (filter.type === 'mojit' && filter.name !== 'shared' && filter.selector === '*' &&
res.length === 0) {
res = self.store.getResourceVersions({ type: 'mojit', name: filter.name });
res.sort(resourceDepthAsc);
}
return new Y.Do.AlterReturn(null, res);
},
/**

@@ -362,3 +384,3 @@ * Hook in to replace the selector with the experiment bundle name.

res.selector = res.source.pkg.bundle;
}
}
},

@@ -365,0 +387,0 @@

@@ -15,1 +15,9 @@ CHANGELOG

* Expose experiment package's dimension name and value at runtime through properties `dimensionName` and `dimensionValue` of the mojit details metadata.
Version 0.0.6
-------------
* Generate urls with selector for static assets.
Version 0.0.8
-------------
* Fix for testing a experiment package with `mojito test`.

2

package.json
{
"name": "mojito-dimensions-base",
"description": "Mojito bucket testing infrastructure Super Bundle Addon",
"version": "0.0.7",
"version": "0.0.8",
"author": "David Gomez <dgomez@yahoo-inc.com>",

@@ -6,0 +6,0 @@ "contributors": [

@@ -120,2 +120,34 @@ /*

getResourceVersions: function (filter) {
//to be tested on addon (plugin)
if (filter.selector === '*') {
return [];
}
return [{
source: {
pkg: {
depth: 2
}
}
}, {
source: {
pkg: {
depth: 3
}
}
}, {
source: {
pkg: {
depth: 1
}
}
}, {
source: {
pkg: {
depth: 2
}
}
}];
},
resolveMojitDetails: function (env, posl, type, ress, mojitRes) {

@@ -447,2 +479,18 @@ var details = {};

A.areEqual(source.pkg.bundle, details.dimensionValue, "Mojit details dimension value");
},
'getResourceVersions should return shallowest resource if mojit resource with * selector is not found' : function () {
var filter = {
type: 'mojit',
name: 'FooMojit',
selector: '*'
},
versions = store.getResourceVersions(filter),
resource;
A.isArray(versions, 'resource versions');
A.areEqual(4, versions.length, 'versions length');
resource = versions[0];
A.isObject(resource, 'resource');
A.areEqual(1, resource.source.pkg.depth, 'resource package depth');
}

@@ -449,0 +497,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