Socket
Socket
Sign inDemoInstall

@khanacademy/wonder-blocks-core

Package Overview
Dependencies
Maintainers
1
Versions
173
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@khanacademy/wonder-blocks-core - npm Package Compare versions

Comparing version 6.4.0 to 6.4.1

6

CHANGELOG.md
# @khanacademy/wonder-blocks-core
## 6.4.1
### Patch Changes
- 5dfac06e: Allow all special characters in IDs, except whitespace.
## 6.4.0

@@ -4,0 +10,0 @@

6

dist/es/index.js

@@ -292,7 +292,3 @@ import * as React from 'react';

_hasValidIdChars(value) {
if (typeof value !== "string") {
return false;
}
const invalidCharsReplaced = value.replace(/[^\d\w-]/g, "-");
return value === invalidCharsReplaced;
return typeof value === "string" ? !/\s/.test(value) : false;
}

@@ -299,0 +295,0 @@ }

@@ -315,7 +315,3 @@ 'use strict';

_hasValidIdChars(value) {
if (typeof value !== "string") {
return false;
}
const invalidCharsReplaced = value.replace(/[^\d\w-]/g, "-");
return value === invalidCharsReplaced;
return typeof value === "string" ? !/\s/.test(value) : false;
}

@@ -322,0 +318,0 @@ }

@@ -25,2 +25,6 @@ import type { IIdentifierFactory } from "./types";

* here because all identifiers are prefixed to avoid needing that check.
*
* According to this post:
* https://stackoverflow.com/questions/70579/html-valid-id-attribute-values/31773673#31773673
* The only characters that are not allowed in an id are whitespace characters.
*/

@@ -27,0 +31,0 @@ _hasValidIdChars(value?: string | null): boolean;

{
"name": "@khanacademy/wonder-blocks-core",
"version": "6.4.0",
"version": "6.4.1",
"design": "v1",

@@ -5,0 +5,0 @@ "publishConfig": {

@@ -48,3 +48,3 @@ import UniqueIDFactory from "../unique-id-factory";

test("special characters in scope, throws", () => {
test("special characters in scope, should not throw", () => {
// Arrange

@@ -57,3 +57,3 @@ const scope = "invalid$%^&*(";

// Assert
expect(underTest).toThrowErrorMatchingSnapshot();
expect(underTest).not.toThrow();
});

@@ -60,0 +60,0 @@ });

@@ -36,10 +36,9 @@ import type {IIdentifierFactory} from "./types";

* here because all identifiers are prefixed to avoid needing that check.
*
* According to this post:
* https://stackoverflow.com/questions/70579/html-valid-id-attribute-values/31773673#31773673
* The only characters that are not allowed in an id are whitespace characters.
*/
_hasValidIdChars(value?: string | null): boolean {
if (typeof value !== "string") {
return false;
}
const invalidCharsReplaced = value.replace(/[^\d\w-]/g, "-");
return value === invalidCharsReplaced;
return typeof value === "string" ? !/\s/.test(value) : false;
}

@@ -46,0 +45,0 @@

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