r3wt / object-path

object-path module for deno

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

object-path: get/set object properties using path syntax


this module is written for Deno, but should work in node.js and the browser if compiled to javascript(its written in typescript). There are zero dependencies, except for the tests which are written using the Deno testing library.

install


*Deno allows you to directly import modules from URL's! To import and use the client in your file, add the following import statement:

import { create } from 'https://raw.githubusercontent.com/r3wt/object-path/master/mod.ts';

API


  1. you should use the create function to create a new instance of ObjectPathModule.
const { parse, get, set, configure } = create({
    seperator:'.',//the path seperator to use can be string or RegExp
    defaultUnsetValue: undefined,//the default returned value for not existing properties.
    autoCreate: false // automatically create properties if they don't exist
});// all options are shown and all returned function in the module are shown as well

About

object-path module for deno


Languages

Language:TypeScript 100.0%