2.3.0 • Published 12 months ago

@epdoc/typeutil v2.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

@epdoc/typeutil

Includes:

  • TypeScript-capable type-checking, type-guard and casting utilities
    • e.g. isString(), isPosInteger(), asInteger()
    • A Util object to encapslate type checking and reach into an Object's properties
  • Type declarations
    • Integer, Dict
  • Other common utilities, for example
    • delayPromise is setTimeout as a Promise
    • camelToDash, underscoreCapitalize string conversion
    • deepCopy, deepEquals
    • pad a string

Utility Functions

import { isBoolean } from '@epdoc/typeutil';

if (isBoolean(value)) {
  doTask();
}

DictUtil

import { dictUtil as test } from '@epdoc/typeutil';

let obj = { a: { b: 3 } };
test(obj)
  .property('a.b')
  .value(); // returns 3

const objUtil:DictUtil = dictUtil(obj);
const abVal:DictUtil = objUtil.property('a.b');
console.log( `Object value=${abVal.value()} and isInteger=${abVal.isInteger()}`);

Build and Publish

npm run build
npm test

Publish to @epdoc

npm run publish
1.2.0

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.4.2

12 months ago

1.4.1

12 months ago

1.4.0

12 months ago

1.3.0

1 year ago

2.3.0

12 months ago

2.2.1

12 months ago

2.2.0

12 months ago

2.1.0

12 months ago

2.0.0

12 months ago

1.0.9

1 year ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago