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

remark-textr

Package Overview
Dependencies
Maintainers
3
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-textr - npm Package Compare versions

Comparing version 6.0.0 to 6.1.0

index.d.ts.map

1

index.d.ts
export { default } from "./lib/index.js";
export type Options = import('./lib/index.js').Options;
export type TextrPlugin = import('./lib/index.js').TextrPlugin;
//# sourceMappingURL=index.d.ts.map

3

lib/index.d.ts

@@ -9,3 +9,3 @@ /**

*/
export default function remarkTextr(options?: Readonly<Options> | null | undefined): (tree: Root) => Promise<undefined>;
export default function remarkTextr(options?: Readonly<Options> | null | undefined): ((tree: Root) => undefined) | ((tree: Root) => Promise<undefined>);
export type Root = import('mdast').Root;

@@ -35,1 +35,2 @@ /**

export type TextrPlugin = (value: string, options: object) => string | null | undefined | void;
//# sourceMappingURL=index.d.ts.map

@@ -47,12 +47,31 @@ /**

const textrOptions = settings.options || {}
if (plugins.every((plugin) => typeof plugin === 'function')) {
const typography = textr(textrOptions).use(...plugins)
/**
* Transform synchronously.
*
* @param {Root} tree
* Tree.
* @returns {undefined}
* Nothing.
*/
return function (tree) {
visit(tree, 'text', function (node) {
node.value = typography.exec(node.value)
})
}
}
const promise = Promise.all(
plugins.map(async function (fn) {
if (typeof fn === 'string') {
// Assume plugin at default.
plugins.map(async function (value) {
if (typeof value === 'string') {
// Assume value at default.
/** @type {{default: TextrPlugin}} */
const mod = await import(fn)
return mod.default
const module_ = await import(value)
return module_.default
}
return fn
return value
})

@@ -64,3 +83,3 @@ ).then(function (list) {

/**
* Transform.
* Transform asynchronously.
*

@@ -67,0 +86,0 @@ * @param {Root} tree

{
"name": "remark-textr",
"version": "6.0.0",
"version": "6.1.0",
"description": "remark plugin to improve typography with Textr",

@@ -37,2 +37,3 @@ "license": "MIT",

"lib/",
"index.d.ts.map",
"index.d.ts",

@@ -49,3 +50,3 @@ "index.js"

"@types/textr": "^0.3.0",
"c8": "^8.0.0",
"c8": "^9.0.0",
"prettier": "^3.0.0",

@@ -59,3 +60,3 @@ "remark": "^15.0.0",

"typographic-quotes": "^2.0.0",
"xo": "^0.56.0"
"xo": "^0.57.0"
},

@@ -62,0 +63,0 @@ "scripts": {

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