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

litejs

Package Overview
Dependencies
Maintainers
1
Versions
213
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

litejs - npm Package Compare versions

Comparing version 19.8.0 to 19.9.0

test/xhr.js

22

app/accept.js

@@ -14,8 +14,17 @@

return Function(
'c,R',
'c,R,D',
'var r=/(?:^|,\\s*)(?:(' +
('' + rules).replace(/[^,;]+|\s*;\s*(\w+)=("([^"]*)"|[^,;\s]*)|,/ig, function add(rule, key, token, qstr, offset) {
if (key) {
fnStr += ',' + key + ':unescape(m[' + (++group + 1) + ']==null?m[' + (group++) + ']||"' + escape(qstr == null ? token : qstr ) + '":m[' + group + '])'
return '(?=(?:"[^"]*"|[^,])*;\\s*' + key + '(?:=|\\*=utf-8\'\\w*\')("([^"]*)"|[^\\s,;]+)|)'
// Parse Parameters
//
// Non-extended notation, using "quoted-string" RFC-8187
// foo: bar; title="US-$ rates"
// Extended notation, using the Unicode character U+00A3 ("£", POUND SIGN):
// foo: bar; title*=utf-8'en'%C2%A3%20rates
fnStr += ',' + key + ':D(m[' + (++group) + '],m[' + (++group + 1) + ']==null?m[' + (group++) + ']||'
+ JSON.stringify(qstr == null ? token : qstr)
+ ':m[' + group + '])'
return '(?=(?:"[^"]*"|[^,])*;\\s*' + key + '(=|\\*=utf-8\'\\w*\')("([^"]*)"|[^\\s,;]+)|)'
}

@@ -53,4 +62,9 @@ if (rule == ',') {

')l=m}return l}'
)(choices, rules)
)(choices, rules, function(op, str) {
if (op !== "=") try {
str = decodeURIComponent(str)
} catch (e) {}
return str
})
}

16

app/content.js

@@ -66,3 +66,10 @@

stream.on("field", function(negod) {
req.body[negod.name] = negod.content.toString()
var step = req.body
, key = negod.name
key.replace(/\[(.*?)\]/g, function(_, _key, offset) {
if (step == req.body) key = key.slice(0, offset)
step = step[key] || (step[key] = _key && +_key != _key ? {} : [])
key = _key
})
step[key || step.length] = negod.content.toString()
})

@@ -112,3 +119,2 @@ stream.on("file", function(negod) {

seq++
makeTable(boundary)

@@ -124,2 +130,3 @@

, remainingFiles = number(reqOpts.maxFiles, req.opts.maxFiles, 1000)
, savePath = (reqOpts.path || os.tmpdir() + "/up-") + process.pid + "-" + (seq++) + "-"

@@ -187,6 +194,3 @@ return new Writable({

if (!fileStream) {
saveTo(
(reqOpts.path || os.tmpdir() + "/upload-") +
process.pid + "-" + seq + "-" + remainingFiles
)
saveTo(savePath + remainingFiles)
}

@@ -193,0 +197,0 @@ }

@@ -423,3 +423,3 @@

, error = {
id: util.rand(16),
id: Math.random().toString(36).slice(2,10),
time: res.req.date,

@@ -426,0 +426,0 @@ code: map.code || e.code || 500,

@@ -494,3 +494,3 @@ //-

"--compress", "evaluate=false,properties=false",
"--mangle",
"--mangle", "eval",
"--beautify", "beautify=false,semicolons=false,keep_quoted_props=true"

@@ -497,0 +497,0 @@ ])

@@ -10,2 +10,4 @@

, filterFns = Object.create(null)
, KEYS = Object.keys
, FILTER_ERR = "Invalid filter: "
, escRe = /['\n\r\u2028\u2029]|\\(?!x2e)/g

@@ -20,3 +22,3 @@ , pathRe = /(^$|.+?)(?:\[([^\]]*)\]|\{([^}]*)})?(\.(?=[^.])|$)/g

, filterRe = /(!?)(\$?)((?:[-+:.\/\w]+|\[[^\]]+\]|\{[^}]+}|\\x2e)+)(\[]|\{}|)(?:(!(?=\1)==?|(?=\1)[<>=]=?)((?:("|')(?:\\?.)*?\7|\w*\{(?:("|')(?:\\?.)*?\8|\w*\{(?:("|')(?:\\?.)*?\9|[^}])*?\}|.)*?\}|[^|&()])*))?(?=[)|&]|$)|((&|\|)\11*|([()])|.)/g
, onlyFilterRe = RegExp("^(?:([<>=])\\d+|" + filterRe.source.slice(0, -10) + "))+$")
, onlyFilterRe = RegExp("^(?:([@*])|" + filterRe.source.slice(0, -10) + "))+$")
, cleanRe = /(\(o=d\)&&(?!.*o=o).*)\(o=d\)&&/g

@@ -405,7 +407,7 @@ , nameRe = / (\w+)/

, sub = arr || obj
if (sub && !(sub = onlyFilterRe.exec(sub))) throw Error("Invalid GET filter")
if (sub && !(sub = onlyFilterRe.exec(sub))) throw Error(FILTER_ERR + str)
return (
sub ?
pathGet(0, path, 0, 0, 1) + (arr ? "i" : "j") + "(o)&&" + v + (
sub[1] ? (arr ? "o" : "Object.keys(o)") + ".length" + (sub[1] == "=" ? "=" : "") + sub[0] :
sub[1] ? (arr ? "o" : "K(o)") + (sub[0] === "*" ? "" : ".length") :
+arr == arr ? "o[" + (arr < 0 ? "o.length" + arr : arr) + "]" :

@@ -433,3 +435,3 @@ (arr ? "I" : "J") + "(o,f('" + sub[0] + "'))"

} else {
if (!onlyFilterRe.test(arr)) throw Error("Invalid SET filter")
if (!onlyFilterRe.test(arr)) throw Error(FILTER_ERR + str)
op = "o[t]"

@@ -449,4 +451,4 @@ out += "(t="+(arr?"I":"J")+"(o,f('" + sub + "'),1))!=null&&"

map[str] ||
(map[str] = Function("i,j,I,J,f", "return function(d,v){var c,o,t;return (o=d)&&" + pathStr(str, set) + "||c}")(
isArray, isObject, inArray, inObject, filterFn
(map[str] = Function("i,j,I,J,K,f", "return function(d,v){var c,o,t;return (o=d)&&" + pathStr(str, set) + "||c}")(
isArray, isObject, inArray, inObject, KEYS, filterFn
))

@@ -460,3 +462,3 @@ )

copy[len] ||
(copy[len] = Function("a,b,k,g", "var v,u;return " + Object.keys(attrs).map(copyFnI) + ",a"))
(copy[len] = Function("a,b,k,g", "var v,u;return " + KEYS(attrs).map(copyFnI) + ",a"))
)(a, b, attrs, pathFn) : a

@@ -507,3 +509,3 @@ }

fn = filterFns[key] = Function(
"a,i,j,I,J,f,p,e,s,g,ge,l,le,m,t",
"a,i,j,I,J,K,f,p,e,s,g,ge,l,le,m,t",
"return function(d){var o;return " + optimized + "}"

@@ -513,3 +515,3 @@ )

return fn(
arr, isArray, isObject, inArray, inObject, filterFn, pathFn,
arr, isArray, isObject, inArray, inObject, KEYS, filterFn, pathFn,
equal, strictEqual, greater, greaterEqual, less, lessEqual, reMatch, tmp

@@ -544,3 +546,3 @@ )

if (!ok2 && !ok1) {
throw new Error("Invalid filter: " + qs)
throw Error(FILTER_ERR + qs)
}

@@ -561,4 +563,9 @@ return ok2 ? ok2 + ok2 : ok1

if (m = attr.match(/\(c=(.*?)\)$/)) {
if (m.index) pre += attr.slice(0, m.index)
attr = m[1]
if (m[1] == "K(o)") {
pre += attr + "&&"
attr = "c"
} else {
if (m.index) pre += attr.slice(0, m.index)
attr = m[1]
}
}

@@ -602,3 +609,3 @@

a.push(
isArray ? (isArray === "[]" ? "I(" : "J(") + attr + "," + idd + "))" :
isArray || attr === "c" ? (isArray == "{}" ? "J(" : "I(") + attr + "," + idd + "))" :
isRe ? "typeof " + attr + "==='string'&&" + v + ".test(" + attr + ")" :

@@ -605,0 +612,0 @@ m[3] || m[4] ? idd + ")(" + attr + ")" :

{
"name": "litejs",
"version": "19.8.0",
"version": "19.9.0",
"license": "MIT",

@@ -5,0 +5,0 @@ "author": "Lauri Rooden <lauri@rooden.ee>",

@@ -251,9 +251,2 @@

}
print(
"#" + (failed ? "" : green + bold) + " pass " + (totalCases - failed) + "/" + totalCases
+ " [" + passedAsserts + "/" + totalAsserts + "]"
+ " in " + (_Date.now() - started) + " ms"
+ " at " + started.toTimeString().slice(0,8)
)
if (failed) {

@@ -267,6 +260,10 @@ for (var nums = [], stack = []; testCase = failedCases[--failed]; ) {

}
print(
"#" + (failed ? "" : green + bold) + " pass " + (totalCases - failed) + "/" + totalCases
+ " [" + passedAsserts + "/" + totalAsserts + "]"
+ " in " + (_Date.now() - started) + " ms"
+ " at " + started.toTimeString().slice(0,8)
)
}
function This() {

@@ -351,6 +348,10 @@ return this

function spy() {
var key, result
var err, key, result
, args = timers.slice.call(arguments)
if (type(origin) === "function") {
result = origin.apply(this, arguments)
try {
result = origin.apply(this, arguments)
} catch(e) {
err = e
}
} else if (isArray(origin)) {

@@ -362,2 +363,5 @@ result = origin[spy.called % origin.length]

}
// TODO:2019-09-09:lauri:
// var spy = assert.spy(Item, "method")
// assert.equal(spy.callCount, 1)
spy.called++

@@ -367,2 +371,3 @@ spy.calls.push({

args: args,
error: err,
result: result

@@ -369,0 +374,0 @@ })

/*
* @version 19.8.0
* @version 19.9.0
* @author Lauri Rooden <lauri@rooden.ee>

@@ -4,0 +4,0 @@ * @license MIT License

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