0.1.3 • Published 3 years ago

whateverscript v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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
0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.1

3 years ago