@ts-common/source-map
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -37,4 +37,4 @@ import { StringMap } from "@ts-common/string-map"; | ||
export declare const setInfo: <T extends object>(value: T, info: ObjectInfo) => Tracked<T>; | ||
export declare const getInfoFunc: (value: object) => InfoFunc | undefined; | ||
export declare const getInfo: (value: object) => RootObjectInfo | ChildObjectInfo | undefined; | ||
export declare const getInfoFunc: (value: object | undefined) => InfoFunc | undefined; | ||
export declare const getInfo: (value: object | undefined) => RootObjectInfo | ChildObjectInfo | undefined; | ||
export declare const copyInfo: <T extends object>(source: object, dest: T) => T; | ||
@@ -41,0 +41,0 @@ export declare type Data = object | JsonPrimitive; |
@@ -31,2 +31,5 @@ "use strict"; | ||
exports.getInfoFunc = (value) => { | ||
if (value === undefined) { | ||
return undefined; | ||
} | ||
const withInfo = value; | ||
@@ -33,0 +36,0 @@ return withInfo[exports.objectInfoSymbol]; |
@@ -83,3 +83,6 @@ import { StringMap } from "@ts-common/string-map" | ||
export const getInfoFunc = (value: object): InfoFunc|undefined => { | ||
export const getInfoFunc = (value: object | undefined): InfoFunc|undefined => { | ||
if (value === undefined) { | ||
return undefined | ||
} | ||
const withInfo = value as Tracked<object> | ||
@@ -89,3 +92,3 @@ return withInfo[objectInfoSymbol] | ||
export const getInfo = (value: object): ObjectInfo|undefined => { | ||
export const getInfo = (value: object | undefined): ObjectInfo|undefined => { | ||
const f = getInfoFunc(value) | ||
@@ -92,0 +95,0 @@ return f === undefined ? undefined : f() |
{ | ||
"name": "@ts-common/source-map", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Source Map", | ||
@@ -8,3 +8,3 @@ "main": "index.js", | ||
"tsc": "tsc", | ||
"test": "tsc && nyc mocha", | ||
"test": "tsc && nyc mocha --reporter mocha-junit-reporter", | ||
"prepack": "npm install && tsc" | ||
@@ -14,5 +14,11 @@ }, | ||
"reporter": [ | ||
"lcov", | ||
"text" | ||
] | ||
"html", | ||
"text", | ||
"cobertura" | ||
], | ||
"check-coverage": true, | ||
"lines": 100, | ||
"statements": 100, | ||
"functions": 100, | ||
"branches": 100 | ||
}, | ||
@@ -46,2 +52,3 @@ "types": "index.d.ts", | ||
"mocha": "^5.2.0", | ||
"mocha-junit-reporter": "^1.18.0", | ||
"nyc": "^13.1.0", | ||
@@ -48,0 +55,0 @@ "tslib": "^1.9.3", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41601
628
8