New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ts-common/source-map

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ts-common/source-map - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

4

index.d.ts

@@ -29,5 +29,7 @@ import { StringMap } from "@ts-common/string-map";

export declare type Tracked<T extends object> = T & TrackedBase;
export declare const setInfoFunc: <T extends object>(value: T, infoFunc: () => ObjectInfo) => Tracked<T>;
export declare const setInfo: <T extends object>(value: T, info: ObjectInfo) => Tracked<T>;
export declare const getInfoFunc: (value: object) => (() => ObjectInfo) | undefined;
export declare const getInfo: (value: object) => RootObjectInfo | ChildObjectInfo | undefined;
export declare const copyInfo: <T extends object>(source: object, dest: T) => T;
export declare const getInfo: (value: object) => RootObjectInfo | ChildObjectInfo | undefined;
export declare type Data = object | JsonPrimitive;

@@ -34,0 +36,0 @@ export declare const copyDataInfo: <T extends Data>(source: Data, dest: T) => T;

@@ -19,21 +19,25 @@ "use strict";

exports.objectInfoSymbol = Symbol.for("@ts-common/source-map/object-info");
exports.setInfo = (value, info) => {
exports.setInfoFunc = (value, infoFunc) => {
const result = value;
if (result[exports.objectInfoSymbol] === undefined) {
result[exports.objectInfoSymbol] = () => info;
result[exports.objectInfoSymbol] = infoFunc;
}
return result;
};
exports.setInfo = (value, info) => exports.setInfoFunc(value, () => info);
exports.getInfoFunc = (value) => {
const withInfo = value;
return withInfo[exports.objectInfoSymbol];
};
exports.getInfo = (value) => {
const f = exports.getInfoFunc(value);
return f === undefined ? undefined : f();
};
exports.copyInfo = (source, dest) => {
const info = exports.getInfo(source);
const info = exports.getInfoFunc(source);
if (info !== undefined) {
exports.setInfo(dest, info);
exports.setInfoFunc(dest, info);
}
return dest;
};
exports.getInfo = (value) => {
const withInfo = value;
const f = withInfo[exports.objectInfoSymbol];
return f === undefined ? undefined : f();
};
exports.copyDataInfo = (source, dest) => {

@@ -40,0 +44,0 @@ const destJson = dest;

{
"name": "@ts-common/source-map",
"version": "0.2.0",
"version": "0.2.1",
"description": "Source Map",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc