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 🙏

© 2024 – Pkg Stats / Ryan Hefner

tshet-uinh-deriver-tools

v0.2.0

Published

Utilities for TshetUinh.js derivers

Downloads

305

Readme

tshet-uinh-deriver-tools

推導方案相關功能,用以使推導方案更便於調用。

使用方法

推導方案編寫

// 演示用方案:直接返回 "<前綴>:<地位描述>"
if (!音韻地位) {
  const params: 選項項目[] = [
    ["前綴", "d"],
    ["高級選項", false],
  ];
  if (選項.高級選項) {
    params.push(["簡略描述", true]);
  }
  return params;
}
return 選項.前綴 + ":" + (選項.簡略描述 ? 音韻地位.簡略描述 : 音韻地位.描述);

調用

import { 推導方案 } from "tshet-uinh-deriver-tools";
import TshetUinh from "tshet-uinh";

const from = TshetUinh.音韻地位.from描述;

const 原始方案 = new Function("TshetUinh", "選項 = {}", "音韻地位", "字頭 = null", 方案代碼).bind(undefined, TshetUinh);

const 方案 = new 推導方案(原始方案);

方案()(from("幫三C凡入")); // => "d:幫三C凡入",以預設選項推導
方案({ 前綴: "D" })(from("幫三C凡入")); // => "d:幫凡入",指定選項推導

// 「指定選項」和「推導」均會分別調用一次原推導函數
// 為了減省原函數調用次數,避免反覆指定並解析相同的選項
// 可以像這樣指定一次選項後批量推導
const 以預設選項推導 = 方案(); // 預設選項
for (const 地位 of TshetUinh.資料.iter音韻地位()) {
  以預設選項推導(地位);
}

方案.方案選項().列表; // 取得解析後的方案選項列表