UNPKG

functionalscript

Version:

FunctionalScript is a purely functional subset of JavaScript

22 lines (21 loc) 1.04 kB
import { type List } from '../types/list/module.f.ts'; import { type Entry as ObjectEntry } 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<string>) => (src: Unknown) => Unknown; export type Entry = ObjectEntry<Unknown>; type Entries = List<Entry>; type MapEntries = (entries: Entries) => Entries; export declare const serialize: (mapEntries: MapEntries) => (value: Unknown) => 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 {};