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

@khanacademy/simple-markdown

Package Overview
Dependencies
Maintainers
1
Versions
1178
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@khanacademy/simple-markdown - npm Package Compare versions

Comparing version 0.0.0-PR2262-20250221180350 to 0.0.0-PR2262-20250221190748

dist/shared-utils/add-library-version-to-perseus-debug.d.ts

42

dist/es/index.js

@@ -1,3 +0,43 @@

import { addLibraryVersionToPerseusDebug } from '@khanacademy/perseus-core';
/**
* Adds the given perseus library version information to the __perseus_debug__
* object and ensures that the object is attached to `globalThis` (`window` in
* browser environments).
*
* This allows each library to provide runtime version information to assist in
* debugging in production environments.
*/
const addLibraryVersionToPerseusDebug = (libraryName, libraryVersion) => {
// If the library version is the default value, then we don't want to
// prefix it with a "v" to indicate that it is a version number.
let prefix = "v";
if (libraryVersion === "__lib_version__") {
prefix = "";
}
const formattedVersion = `${prefix}${libraryVersion}`;
if (typeof globalThis !== "undefined") {
var _globalThis$__perseus;
globalThis.__perseus_debug__ = (_globalThis$__perseus = globalThis.__perseus_debug__) != null ? _globalThis$__perseus : {};
const existingVersionEntry = globalThis.__perseus_debug__[libraryName];
if (existingVersionEntry) {
// If we already have an entry and it doesn't match the registered
// version, we morph the entry into an array and log a warning.
if (existingVersionEntry !== formattedVersion) {
// Existing entry might be an array already (oops, at least 2
// versions of the library already loaded!).
const allVersions = Array.isArray(existingVersionEntry) ? existingVersionEntry : [existingVersionEntry];
allVersions.push(formattedVersion);
globalThis.__perseus_debug__[libraryName] = allVersions;
// eslint-disable-next-line no-console
console.warn(`Multiple versions of ${libraryName} loaded on this page: ${allVersions.sort().join(", ")}`);
}
} else {
globalThis.__perseus_debug__[libraryName] = formattedVersion;
}
} else {
// eslint-disable-next-line no-console
console.warn(`globalThis not found found (${formattedVersion})`);
}
};
// This file is processed by a Rollup plugin (replace) to inject the production

@@ -4,0 +44,0 @@ const libName = "@khanacademy/simple-markdown";

@@ -5,8 +5,47 @@ 'use strict';

var perseusCore = require('@khanacademy/perseus-core');
/**
* Adds the given perseus library version information to the __perseus_debug__
* object and ensures that the object is attached to `globalThis` (`window` in
* browser environments).
*
* This allows each library to provide runtime version information to assist in
* debugging in production environments.
*/
const addLibraryVersionToPerseusDebug = (libraryName, libraryVersion) => {
// If the library version is the default value, then we don't want to
// prefix it with a "v" to indicate that it is a version number.
let prefix = "v";
if (libraryVersion === "__lib_version__") {
prefix = "";
}
const formattedVersion = `${prefix}${libraryVersion}`;
if (typeof globalThis !== "undefined") {
globalThis.__perseus_debug__ = globalThis.__perseus_debug__ ?? {};
const existingVersionEntry = globalThis.__perseus_debug__[libraryName];
if (existingVersionEntry) {
// If we already have an entry and it doesn't match the registered
// version, we morph the entry into an array and log a warning.
if (existingVersionEntry !== formattedVersion) {
// Existing entry might be an array already (oops, at least 2
// versions of the library already loaded!).
const allVersions = Array.isArray(existingVersionEntry) ? existingVersionEntry : [existingVersionEntry];
allVersions.push(formattedVersion);
globalThis.__perseus_debug__[libraryName] = allVersions;
// eslint-disable-next-line no-console
console.warn(`Multiple versions of ${libraryName} loaded on this page: ${allVersions.sort().join(", ")}`);
}
} else {
globalThis.__perseus_debug__[libraryName] = formattedVersion;
}
} else {
// eslint-disable-next-line no-console
console.warn(`globalThis not found found (${formattedVersion})`);
}
};
// This file is processed by a Rollup plugin (replace) to inject the production
const libName = "@khanacademy/simple-markdown";
const libVersion = "0.13.20";
perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
addLibraryVersionToPerseusDebug(libName, libVersion);

@@ -13,0 +52,0 @@ /* eslint-disable prefer-spread, no-regex-spaces, guard-for-in, no-console, no-var */

8

package.json

@@ -6,3 +6,3 @@ {

"license": "MIT",
"version": "0.0.0-PR2262-20250221180350",
"version": "0.0.0-PR2262-20250221190748",
"publishConfig": {

@@ -25,7 +25,5 @@ "access": "public"

],
"dependencies": {
"@khanacademy/perseus-core": "0.0.0-PR2262-20250221180350"
},
"dependencies": {},
"devDependencies": {
"perseus-build-settings": "0.0.0-PR2262-20250221180350"
"perseus-build-settings": "0.0.0-PR2262-20250221190748"
},

@@ -32,0 +30,0 @@ "peerDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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