@lwrjs/shared-utils
Advanced tools
Comparing version 0.0.2-alpha30 to 0.0.2-alpha32
@@ -23,2 +23,6 @@ "use strict"; | ||
} | ||
/** | ||
* Pull the custom elements and img tags out of an HTML string, to use as metadata | ||
* @param htmlSource - An HTML string to parse | ||
*/ | ||
function extractMetadataFromHtml(htmlSource) { | ||
@@ -25,0 +29,0 @@ return new Promise((resolve, reject) => { |
@@ -100,3 +100,14 @@ "use strict"; | ||
const RE_NORMAL = /^([^/@]+)(?:\/([^@]+))?(?:@([\s\S]+))?/; | ||
// modified from https://github.com/egoist/parse-package-name#readme | ||
/** | ||
* Parses an npm-style specifier | ||
* modified from https://github.com/egoist/parse-package-name#readme | ||
* | ||
* @param specifier - String to parse | ||
* | ||
* @example "@angular/core" => { scope: "@angular", packageName: "@angular/core", subResource: "" } | ||
* @example "@lwr/core/some/path" => { scope: "@lwr", packageName: "@lwr/core", subResource: "some/path" } | ||
* @example "my/app" => { packageName: "my", subResource: "app" } | ||
* @example "my/app/utils" => { packageName: "my", subResource: "app/utils" } | ||
* @example "lwc" => { packageName: "lwc", subResource: "" } | ||
*/ | ||
function parsePackageSpecifier(specifier) { | ||
@@ -103,0 +114,0 @@ const isScoped = specifier.charAt(0) === '@'; |
@@ -13,6 +13,8 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./utils"), exports); | ||
__exportStar(require("./observable"), exports); | ||
__exportStar(require("./fs"), exports); | ||
__exportStar(require("./html-meta"), exports); | ||
__exportStar(require("./identity"), exports); | ||
__exportStar(require("./object"), exports); | ||
__exportStar(require("./observable"), exports); | ||
__exportStar(require("./serialize"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -6,3 +6,2 @@ "use strict"; | ||
* Creates a simple observable object, which can have any number of observers. | ||
* | ||
* @returns {object} | ||
@@ -9,0 +8,0 @@ */ |
@@ -17,2 +17,6 @@ import SAXParser from 'parse5-sax-parser'; | ||
} | ||
/** | ||
* Pull the custom elements and img tags out of an HTML string, to use as metadata | ||
* @param htmlSource - An HTML string to parse | ||
*/ | ||
export function extractMetadataFromHtml(htmlSource) { | ||
@@ -19,0 +23,0 @@ return new Promise((resolve, reject) => { |
@@ -88,3 +88,14 @@ import slugifyText from 'slugify'; | ||
const RE_NORMAL = /^([^/@]+)(?:\/([^@]+))?(?:@([\s\S]+))?/; | ||
// modified from https://github.com/egoist/parse-package-name#readme | ||
/** | ||
* Parses an npm-style specifier | ||
* modified from https://github.com/egoist/parse-package-name#readme | ||
* | ||
* @param specifier - String to parse | ||
* | ||
* @example "@angular/core" => { scope: "@angular", packageName: "@angular/core", subResource: "" } | ||
* @example "@lwr/core/some/path" => { scope: "@lwr", packageName: "@lwr/core", subResource: "some/path" } | ||
* @example "my/app" => { packageName: "my", subResource: "app" } | ||
* @example "my/app/utils" => { packageName: "my", subResource: "app/utils" } | ||
* @example "lwc" => { packageName: "lwc", subResource: "" } | ||
*/ | ||
export function parsePackageSpecifier(specifier) { | ||
@@ -91,0 +102,0 @@ const isScoped = specifier.charAt(0) === '@'; |
@@ -1,5 +0,7 @@ | ||
export * from './utils'; | ||
export * from './observable'; | ||
export * from './fs'; | ||
export * from './html-meta'; | ||
export * from './identity'; | ||
export * from './object'; | ||
export * from './observable'; | ||
export * from './serialize'; | ||
//# sourceMappingURL=index.js.map |
/** | ||
* Creates a simple observable object, which can have any number of observers. | ||
* | ||
* @returns {object} | ||
@@ -5,0 +4,0 @@ */ |
@@ -1,7 +0,7 @@ | ||
import { HtmlAssetReference } from '@lwrjs/types'; | ||
export interface HtmlMetadata { | ||
customElements: string[]; | ||
assetReferences: HtmlAssetReference[]; | ||
} | ||
export declare function extractMetadataFromHtml(htmlSource: string): Promise<HtmlMetadata>; | ||
import { RenderedViewDefinitionMetaData } from '@lwrjs/types'; | ||
/** | ||
* Pull the custom elements and img tags out of an HTML string, to use as metadata | ||
* @param htmlSource - An HTML string to parse | ||
*/ | ||
export declare function extractMetadataFromHtml(htmlSource: string): Promise<RenderedViewDefinitionMetaData>; | ||
//# sourceMappingURL=html-meta.d.ts.map |
@@ -63,2 +63,14 @@ import getCacheKeyFromJson from 'fast-json-stable-stringify'; | ||
} | ||
/** | ||
* Parses an npm-style specifier | ||
* modified from https://github.com/egoist/parse-package-name#readme | ||
* | ||
* @param specifier - String to parse | ||
* | ||
* @example "@angular/core" => { scope: "@angular", packageName: "@angular/core", subResource: "" } | ||
* @example "@lwr/core/some/path" => { scope: "@lwr", packageName: "@lwr/core", subResource: "some/path" } | ||
* @example "my/app" => { packageName: "my", subResource: "app" } | ||
* @example "my/app/utils" => { packageName: "my", subResource: "app/utils" } | ||
* @example "lwc" => { packageName: "lwc", subResource: "" } | ||
*/ | ||
export declare function parsePackageSpecifier(specifier: string): PackageIdentity; | ||
@@ -65,0 +77,0 @@ /** |
@@ -1,5 +0,7 @@ | ||
export * from './utils'; | ||
export * from './observable'; | ||
export * from './fs'; | ||
export * from './html-meta'; | ||
export * from './identity'; | ||
export * from './object'; | ||
export * from './observable'; | ||
export * from './serialize'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -10,3 +10,2 @@ /** | ||
* Creates a simple observable object, which can have any number of observers. | ||
* | ||
* @returns {object} | ||
@@ -13,0 +12,0 @@ */ |
@@ -7,3 +7,3 @@ { | ||
}, | ||
"version": "0.0.2-alpha30", | ||
"version": "0.0.2-alpha32", | ||
"homepage": "https://lwr.dev/", | ||
@@ -45,3 +45,3 @@ "repository": { | ||
}, | ||
"gitHead": "ec31eb8e6e809d9afc95f63c0428e04a5830451d" | ||
"gitHead": "2d07a298719f056b7ce9c16788f6e57ab64723dd" | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
52332
24
1274
0