Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dofiltra/helpers

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dofiltra/helpers - npm Package Compare versions

Comparing version 1.0.50 to 1.0.53

19

lib/index.d.ts

@@ -51,2 +51,8 @@ import type { TDodecoratorSettings, TResultError, TTrackMetadata } from '@dofiltra/types';

export declare const median: (arr: string[]) => number;
export declare class MathHelper {
static roundUp({ num, precision }: {
num: number;
precision: number;
}): number;
}
export declare class TextHelper {

@@ -93,2 +99,9 @@ static isHeadingTag: (tag: string) => boolean;

}): string[];
static getShortcodes({ text }: {
text: string;
}): {
shortcode: string;
attributes: string;
content: string;
}[];
}

@@ -257,7 +270,1 @@ export declare class SplitHelper {

}
export declare class MathHelper {
static roundUp({ num, precision }: {
num: number;
precision: number;
}): number;
}

@@ -106,2 +106,8 @@ /* tslint:disable:max-classes-per-file */

};
export class MathHelper {
static roundUp({ num, precision }) {
precision = Math.pow(10, precision);
return Math.ceil(num * precision) / precision;
}
}
//#endregion MATH

@@ -229,2 +235,17 @@ //#region TEXT

}
static getShortcodes({ text }) {
// Regex to match shortcodes
const regex = /\[([a-zA-Z0-9_-]+)([^\]]*)\](?:([^[]*(?:\[(?!\/\1\])[^[]*\])*?)\[\/\1\])?/g;
const shortcodes = [];
let match;
// Iterate over all matches
while ((match = regex.exec(text)) !== null) {
shortcodes.push({
shortcode: match[1], // Name of the shortcode
attributes: match[2], // Attributes of the shortcode
content: match[3] // Content inside the shortcode
});
}
return shortcodes;
}
}

@@ -676,3 +697,5 @@ export class SplitHelper {

currentLength -= microHtml.length;
chunk += separator + microHtml;
if (microHtml?.trim?.()) {
chunk += separator + microHtml;
}
});

@@ -852,10 +875,2 @@ if (chunk) {

//#endregion TIMELINE
//#region MATH
export class MathHelper {
static roundUp({ num, precision }) {
precision = Math.pow(10, precision);
return Math.ceil(num * precision) / precision;
}
}
//#endregion MATH
//#region COMMON

@@ -862,0 +877,0 @@ //#endregion COMMON

{
"name": "@dofiltra/helpers",
"version": "1.0.50",
"version": "1.0.53",
"license": "MIT",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

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