summaryrefslogtreecommitdiff
path: root/includes/external/signal/node_modules/.bin/sdp-verify
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2023-11-18 11:34:36 +0100
committerRaindropsSys <raindrops@equestria.dev>2023-11-18 11:34:36 +0100
commit9337aae8b1c87fad34884dacd5cd79d9591c60db (patch)
tree5340f9fa67cd6236e4c879f0057d51d0b1e21361 /includes/external/signal/node_modules/.bin/sdp-verify
parent953ddd82e48dd206cef5ac94456549aed13b3ad5 (diff)
downloadpluralconnect-9337aae8b1c87fad34884dacd5cd79d9591c60db.tar.gz
pluralconnect-9337aae8b1c87fad34884dacd5cd79d9591c60db.tar.bz2
pluralconnect-9337aae8b1c87fad34884dacd5cd79d9591c60db.zip
Updated 39 files, added 86 files, deleted 40 files and renamed 2 files (automated)
Diffstat (limited to 'includes/external/signal/node_modules/.bin/sdp-verify')
-rw-r--r--includes/external/signal/node_modules/.bin/sdp-verify47
1 files changed, 47 insertions, 0 deletions
diff --git a/includes/external/signal/node_modules/.bin/sdp-verify b/includes/external/signal/node_modules/.bin/sdp-verify
new file mode 100644
index 0000000..cf88a90
--- /dev/null
+++ b/includes/external/signal/node_modules/.bin/sdp-verify
@@ -0,0 +1,47 @@
+#!/usr/bin/env node
+
+var transform = require('./')
+ , file = require('path').join(process.cwd(), process.argv[2])
+ , sdp = require('fs').readFileSync(file).toString()
+ , parsed = transform.parse(sdp)
+ , written = transform.write(parsed)
+ , writtenLines = written.split('\r\n')
+ , origLines = sdp.split('\r\n')
+ , numMissing = 0
+ , numNew = 0
+ ;
+
+var parseFails = 0;
+parsed.media.forEach(function (media) {
+ (media.invalid || []).forEach(function (inv) {
+ console.warn('unrecognized a=' + inv.value + ' belonging to m=' + media.type);
+ parseFails += 1;
+ });
+});
+var parseStr = parseFails + ' unrecognized line(s) copied blindly';
+
+origLines.forEach(function (line, i) {
+ if (writtenLines.indexOf(line) < 0) {
+ console.error('l' + i + ' lost (' + line + ')');
+ numMissing += 1;
+ }
+});
+
+writtenLines.forEach(function (line, i) {
+ if (origLines.indexOf(line) < 0) {
+ console.error('l' + i + ' new (' + line + ')');
+ numNew += 1;
+ }
+});
+
+var failed = (numMissing > 0 || numNew > 0);
+if (failed) {
+ console.log('\n' + file + ' changes during transform:');
+ console.log(numMissing + ' missing line(s), ' + numNew + ' new line(s)%s',
+ parseFails > 0 ? ', ' + parseStr : ''
+ );
+}
+else {
+ console.log(file + ' verified%s', parseFails > 0 ? ', but had ' + parseStr : '');
+}
+process.exit(failed ? 1 : 0);