New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

aegisub-parser

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aegisub-parser - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

src/sections/index.js

2

package.json
{
"name": "aegisub-parser",
"version": "1.0.0",
"version": "1.0.1",
"description": "Parses Aegisub Files (.ass)",

@@ -5,0 +5,0 @@ "license": "MIT",

const fs = require('fs');
const path = require('path');
const readline = require('readline');
const sections = require('./sections');

@@ -10,18 +10,12 @@ class AegisubScript {

// Load Section Parsers
const directory = path.join(__dirname, 'sections/');
const files = fs.readdirSync(directory);
Object.keys(sections).forEach((key) => {
const parser = new sections[key]();
files.forEach(file => {
if (file.endsWith('.js')) {
const SectionParser = require(path.join(directory, file));
const parser = new SectionParser();
SectionParser.registerHeaders().forEach(header => {
if (this.parsers.has(header)) {
this.parsers.set(header, [parser, ...this.parsers.get(header)]);
} else {
this.parsers.set(header, [parser]);
}
});
}
parser.registerHeaders().forEach((header) => {
if (this.parsers.has(header)) {
this.parsers.set(header, [parser, ...this.parsers.get(header)]);
} else {
this.parsers.set(header, [parser]);
}
});
});

@@ -40,3 +34,3 @@ }

rl.on('line', line => {
rl.on('line', (line) => {
const val = line.trim();

@@ -57,3 +51,3 @@

if (script.parsers.has(currentSection)) {
script.parsers.get(currentSection).forEach(parser => {
script.parsers.get(currentSection).forEach((parser) => {
try {

@@ -69,4 +63,4 @@ parser.parse(val);

rl.on('close', () => {
[...script.parsers.values()].forEach(parsers => {
parsers.forEach(parser => {
[...script.parsers.values()].forEach((parsers) => {
parsers.forEach((parser) => {
script[parser.constructor.name.toLowerCase()] = parser.getValue();

@@ -73,0 +67,0 @@ });

@@ -10,3 +10,3 @@ const AegisubInvalidEvent = require('../errors/aegisub-invalid-event');

static registerHeaders() {
registerHeaders() {
return [

@@ -13,0 +13,0 @@ 'Events',

@@ -6,3 +6,3 @@ class Garbage {

static registerHeaders() {
registerHeaders() {
return [

@@ -9,0 +9,0 @@ 'Aegisub Project Garbage',

@@ -6,3 +6,3 @@ class Info {

static registerHeaders() {
registerHeaders() {
return [

@@ -9,0 +9,0 @@ 'Script Info',

@@ -9,3 +9,3 @@ const AegisubInvalidStyle = require('../errors/aegisub-invalid-style');

static registerHeaders() {
registerHeaders() {
return [

@@ -12,0 +12,0 @@ 'V4+ Styles',

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