@reckona/mreact-shared 0.0.185 → 0.0.186

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.
@@ -0,0 +1,5 @@
1
+ /** Returns true for React-style event handler props such as onClick. */
2
+ export declare function isReactEventHandlerPropName(name: string): boolean;
3
+ /** Returns true for any event-like prop name with an on prefix, including lowercase DOM handlers. */
4
+ export declare function isEventLikePropName(name: string): boolean;
5
+ //# sourceMappingURL=dom-prop-names.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dom-prop-names.d.ts","sourceRoot":"","sources":["../src/dom-prop-names.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGjE;AAED,qGAAqG;AACrG,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAMzD"}
@@ -0,0 +1,12 @@
1
+ /** Returns true for React-style event handler props such as onClick. */
2
+ export function isReactEventHandlerPropName(name) {
3
+ const third = name.charCodeAt(2);
4
+ return name.charCodeAt(0) === 111 && name.charCodeAt(1) === 110 && third >= 65 && third <= 90;
5
+ }
6
+ /** Returns true for any event-like prop name with an on prefix, including lowercase DOM handlers. */
7
+ export function isEventLikePropName(name) {
8
+ return (name.length > 1 &&
9
+ (name.charCodeAt(0) | 32) === 111 &&
10
+ (name.charCodeAt(1) | 32) === 110);
11
+ }
12
+ //# sourceMappingURL=dom-prop-names.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dom-prop-names.js","sourceRoot":"","sources":["../src/dom-prop-names.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,MAAM,UAAU,2BAA2B,CAAC,IAAY;IACtD,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACjC,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,KAAK,IAAI,EAAE,IAAI,KAAK,IAAI,EAAE,CAAC;AAChG,CAAC;AAED,qGAAqG;AACrG,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,OAAO,CACL,IAAI,CAAC,MAAM,GAAG,CAAC;QACf,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,GAAG;QACjC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,GAAG,CAClC,CAAC;AACJ,CAAC","sourcesContent":["/** Returns true for React-style event handler props such as onClick. */\nexport function isReactEventHandlerPropName(name: string): boolean {\n const third = name.charCodeAt(2);\n return name.charCodeAt(0) === 111 && name.charCodeAt(1) === 110 && third >= 65 && third <= 90;\n}\n\n/** Returns true for any event-like prop name with an on prefix, including lowercase DOM handlers. */\nexport function isEventLikePropName(name: string): boolean {\n return (\n name.length > 1 &&\n (name.charCodeAt(0) | 32) === 111 &&\n (name.charCodeAt(1) | 32) === 110\n );\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -2,4 +2,5 @@ export * from "./html-escape.js";
2
2
  export * from "./html-elements.js";
3
3
  export * from "./url-safety.js";
4
4
  export * from "./compiler-contract.js";
5
+ export * from "./dom-prop-names.js";
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -2,4 +2,5 @@ export * from "./html-escape.js";
2
2
  export * from "./html-elements.js";
3
3
  export * from "./url-safety.js";
4
4
  export * from "./compiler-contract.js";
5
+ export * from "./dom-prop-names.js";
5
6
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC","sourcesContent":["export * from \"./html-escape.js\";\nexport * from \"./html-elements.js\";\nexport * from \"./url-safety.js\";\nexport * from \"./compiler-contract.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC","sourcesContent":["export * from \"./html-escape.js\";\nexport * from \"./html-elements.js\";\nexport * from \"./url-safety.js\";\nexport * from \"./compiler-contract.js\";\nexport * from \"./dom-prop-names.js\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reckona/mreact-shared",
3
- "version": "0.0.185",
3
+ "version": "0.0.186",
4
4
  "description": "Shared runtime utilities used by mreact packages.",
5
5
  "keywords": [
6
6
  "jsx",
@@ -45,6 +45,10 @@
45
45
  "./compiler-contract": {
46
46
  "types": "./dist/compiler-contract.d.ts",
47
47
  "default": "./dist/compiler-contract.js"
48
+ },
49
+ "./dom-prop-names": {
50
+ "types": "./dist/dom-prop-names.d.ts",
51
+ "default": "./dist/dom-prop-names.js"
48
52
  }
49
53
  },
50
54
  "publishConfig": {
@@ -0,0 +1,14 @@
1
+ /** Returns true for React-style event handler props such as onClick. */
2
+ export function isReactEventHandlerPropName(name: string): boolean {
3
+ const third = name.charCodeAt(2);
4
+ return name.charCodeAt(0) === 111 && name.charCodeAt(1) === 110 && third >= 65 && third <= 90;
5
+ }
6
+
7
+ /** Returns true for any event-like prop name with an on prefix, including lowercase DOM handlers. */
8
+ export function isEventLikePropName(name: string): boolean {
9
+ return (
10
+ name.length > 1 &&
11
+ (name.charCodeAt(0) | 32) === 111 &&
12
+ (name.charCodeAt(1) | 32) === 110
13
+ );
14
+ }
package/src/index.ts CHANGED
@@ -2,3 +2,4 @@ export * from "./html-escape.js";
2
2
  export * from "./html-elements.js";
3
3
  export * from "./url-safety.js";
4
4
  export * from "./compiler-contract.js";
5
+ export * from "./dom-prop-names.js";