Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F111342381
AssetSourceParser.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Apr 30, 22:49
Size
869 B
Mime Type
text/x-c++
Expires
Fri, May 2, 22:49 (2 d)
Engine
blob
Format
Raw Data
Handle
25897396
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
AssetSourceParser.js
View Options
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Yuta Hiroto @hiroppy
*/
"use strict";
const Parser = require("../Parser");
/** @typedef {import("../Parser").ParserState} ParserState */
/** @typedef {import("../Parser").PreparsedAst} PreparsedAst */
class AssetSourceParser extends Parser {
/**
* @param {string | Buffer | PreparsedAst} source the source to parse
* @param {ParserState} state the parser state
* @returns {ParserState} the parser state
*/
parse(source, state) {
if (typeof source === "object" && !Buffer.isBuffer(source)) {
throw new Error("AssetSourceParser doesn't accept preparsed AST");
}
const { module } = state;
module.buildInfo.strict = true;
module.buildMeta.exportsType = "default";
state.module.buildMeta.defaultObject = false;
return state;
}
}
module.exports = AssetSourceParser;
Event Timeline
Log In to Comment