storybook-chrome-screenshot
Version:
A Storybook addon, Save the screenshot image of your stories! via puppeteer.
35 lines • 1.27 kB
JavaScript
;
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
var qs = __importStar(require("query-string"));
var constants_1 = require("../constants");
var Env = /** @class */ (function () {
function Env(storybookEnv, queryString) {
this.storybookEnv = storybookEnv;
var query = qs.parse(queryString);
this.phase = query[constants_1.PhaseIdentity];
this.kind = query.selectKind;
this.story = query.selectStory;
}
Env.prototype.getStorybookEnv = function () {
return this.storybookEnv != null ? this.storybookEnv : 'react';
};
Env.prototype.getPhase = function () {
return this.phase != null ? this.phase : '';
};
Env.prototype.getKind = function () {
return this.kind != null ? this.kind : '';
};
Env.prototype.getStory = function () {
return this.story != null ? this.story : '';
};
return Env;
}());
exports.Env = Env;
//# sourceMappingURL=Env.js.map