noldova.context.core
最低的CONTEXT库: nameof,返回已检查的成员名
类中添加的谓词和帮助器
全球 Object 和 String 构造函数。导入包将安装
增加;所有其他CONTEXT包都建立在它们之上。
安装
npm install @noldova/context.core
使用
import { nameof } from "@noldova/context.core";
class Options {
public timeout: number = 0;
}
nameof<Options>("timeout"); // "timeout"; another name does not compile.
nameof<Options>(t => t.timeout); // "timeout"
Object.isNullOrUndefined(0); // false: zero is a value.
Object.isString(""); // true
String.format("Expected {0} of {1}", 3, 5); // "Expected 3 of 5"
String.isNullOrWhitespace(" \t\r\n "); // true
谓词只对原语进行分类: Object.isString(new String("")) 是
false. 声明文件 api/index.d.ts 用其记录每个成员
合同和例子。
许可证
麻省理工学院;看到 LICENSE.