![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@internetarchive/field-parsers
Advanced tools
Parsers to convert strings from Internet Archive API responses to their native javascript equivalents.
Each parser implements the FieldParserInterface
:
export type FieldParserRawValue = string | number | boolean;
export interface FieldParserInterface<T> {
/**
* Parse the raw value and return a value of type T or undefined if unparseable
*
* @param rawValue T | undefined
*/
parseValue(rawValue: FieldParserRawValue): T | undefined;
}
They are responsible for parsing the input and returning the appropriate value or undefined
.
Instantiate a parser or use the shared instance:
const parser = new BooleanParser()
parser.parse('true') => true
BooleanParser.shared.parse('false') => false
See tests for more usage examples.
Boolean
Byte
- a number in bytesDate
- parses the various Internet Archive date formatsDuration
- Parses hh:mm:ss.ms
and ss.ms
formats to secondsMediaType
- Internet Archive media typesNumber
PageProgression
- Internet Archive page progression (right to left, left to right)String
To run the suite of Web Test Runner tests, run
yarn run test
To run the tests in watch mode (for <abbr title="test driven development">TDD</abbr>, for example), run
yarn run test:watch
To scan the project for linting errors, run
yarn run lint
You can lint with ESLint and Prettier individually as well
yarn run lint:eslint
yarn run lint:prettier
To automatically fix many linting errors, run
yarn run format
You can format using ESLint and Prettier individually as well
yarn run format:eslint
yarn run format:prettier
For most of the tools, the configuration is in the package.json
to reduce the amount of files in your project.
If you customize the configuration a lot, you can consider moving them to individual files.
FAQs
Field parsers for Internet Archive metadata fields.
The npm package @internetarchive/field-parsers receives a total of 267 weekly downloads. As such, @internetarchive/field-parsers popularity was classified as not popular.
We found that @internetarchive/field-parsers demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 15 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.