@khanacademy/simple-markdown 0.14.0 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/es/index.js CHANGED
@@ -1,48 +1,8 @@
1
- /**
2
- * Adds the given perseus library version information to the __perseus_debug__
3
- * object and ensures that the object is attached to `globalThis` (`window` in
4
- * browser environments).
5
- *
6
- * This allows each library to provide runtime version information to assist in
7
- * debugging in production environments.
8
- */
9
- const addLibraryVersionToPerseusDebug = (libraryName, libraryVersion) => {
10
- // If the library version is the default value, then we don't want to
11
- // prefix it with a "v" to indicate that it is a version number.
12
- let prefix = "v";
13
- if (libraryVersion === "__lib_version__") {
14
- prefix = "";
15
- }
16
- const formattedVersion = `${prefix}${libraryVersion}`;
17
- if (typeof globalThis !== "undefined") {
18
- var _globalThis$__perseus;
19
- globalThis.__perseus_debug__ = (_globalThis$__perseus = globalThis.__perseus_debug__) != null ? _globalThis$__perseus : {};
20
- const existingVersionEntry = globalThis.__perseus_debug__[libraryName];
21
- if (existingVersionEntry) {
22
- // If we already have an entry and it doesn't match the registered
23
- // version, we morph the entry into an array and log a warning.
24
- if (existingVersionEntry !== formattedVersion) {
25
- // Existing entry might be an array already (oops, at least 2
26
- // versions of the library already loaded!).
27
- const allVersions = Array.isArray(existingVersionEntry) ? existingVersionEntry : [existingVersionEntry];
28
- allVersions.push(formattedVersion);
29
- globalThis.__perseus_debug__[libraryName] = allVersions;
30
-
31
- // eslint-disable-next-line no-console
32
- console.warn(`Multiple versions of ${libraryName} loaded on this page: ${allVersions.sort().join(", ")}`);
33
- }
34
- } else {
35
- globalThis.__perseus_debug__[libraryName] = formattedVersion;
36
- }
37
- } else {
38
- // eslint-disable-next-line no-console
39
- console.warn(`globalThis not found found (${formattedVersion})`);
40
- }
41
- };
1
+ import { addLibraryVersionToPerseusDebug } from '@khanacademy/perseus-utils';
42
2
 
43
3
  // This file is processed by a Rollup plugin (replace) to inject the production
44
4
  const libName = "@khanacademy/simple-markdown";
45
- const libVersion = "0.14.0";
5
+ const libVersion = "0.14.1";
46
6
  addLibraryVersionToPerseusDebug(libName, libVersion);
47
7
 
48
8
  /* eslint-disable prefer-spread, no-regex-spaces, guard-for-in, no-console, no-var */