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

@lrc-maker/lrc-parser

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lrc-maker/lrc-parser - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

9

build/lrc-parser.d.ts

@@ -16,3 +16,10 @@ declare global {

}>;
export declare const parser: (lrcString: string) => Readonly<{
export declare type TrimOptios = Partial<{
trimStart: boolean;
trimEnd: boolean;
}>;
export declare const parser: (lrcString: string, option?: Partial<{
trimStart: boolean;
trimEnd: boolean;
}>) => Readonly<{
info: Map<string, string>;

@@ -19,0 +26,0 @@ lyric: Readonly<ILyric>[];

@@ -1,2 +0,3 @@

export const parser = (lrcString) => {
export const parser = (lrcString, option = {}) => {
const { trimStart = false, trimEnd = false } = option;
const lines = lrcString.split(/\r\n|\n|\r/);

@@ -39,2 +40,12 @@ const timeTag = /\[\s*(\d{1,3}):(\d{1,2}(?:[:.]\d{1,3})?)\s*]/y;

}
if (trimStart || trimEnd) {
lyric.forEach((line) => {
if (trimStart) {
line.text = line.text.trimStart();
}
if (trimEnd) {
line.text = line.text.trimEnd();
}
});
}
return { info, lyric };

@@ -41,0 +52,0 @@ };

2

package.json
{
"name": "@lrc-maker/lrc-parser",
"description": "lrc-parser for lrc-maker",
"version": "0.0.1",
"version": "0.1.0",
"repository": "https://github.com/magic-akari/lrc-maker.git",

@@ -6,0 +6,0 @@ "author": "阿卡琳 <hufan.akarin@Gmail.com>",

@@ -21,3 +21,10 @@ declare global {

export const parser = (lrcString: string): State => {
export type TrimOptios = Partial<{
trimStart: boolean;
trimEnd: boolean;
}>;
export const parser = (lrcString: string, option: TrimOptios = {}): State => {
const { trimStart = false, trimEnd = false } = option;
const lines = lrcString.split(/\r\n|\n|\r/);

@@ -76,2 +83,13 @@

if (trimStart || trimEnd) {
lyric.forEach((line) => {
if (trimStart) {
line.text = line.text.trimStart();
}
if (trimEnd) {
line.text = line.text.trimEnd();
}
});
}
return { info, lyric };

@@ -78,0 +96,0 @@ };

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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