Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function prefixType({ typeDef, name }): GraphQLObjectType {
return Object.assign(
// assign prototype
Object.create(typeDef),
// assign all fields
typeDef,
// override name
{
name: `${pascalCase(name)}${typeDef.name}`,
},
);
}
.map(([operation, typeDef]) => ({
[operation]: new GraphQLObjectType({
name: pascalCase(operation),
fields: {
[name]: {
type: new GraphQLNonNull(typeDef),
resolve: () => true
},
},
}),
}))
.reduce((a, b) => ({ ...a, ...b }), {}); // combine objects
constructor (pageObject, options = {}) {
let { basename, meta, path, url } = pageObject;
let { includeName, isPlugin } = options;
// `meta` may not exist if this is an empty, brand new .po.js file:
if (!meta) {
this.name = basename;
this.actions = [];
this.elements = [];
}
this.name = this.name || meta.name;
this.path = path;
this.url = url;
this.variableName = pascalcase(this.name);
this.instanceName = camelcase(this.name);
this.actions = this.actions || meta.actions.map(action => new ActionMetaModel({
...action,
returns: 'promise'
}));
this.elements = this.elements || meta.elements.map(element => new ValueModel(element));
this.elementsWithType = this.elements.filter((_, i) => meta.elements[i].type);
this.elementGroups = this.elements.filter((_, i) => meta.elements[i].group);
this.isIncluded = !!includeName;
this.isPlugin = !!isPlugin;
this.displayName = this.isIncluded ? `${includeName} - ${this.name}` : this.name;
}
};
webhooks.forEach(({ name, actions, examples }) => {
if (!examples) {
return;
}
const typeName = `WebhookPayload${pascalCase(name)}`;
tw.add(examples, {
rootTypeName: typeName,
namedKeyPaths: {
[`${typeName}.repository`]: "PayloadRepository",
// This prevents a naming colision between the payload of a `installation_repositories` event
// and the `repositories` attribute of a `installation` event
"WebhookPayloadInstallation.repositories":
"WebhookPayloadInstallation_Repositories"
}
});
const events = [
`'${name}'`,
...actions.map(action => `'${name}.${action}'`)
].join(" | ");
signatures.push(`
name &&
(isFn(component) || typeof component.styledComponentId === 'string')
) {
name = lowercase(name)
if (noWrapper) {
registry.fields[name] = component
registry.fields[name].__WRAPPERS__ = []
} else {
registry.fields[name] = compose(
component,
registry.wrappers,
true
)
registry.fields[name].__WRAPPERS__ = registry.wrappers
}
registry.fields[name].displayName = pascalCase(name)
}
}
{children}
)
if (component.defaultProps) {
VirtualBox.defaultProps = component.defaultProps
}
VirtualBox.displayName = pascalCase(name)
return VirtualBox
}
export default function getAnimationProp() {
const prop = "animation";
const animation = cssVendor.supportedProperty(prop) || prop;
const prefix = animation.replace("animation", "");
return {
css: animation,
js: prefix === "" ? animation : pascalCase(animation)
};
}
.info('Using manifest:', JSON.stringify(manifest));
} else if (args.url && args.sdkVersion) {
const { url, sdkVersion, releaseChannel } = args;
manifest = await getManifestAsync(url, {
'Exponent-SDK-Version': sdkVersion,
'Exponent-Platform': 'ios',
'Expo-Release-Channel': releaseChannel ? releaseChannel : 'default',
Accept: 'application/expo+json,application/json',
});
}
let bundleExecutable = args.type === 'client' ? EXPONENT_APP : EXPOKIT_APP;
if (has(manifest, 'ios.infoPlist.CFBundleExecutable')) {
bundleExecutable = get(manifest, 'ios.infoPlist.CFBundleExecutable');
} else if (privateConfig && privateConfig.bundleIdentifier) {
bundleExecutable = pascalCase(privateConfig.bundleIdentifier);
}
const buildFlags = StandaloneBuildFlags.createIos(args.configuration, {
workspaceSourcePath,
appleTeamId: args.appleTeamId,
buildType: args.type,
bundleExecutable,
});
const context = StandaloneContext.createServiceContext(
expoSourcePath,
args.archivePath,
manifest,
privateConfig,
args.testEnvironment,
buildFlags,
args.url,
export default function (CustomElement, opts) {
opts = assign({}, defaults, opts);
if (typeof CustomElement !== 'function') {
throw new Error('Given element is not a valid constructor');
}
const tagName = (new CustomElement()).tagName.toLowerCase();
const displayName = pascalCase(tagName);
const { React, ReactDOM } = opts;
if (!React || !ReactDOM) {
throw new Error('React and ReactDOM must be dependencies, globally on your `window` object or passed via opts.');
}
class ReactComponent extends React.Component {
static get displayName() {
return displayName;
}
componentDidMount() {
this.componentWillReceiveProps(this.props);
}
componentWillReceiveProps(props) {
const node = ReactDOM.findDOMNode(this);
Object.keys(props).forEach(name => {
{children}
)
if (component.defaultProps) {
VirtualBox.defaultProps = component.defaultProps
}
VirtualBox.displayName = pascalCase(name)
return VirtualBox
}