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

deepjs

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deepjs - npm Package Compare versions

Comparing version 0.9.9 to 0.9.10

DOCS/constraints/filters.md

2

deep-errors.js

@@ -18,3 +18,3 @@ /**

if(this.report.toString)
this.report.toString();
res += this.report.toString();
else

@@ -21,0 +21,0 @@ res += " - report : "+JSON.stringify(this.report);

@@ -289,3 +289,3 @@ /**

define(["require"],
function(require, utils, promise, Querier){
function(require){

@@ -295,3 +295,2 @@ return function (deep) {

var utils = deep.utils;
var promise = deep;
var Querier = deep.Querier;

@@ -329,3 +328,3 @@

return null;
}
};

@@ -550,3 +549,2 @@

var othis = this;
var deferred = promise.Deferred();
this.options = options | {};

@@ -563,6 +561,6 @@ if(!this.options.basePath)

date:Date.now(),
valid:(othis.errors.length == 0)
}
valid:(othis.errors.length === 0)
};
return report;
}
};

@@ -616,3 +614,3 @@ Validator.prototype.validate = function validate(value, schema, options){

var schemaPaths = [];
var deferred = promise.Deferred();
var deferred = deep.Deferred();
var othis = this;

@@ -639,3 +637,4 @@ //console.log("Validator", "partialValidation : fieldsToCheck = " + fieldsToCheck);

promise.all(promises).then(function partialValidationDone(results){
deep.all(promises)
.then(function partialValidationDone(results){
var valid = true;

@@ -658,4 +657,4 @@

deferred.resolve({ schema:schema, value:object, errorsMap:othis.errorsMap, valid:valid, date:Date.now(), partial:true })
})
return promise.promise(deferred);
});
return deferred.promise();
}

@@ -684,2 +683,3 @@

break;
default :

@@ -737,3 +737,2 @@ validations.push(this.checkRef(schema[i], this.lexic[i].schema, schemaPath, i+".schema"));

{
if(types[i] == "schema")

@@ -768,7 +767,10 @@ {

var res = Querier.query(value, dep.query);
//console.log("test dependancy query: ", res, " - constraints : ", dep.constraints)
console.log("test dependancy query: ", res, " - constraints : ", dep.constraints)
if(res.length > 0)
{
dependenciesMatch = true;
var rep = othis.validateProperty(value, dep.constraints, valuePath, schemaPath);
var finSchema = deep.utils.up(schema, {});
deep.utils.up(dep.constraints, finSchema);
delete finSchema.dependencies;
var rep = othis.validateProperty(value, finSchema, valuePath, schemaPath);
///console.log("dependency validation ? ", rep.valid)

@@ -775,0 +777,0 @@ ok = ok && rep.valid;

@@ -87,3 +87,3 @@ if (typeof define !== 'function') {

if(e)
console.error("****** test failed ! ******* : ",fn.key, " error : ", e);
console.error("****** test failed ! ******* : ",fn.key, " error : ", e, e.report);
else

@@ -112,5 +112,3 @@ console.log("\tok !");

};
d.done(function(context)
{
self.context = context || {};
d.always(function(){
if(options.verbose !== false)

@@ -121,2 +119,7 @@ {

}
})
.done(function(context)
{
self.context = context || {};
this.when(applyTest(functions.shift()))

@@ -210,2 +213,3 @@ .done(done)

var doTest = function(unit){
unit = new deep.Unit(unit);
if(options.verbose !== false)

@@ -247,3 +251,9 @@ console.log("\n\n\n*************** Executing unit : ", unit.title);

//console.log("\n",report,"\n");
console.log("\n\tErrors: ", report.errors);
console.log("\n\tErrors: ");
report.errors.forEach(function (e) {
console.log(e.unit+":"+e.test, e.error.toString());
if(e.error && e.error.report)
console.log("report : ", report.toString());
});
console.log("\tNumber of units : ", report.numberOfUnits);

@@ -250,0 +260,0 @@ console.log("\tNumber of tests : ", report.numberOfTests);

@@ -0,5 +1,12 @@

[Back to tutorials](./tutorials.md)
## Layered Aspect Oriented and Query Based programmation
[Back to tutorials](./tutorials.md)
deepjs define two fondamentals methods that deeply merge objects together : the 'up' and 'bottom' .
Think your objects as bidimensionnal layers that you could stack, where properties or functions that share same path (from layers root), as deep as they are, are merged together, in stack order.
The way and the result of merge depends on collided object's nature and stack order.
Think about photoshop transparent layers stack : pixels from different layers that share same coord are merged together in stack order, and the way that they are merged depends on their fusion mode.
```javascript

@@ -6,0 +13,0 @@

@@ -24,2 +24,14 @@ # Native stores

* get
* post
* put
* patch
* del
* query
* range
* rpc
* bulk
See also [privates](./constraints/privates.md), [readOnly](./constraints/readonly.md), [filters](./constraints/filters.md), [sanitize](./constraints/filters.md) and [ownership](./constraints/ownership.md) constraints from schema.
### Simple usage

@@ -36,3 +48,4 @@

.post( { title:"deepjs" } )
.post( { title:"tools" } );
.post( { title:"tools" } )
.log();

@@ -39,0 +52,0 @@ //...

@@ -5,2 +5,4 @@ Tutorials

#### Modelisation and Queries
deepjs provides tools to modelise and manipulate structures inheritance and compositions.
For this, it mainly uses Aspects Composition (AOP) principles, and particular queries that allow to navigate-in and select objects structures. The combination of those two paradigms (AOP + queries) gives differents ways to nicely handle objects structures.
* [basic-modelisation](./basic-modelisation.md)

@@ -14,4 +16,11 @@ * [compositions](./compositions.md)

* [Object Capabilities Manager](./ocm.md)
* [Additive vs restrictive](./ocm/ocm-synthesis.md)
* [Delegation](./ocm/ocm-delegate.md)
* [Server usages](./ocm/ocm-server.md)
* [Browser usages](./ocm/ocm-browser.md)
#### Asynch, Promises and Chains
deepjs uses promises at all level. It provides its own implementation of promises and deferreds that gives smart chained asynch management (natural chain branching, context management, log facilities, ...). As additionnal asynch sugar : it natively offers another particular chain (that inherit from promise's one) to manipulate objects, runtime and other asynch stuffs.
As deepjs want to be, by others, an asynch-chain-factory : other useful chains are implemented as "plugin" and have their own docs.
* [promised and chained asynch management example](./asynch/async-management.md)

@@ -24,10 +33,19 @@ * [deep promise](./asynch/deep-promise.md)

#### Protocoles and Stores
#### Protocols
Protocols provide nice namespaces to store and use datas fetcher and manager
* [native protocoles](./stores/native-protocoles.md)
* [native stores](./stores/native-stores.md)
* [list of externals modules](./modules.md)
* [custom protocoles](./stores/custom-protocoles.md)
* [custom stores](./stores/custom-stores.md)
#### Stores
deepjs provides an absolute homogeneous persistent store API and provides, through its chain, a simple and convinient way to handle store's transactions sequences.
The aim is to manage dynamic datas, through JSON/REST API, in exactly the same way, browser or server side.
* [native collection store](./stores/native-stores.md)
* [ocm, stores and chains](./stores/store-chain.md)
* [list of implemented stores](./modules.md)
#### JSON Schema usage
deepjs comes natively with json-schema support and gives tools to handle it.
* [validations](./json-schemas/validations.md)

@@ -37,3 +55,14 @@ * [relations management](./json-schemas/relations.md)

#### Owner, privates, filters and readOnly
Stores could protect ressources through schema custom entries.
For this, deepjs stores provides mecanism to dynamicaly check readOnly constraint, hide privates proprties or limit access to ressource owner.
* [privates](./constraints/privates.md)
* [readOnly](./constraints/readonly.md)
* [ownership](./constraints/ownership.md)
* [filters](./constraints/filters.md)
* [sanitize](./constraints/sanitize.md)
#### Tests Units
deepjs comes with it's own simple asynch unit testcaser. It uses deepjs native chain tools as 'equal', 'validate', 'assert' to test itself. More work need to be done to articulate it more nicely with other tests frameworks.
* [perform deep-core tests](../units/README.md)

@@ -52,2 +81,2 @@ * [write your own](./custom-units.md)

* [deep-spa-sandbox](https://github.com/deepjs/deep-spa-sandbox)
* [deepjs.org](https://github.com/deepjs/deepjs.org)
* [deepjs.org](https://github.com/deepjs/deepjs.org)
{
"name" : "deepjs",
"version" : "0.9.9",
"version" : "0.9.10",
"author" : "Gilles Coomans <gilles.coomans@gmail.com>",

@@ -5,0 +5,0 @@ "description" : "Powerful atomic tools for managing objects, functions and promises",

@@ -172,3 +172,3 @@ /**

promise: function promiseDef() {
var prom = new deep.Promise();
var prom = new deep.Promise({ context:this._context});
//console.log("deep2.Deffered.promise : ", prom, " r,r,c : ", this.rejected, this.resolved, this.canceled)

@@ -184,3 +184,3 @@ if (this.resolved || this.rejected || this.canceled)

options = options || {};
this._context = deep.context;
this._context = options.context || deep.context;
this._queue = [];

@@ -534,4 +534,5 @@ this.oldQueue = null;

{
// console.log("chain.mode : ", arguments, deep.context);
var self = this;
//console.log("chain.mode : ", arg, arg2, deep.context.modes);
if(typeof arg === 'string')

@@ -543,2 +544,4 @@ {

}
//console.log("chain.mode obj: ", arg);
var func = function(s,e)

@@ -550,8 +553,9 @@ {

for(var i in deep.context.modes)
if(!arg[i] && deep.context.modes.hasOwnProperty(i))
arg[i] = deep.context.modes[i];
deep.context.modes = arg;
for(var i in self._context.modes)
if(!arg[i] && self._context.modes.hasOwnProperty(i))
arg[i] = self._context.modes[i];
self._context.modes = arg;
//console.log("deep.context.mode setted : ",self._context.modes);
deep.context = self._context;
return s;
// console.log("deep.context.mode setted : ",deep.context.mode);
};

@@ -564,3 +568,29 @@ func._isDone_ = true;

}
deep.wrapNodeAsynch = function(parent, cmd, args)
{
var def = deep.Deferred();
//console.log("wrapNodeAsynch : ", typeof parent, cmd);
var callback = function(){
var argus = Array.prototype.slice.apply(arguments);
//console.log("wrapNode callBack direct response : ",argus);
var err = argus.shift();
if(err)
def.reject(err);
else
def.resolve(argus);
};
args.push(callback);
if(parent)
{
if(typeof cmd === 'string')
parent[cmd].apply(parent, args);
else
cmd.apply(parent, args);
}
else
cmd.apply({}, args);
return def.promise();
};
};
});

@@ -81,3 +81,3 @@ if (typeof define !== 'function') {

return new Unit(unit);
return unit;
});

@@ -527,3 +527,3 @@ if (typeof define !== 'function') {

return new Unit(unit);
return unit;
});

@@ -31,4 +31,4 @@ if (typeof define !== 'function') {

return new Unit(unit);
return unit;
});

@@ -121,4 +121,4 @@ if (typeof define !== 'function') {

return new Unit(unit);
return unit;
});

@@ -351,3 +351,3 @@ if (typeof define !== 'function') {

return new Unit(unit);
return unit;
});

@@ -84,3 +84,3 @@ if (typeof define !== 'function') {

return new Unit(unit);
return unit;
});

@@ -132,4 +132,4 @@ if (typeof define !== 'function') {

return new Unit(unit);
return unit;
});

@@ -108,3 +108,3 @@ if (typeof define !== 'function') {

return new Unit(unit);
return unit;
});

@@ -32,3 +32,3 @@ if (typeof define !== 'function') {

return new Unit(unit);
return unit;
});

@@ -113,3 +113,3 @@ if (typeof define !== 'function') {

return new Unit(unit);
return unit;
});

@@ -77,3 +77,3 @@ if (typeof define !== 'function') {

return new Unit(unit);
return unit;
});

@@ -1020,3 +1020,3 @@ if (typeof define !== 'function') {

};
return new Unit(unit);
return unit;
});

@@ -1023,0 +1023,0 @@

@@ -61,3 +61,3 @@ if (typeof define !== 'function') {

return new Unit(unit);
return unit;
});

@@ -135,3 +135,3 @@ if (typeof define !== 'function') {

return new Unit(unit);
return unit;
});

@@ -108,3 +108,3 @@ if (typeof define !== 'function') {

return new Unit(unit);
return unit;
});

@@ -54,3 +54,3 @@ if (typeof define !== 'function') {

return new Unit(unit);
return unit;
});

@@ -144,5 +144,5 @@ if (typeof define !== 'function') {

return new Unit(unit);
return unit;
});

Sorry, the diff of this file is too big to display

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