whateverscript
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

WhateverScript

A loosely-typed companion to TypeScript.

Installation

npm install whateverscript

Usage

Basic Usage

Integrating WhateverScript into your project is easy! Just import Whatever, and immediately see its power.

import type Whatever from 'whateverscript';

function foo(bar: Whatever): Whatever {
  return `Hello ${bar}!`;
}

Advanced Usage

You can also quickly convert existing typed objects by either explicitly setting the Whatever type or by using the makeWhatever utility function.

// foo.ts
export const helloWorld: IntrinsicAttributes & InferPropsInner<Pick<{ myProp }> & Requireable<(...args)> = 'Hello World!';

// bar.ts
import { helloWorld } from './foo';
import Whatever, { makeWhatever } from 'whateverscript;


const myHelloWorld1: Whatever = helloWorld as Whatever;  // Hello World!

const myHelloWorld2: Whatever = makeWhatever(helloWorld);  // Hello World!

Other Usage

WhateverScript works with any data type... even Date objects!

import { makeWhatever } from 'whateverscript;
const now = new Date();

makeWhatever(now); // 2021-04-01T00:00:00Z

Readme

Keywords

none

Package Sidebar

Install

npm i whateverscript

Weekly Downloads

0

Version

0.1.3

License

MIT

Unpacked Size

6.26 kB

Total Files

10

Last publish

Collaborators

  • kyleget