mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
@@ -0,0 +1,12 @@
|
||||
/// <reference path="./dot-prop.d.ts" />
|
||||
|
||||
import * as dotProp from 'dot-prop';
|
||||
|
||||
dotProp.get({foo: {bar: 'unicorn'}}, 'foo.bar');
|
||||
dotProp.get({foo: {bar: 'a'}}, 'foo.notDefined.deep');
|
||||
dotProp.get({foo: {'dot.dot': 'unicorn'}}, 'foo.dot\\.dot');
|
||||
|
||||
const obj = {foo: {bar: 'a'}};
|
||||
dotProp.set(obj, 'foo.bar', 'b');
|
||||
dotProp.set(obj, 'foo.baz', 'x');
|
||||
dotProp.set(obj, 'foo.dot\\.dot', 'unicorn');
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
// Type definitions for dot-prop
|
||||
// Project: https://github.com/sindresorhus/dot-prop
|
||||
// Definitions by: Sam Verschueren <https://github.com/samverschueren>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module "dot-prop" {
|
||||
export function get(object: any, path: string): any;
|
||||
export function set(object: any, path: string, value: any): void;
|
||||
}
|
||||
Reference in New Issue
Block a user