<commit_before>/*
 * A deep oriented implementation of RQL for JavaScript arrays based on rql/js-array from Kris Zyp (https://github.com/persvr/rql).
 * For example:
 * require("deep/deep-rql").query("a=3", {}, [{a:1},{a:3}]) -> [{a:3}]

What's different from js-array ? It could handle schema properties and ancestor access when filtering

 * @author <NAME> <<EMAIL>>
 */

if(typeof define !== 'function'){
	var define = require('amdefine')(module);
}
/**
TODO : 
add distinct(testPropertyPath)
add merge()
add backgrounds()  :  do object extension with deep-extender + schema



add _ancestor (any ancestor)
add _brothers  (any brothers)

! TEST ALL operations !

*/ 
define(function defineJsonQuery(require){
	RQL_Global = {}

var layer = {};
var utils = require("./utils");
var retrieveFullSchemaByPath = utils.retrieveFullSchemaByPath;
var parser = require("rql/parser");
var parseQuery = parser.parseQuery;
var stringify = JSON.stringify || function(str){
	return '"' + str.replace(/"/g, "\\\"") + '"';
};

function getJSPrimitiveType(obj){
	if(obj instanceof Array || obj.push)
		return "array"
	return typeof obj;
}<commit_msg>check if obj is not null<commit_after>/*
 * A deep oriented implementation of RQL for JavaScript arrays based on rql/js-array from Kris Zyp (https://github.com/persvr/rql).
 * For example:
 * require("deep/deep-rql").query("a=3", {}, [{a:1},{a:3}]) -> [{a:3}]

What's different from js-array ? It could handle schema properties and ancestor access when filtering

 * @author <NAME> <<EMAIL>>
 */

if(typeof define !== 'function'){
	var define = require('amdefine')(module);
}
/**
TODO : 
add distinct(testPropertyPath)
add merge()
add backgrounds()  :  do object extension with deep-extender + schema



add _ancestor (any ancestor)
add _brothers  (any brothers)

! TEST ALL operations !

*/ 
define(function defineJsonQuery(require){
	RQL_Global = {}

var layer = {};
var utils = require("./utils");
var retrieveFullSchemaByPath = utils.retrieveFullSchemaByPath;
var parser = require("rql/parser");
var parseQuery = parser.parseQuery;
var stringify = JSON.stringify || function(str){
	return '"' + str.replace(/"/g, "\\\"") + '"';
};

function getJSPrimitiveType(obj){
	if(obj && obj instanceof Array || obj.push)
		return "array"
	return typeof obj;
}
{'fraction_non_alphanumeric': 0.15646853146853146, 'fraction_numerical': 0.0034965034965034965, 'mean_word_length': 4.7225, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1138759', 'n_tokens_mistral': 740, 'n_tokens_neox': 722, 'n_words': 212}