npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lazy-assert/jest-diff

v1.0.11

Published

Jest diff utility with CRLF/LF line separator detection / Jest 差異比較工具,支援 CRLF/LF 行分隔符號檢測

Readme

@lazy-assert/jest-diff

Jest 差異比較工具,提供增強的字串差異比較功能,特別針對行分隔符號(CRLF/LF)差異進行優化。

Jest difference comparison utility with enhanced string diff functionality, optimized for line separator (CRLF/LF) differences.

特色 (Features)

  • 支援行分隔符號差異檢測 / Supports line separator difference detection
  • 整合 CRLF 正規化 / Integrates CRLF normalization
  • 提供增強的差異訊息 / Provides enhanced difference messages
  • 支援 Jest 匹配器工具 / Supports Jest matcher utilities

安裝 (Installation)

npm install @lazy-assert/jest-diff
# or
yarn add @lazy-assert/jest-diff

使用方式 (Usage)

基本使用 (Basic Usage)

import { _stringDiff, _stringDiffCore } from '@lazy-assert/jest-diff';

const received = 'Hello\r\nWorld';
const expected = 'Hello\nWorld';

// 檢測行分隔符號差異 / Detect line separator differences
console.log(_stringDiffCore(received, expected));

// 取得差異結果 / Get difference result
console.log(_stringDiff(received, expected));

自定義選項 (Custom Options)

import { _stringDiff } from '@lazy-assert/jest-diff';
import { DiffOptions } from 'jest-matcher-utils';

const options: DiffOptions = {
  // 自定義選項 / Custom options
};

const result = _stringDiff(received, expected, options);

API 參考 (API Reference)

_stringDiffCore(received, expected, options?)

核心差異比較函式,回傳差異訊息陣列。

Core difference comparison function, returns array of difference messages.

_stringDiff(received, expected, options?)

取得格式化的差異結果字串。

Get formatted difference result string.

EnumDiffMessage

差異訊息列舉:

  • LINE_SEPARATORS - 僅行分隔符號不同 / Contents have differences only in line separators

授權 (License)

ISC