@isomp4/parser
Advanced tools
+18
-8
@@ -22,13 +22,23 @@ "use strict"; | ||
| /** | ||
| * | ||
| * @param encodings | ||
| * Registers the given box encoding for the parser. | ||
| * @param encoding The encoding to register. | ||
| * @param children Whether to also register all child boxes of the given encoding. Default: false | ||
| */ | ||
| registerBox(...encodings) { | ||
| for (const encoding of encodings) { | ||
| if (this.boxes.has(encoding.type)) { | ||
| throw new Error("Box type is already registered: " + encoding.type); | ||
| } | ||
| this.boxes.set(encoding.type, encoding); | ||
| registerBox(encoding, children) { | ||
| // Register encoding and all parent encodings | ||
| let parent = encoding; | ||
| do { | ||
| this.boxes.set(parent.type, parent); | ||
| } while ((parent = parent.parent) != null); | ||
| // Register child encodings | ||
| if (children) { | ||
| this.registerBoxChildren(encoding); | ||
| } | ||
| } | ||
| registerBoxChildren(encoding) { | ||
| encoding.forEachChild(c => { | ||
| this.boxes.set(c.type, c); | ||
| this.registerBoxChildren(c); | ||
| }); | ||
| } | ||
| /** | ||
@@ -35,0 +45,0 @@ * |
+5
-3
@@ -35,6 +35,8 @@ import { Buffer } from "buffer"; | ||
| /** | ||
| * | ||
| * @param encodings | ||
| * Registers the given box encoding for the parser. | ||
| * @param encoding The encoding to register. | ||
| * @param children Whether to also register all child boxes of the given encoding. Default: false | ||
| */ | ||
| registerBox(...encodings: BoxEncoding[]): void; | ||
| registerBox(encoding: BoxEncoding, children?: boolean): void; | ||
| private registerBoxChildren; | ||
| /** | ||
@@ -41,0 +43,0 @@ * |
+18
-8
@@ -19,13 +19,23 @@ import { Buffer } from "buffer"; | ||
| /** | ||
| * | ||
| * @param encodings | ||
| * Registers the given box encoding for the parser. | ||
| * @param encoding The encoding to register. | ||
| * @param children Whether to also register all child boxes of the given encoding. Default: false | ||
| */ | ||
| registerBox(...encodings) { | ||
| for (const encoding of encodings) { | ||
| if (this.boxes.has(encoding.type)) { | ||
| throw new Error("Box type is already registered: " + encoding.type); | ||
| } | ||
| this.boxes.set(encoding.type, encoding); | ||
| registerBox(encoding, children) { | ||
| // Register encoding and all parent encodings | ||
| let parent = encoding; | ||
| do { | ||
| this.boxes.set(parent.type, parent); | ||
| } while ((parent = parent.parent) != null); | ||
| // Register child encodings | ||
| if (children) { | ||
| this.registerBoxChildren(encoding); | ||
| } | ||
| } | ||
| registerBoxChildren(encoding) { | ||
| encoding.forEachChild(c => { | ||
| this.boxes.set(c.type, c); | ||
| this.registerBoxChildren(c); | ||
| }); | ||
| } | ||
| /** | ||
@@ -32,0 +42,0 @@ * |
+4
-4
| { | ||
| "name": "@isomp4/parser", | ||
| "version": "0.1.4", | ||
| "version": "0.2.0", | ||
| "description": "", | ||
@@ -44,6 +44,6 @@ "keywords": [ | ||
| "dependencies": { | ||
| "@isomp4/core": "^0.1.4" | ||
| "@isomp4/core": "^0.2.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@isomp4/box-moov": "^0.1.4" | ||
| "@isomp4/box-moov": "^0.2.0" | ||
| }, | ||
@@ -57,3 +57,3 @@ "scripts": { | ||
| }, | ||
| "gitHead": "622a45165f4730d4012e528f98b0b01127a595a5" | ||
| "gitHead": "b0ee75bb8669766d529bc6b505ea39d703a84c6a" | ||
| } |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
40480
2.73%574
3.99%0
-100%+ Added
- Removed
Updated