Comparing version 0.1.0 to 0.1.1
// Generated by CoffeeScript 1.3.3 | ||
(function() { | ||
var JSLINT, VERBOSE, access, accessList, adsafeId, ast, ctx, details, entry, error, filename, foot, fs, head, id, k, lineDiff, lines, lines2, num2alphabet, ok, okayReasons, old, out, outputFilename, overrideDetails, parser, re, result, script, tty, uglify, util, v, vm, walk, _i, _j, _len, _len1, _ref, _ref1, | ||
var JSLINT, VERBOSE, access, accessList, adsafeId, ast, ctx, description, details, entry, error, filename, foot, fs, head, id, k, lineDiff, lines, lines2, num2alphabet, ok, okayReasons, old, out, outputFilename, overrideDetails, parser, re, result, script, tty, type, uglify, util, v, vm, walk, _i, _j, _len, _len1, _ref, _ref1, | ||
__slice = [].slice; | ||
@@ -73,3 +73,3 @@ | ||
} else { | ||
outputFilename = "" + filename + ".adsafe.js"; | ||
outputFilename = filename.replace(/(\.js|)$/, ".ps"); | ||
} | ||
@@ -81,6 +81,10 @@ | ||
type = null; | ||
details = null; | ||
re = /\/\*\![A-Z_]+([\s\S]+?)\*\//; | ||
description = null; | ||
re = /\/\*\!([A-Z_]+)\s*(\{[\s\S]+?\})\s*(?:\n---+\n([\s\S]+?))?\*\//; | ||
script = script.replace(re, function(header) { | ||
@@ -91,4 +95,8 @@ var matches; | ||
try { | ||
details = JSON.parse(matches[1]); | ||
} catch (_error) {} | ||
type = matches[1]; | ||
details = JSON.parse(matches[2]); | ||
description = matches[3]; | ||
} catch (e) { | ||
console.log("JSON decode error: " + e.message); | ||
} | ||
} | ||
@@ -109,2 +117,10 @@ return ""; | ||
details.type = type; | ||
if (description != null ? description.length : void 0) { | ||
details.description = description; | ||
} | ||
script = script.replace(re, function(description) {}); | ||
lines2 = script.split("\n").length; | ||
@@ -143,3 +159,3 @@ | ||
walk = function(ast) { | ||
var a, ast2, base, condition, funcName, i, operation, params, property, seq, seqs, stats, type, unrollSeqs, value, variable, _j, _k, _l, _len1, _len2, _len3, _len4, _len5, _len6, _len7, _m, _n, _o, _p, _q, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8; | ||
var a, ast2, base, condition, funcName, i, operation, params, property, seq, seqs, stats, unrollSeqs, value, variable, _j, _k, _l, _len1, _len2, _len3, _len4, _len5, _len6, _len7, _m, _n, _o, _p, _q, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8; | ||
if (Array.isArray(ast) && ast.length > 0) { | ||
@@ -434,3 +450,4 @@ type = ast[0]; | ||
errors: [], | ||
warnings: [] | ||
warnings: [], | ||
details: details | ||
}; | ||
@@ -464,8 +481,10 @@ | ||
} | ||
console.error(JSON.stringify(out)); | ||
if (out.errors.length > 0) { | ||
process.exit(1); | ||
} | ||
} | ||
console.error(JSON.stringify(out)); | ||
if (out.errors.length > 0) { | ||
process.exit(1); | ||
} | ||
script = script.substr(head.length, script.length - (head.length + foot.length)); | ||
@@ -472,0 +491,0 @@ |
{ "name": "pimscript", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Converts JavaScript to be more likely to be compatible with ADsafe", | ||
@@ -4,0 +4,0 @@ "keywords": ["Pim","javascript","ADsafe","FBJS"], |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
235352
6379