functionalscript
Version:
FunctionalScript is a purely functional subset of JavaScript
22 lines (21 loc) • 1.04 kB
TypeScript
import * as list from '../types/list/module.f.ts';
import * as object from '../types/object/module.f.ts';
type Object = {
readonly [k in string]: Unknown;
};
type Array = readonly Unknown[];
export type Primitive = boolean | string | number | null;
export type Unknown = Primitive | Object | Array;
export declare const setProperty: (value: Unknown) => (path: list.List<string>) => (src: Unknown) => Unknown;
export type Entry = object.Entry<Unknown>;
type Entries = list.List<Entry>;
type MapEntries = (entries: Entries) => Entries;
export declare const serialize: (mapEntries: MapEntries) => (value: Unknown) => list.List<string>;
/**
* The standard `JSON.stringify` rules determined by
* https://262.ecma-international.org/6.0/#sec-ordinary-object-internal-methods-and-internal-slots-ownpropertykeys
*/
export declare const stringify: (mapEntries: MapEntries) => (value: Unknown) => string;
export declare const parse: (value: string) => Unknown;
export declare const isObject: (value: Unknown) => value is Object;
export {};